From 017b9e0d7fff6d5d7d3d455c8e31f2820f0bf715 Mon Sep 17 00:00:00 2001 From: jeon Date: Wed, 9 Jan 2019 14:26:11 +0900 Subject: [PATCH] e_client: make fake mouse-out upon focus-out conditional - cursor is not changed correctly on wayland when a window lost focus while the cursor remained inside the window. - so patch this fake mouse-out condition refer to opensource Change-Id: Iac21c482c4c4a274aa8748c390f6031efc1c7510 --- src/bin/e_client.c | 3 ++- src/bin/e_client.h | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/bin/e_client.c b/src/bin/e_client.c index c5d54de..7f218fe 100644 --- a/src/bin/e_client.c +++ b/src/bin/e_client.c @@ -5028,7 +5028,8 @@ e_client_focused_set(E_Client *ec) ec_unfocus->want_focus = ec_unfocus->focused = 0; if (!e_object_is_del(E_OBJECT(ec_unfocus))) e_focus_event_focus_out(ec_unfocus); - if (ec_unfocus->mouse.in) + if (ec_unfocus->mouse.in && ec && (!e_client_util_is_popup(ec)) && + (e_config->focus_policy != E_FOCUS_CLICK)) e_client_mouse_out(ec_unfocus, ec_unfocus->x - 1, ec_unfocus->y - 1); /* if there unfocus client is fullscreen and visible */ diff --git a/src/bin/e_client.h b/src/bin/e_client.h index 0796881..69efeec 100644 --- a/src/bin/e_client.h +++ b/src/bin/e_client.h @@ -1285,4 +1285,25 @@ e_client_util_name_get(const E_Client *ec) return ec->icccm.title; return NULL; } + +static inline Eina_Bool +e_client_util_is_popup(const E_Client *ec) +{ + if (!ec) return EINA_FALSE; + switch (ec->netwm.type) + { + case E_WINDOW_TYPE_MENU: + case E_WINDOW_TYPE_SPLASH: + case E_WINDOW_TYPE_DROPDOWN_MENU: + case E_WINDOW_TYPE_POPUP_MENU: + case E_WINDOW_TYPE_TOOLTIP: + case E_WINDOW_TYPE_NOTIFICATION: + case E_WINDOW_TYPE_COMBO: + case E_WINDOW_TYPE_DND: + return EINA_TRUE; + default: break; + } + return EINA_FALSE; +} + #endif -- 2.7.4