Skip to content

wayland: use touch serials for drag_window, drag_resize_window and show_window_menu - #4683

Open
hojjatabdollahi wants to merge 1 commit into
rust-windowing:masterfrom
hojjatabdollahi:hojjat/touch-move
Open

wayland: use touch serials for drag_window, drag_resize_window and show_window_menu#4683
hojjatabdollahi wants to merge 1 commit into
rust-windowing:masterfrom
hojjatabdollahi:hojjat/touch-move

Conversation

@hojjatabdollahi

Copy link
Copy Markdown

Window::drag_window() on Wayland passes the pointer's last button serial to xdg_toplevel.move. Touch input never records a serial, so the request carries a stale pointer serial. Compositors validate the serial against the active implicit grab and reject the request, so client-side decorations cannot be dragged. (The same for resize, and window_menu).

Here's what I'm doing:

  • Record (WlSeat, serial) on the WindowState in the touch down handler.
  • Clear it in up once no other finger remains on that surface, and in cancel.
  • In drag_window, drag_resize_window and show_window_menu, prefer the stored touch serial when a finger is down on the window and fall back to the pointer serial otherwise.

__

  • Tested on all platforms changed
    • it only touches Wayland
  • Added an entry to the changelog module if knowledge of this change could be valuable to users
  • Updated documentation to reflect any user-facing changes, including notes of platform-specific behavior
  • Created or updated an example program if it would help users understand this functionality

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant