Skip to content

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

Open
woongzeyi wants to merge 2 commits into
paperwm:developfrom
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 2 commits into
paperwm:developfrom
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>
Thesola10
Thesola10 previously approved these changes Jun 23, 2026

@Thesola10 Thesola10 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some nitpicks

Comment thread patches.js
// Don't disable mid-gesture: on GNOME 50 disabling a
// SCROLLING tracker fires _interrupt() -> synthetic 'end'
// -> illegal overview transition -> hang.
if (Gestures.isInGesture?.()) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is there a null-check? This is our own module, the symbol should always exist

Comment thread gestures.js
// SCROLLING tracker calls _interrupt() -> synthetic 'end' -> illegal
// overview state transition -> stuck/hang.
GLib.idle_add(GLib.PRIORITY_DEFAULT, () => {
if (!inGesture && gestureEnabled()) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using the isInGesture() accessor even within the module

@Thesola10 Thesola10 changed the base branch from release to develop June 23, 2026 06:38
@Thesola10 Thesola10 dismissed their stale review June 23, 2026 06:38

The base branch was changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants