Skip to content

gestures: don't disable swipe trackers mid-gesture (GNOME 49/50 overview hang)#1166

Open
woongzeyi wants to merge 1 commit into
paperwm:releasefrom
woongzeyi:fix/overview-gesture-hang-gnome49
Open

gestures: don't disable swipe trackers mid-gesture (GNOME 49/50 overview hang)#1166
woongzeyi wants to merge 1 commit into
paperwm:releasefrom
woongzeyi:fix/overview-gesture-hang-gnome49

Conversation

@woongzeyi

Copy link
Copy Markdown

Summary

Fixes the overview hang / shell freeze that happens when a 3-finger up-to-overview gesture immediately follows another 3-finger gesture on GNOME 49/50.

Fixes #1165

Root cause

GNOME 49 rewrote SwipeTracker. Its enabled setter now interrupts an in-progress gesture instead of just flipping a flag:

set enabled(enabled) {
    ...
    if (!enabled && this._state === State.SCROLLING)
        this._interrupt();   // emits a synthetic 'end' with cancelProgress
    ...
}

So calling swipeTrackersEnable(false) while the overview tracker is mid-gesture emits a synthetic end, which pushes the overview into an illegal state transition:

JS ERROR: Error: Invalid overview shown transition from HIDDEN to HIDING

The overview animation then never completes and the shell wedges (pressing Super afterwards freezes it).

PaperWM disables trackers from a few spots that can run while an overview hand-off gesture is live. The Main.overview 'hidden' handler fires during the hand-off on every up-swipe; the pillSwipeTimer (300 ms) can land inside the next gesture.

Fix

Never disable a tracker while a PaperWM gesture is in progress:

  • gestures.js — add an inGesture flag (set at BEGIN, cleared at END/CANCEL) and an isInGesture() accessor. Defer the overview 'hidden' tracker-disable to idle and skip it when inGesture is still set, so the in-flight overview animation settles (tracker → State.NONE) before anything disables it.
  • patches.js — the pillSwipeTimer skips disabling trackers when Gestures.isInGesture() is true.

Follow-finger overview hand-off is unchanged.

Testing

  • GNOME Shell 50.2 (Wayland), PaperWM 50.0.1.
  • Before: horizontal scroll → immediate up-swipe reliably hung the overview and logged Invalid overview shown transition …; Super then froze the shell.
  • After: repeated reproductions show zero Invalid overview … errors and no hang. Verified via journalctl --user.

…iew hang)

On GNOME 49+ SwipeTracker.set enabled(false) calls _interrupt() when the
tracker is State.SCROLLING, emitting a synthetic end that drives the
overview into an illegal state transition (Invalid overview shown
transition ...), hanging the overview and freezing the shell.

Guard every mid-gesture tracker disable: track an inGesture flag, defer
the overview hidden disable to idle (skipped while a gesture is live),
and skip the pillSwipeTimer disable during a gesture.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant