WillPower3309 / swayfx

SwayFX: Sway, but with eye candy!
MIT License
1.29k stars 48 forks source link

Windows lose saturation value after minimizing and reopen #134

Closed rafaelsgirao closed 1 year ago

rafaelsgirao commented 1 year ago

Please read the following before submitting:

Please fill out the following:

I also noticed both programs I tested this in (Discord and Ferdium) are both running under XWayland, if that matters - I don't know of any minimizable program that runs on native Wayland.

WillPower3309 commented 1 year ago

Thanks for raising the issue! I'll ping @ErikReider on this, who implemented saturation and is also taking a look at scratchpad behavior

ErikReider commented 1 year ago

Close should work which is strange

WillPower3309 commented 1 year ago

To clarify, would this occur when sending a window to the scratchpad? We (as in sway upstream as well) don't yet support minimization

ErikReider commented 1 year ago

Can't reproduce either way. Could you provide your config file?

rafaelsgirao commented 1 year ago

To clarify, would this occur when sending a window to the scratchpad? We (as in sway upstream as well) don't yet support minimization

I can confirm that windows retain saturation when sending and retrieving them to scratchpad.

Can't reproduce either way. Could you provide your config file? Of course. But I've reproduced this on the default config ( just adding the line for_window [class="discord"] saturation set 0 at the end ). Sway config used

rafaelsgirao commented 1 year ago

Adding some more information: Windows that lost their saturation get it back after I issue swaymsg reload and mess around with said window a little.

Also, checking the debug log I sent above again, I noticed these two snippets:

00:00:03.846 [DEBUG] [sway/tree/view.c:503] Checking criteria [class="discord"]
00:00:03.846 [DEBUG] [sway/tree/view.c:508] for_window '[class="discord"]' matches view 0x1d6d130, cmd: 'saturation set 0'
00:00:03.846 [INFO] [sway/commands.c:272] Handling command 'saturation set 0'

Then, down below (presumably after I've closed and reopened Discord from the tray bar), this snippet:

00:00:06.189 [DEBUG] [sway/tree/view.c:503] Checking criteria [class="discord"]
00:00:06.189 [DEBUG] [sway/tree/view.c:505] Criteria already executed

I think that from swayfx's perspective, the window is still the same (which seems plausible), so it doesn't reapply the lost saturation rate.

ErikReider commented 1 year ago

Hmmm. Seems to be an issue when closing the window into it's appindicator (which discord does by default)

ErikReider commented 1 year ago

This also applies to other for_window rules/preferences. One example would be my Steam Friends window rule for_window [class="^Steam$" title="^Friends List$"] floating enable which only works the first time I open the window. So this is a upstream bug

WillPower3309 commented 1 year ago

Ah good to know, thanks for the investigation Erik, @rafaelsgirao try raising an upstream issue please :)