From d8495d81f227c6f741697d7f1bb7eedf4f659e86 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Sun, 2 Feb 2020 18:07:43 +0300 Subject: [PATCH] anvil.shell: check that there's a grab before Move If there's no click grab then the request is invalid. --- anvil/src/shell.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/anvil/src/shell.rs b/anvil/src/shell.rs index 81b85b5..e69b400 100644 --- a/anvil/src/shell.rs +++ b/anvil/src/shell.rs @@ -160,6 +160,11 @@ pub fn init_shell( // TODO: touch move. let pointer = seat.get_pointer().unwrap(); + // Check that this surface has a click grab. + if !pointer.has_grab(serial) { + return; + } + let start_data = pointer.grab_start_data().unwrap(); let toplevel = SurfaceKind::Xdg(surface); @@ -210,6 +215,11 @@ pub fn init_shell( // TODO: touch move. let pointer = seat.get_pointer().unwrap(); + // Check that this surface has a click grab. + if !pointer.has_grab(serial) { + return; + } + let start_data = pointer.grab_start_data().unwrap(); let toplevel = SurfaceKind::Wl(surface);