From 867dec7ff09e1060f9b45e284bd809c06e2193f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Thu, 1 Mar 2012 17:09:37 -0500 Subject: [PATCH] compositor: Post keyboard leave before destroying surface We may want to move this into wayland-server. --- src/compositor.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/compositor.c b/src/compositor.c index c4bdf251..09519b78 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -598,11 +598,18 @@ weston_compositor_repick(struct weston_compositor *compositor) static void weston_surface_unmap(struct weston_surface *surface) { + struct wl_input_device *device = surface->compositor->input_device; + weston_surface_damage_below(surface); surface->output = NULL; wl_list_remove(&surface->link); wl_list_remove(&surface->layer_link); weston_compositor_repick(surface->compositor); + + if (device->keyboard_focus == &surface->surface) + wl_input_device_set_keyboard_focus(device, NULL, + weston_compositor_get_time()); + weston_compositor_schedule_repaint(surface->compositor); }