From 1051c77d31ac2a871bfd26c9bc0b2b58c523d240 Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Fri, 25 Mar 2022 10:40:00 +0000 Subject: [PATCH] fix fullscreen flicker/toggle when window is small and we get mouse out we get a spurious mouse out if your window is small then told to go fullscreen which then causes in ponter focus a unfocus event which causes e to restore window to its non-fulscreen mode which then may cause a mouse in again if mouse is positioned right which causes a "go fullscreen now again" and so on... fix this and ignore that mouse out right after going fullscreen. @fix --- src/bin/e_client.c | 1 + src/bin/e_client.h | 2 ++ src/bin/e_comp_x.c | 6 ++++++ 3 files changed, 9 insertions(+) diff --git a/src/bin/e_client.c b/src/bin/e_client.c index a0314df2f..01a1b0bbf 100644 --- a/src/bin/e_client.c +++ b/src/bin/e_client.c @@ -4533,6 +4533,7 @@ e_client_fullscreen(E_Client *ec, E_Fullscreen policy) evas_object_layer_set(ec->frame, E_LAYER_CLIENT_FULLSCREEN); ec->fullscreen = 1; + ec->fullscreen_time = ecore_time_get(); ec->unfullscreen_forced = 0; #ifndef HAVE_WAYLAND_ONLY if ((eina_list_count(e_comp->zones) > 1) || diff --git a/src/bin/e_client.h b/src/bin/e_client.h index 826cf352d..cc4bc9b1a 100644 --- a/src/bin/e_client.h +++ b/src/bin/e_client.h @@ -693,6 +693,8 @@ struct E_Client int x, y; } drag; + double fullscreen_time; + Ecore_Timer *raise_timer; E_Client_Move_Intercept_Cb move_intercept_cb; E_Remember *remember; diff --git a/src/bin/e_comp_x.c b/src/bin/e_comp_x.c index ebc2ac4cd..55303b860 100644 --- a/src/bin/e_comp_x.c +++ b/src/bin/e_comp_x.c @@ -2705,6 +2705,12 @@ _e_comp_x_mouse_out(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_X_Event_ return ECORE_CALLBACK_PASS_ON; ec = _e_comp_x_client_find_by_window(ev->win); if (!ec) return ECORE_CALLBACK_RENEW; + // if we're fullscreen and see a mout out within a short time of having + // set this client ot fullscreen - it's a "false flag" that is a bi-product + // of things moving around while becoming fullscreen, so ignore it + if ((ec->fullscreen) && + (ecore_time_get() - ec->fullscreen_time) < 0.2) // 0.2sec enough + return ECORE_CALLBACK_RENEW; if (_e_comp_x_client_data_get(ec)->deleted) return ECORE_CALLBACK_RENEW; if (mouse_client == ec) {