From 3964eae17d202d57129af3e92100bf1b9f6939f3 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Fri, 26 Aug 2016 12:05:58 -0500 Subject: [PATCH] Don't send keyboard leave events to unfocused clients This fixes a problem when focus moves between two xwayland clients. My testing of gtk applications shows no regressions, bug if xdg_shell popups start behaving oddly again, look here first. --- src/bin/e_comp_wl.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c index 05c1bc9f6..a43aa7215 100644 --- a/src/bin/e_comp_wl.c +++ b/src/bin/e_comp_wl.c @@ -2448,11 +2448,7 @@ _e_comp_wl_client_cb_del(void *data EINA_UNUSED, E_Client *ec) ec->parent->modal = NULL; } - /* FIXME: We should probably test if ec really has keyboard - * focus, but this at least catches GTK's silly habit of creating - * a surface, never attaching anything to it, then deleting it. - */ - if (ec->visible)_e_comp_wl_keyboard_leave(ec); + if ((ec == e_client_focused_get()) && ec->visible) _e_comp_wl_keyboard_leave(ec); wl_signal_emit(&ec->comp_data->destroy_signal, &ec->comp_data->surface);