only sink window if actually fullscreened

`EwmhFullscreen` unconditionally sinks windows in response to a
`_NET_WM_STATE` root window message removing `_NET_WM_STATE_FULLSCREEN`.
Unfortunately, at least some versions of either the Gtk or GNOME
libraries send this on startup while restoring a window's last
known state, which means a `manageHook` `doFloat` will be undone.

This change ignores the remove if the window is not fullscreen.

A followup issue, #865, has been added for the follow-on problem
that the floating state of a window is not restored on removal of
the fullscreen state.

Fixes: #820
This commit is contained in:
brandon s allbery kf8nh 2024-01-18 14:39:44 -05:00
parent a5fb7e021a
commit 318ee92e61

View File

@ -545,10 +545,10 @@ fullscreenEventHook'
chWstate f = io $ changeProperty32 dpy win wmstate aTOM propModeReplace (f wstate) chWstate f = io $ changeProperty32 dpy win wmstate aTOM propModeReplace (f wstate)
when (managed && typ == wmstate && fi fullsc `elem` dats) $ do when (managed && typ == wmstate && fi fullsc `elem` dats) $ do
when (action == add || (action == toggle && not isFull)) $ do when (not isFull && (action == add || action == toggle)) $ do
chWstate (fi fullsc:) chWstate (fi fullsc:)
windows . appEndo =<< runQuery fullscreenHook win windows . appEndo =<< runQuery fullscreenHook win
when (action == remove || (action == toggle && isFull)) $ do when (isFull && (action == remove || action == toggle)) $ do
chWstate $ delete (fi fullsc) chWstate $ delete (fi fullsc)
windows . appEndo =<< runQuery unFullscreenHook win windows . appEndo =<< runQuery unFullscreenHook win