e_policy: Flush buffer of e_client when client is unmap state 72/321572/3
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:22:43 +0000 (17:22 +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 c6fde138f465612a870fe057cdd43c28b271c021..04b8801cc612036d650ac42b87ace931a34d1b1f 100644 (file)
@@ -24,6 +24,7 @@
 #include "e_comp_canvas_intern.h"
 #include "e_hwc_window_intern.h"
 #include "e_canvas_intern.h"
+#include "e_policy_visibility_intern.h"
 
 #define PRI(ec) ((E_Client_Private *)e_object_data_get(E_OBJECT(ec)))
 
@@ -8832,3 +8833,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 048fc3b4d5576b9f5ca1c280605ef013b4f3ff1c..b7319772bd71c630c3c56a3ae1eaf04da9648c2c 100644 (file)
@@ -287,4 +287,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 af6bebe4f01a4f69a1a7887f741db23c39f337b6..ebad2c35bd64a31e7e1af34400fd129543d6c587 100644 (file)
@@ -2822,9 +2822,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 81f6087b3bb9c10d2fb4c03d046f011cb5494ad9..af6251221c2cde820b13120358676dc908d75d72 100644 (file)
@@ -1375,9 +1375,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);
@@ -1595,9 +1593,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);
@@ -1701,9 +1697,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 175cfd9f392a0eadd3f87e5316d9b999306dd9e6..504407175448457725285a1910eb6efade7422e8 100644 (file)
@@ -3006,12 +3006,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);
 
    buffer = e_surface_buffer_try_get(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 7bfc3c0ca3e30972b1bd6a97e16d41db76499105..37953b3fb407220ca3d95f9b004c478385827393 100644 (file)
@@ -2184,8 +2184,7 @@ _e_policy_client_pixmap_buffer_clear(E_Policy_Client *policy_client, Eina_Bool o
    E_Tizen_Surface_Shm *surface_shm;
    E_Tizen_Surface_Shm_Flusher *surface_shm_flusher = NULL;
 
-   /* 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;
 
    surface_shm = (E_Tizen_Surface_Shm *)e_server_feature_handle_get(E_SERVER_FEATURE_TIZEN_SURFACE_SHM);
    if (surface_shm)
index a3f99b81e137db4d7d8eeb5a8f978d719bedee59..77b7928a9cc6f81c95a44a27c40c5244a8c65494 100644 (file)
@@ -1129,7 +1129,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);
 }