Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot select effect color on KDE #201

Closed
rrpeak opened this issue Aug 19, 2022 · 11 comments
Closed

Cannot select effect color on KDE #201

rrpeak opened this issue Aug 19, 2022 · 11 comments
Labels
bug Something isn't working KDE The bug is specific to KDE

Comments

@rrpeak
Copy link

rrpeak commented Aug 19, 2022

Instead of the effect the window is displayed as a black box and then (dis)appears after the effect duration.

As suggested on reddit I tried checking the output of "journalctl -f -o cat". This seems to be the error hat comes up when a windows is opened/closed:

qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 2637, resource id: 71303488, major code: 18 (ChangeProperty), minor code: 0
app-systemsettings-9f887cded2da4588a5145e588ddc0583.scope: Succeeded.
qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 2641, resource id: 41943426, major code: 18 (ChangeProperty), minor code: 0

Operating System: KDE neon 5.25
KDE Plasma Version: 5.25.4
KDE Frameworks Version: 5.96.0
Qt Version: 5.15.5
Kernel Version: 5.15.0-46-generic (64-bit)
Graphics Platform: X11
Processors: 12 × AMD Ryzen 5 3600 6-Core Processor
Memory: 15,6 GiB of RAM
Graphics Processor: Radeon RX 5500 XT
Manufacturer: Gigabyte Technology Co., Ltd.
Product Name: B550 AORUS PRO

@Schneegans
Copy link
Owner

Schneegans commented Aug 20, 2022

Hi there! Thanks for the report! Sadly, I cannot reproduce this on my end. It could be due to an issue with your GPU (I only have an NVidia card for testing). Do you have by any chance some coding experience so that we could try to debug this on your end?

The shaders should be stored in ~/.local/share/kwin/effects/kwin4_effect_fire/contents/shaders. There are two files, which one is used, depends on your system. Usually it should be fire_core.frag. If you feel comfortable editing these shaders, we could try to find the issue!

@Schneegans Schneegans added bug Something isn't working KDE The bug is specific to KDE labels Aug 20, 2022
@rrpeak
Copy link
Author

rrpeak commented Aug 21, 2022

I don't have coding experience, but I guess we could still try. I found the shader files. What do I need to edit?
I see both fire.frag and fire_core.frag have sections for KWIN and KWIN_LEGACY

@nlsvgtr
Copy link

nlsvgtr commented Nov 5, 2022

I do feel comfortable editing these shaders, and I have the same issue.

What would you like me to do?

@Schneegans
Copy link
Owner

Schneegans commented Nov 5, 2022

Well, first I would try to check which shader is actually used. For this, you could find the main() in fire_core.frag and put this right in the beginning of the main method:

main() {
  setOutputColor(vec4(1.0, 0.0, 0.0, 1.0));
  return;
  ...

If you now save this file, select a different effect in the system settings and the re-select the fire effect, you should get red boxes whenever you open or close a window. If nothing changed, you should try the same with the other fire shader. If the windows just open and close instantaneously, you most likely have a typo in the GLSL code. To find these, you should have

 journalctl -f -o cat 

always running in a terminal. This will print any GLSL errors whenever you (re-)select the effect in the system settings.

If you see the red boxes, you could try to print some of the values in the shader. For example, you could print the UV coordinates. These are computed right at the start of the main and you could set them as output color right after the computation:

void main() {
  // Get a noise value which moves vertically in time.
  vec2 uv = iTexCoord.st * uSize / vec2(400, 600) / uScale;
  uv.y += uProgress * uDuration * uMovementSpeed;

  setOutputColor(vec4(uv, 0.0, 1.0));
  return;
 ...

This should now produce no red boxes but red-green-yellow gradients. Then there are some examples at the bottom of the shader file (https://github.com/Schneegans/Burn-My-Windows/blob/main/resources/shaders/fire.frag#L129) which you could try.

If you play around a bit, you should get an idea what part does not work. I somehow suspect that there is some issue with the noise...

@Schneegans
Copy link
Owner

Btw, do you by any chance also experience #199?

@nlsvgtr
Copy link

nlsvgtr commented Nov 6, 2022

The wisp effect seems to work, but there is no color, i.e. the wisps are black. The color selector in the settings is empty, (as is the gradient selector in the fire effect settings btw). I do not have the abnormalities in the border.

The shader used is fire_core.frag.

When I add the setOutputColor line and re-apply the fire effect, a new error is shown in the journal:
kwin_scripting: /home/niels/.local/share/kwin/effects/kwin4_effect_fire/contents/code/main.js:64: error: Failed to set uniform uDuration

This happens when I move the line lower and lower until the code looks like this:

  setOutputColor(vec4(1.0, 0.0, 0.0, 1.0));
  return;

  // Map noise value to color.
  vec4 fire = getFireColor(noise);

Starting at

  // Map noise value to color.
  vec4 fire = getFireColor(noise);

  setOutputColor(vec4(1.0, 0.0, 0.0, 1.0));
  return;

until the bottom, the error is
kwin_scripting: /home/niels/.local/share/kwin/effects/kwin4_effect_fire/contents/code/main.js:70: error: Failed to set uniform uGradient1

Windows now open and close without an animation.

After removing lines 70-74 from contents/code/main.js I do get the red square.

Now I removed the the extra setOutputColor line from the shader, and I got a nice animation, not suprisingly without the fire. Here's a gif.

Apparently the problem is in the uGradient1: if I remove only that line I get a black fire.

I am using Plasma 5.25.5; my graphics card is a GeForce RTX 2060 Super.

What's next :)

@Schneegans
Copy link
Owner

Well, that's interesting. It seems like the color picker could be the issue. How does it behave?Can you select a different color? Does it always reset to black somehow?

@Schneegans
Copy link
Owner

I just remembered this discussion: #177 Maybe that's the reason?

@nlsvgtr
Copy link

nlsvgtr commented Nov 7, 2022

Yes, that did it. In Kubuntu the package is called libkf5widgetsaddons-dev, and after installing that I can select colors and revert them to default. Now the fire looks fine.

Thanks a lot.

Like vitotankian in #177 I was considering moving to Gnome for the burning windows alone :)
Thanks for your work on the effect and the KWin port.

@Schneegans
Copy link
Owner

Schneegans commented Nov 8, 2022

Great! I'll add a corresponding note to the README and the pages on store.kde.org. I'll also pin this issue so that others may find it more easily.

TLDR; If the color picker widgets do not work for you, you may have to install a package called libkf5widgetsaddons-dev (Kubuntu, ...), kwidgetsaddons-devel (Fedora, OpenSuse, ...), or similar, depending on your package manager.

If you are on Plasma 6 already, the package may be called differently, like KF6-kwidgetaddons-devel for instance.

@Schneegans Schneegans changed the title Fire effect broken (black box) Cannot select effect color on KDE Nov 8, 2022
@Schneegans Schneegans pinned this issue Nov 8, 2022
@FizzBuzz3000
Copy link

Gonna add a comment for Gentoo/from-source distro users, you need to enable the QT designer flag (USE=designer for gentoo folk) support if you still don't get the color picker to show up and have the kwidgetsaddon package already installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working KDE The bug is specific to KDE
Projects
None yet
Development

No branches or pull requests

4 participants