y4my4my4m / kde-shader-wallpaper

KDE / Plasma - Shader Wallpaper plugin
GNU General Public License v3.0
247 stars 13 forks source link

Interacting with KDE desktop elements or changing wallpaper settings on high refresh rate monitors causes shader to speed up. #43

Open Fighterbuilder opened 7 months ago

Fighterbuilder commented 7 months ago

When using this wallpaper on a monitor with a refresh rate above 60 Hz, interacting with desktop components of KDE Plasma 5 (not including applications like Dolphin) causes the shader to speed up very briefly, and it's very distracting. https://github.com/y4my4my4m/kde-shader-wallpaper/assets/33814663/a34f79b9-2235-44fe-b5bf-1e5e37e5e7c9 In this case, I'm currently using a monitor with a refresh rate of 240 Hz but the problem is still visible in a 60 FPS recording.

A similar issue occurs when opening the wallpaper settings to adjust the shader, this time speeding up consistently for the entire time the menu is open. https://github.com/y4my4my4m/kde-shader-wallpaper/assets/33814663/6f8d570a-74e1-45c9-8400-90b1099e8a0c

Changing the refresh rate to 60 Hz does resolve this problem, but I would rather not have to do that.

y4my4my4m commented 7 months ago

Oh wow that's super strange.

Thanks for sharing. I have a 120hz monitor, however so far I've only been working from a VM so I hadn't noticed this.

I'll see what I can do

luisbocanegra commented 7 months ago

What if you try changing 16 to 4 here:

https://github.com/y4my4my4m/kde-shader-wallpaper/blob/0db87022d8578a2e21e3cc5626d6487a0a899d21/package/contents/ui/main.qml#L194

And 0.016 to 0.004 here:

https://github.com/y4my4my4m/kde-shader-wallpaper/blob/0db87022d8578a2e21e3cc5626d6487a0a899d21/package/contents/ui/main.qml#L214

Does this make sense? I know nothing about shaders

Edit: Actually it should be 4 and not 8 (1/240)

y4my4my4m commented 7 months ago

What if you try changing 16 to 4 here:

Good thinking. @Fighterbuilder if this works, I'll implement a way to detect the frequency of the monitor and divide accordingly.

Could you please test it?

Fighterbuilder commented 7 months ago

I'm sorry, I don't really know how to find those files on my install. I'm still very much a Linux noob lol

If you could help point me in the right direction, I'd greatly appreciate it!

luisbocanegra commented 7 months ago

It's in ~/.local/share/plasma/wallpapers/online.knowmad.shaderwallpaper/contents/ui/main.qml the lines you have to modify are by the end of the file inside the Timer {} block.

y4my4my4m commented 7 months ago

@Fighterbuilder

In a folder of your choice:

  1. clone the project with git: git clone https://github.com/y4my4my4m/kde-shader-wallpaper.git
  2. go in the folder:cd kde-shader-wallpaper
  3. switch to the plasma6 branch: git checkout plasma6 && git pull
  4. modify the lines he's mentioned in the comment above
  5. delete the old installation of the plugin: rm -rf ~/.local/share/plasma/wallpapers/online.knowmad.shaderwallpaper/
  6. still from within kde-shader-wallpaper, install the modified one from source: kpackagetool6 -t Plasma/Wallpaper -i package
  7. restart plasmashell pkill plasmashell && plasmashell
  8. reselect "shaders" plugin from your desktop > configure desktop and wallpaper
  9. verify
Fighterbuilder commented 7 months ago

Alright, I'm finally getting around to this, sorry for the wait there. Anyway, I'm on Plasma 5.27.8 - do you still want me to use the Plasma 6 branch @y4my4my4m?