Fix: Restore former window fullscreen state after screensaver exit #3284
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Addresses #3218 by @rmusaev99.
Currently the fullscreen launch of the screensaver will override any former full-screen windows and will not return them to their state upon closing.
Changes:
//) to try and prevent any errors from launching screensaver from blank workspaces.Testing
I was able to test the individual commands using my custom instance of Hyprland on a laptop, but I was not able to get an instance of Omarchy running in a VM. Would be very appreciative if someone could test the changes on their own instance. Happy to make whatever tweaks are required to confirm this works on single-monitor and multi-monitor systems as well as small taste-related code changes.
Other Approach
I have also experimented with the idea of forcing the screensaver to run on uniquely-named special workspaces, such as iterating over all monitors and running:
hyprctl dispatch togglespecialworkspace "screensaver-${MONITOR-NAME}"This way, there is no conflict or need for reverting the state of any former windows on teardown. If this is something that would like to be looked into, I would be happy to make additional changes or open another PR.