From 109c58ac02ec94ff311560b1a3cf601cc03e8bf4 Mon Sep 17 00:00:00 2001 From: Jay Ta'ala Date: Sun, 21 Jul 2024 13:02:47 +1000 Subject: [PATCH 1/4] Added a metawindow property to track "above" state when fullscreened. After fullscreening, we "make_above()" on the window to ensure if it above other windows (namely, modal windows). --- tiling.js | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/tiling.js b/tiling.js index c9f1b76a..15f31a15 100644 --- a/tiling.js +++ b/tiling.js @@ -2395,7 +2395,9 @@ export const Spaces = class Spaces extends Map { metaWindow._targetHeight = null; metaWindow._targetWidth = null; - if (metaWindow.get_workspace() === workspaceManager.get_active_workspace() && !metaWindow.minimized) + if ( + metaWindow.get_workspace() === workspaceManager.get_active_workspace() && + !metaWindow.minimized) actor.show(); else actor.hide(); @@ -3387,8 +3389,23 @@ export function registerWindow(metaWindow) { // if window is in a column, expel it barf(metaWindow, metaWindow); - const space = spaces.spaceOfWindow(metaWindow); - space?.setSpaceTopbarElementsVisible(true); + /** + * Set fullscreen windows to "always on top". This is to ensure + * that the fullscreened window is "above" modal windows. + */ + if (metaWindow.fullscreen) { + // get current "above" value (for later restoring) + metaWindow._fullscreen_above = metaWindow.is_above(); + metaWindow.make_above(); + } + else if (metaWindow._fullscreen_above !== null) { + if (!metaWindow._fullscreen_above) { + metaWindow.unmake_above(); + } + delete metaWindow._fullscreen_above; + } + + spaces.spaceOfWindow(metaWindow)?.setSpaceTopbarElementsVisible(true); }); signals.connect(metaWindow, 'notify::minimized', metaWindow => { minimizeHandler(metaWindow); @@ -3530,6 +3547,8 @@ export function removePaperWMFlags(w) { delete w._pos_mismatch_count; delete w._tiled_on_minimize; delete w._fullscreen_frame; + delete w._fullscreen_lock; + delete w._fullscreen_above; delete w._last_layout_frame; } From 607407f4d1b8c2938ed5313d1f0cfda18a7a8e3d Mon Sep 17 00:00:00 2001 From: Jay Ta'ala <30424662+jtaala@users.noreply.github.com> Date: Sun, 21 Jul 2024 13:11:57 +1000 Subject: [PATCH 2/4] Update README.md Changed wording re PaperWM managed Gnome Shell settings. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a0c8d2d1..61c89f83 100644 --- a/README.md +++ b/README.md @@ -355,9 +355,9 @@ Users can disable PaperWM's ability to change GNOME Top Bar styling from PaperWM _Note: several PaperWM specific features are dependent on changing the Gnome Top Bar to function correctly. If you choose to disable PaperWM's ability to change the Top Bar styles (with the setting above), you may also want to disable the [Window Position Bar](#window-position-bar-colored-bar-segment-in-top-bar)_. -## Recommended Gnome Shell Settings ## +## Managed Gnome Shell Settings ## -There's a few Gnome Shell settings which works poorly with PaperWM. Namely +There's a few Gnome Shell settings that are incompatible with, or work poorly with, PaperWM. Namely - `workspaces-only-on-primary`: Multi monitor support require workspaces spanning all monitors - `edge-tiling`: We don't support the native half tiled windows From 5e7497415c08bf2aa60f3545f8ddbd604b1639c2 Mon Sep 17 00:00:00 2001 From: Jay Ta'ala Date: Sun, 21 Jul 2024 13:39:09 +1000 Subject: [PATCH 3/4] Update "above" property when switching to another window. --- tiling.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tiling.js b/tiling.js index 15f31a15..1a1d3c72 100644 --- a/tiling.js +++ b/tiling.js @@ -4442,8 +4442,20 @@ export function focus_handler(metaWindow) { space.enableWindowPositionBar(false); space.setSpaceTopbarElementsVisible(false); space.hideSelection(); + if (!metaWindow.is_above()) { + metaWindow.make_above(); + } } else { + space.getWindows().filter(w => w.fullscreen).forEach(w => { + if ( + w._fullscreen_above !== null && + !w._fullscreen_above + ) { + w.unmake_above(); + } + }); + let needLayout = false; /** * If has fullscreen window - when selected non-fullscreen window, do layout: From a5f867a9f189b2603d643837b5c2bbf8e88cfecf Mon Sep 17 00:00:00 2001 From: Jay Ta'ala Date: Sun, 21 Jul 2024 14:00:30 +1000 Subject: [PATCH 4/4] Some cleanup. --- tiling.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tiling.js b/tiling.js index 1a1d3c72..39a66e26 100644 --- a/tiling.js +++ b/tiling.js @@ -2397,10 +2397,13 @@ export const Spaces = class Spaces extends Map { if ( metaWindow.get_workspace() === workspaceManager.get_active_workspace() && - !metaWindow.minimized) + !metaWindow.minimized + ) { actor.show(); - else + } + else { actor.hide(); + } }); this.signals.destroy();