From 545218e34a2a4ab893516c6c882a9c80f79076f9 Mon Sep 17 00:00:00 2001 From: brandon s allbery kf8nh Date: Thu, 18 Jan 2024 14:39:44 -0500 Subject: [PATCH] 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 --- XMonad/Hooks/EwmhDesktops.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/XMonad/Hooks/EwmhDesktops.hs b/XMonad/Hooks/EwmhDesktops.hs index d1e967c5a..cfb1b91df 100644 --- a/XMonad/Hooks/EwmhDesktops.hs +++ b/XMonad/Hooks/EwmhDesktops.hs @@ -545,10 +545,10 @@ fullscreenEventHook' chWstate f = io $ changeProperty32 dpy win wmstate aTOM propModeReplace (f wstate) 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:) windows . appEndo =<< runQuery fullscreenHook win - when (action == remove || (action == toggle && isFull)) $ do + when (isFull && (action == remove || action == toggle)) $ do chWstate $ delete (fi fullsc) windows . appEndo =<< runQuery unFullscreenHook win