This reverts the commits:
 311ab6b08ccf ("Raise fullscreened window")
 a504370f3b27 ("Remove WMFullscreenLevel")

Removing WMFullscreenLevel had the side effect that a dock or panel
having the _NET_WM_WINDOW_TYPE_DOCK type would stack on top of
fullscreen windows, obscuring part of them.  This is unwanted. No
other window should cover a focused fullscreen window:.
https://specifications.freedesktop.org/wm-spec/latest/ar01s09.html#STACKINGORDER

Simply raising the fullscreen window to the top of the stack of normal
windows is not sufficient if there are windows with higher stacking
levels present.  The separate WMFullscreenLevel is needed.

Cc: Amadeusz Sławiński <am...@asmblr.net>
Signed-off-by: Bjørn Mork <bj...@mork.no>
---
 src/WindowMaker.h |  1 +
 src/actions.c     | 16 ++++++++++------
 src/wmspec.c      |  2 +-
 3 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/src/WindowMaker.h b/src/WindowMaker.h
index 21da64da6841..6a34962e0bd0 100644
--- a/src/WindowMaker.h
+++ b/src/WindowMaker.h
@@ -59,6 +59,7 @@ enum {
        WMSubmenuLevel = 15,
        WMMainMenuLevel = 20,
        WMStatusLevel = 21,
+       WMFullscreenLevel = 50,
        WMModalLevel = 100,
        WMPopUpLevel = 101,
        WMScreensaverLevel = 1000,
diff --git a/src/actions.c b/src/actions.c
index 5adfab49d6eb..63f9f36457ca 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -726,8 +726,7 @@ void wFullscreenWindow(WWindow *wwin)
 
        wWindowConfigureBorders(wwin);
 
-       ChangeStackingLevel(wwin->frame->core, WMNormalLevel);
-       wRaiseFrame(wwin->frame->core);
+       ChangeStackingLevel(wwin->frame->core, WMFullscreenLevel);
 
        wwin->bfs_geometry.x = wwin->frame_x;
        wwin->bfs_geometry.y = wwin->frame_y;
@@ -751,10 +750,15 @@ void wUnfullscreenWindow(WWindow *wwin)
 
        wwin->flags.fullscreen = False;
 
-       if (WFLAGP(wwin, sunken))
-               ChangeStackingLevel(wwin->frame->core, WMSunkenLevel);
-       else if (WFLAGP(wwin, floating))
-               ChangeStackingLevel(wwin->frame->core, WMFloatingLevel);
+       if (wwin->frame->core->stacking->window_level == WMFullscreenLevel) {
+               if (WFLAGP(wwin, sunken)) {
+                       ChangeStackingLevel(wwin->frame->core, WMSunkenLevel);
+               } else if (WFLAGP(wwin, floating)) {
+                       ChangeStackingLevel(wwin->frame->core, WMFloatingLevel);
+               } else {
+                       ChangeStackingLevel(wwin->frame->core, WMNormalLevel);
+               }
+       }
 
        wWindowConfigure(wwin, wwin->bfs_geometry.x, wwin->bfs_geometry.y,
                         wwin->bfs_geometry.width, wwin->bfs_geometry.height);
diff --git a/src/wmspec.c b/src/wmspec.c
index 9b56f96f3970..0bfc8648dce0 100644
--- a/src/wmspec.c
+++ b/src/wmspec.c
@@ -1057,7 +1057,7 @@ static int getWindowLayer(WWindow *wwin)
                if (wwin->transient_for) {
                        WWindow *parent = wWindowFor(wwin->transient_for);
                        if (parent && parent->flags.fullscreen)
-                               layer = WMNormalLevel;
+                               layer = WMFullscreenLevel;
                }
                /* //layer = WMPopUpLevel; // this seems a bad idea -Dan */
        } else if (wwin->type == net_wm_window_type_dropdown_menu) {
-- 
2.8.1


-- 
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.

Reply via email to