From c80e95cd033f9751f68cc06a8e27ce6d5a0aa1d5 Mon Sep 17 00:00:00 2001 From: Leleat Date: Tue, 28 Mar 2023 13:51:01 +0200 Subject: [PATCH] Window Grab Operations: Fix regression for GNOME 44 Mutter introduced a new flag META_GRAB_OP_WINDOW_FLAG_UNCONSTRAINED (1024) in 2d8fa26c. See that commit for more details. The flag is used to indicate wether a window is unconstrainted during a grab operation e. g. wether it can go under the top bar. As an example, this flag will be set, if you use super + mouse buttons. We currently only check for equality when looking at the Meta.GrabOp instead of using a bitwise or. That's why for simplicitiy's sake, just remove the new flag before working with the grabOp (and take the new flag into account during an upcoming larger refactor). Fixes https://github.com/Leleat/Tiling-Assistant/issues/252 --- .../src/extension/moveHandler.js | 2 ++ .../src/extension/resizeHandler.js | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/tiling-assistant@leleat-on-github/src/extension/moveHandler.js b/tiling-assistant@leleat-on-github/src/extension/moveHandler.js index 95bedae..50eaac0 100644 --- a/tiling-assistant@leleat-on-github/src/extension/moveHandler.js +++ b/tiling-assistant@leleat-on-github/src/extension/moveHandler.js @@ -24,6 +24,8 @@ var Handler = class TilingMoveHandler { this._displaySignals = []; const g1Id = global.display.connect('grab-op-begin', (src, window, grabOp) => { + grabOp &= ~1024; // META_GRAB_OP_WINDOW_FLAG_UNCONSTRAINED + if (window && moveOps.includes(grabOp)) this._onMoveStarted(window, grabOp); }); diff --git a/tiling-assistant@leleat-on-github/src/extension/resizeHandler.js b/tiling-assistant@leleat-on-github/src/extension/resizeHandler.js index a7325ea..1a37338 100644 --- a/tiling-assistant@leleat-on-github/src/extension/resizeHandler.js +++ b/tiling-assistant@leleat-on-github/src/extension/resizeHandler.js @@ -45,10 +45,14 @@ var Handler = class TilingResizeHandler { }; const g1 = global.display.connect('grab-op-begin', (d, window, grabOp) => { + grabOp &= ~1024; // META_GRAB_OP_WINDOW_FLAG_UNCONSTRAINED + if (window && isResizing(grabOp)) this._onResizeStarted(window, grabOp); }); const g2 = global.display.connect('grab-op-end', (d, window, grabOp) => { + grabOp &= ~1024; // META_GRAB_OP_WINDOW_FLAG_UNCONSTRAINED + if (window && isResizing(grabOp)) this._onResizeFinished(window, grabOp); });