atagen

monolith

public
Star0
Watch0

Commit 4b22f3d1f79d

tarball

atagen <boss@atagen.co>2026-10-19 10:59 UTC

1 file changed+9-1
xwayland: start a compositor drag only from a press on the requesting window

x11_drag accepted any active pointer grab, so an X11 client could start moving or resizing its window while the user held a button on some other surface.
Modified file: crates/monolith/src/xwayland.rs+9 additions−1 deletions
@@ -530,7 +530,8 @@ impl State {
530530 .map(|(id, _)| id)
531531 }
532532
533- /// X11 requests carry no serial, so the pointer must be holding a press.
533+ /// X11 requests carry no serial, so the pointer must be holding a press
534+ /// that started on the requesting window.
534535 fn x11_drag(&mut self, window: &X11Surface, edges: Option<Edges>) {
535536 let Some(start) = self
536537 .input
@@ -540,6 +541,13 @@ impl State {
540541 else {
541542 return;
542543 };
544+ let held = start
545+ .focus
546+ .as_ref()
547+ .is_some_and(|(f, _)| window.wl_surface().as_ref() == Some(f));
548+ if !held {
549+ return;
550+ }
543551 if let Some(id) = self.x11_window_id(window) {
544552 self.client_drag(id, edges, start.button);
545553 }