mirror of
https://github.com/brl/mutter.git
synced 2024-11-11 00:26:40 -05:00
keyboard: Don't send leave events to dying surfaces
This commit is contained in:
parent
0ac142d39e
commit
600a0f836f
@ -501,14 +501,14 @@ meta_wayland_keyboard_set_focus (MetaWaylandKeyboard *keyboard,
|
|||||||
struct wl_resource *resource;
|
struct wl_resource *resource;
|
||||||
uint32_t serial;
|
uint32_t serial;
|
||||||
|
|
||||||
if (keyboard->focus_resource && keyboard->focus != surface)
|
if (keyboard->focus == surface)
|
||||||
{
|
return;
|
||||||
struct wl_display *display;
|
|
||||||
struct wl_client *client;
|
|
||||||
|
|
||||||
resource = keyboard->focus_resource;
|
resource = keyboard->focus_resource;
|
||||||
client = wl_resource_get_client (resource);
|
if (keyboard->focus_resource && keyboard->focus->resource)
|
||||||
display = wl_client_get_display (client);
|
{
|
||||||
|
struct wl_client *client = wl_resource_get_client (resource);
|
||||||
|
struct wl_display *display = wl_client_get_display (client);
|
||||||
serial = wl_display_next_serial (display);
|
serial = wl_display_next_serial (display);
|
||||||
wl_keyboard_send_leave (resource, serial, keyboard->focus->resource);
|
wl_keyboard_send_leave (resource, serial, keyboard->focus->resource);
|
||||||
|
|
||||||
@ -516,13 +516,11 @@ meta_wayland_keyboard_set_focus (MetaWaylandKeyboard *keyboard,
|
|||||||
}
|
}
|
||||||
|
|
||||||
resource = find_resource_for_surface (&keyboard->resource_list, surface);
|
resource = find_resource_for_surface (&keyboard->resource_list, surface);
|
||||||
if (resource &&
|
if (resource)
|
||||||
(keyboard->focus != surface || keyboard->focus_resource != resource))
|
|
||||||
{
|
{
|
||||||
struct wl_client *client = wl_resource_get_client (resource);
|
struct wl_client *client = wl_resource_get_client (resource);
|
||||||
struct wl_display *display;
|
struct wl_display *display = wl_client_get_display (client);
|
||||||
|
|
||||||
display = wl_client_get_display (client);
|
|
||||||
serial = wl_display_next_serial (display);
|
serial = wl_display_next_serial (display);
|
||||||
|
|
||||||
/* If we're in a modal grab, the client is focused but doesn't see
|
/* If we're in a modal grab, the client is focused but doesn't see
|
||||||
|
Loading…
Reference in New Issue
Block a user