anvil.shell: check that grab is correct in Move

Check that the grab had a focus and it was the same client as this
surface.
This commit is contained in:
Ivan Molodetskikh 2020-02-02 18:09:21 +03:00
parent d8495d81f2
commit 32613f3cd6
No known key found for this signature in database
GPG Key ID: 02CE38DA47E9D691
1 changed files with 26 additions and 0 deletions

View File

@ -167,6 +167,19 @@ pub fn init_shell(
let start_data = pointer.grab_start_data().unwrap();
// If the focus was for a different surface, ignore the request.
if start_data.focus.is_none()
|| !start_data
.focus
.as_ref()
.unwrap()
.0
.as_ref()
.same_client_as(surface.get_surface().unwrap().as_ref())
{
return;
}
let toplevel = SurfaceKind::Xdg(surface);
let initial_window_location = xdg_window_map.borrow().location(&toplevel).unwrap();
@ -222,6 +235,19 @@ pub fn init_shell(
let start_data = pointer.grab_start_data().unwrap();
// If the focus was for a different surface, ignore the request.
if start_data.focus.is_none()
|| !start_data
.focus
.as_ref()
.unwrap()
.0
.as_ref()
.same_client_as(surface.get_surface().unwrap().as_ref())
{
return;
}
let toplevel = SurfaceKind::Wl(surface);
let initial_window_location = shell_window_map.borrow().location(&toplevel).unwrap();