mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 19:42:05 +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);
|
wl_array_release (&keyboard->pressed_keys);
|
||||||
|
|
||||||
g_object_unref (keyboard->settings);
|
g_object_unref (keyboard->settings);
|
||||||
|
|
||||||
|
keyboard->display = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -517,6 +519,9 @@ void
|
|||||||
meta_wayland_keyboard_set_focus (MetaWaylandKeyboard *keyboard,
|
meta_wayland_keyboard_set_focus (MetaWaylandKeyboard *keyboard,
|
||||||
MetaWaylandSurface *surface)
|
MetaWaylandSurface *surface)
|
||||||
{
|
{
|
||||||
|
if (keyboard->display == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
if (keyboard->focus_surface == surface)
|
if (keyboard->focus_surface == surface)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -216,6 +216,8 @@ meta_wayland_pointer_release (MetaWaylandPointer *pointer)
|
|||||||
{
|
{
|
||||||
meta_wayland_pointer_set_focus (pointer, NULL);
|
meta_wayland_pointer_set_focus (pointer, NULL);
|
||||||
set_cursor_surface (pointer, NULL);
|
set_cursor_surface (pointer, NULL);
|
||||||
|
|
||||||
|
pointer->display = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -476,6 +478,9 @@ void
|
|||||||
meta_wayland_pointer_set_focus (MetaWaylandPointer *pointer,
|
meta_wayland_pointer_set_focus (MetaWaylandPointer *pointer,
|
||||||
MetaWaylandSurface *surface)
|
MetaWaylandSurface *surface)
|
||||||
{
|
{
|
||||||
|
if (pointer->display == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
if (pointer->focus_surface == surface)
|
if (pointer->focus_surface == surface)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user