HobbyBlobby / PlasmaWallpaper_CityGrow

Plasma Wallpaper Plugin (also Screen Lock) with growing city animation
MIT License
10 stars 0 forks source link

Implement pausing when fullscreen or desktop isn't visible #1

Open 5HT2 opened 9 months ago

5HT2 commented 9 months ago

The option to pause the animation when in fullscreen or when the desktop isn't visible would be really nice, because on a Ryzen 5600G with the wallpaper enabled, stat branches set to 10 and scale set to 5, plasmashell jumps to the top with about 17% usage image

Granted, this isn't much with 8 cores, but it'd be nice to save these resources when I'm in fullscreen playing a game.

An example of a wallpaper plugin that has this implemented can be found here: https://www.reddit.com/r/unixporn/comments/cj4dfh/plasma_smart_video_wallpaper/

HobbyBlobby commented 8 months ago

Hi,

good point. The project was designed to be used as a screensaver (which is technically also a plasma-wallpaper plugin). So I never thought about have this running in background while a full screen application is hiding the plugin. I'll check, if there is a standard API to find out, if the screen is visible (and check you example implementation).

5HT2 commented 8 months ago

Take a look at QEvent::WindowStateChange on https://doc.qt.io/qt-5/qevent.html#Type-enum! I'm unsure if the screensaver / wallpaper plugins provide the context window required for this, I've never written Qt before, but it looks like other wallpaper plugins also implement this.

Qt should handle X11/Wayland compat in this case.

HobbyBlobby commented 3 months ago

Hi,

during the port to KDE6, I also improved the plugin with your idea. There is now an option to pause the plugin if there are full screen or maximized windows detected.

This is still in testing (e.g. behavior with multiple monitors). Therefore, this is currently only available from the git repo (not from the KDE store). Also, the KDE5 port of the new feature is outstanding.

I will close this issue, when the new feature is available via KDE store.

HobbyBlobby commented 3 months ago

I did some adjustments, so the plugin is looking on the correct monitor and pauses only, if a maximized/fullscreen window on the correct screen is blocking the view. The KDE6 version is now available on KDE store.

I am not certain, if I am doing a back port of this feature to the KDE5 version of the plugin.

5HT2 commented 2 months ago

Thank you so much! My primary machine is no longer a KDE setup but I will report back in the future if I do encounter any issues.

I really appreciate you taking the time to add this feature :)