Touch at the window border: no GNOME Shell crash, resize and move by touch #8
Closed
asxpi
wants to merge 0 commits from
asxpi/anotherim-js:fix/touch-resize into develop
pull from: asxpi/anotherim-js:fix/touch-resize
merge into: another-im:develop
another-im:develop
another-im:fix/relock-dismiss
another-im:fix/settings-accounts
another-im:feat/unified-dialogs-1
another-im:feat/unified-dialogs-2
another-im:feat/unified-dialogs-3
another-im:feat/one-status
another-im:macos-0.6.1
another-im:fix/console-tab-out
another-im:fix/desktop-drop
another-im:fix/xml-console-menu
another-im:feat/telegram-connect
another-im:feat/chat-tags
another-im:feat/muc-omemo
another-im:integrate/origin-develop-2026-10-02
another-im:fix/media-bubble-size
another-im:fix/empty-click-focus
another-im:feat/system-font-default
another-im:integrate/develop-2026-10-02
another-im:fix/attachment-decrypt
another-im:feat/system-font
another-im:fix/chat-links
another-im:fix/android-background-network
another-im:feat/tray
another-im:feat/thumb-cache
another-im:fix/android-csi-native
another-im:feat/opfs-store
another-im:fix/alttab-focus
another-im:try/groupcalls
another-im:feat/pwa-install
another-im:integrate/0.3.0
another-im:fix/upload-bubble-030
another-im:feat/drag-select
another-im:fix/upload-bubble
another-im:feat/encryption-info
another-im:chore/libtacky-path
another-im:feat/chat-header-menus
another-im:integrate/develop
another-im:fix/saved-top-linux-voice
another-im:fix/dialog-close-icons
another-im:feat/window-title-unread
another-im:feat/groupcalls
another-im:fix/open-picture-one-tap
another-im:feat/server-info-console
another-im:fix/chat-open-scroll-end
another-im:fix/desktop-push-mutes
another-im:fix/android-mute-push-selection
another-im:feat/otr-lock-colours
another-im:otr-v3-secret-chats
another-im:chore/remove-otr
another-im:feat/room-invites
another-im:feat/voice-video-messages
another-im:docs/readme
another-im:fix/android-empty-files
another-im:api-freeze
another-im:feat/push-counts
another-im:feat/h264-android-save
another-im:feat/keep-attachments-decrypted
another-im:feat/media-player
another-im:feat/fix-subdomain-attachments
another-im:feat/fonts-pt-sans
another-im:feat/always-decrypt-on-the-fly
another-im:feat/default-scale-125
another-im:fix/composer-focus-after-send
another-im:feat/android-native-calls
another-im:feat/media-stream-decrypt
another-im:feat/download-failure
another-im:feat/outbox-cap
another-im:feat/web-call-sheet
another-im:feat/first-run-push-check
another-im:feat/font-size-110
another-im:feat/log-view
another-im:fix/failed-transfer-history
another-im:feat/secure-unlock
another-im:feat/tpm-desktop
another-im:feat/tpm-android
another-im:feat/api-freeze-client
No reviewers
Labels
Clear labels
bug
Something is not working
duplicate
This issue or pull request already exists
feature request
New feature
linux
linux exclusive
macos
macos exclusive
needsinfo
Needs more information
severity: high
Major issue, significantly impacts usability or blocks core functionality
severity: low
Minor issue, cosmetic or rarely affects usage
severity: medium
Noticeable issue, but there is a workaround or limited impact
telegram_gw
issues related to the telegram gw
ui/ux
issues related to the interface and user experience (visual glitches, layout, interactions, usability problems)
windows
windows exclusive
wontfix
This won't be fixed
No labels
bug
duplicate
feature request
linux
macos
needsinfo
severity: high
severity: low
severity: medium
telegram_gw
ui/ux
windows
wontfix
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set
Reference
another-im/anotherim-js!8
Loading…
Reference in a new issue
No description provided.
Delete branch "asxpi/anotherim-js:fix/touch-resize"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes the GNOME Shell crash on touch at the window's border (#7), and makes resizing and moving the window by touch work (closes #9).
The crash
On GNOME (Wayland, mutter 50.2), a finger near the edge of the window with the app's own title bar could crash GNOME Shell and end the session. A Wayland protocol log of the app showed the cause:
For a window without the system's frame, both tao (on the GtkWindow) and tauri-runtime-wry (on the webview) connect a
touch-eventhandler that callsbegin_resize_drag_for_deviceon every touch event within 5px of the border: the press, each move and the release, all with the same touch serial. The first resize makes mutter cancel the touch; the next one dereferences the cancelled touch's NULLfocus_surfaceintouch_can_grab_surface():The root cause is in mutter (
mainstill has the unchecked dereference; a one-line NULL check fixes it), but until GNOME ships a fix, the app has to send only one grab request per touch.What changes
ui/src/views/window-controls.ts): they listen forpointerdownand skippointerType === 'touch', so WebKit's emulatedmousedownno longer becomes a resize with a touch's serial.g_signal_handlers_block_matchedontouch-event); neither crate has a switch for them. tao connects its handler only later, from its event loop, so the block runs once the main loop is idle after setup and again whenever a touch begins, sparing ours. WebKit's own touch handling is the view's class handler and is not affected.src-tauri/src/window_frame.rs,linux::touch_resize), on both widgets:frame_logic::resize_edge: the same band and corners the page draws, with or without the frame) starts onebegin_resize_drag_for_devicefor the touch's device. The rest of that touch is held back from the page and the window, so the request goes out once, with a serial mutter has not cancelled.window_touch_movecommand once per touch, and the shell callsbegin_move_drag_for_devicefor that touch; a second ask for the same touch is dropped. tao'sdrag_window()could not do this: it always moves by the pointer device. The page cancels the pan its root would start, at the firsttouchmove, so a tap still clicks.Commits
0f6a348window-controls: don't resize from the edges by touch4089b20app: block Tauri's touch resizing at the window borderfdec5c6window_frame: resize and move by touch, one request per touch (replaces the blocking-only step of4089b20with the handler above)bb9ef5fwindow_frame: block Tauri's touch handlers once they are connected (the block in4089b20/fdec5c6ran before tao had connected its handler, so tao's still fired)Tested
frame_logicunit tests (rustc --test, asmake test-shell): 13/13, two new forresize_edge.ui/test/window-frame.test.ts: 42/42, new cases for a finger on the resize edges and a finger dragging the title bar;tscclean.bb9ef5fon GNOME 50 / mutter 50.2 (carrying the !5375 NULL check, so the log, not the absence of a crash, is the test) with a touchscreen,WAYLAND_DEBUG=client, 22 touches over the edges, a corner, the title bar and the page: every touch that grabs sends exactly onexdg_toplevel.resizeormove, with that touch's serial, followed by the compositor'swl_touch.cancel; nothing repeated, taps and scrolling in the page unchanged. The build beforebb9ef5fstill sent two resizes for a finger moving along the bottom edge.touch_can_grab_surface, as before), this build did not. The logged touches there: title-bar moves and a corner resize, one request each, thenwl_touch.cancel, nothing repeated.Reported upstream: tao (https://github.com/tauri-apps/tao/issues/1380) and tauri-runtime-wry (https://github.com/tauri-apps/tauri/issues/16276), to start a touch resize on
TouchBeginonly; the mutter fix is https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/5375.🤖 Generated with Claude Code
Don't resize the window from its edges by touchto Touch at the window border: no GNOME Shell crash, resize and move by touchMerged into develop by hand as
c942779b(feat/0.5.2), released in 0.5.2 (release 101, tag v0.5.2 =6b73fbc9). Reviewed: one grab per touch on the shell side, the page's touch path beside the mouse one; the only conflicts were the two command lists (window_open from the start-screen work beside window_touch_move).Pull request closed