Skip to content

Make TouchAsMouse QScroller grab idempotent to stop QGestureManager SIGSEGV - #2360

Merged
trissim merged 1 commit into
mainfrom
fix/finger-scrolling-idempotent-grab
Nov 28, 2026
Merged

trissim merged 1 commit into
mainfrom
fix/finger-scrolling-idempotent-grab

Conversation

@trissim

@trissim trissim commented Nov 28, 2026

Copy link
Copy Markdown

Fixes live Pixel 8a SIGSEGV in QApplication::notify -> QGestureManager::filterEvent -> QGestureManager::getState (0x362950 / 0x362da0 / 0x364f98 in libQt6Widgets_arm64-v8a.so).

  • src/toad/qt/finger_scrolling.py: guard TouchAsMouse.grab() with QScroller.grabbedGesture(viewport).value <= Qt.GestureType.CustomGesture.value so repolishing a scroll area never unregisters and deletes its live QFlickGestureRecognizer.
  • src/toad/qt/composer.py: remove the duplicate direct QScroller.grabGesture call on attached_scroll.viewport() (FingerScrolling already owns all scroll areas).
  • tests/model/test_qt_finger_scrolling.py: add test_touch_grab_is_idempotent_across_repolish.

Verified: focused tests green, tools/qt_inherit_ratchet.py 0/0/0/0/0, REL_IMPORTS=0.

…IGSEGV

FingerScrolling.polish() called QScroller.grabGesture(viewport,
LeftMouseButtonGesture) on every QAbstractScrollArea repolish (stylesheet,
theme, focus, or dynamic update). Qt 6 QScroller::grabGesture() unregisters
and deletes the previous QFlickGestureRecognizer on every call, churning
custom gesture IDs (257 -> 497 in 10 taps) and causing QGestureManager::getState
use-after-free SIGSEGVs on Pixel 8a (0x362950/0x362da0/0x364f98 in
libQt6Widgets_arm64-v8a.so).

Guard TouchAsMouse.grab() with grabbedGesture <= CustomGesture so each
viewport grabs once, remove the duplicate grabGesture call in
QtMessageComposer (composer.py:921), and add a regression test.
@trissim
trissim merged commit 4d61616 into main Nov 28, 2026
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