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
This commit is contained in:
Carsten Haitzler 2022-03-25 10:40:00 +00:00
parent f81387470f
commit 1051c77d31
3 changed files with 9 additions and 0 deletions

View File

@ -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) ||

View File

@ -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;

View File

@ -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)
{