Skip to content

fix: clear this.grabOp when the grab ends#526

Open
mayconrcmello wants to merge 1 commit intoforge-ext:mainfrom
mayconrcmello:fix/clear-grabop-on-grab-end
Open

fix: clear this.grabOp when the grab ends#526
mayconrcmello wants to merge 1 commit intoforge-ext:mainfrom
mayconrcmello:fix/clear-grabop-on-grab-end

Conversation

@mayconrcmello
Copy link
Copy Markdown

Summary

_handleGrabOpBegin writes this.grabOp = grabOp. _handleGrabOpEnd never clears it.

this.grabOp is read by:

  1. updateMetaWorkspaceMonitor() — to decide whether the tabbed-focus update is safe (skip during a drag).
  2. _handleResizing() — to decompose the grab type into directions during an active resize.

Consumer (2) only runs during an active resize grab, so a stale value can't reach it. Consumer (1) is the problem: after the user's first base grab, this.grabOp retains Meta.GrabOp.WINDOW_BASE for the entire session, and every subsequent workspace/monitor change for a tabbed window goes through the "skip update" branch — even when no grab is in progress.

Fix

Clear this.grabOp = null at the end of _handleGrabOpEnd.

Pairs with #524

#524 corrects the operator-precedence bug on the same condition. Without this clear, the precedence fix would mostly go back to a no-op after the user's first drag, because the flag stays stuck on WINDOW_BASE. They're independent (either could land first) but the user-visible behaviour only becomes correct with both.

Test plan

  • node --check
  • After dragging a window once (any drag), then moving a tabbed window across workspaces with Super+Shift+1..9: the tab head re-renders correctly. Without this fix, the tab head would never update again until gnome-shell restart.

`_handleGrabOpBegin` sets `this.grabOp = grabOp` but `_handleGrabOpEnd`
never clears it. The flag is also read in `updateMetaWorkspaceMonitor`
to decide whether to skip the tabbed-focus update during an active
drag. Once the user has done a single base grab, `this.grabOp` retains
`Meta.GrabOp.WINDOW_BASE` for the rest of the session, and every
subsequent workspace/monitor change for a tabbed window suppresses
the focus update — even when no grab is in progress.

The other consumer of `this.grabOp`, `_handleResizing`, only fires
during an active resize grab, so clearing the flag at grab-end has
no effect on it.

Pairs with the operator-precedence fix in forge-ext#524 (which corrected the
direction of the same condition); without this clear the precedence
fix mostly goes back to no-op after the user's first drag.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant