e_policy: Flush buffer of e_client when client is unmap state 75/321575/1
authorChangyeon Lee <cyeon.lee@samsung.com>
Thu, 6 Mar 2025 09:52:39 +0000 (18:52 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Tue, 25 Mar 2025 08:01:07 +0000 (17:01 +0900)
Change-Id: I8fc4248b06a7395e518fd40870486354ff3ec608

src/bin/core/e_client.c
src/bin/core/e_client_intern.h
src/bin/displaymgr/e_hwc_window.c
src/bin/displaymgr/e_hwc_window_queue.c
src/bin/server/e_comp_wl.c
src/bin/windowmgr/e_policy.c
src/bin/windowmgr/e_policy_visibility.c

index 7c80f731997589ca402e157bda13c22b1f361cbe..d2a746d5a233add86a602ea1df8cd199aa026b08 100644 (file)
@@ -8840,3 +8840,18 @@ e_client_subsurface_data_try_get(E_Client *ec)
 {
    return ec->comp_data ? ec->comp_data->sub.data : NULL;
 }
+
+EINTERN Eina_Bool
+e_client_buffer_flush_enabled_get(E_Client *ec)
+{
+   if (!ec) return EINA_FALSE;
+   if (!ec->comp_data) return EINA_FALSE;
+   if (!ec->exp_iconify.buffer_flush) return EINA_FALSE;
+   if (e_view_client_visible_get(e_client_view_get(ec))) return EINA_FALSE;
+   if (ec->is_cursor) return EINA_FALSE;
+
+   if (e_policy_visibility_client_is_iconic(ec)) return EINA_TRUE;
+   if (!ec->comp_data->mapped) return EINA_TRUE;
+
+   return EINA_FALSE;
+}
index c5db9373d6971e1e89c23805cb61f2e8996c6140..654520dad91cebe1c5d8463dbec7b1f2e5e50fa2 100644 (file)
@@ -274,4 +274,6 @@ int       e_client_virtual_touch_finger_get(E_Client *ec);
 void      e_client_virtual_touch_threshold_set(E_Client *ec, int threshold);
 int       e_client_virtual_touch_threshold_get(E_Client *ec);
 
+EINTERN Eina_Bool e_client_buffer_flush_enabled_get(E_Client *ec);
+
 #endif
index 4da34ff3d7bc1bd9ad442a01b18447cf68cbb61a..f7b2bf16b309ffab197456e73dbf95ba54702a79 100644 (file)
@@ -2741,9 +2741,7 @@ _e_hwc_window_client_recover(E_Hwc_Window *hwc_window, Eina_Bool *clear_attach)
    comp_wl_buffer = _e_hwc_window_comp_wl_buffer_get(hwc_window);
 
    if ((!comp_wl_buffer) &&
-       (!e_view_client_visible_get(e_client_view_get(ec))) &&
-       (ec->exp_iconify.buffer_flush) &&
-       (e_policy_visibility_client_is_iconic(ec)))
+       (e_client_buffer_flush_enabled_get(ec)))
     return EINA_FALSE;
 
    if (!comp_wl_buffer)
index a6cf7ee98e73110a7b65afa2a645f338810ae98a..f57784dde3e8309f69159fa8be0d62f48ee5cfff 100644 (file)
@@ -1374,9 +1374,7 @@ _e_hwc_window_queue_copy_thread_run_end_cb(void *data, Ecore_Thread *thread)
    if (!(ec = copy_thread_data->hwc_window->ec)) goto end;
    if (!e_client_cdata_get(ec)) goto end;
 
-   if ((!e_view_client_visible_get(e_client_view_get(ec))) &&
-       (ec->exp_iconify.buffer_flush) &&
-       (e_policy_visibility_client_is_iconic(ec)))
+   if (e_client_buffer_flush_enabled_get(ec))
      goto end;
 
    comp_buffer = _comp_wl_buffer_get(ec);
@@ -1594,9 +1592,7 @@ _e_hwc_window_queue_prepare_unset(E_Hwc_Window_Queue *queue)
 
    if (!hwc_window->ec) return;
 
-   if ((!e_view_client_visible_get(e_client_view_get(hwc_window->ec))) &&
-       (hwc_window->ec->exp_iconify.buffer_flush) &&
-       (e_policy_visibility_client_is_iconic(hwc_window->ec)))
+   if (e_client_buffer_flush_enabled_get(hwc_window->ec))
      return;
 
    _e_hwc_window_queue_copy_thread_check_and_run(hwc_window);
@@ -1700,9 +1696,7 @@ _e_hwc_window_queue_cb_buffer_change(void *data, E_Client *ec)
 
    hwc_window = ec->hwc_window;
    if (!hwc_window) return;
-   if ((!e_view_client_visible_get(e_client_view_get(ec))) &&
-       (ec->exp_iconify.buffer_flush) &&
-       (e_policy_visibility_client_is_iconic(ec)))
+   if (e_client_buffer_flush_enabled_get(hwc_window->ec))
      return;
 
    _e_hwc_window_queue_copy_thread_check_and_run(hwc_window);
index ca5b2b9189d98ea45d251dc38709d207c6df7b09..a566aeeefaa67001bc552c54558860adcc7baf54 100644 (file)
@@ -3237,12 +3237,8 @@ _e_comp_wl_surface_state_commit(E_Client *ec, E_Comp_Wl_Surface_State *state)
 
    wl_signal_emit(&cdata->state_commit_signal, &cdata->surface);
 
-   if (buffer &&
-       ec->exp_iconify.buffer_flush &&
-       e_policy_visibility_client_is_iconic(ec))
-     {
-        e_pixmap_buffer_clear(ec->pixmap, EINA_FALSE);
-     }
+   if ((buffer) && (e_client_buffer_flush_enabled_get(ec)))
+     e_pixmap_buffer_clear(ec->pixmap, EINA_FALSE);
 }
 
 static void
index c9d17aae02232ca52982078bbd7afc35852f3b50..58f7b997299cdc56c4ca320103b778a5c63199fc 100644 (file)
@@ -2192,8 +2192,7 @@ _e_policy_client_pixmap_buffer_clear(E_Policy_Client *policy_client, Eina_Bool o
    E_Pixmap *pixmap = ec->pixmap;
    E_Surface *surface;
 
-   /* if not only free, client should be iconic state */
-   if (!only_free && !e_policy_visibility_client_is_iconic(ec)) return;
+   if ((!only_free) && (!e_client_buffer_flush_enabled_get(ec))) return;
 
    E_Tizen_Surface_Shm *surface_shm;
    E_Tizen_Surface_Shm_Flusher *surface_shm_flusher;
index 64cac39334ff6d95ab37b4068792cd2f6ed4336a..1dbe02262ea76a0a69edd18d0e1112165e28cbb1 100644 (file)
@@ -1124,7 +1124,7 @@ _e_vis_client_cb_hide(struct wl_listener *listener, void *data)
    VS_DBG(ec, "\tUPDATE ICONIC STATE: %s", STATE_STR(vc));
    vc->prepare_emitted = 0;
 
-   if (ec->iconic && ec->exp_iconify.buffer_flush)
+   if (e_client_buffer_flush_enabled_get(ec))
      e_pixmap_buffer_clear(ec->pixmap, EINA_FALSE);
 }