mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 11:32:04 +00:00
wayland: Don't set_focus when the device has been released
It's possible for a released pointer to have repick / set_focus on it as part of sync_input_focus. When the pointer is actually re-init'd, it will memset 0, which can cause corruption as our destroy listener has already been added. Released devices should be idempotent, so just make sure method calls on them don't have any effect.
This commit is contained in:
parent
e19516ec5a
commit
4d75de006c
@ -380,6 +380,8 @@ meta_wayland_keyboard_release (MetaWaylandKeyboard *keyboard)
|
||||
wl_array_release (&keyboard->pressed_keys);
|
||||
|
||||
g_object_unref (keyboard->settings);
|
||||
|
||||
keyboard->display = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -517,6 +519,9 @@ void
|
||||
meta_wayland_keyboard_set_focus (MetaWaylandKeyboard *keyboard,
|
||||
MetaWaylandSurface *surface)
|
||||
{
|
||||
if (keyboard->display == NULL)
|
||||
return;
|
||||
|
||||
if (keyboard->focus_surface == surface)
|
||||
return;
|
||||
|
||||
|
@ -216,6 +216,8 @@ meta_wayland_pointer_release (MetaWaylandPointer *pointer)
|
||||
{
|
||||
meta_wayland_pointer_set_focus (pointer, NULL);
|
||||
set_cursor_surface (pointer, NULL);
|
||||
|
||||
pointer->display = NULL;
|
||||
}
|
||||
|
||||
static int
|
||||
@ -476,6 +478,9 @@ void
|
||||
meta_wayland_pointer_set_focus (MetaWaylandPointer *pointer,
|
||||
MetaWaylandSurface *surface)
|
||||
{
|
||||
if (pointer->display == NULL)
|
||||
return;
|
||||
|
||||
if (pointer->focus_surface == surface)
|
||||
return;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user