e_policy: Flush buffer of e_client if it is hide_by_request state 68/322668/1
authorChangyeon Lee <cyeon.lee@samsung.com>
Mon, 14 Apr 2025 03:33:20 +0000 (12:33 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Mon, 14 Apr 2025 07:41:27 +0000 (16:41 +0900)
Change-Id: I9f123658aaf3b4051200b283e6edfa0b13d13337

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_intern.h
src/bin/windowmgr/e_policy_visibility.c

index 4da34ff3d7bc1bd9ad442a01b18447cf68cbb61a..a836639086e3fe5c393421b76f25c2b14b4439d0 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_policy_client_buffer_flush_enabled_get(ec)))
     return EINA_FALSE;
 
    if (!comp_wl_buffer)
index a6cf7ee98e73110a7b65afa2a645f338810ae98a..016bf70771138d372e870f0c13fd7423cf60e8ac 100644 (file)
@@ -10,6 +10,7 @@
 #include "e_policy_visibility_intern.h"
 #include "e_client_intern.h"
 #include "e_view_client_intern.h"
+#include "e_policy_intern.h"
 
 # include <gbm.h>
 # include <wayland-tbm-server.h>
@@ -1374,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_policy_client_buffer_flush_enabled_get(ec))
      goto end;
 
    comp_buffer = _comp_wl_buffer_get(ec);
@@ -1594,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_policy_client_buffer_flush_enabled_get(hwc_window->ec))
      return;
 
    _e_hwc_window_queue_copy_thread_check_and_run(hwc_window);
@@ -1700,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_policy_client_buffer_flush_enabled_get(hwc_window->ec))
      return;
 
    _e_hwc_window_queue_copy_thread_check_and_run(hwc_window);
index ca5b2b9189d98ea45d251dc38709d207c6df7b09..c51213c7907f55d2cd90205df3a3de2aae97c843 100644 (file)
@@ -46,6 +46,7 @@
 #include "e_devicemgr_wl_intern.h"
 #include "e_view_client_intern.h"
 #include "e_comp_wl_input_thread_intern.h"
+#include "e_policy_intern.h"
 
 #include <tizen-extension-server-protocol.h>
 #include <relative-pointer-unstable-v1-server-protocol.h>
@@ -3237,12 +3238,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_policy_client_buffer_flush_enabled_get(ec)))
+     e_pixmap_buffer_clear(ec->pixmap, EINA_FALSE);
 }
 
 static void
index c9d17aae02232ca52982078bbd7afc35852f3b50..a20f727051b7ce6b848d22f21bf28d547f036a9a 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_policy_client_buffer_flush_enabled_get(ec))) return;
 
    E_Tizen_Surface_Shm *surface_shm;
    E_Tizen_Surface_Shm_Flusher *surface_shm_flusher;
@@ -2327,6 +2326,25 @@ _e_policy_client_cb_pixmap_destroy(struct wl_listener *listener, void *data)
    wl_list_init(&pc->pixmap_destroy.link);
 }
 
+EINTERN Eina_Bool
+e_policy_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;
+   /* Currently, there is no case where the ec used as a subsurface is in the iconify
+      or hide_by_request state, and it can not be determined whether it is suitable
+      for a subsurface. */
+   if (e_comp_wl_subsurface_check(ec)) return EINA_FALSE;
+
+   if (e_policy_visibility_client_is_iconic(ec)) return EINA_TRUE;
+   if (e_client_hide_by_request_get(ec)) return EINA_TRUE;
+
+   return EINA_FALSE;
+}
+
 EINTERN E_Policy_Client *
 e_policy_client_add(E_Client *ec)
 {
index c1e6f4cce99350ec80fa96680bc49977ad3bc67d..afa4d72cb178fff8fd3cf1091b6c6c7b021abfd8 100644 (file)
@@ -143,5 +143,6 @@ EINTERN void             e_policy_interceptors_clean(void);
 EINTERN Eina_Bool        e_policy_interceptor_call(E_Policy_Intercept_Point ipoint, E_Client *ec, ...);
 
 EINTERN E_Config_Policy_Desk *_e_policy_desk_get_by_num(unsigned int zone_num, int x, int y);
+EINTERN Eina_Bool e_policy_client_buffer_flush_enabled_get(E_Client *ec);
 
 #endif
index 64cac39334ff6d95ab37b4068792cd2f6ed4336a..eb7ae1107237e845a8fb70f3f58d04e8bdcbc086 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_policy_client_buffer_flush_enabled_get(ec))
      e_pixmap_buffer_clear(ec->pixmap, EINA_FALSE);
 }