From 328a214d58656de1d3b5de5f0c213feb0091fe06 Mon Sep 17 00:00:00 2001 From: Maycon Date: Wed, 29 Apr 2026 14:02:36 -0300 Subject: [PATCH] fix: correct operator precedence on grabOp tabbed-focus guard MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In updateMetaWorkspaceMonitor(): if (!this.grabOp === Meta.GrabOp.WINDOW_BASE) this.updateTabbedFocus(existNodeWindow); `!` binds tighter than `===`, so this evaluates as `(!this.grabOp) === Meta.GrabOp.WINDOW_BASE` — i.e. a boolean compared to an integer, which is *always* false. updateTabbedFocus has therefore never run from this code path. The intent (matching every other GrabOp comparison in the codebase, all of the form `grabOp === Meta.GrabOp.X`) is "skip the update only when the grab op IS WINDOW_BASE" — i.e. don't yank tabbed focus while the user is mid-drag. Replace with `this.grabOp !== Meta.GrabOp.WINDOW_BASE`. Surfaces when a tabbed window is moved across workspaces/monitors without an active grab — the tab head should follow the focus, but currently doesn't. --- lib/extension/window.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/extension/window.js b/lib/extension/window.js index 61820e1e..9d23cae9 100644 --- a/lib/extension/window.js +++ b/lib/extension/window.js @@ -1735,7 +1735,7 @@ export class WindowManager extends GObject.Object { // Ensure that the workspace tiling is honored if (this.isActiveWindowWorkspaceTiled(metaWindow)) { - if (!this.grabOp === Meta.GrabOp.WINDOW_BASE) this.updateTabbedFocus(existNodeWindow); + if (this.grabOp !== Meta.GrabOp.WINDOW_BASE) this.updateTabbedFocus(existNodeWindow); this.updateStackedFocus(existNodeWindow); } else { if (this.floatingWindow(existNodeWindow)) {