rotation: unset rot.pending_show when ec's pixmap is unusable 45/268845/1
authorDoyoun Kang <doyoun.kang@samsung.com>
Tue, 4 Jan 2022 01:56:51 +0000 (10:56 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Tue, 4 Jan 2022 02:12:36 +0000 (11:12 +0900)
If an window requested to unmap while pending show by rotation, then ec's rot.pending_show
flag remained to 1. So, window could not shown when it reqeusted to show again.
This patch resolve this problem.

Change-Id: I7e4e4c4388a9debd3d868b25fe2f1c173e10e591

src/e_mod_main.h
src/rotation/e_mod_rotation_wl.c

index 548c28e..006815b 100644 (file)
@@ -58,6 +58,17 @@ typedef enum
     }                                                    \
   while (0)
 
+#undef E_PIXMAP_HOOK_APPEND
+#define E_PIXMAP_HOOK_APPEND(l, t, cb, d) \
+  do                                      \
+    {                                     \
+       E_Pixmap_Hook *_h;                 \
+       _h = e_pixmap_hook_add(t, cb, d);  \
+       assert(_h);                        \
+       l = eina_list_append(l, _h);       \
+    }                                     \
+  while (0)
+
 extern Mod *_pol_mod;
 
 EINTERN void             e_mod_pol_conf_init(Mod *mod);
index 06d437c..2e5fd43 100644 (file)
@@ -96,6 +96,7 @@ static Eina_Hash *rot_hash = NULL;
 static Eina_List *rot_cbs = NULL;
 static Eina_List *rot_ec_hooks = NULL;
 static Eina_List *rot_obj_hooks = NULL;
+static Eina_List *rot_pixmap_hooks = NULL;
 static Eina_List *wl_hooks = NULL;
 static Eina_List *pol_vis_hooks = NULL;
 static Ecore_Idle_Enterer *rot_idle_enterer = NULL;
@@ -2920,6 +2921,19 @@ _rot_cb_idle_enterer(void *data EINA_UNUSED)
    return ECORE_CALLBACK_RENEW;
 }
 
+static void
+_rot_hook_pixmap_unusable(void *data EINA_UNUSED, E_Pixmap *cp)
+{
+   E_Client *ec = (E_Client *)e_pixmap_client_get(cp);
+   if (!ec) return;
+
+   if (ec->e.state.rot.pending_show)
+     {
+        ELOGF("ROTATION", "Unset Postpone show", ec);
+        ec->e.state.rot.pending_show = 0;
+     }
+}
+
 Eina_Bool
 e_mod_rot_wl_init(void)
 {
@@ -2945,6 +2959,7 @@ e_mod_rot_wl_init(void)
    E_COMP_OBJECT_INTERCEPT_HOOK_APPEND(rot_obj_hooks, E_COMP_OBJECT_INTERCEPT_HOOK_SHOW_HELPER, _rot_intercept_hook_show_helper, NULL);
    E_COMP_OBJECT_INTERCEPT_HOOK_APPEND(rot_obj_hooks, E_COMP_OBJECT_INTERCEPT_HOOK_HIDE,        _rot_intercept_hook_hide,        NULL);
    E_COMP_WL_HOOK_APPEND(wl_hooks,                    E_COMP_WL_HOOK_BUFFER_CHANGE,             _rot_cb_wl_buffer_change,        NULL);
+   E_PIXMAP_HOOK_APPEND(rot_pixmap_hooks, E_PIXMAP_HOOK_UNUSABLE, _rot_hook_pixmap_unusable, NULL);
 
    E_Pol_Vis_Hook *h = e_policy_visibility_hook_add(E_POL_VIS_HOOK_TYPE_FG_SET, _rot_hook_fg_set, NULL);
    pol_vis_hooks = eina_list_append(pol_vis_hooks, h);
@@ -2965,6 +2980,7 @@ e_mod_rot_wl_shutdown(void)
    E_FREE_LIST(rot_ec_hooks, e_client_hook_del);
    E_FREE_LIST(rot_cbs, ecore_event_handler_del);
    E_FREE_LIST(rot_obj_hooks, e_comp_object_intercept_hook_del);
+   E_FREE_LIST(rot_pixmap_hooks, e_pixmap_hook_del);
 
    if (rot_global)
      {