e_policy: Flush buffer of e_client if it is hide_by_request state 77/322677/2
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 10:29:29 +0000 (19:29 +0900)
Change-Id: I1aa3a8945380efc1a3c719555cf13c02008737e9

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 8d5d01e63bb39722c40fb5872bc75fa4bfab7f15..8b56ddc269c01c801b2c673d0b7edfc0a4c887bc 100644 (file)
@@ -2826,9 +2826,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 81f6087b3bb9c10d2fb4c03d046f011cb5494ad9..94532866d8ca7b7d2997f2cacf3233536c201da2 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>
@@ -1375,9 +1376,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);
@@ -1595,9 +1594,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);
@@ -1701,9 +1698,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 5e6a1a0a1050ded1b04112dec22a640d3be09fdc..6dd37264405a629a467649086265ddb6d6acf394 100644 (file)
@@ -52,6 +52,7 @@
 #include "e_zone_intern.h"
 #include "ecore_device_ex_intern.h"
 #include "e_canvas_intern.h"
+#include "e_policy_intern.h"
 
 #include <tizen-extension-server-protocol.h>
 #include <relative-pointer-unstable-v1-server-protocol.h>
@@ -3337,12 +3338,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_policy_client_buffer_flush_enabled_get(ec)))
+     e_pixmap_buffer_clear(ec->pixmap, EINA_FALSE);
 }
 
 static void
index f1f9105063e7f097c58153692cdeb8f78ef2c730..bb46cfbad2025a59a4f48c30a3bf1416e97fb2d9 100644 (file)
@@ -1987,8 +1987,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_policy_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)
@@ -2261,6 +2260,25 @@ _e_policy_client_cb_client_unmap(struct wl_listener *listener, void *data)
    _e_policy_client_unmap(policy_client->ec);
 }
 
+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 8bfbebaf98509be7484319b8906cfbe4e2af5ab9..ea1669a2e247865719215a041cf5a5ebff771696 100644 (file)
@@ -151,4 +151,6 @@ EINTERN void             e_policy_keyboard_layout_apply(E_Client *ec);
 EINTERN void             e_policy_interceptors_clean(void);
 EINTERN Eina_Bool        e_policy_interceptor_call(E_Policy_Intercept_Point ipoint, E_Client *ec, ...);
 
+EINTERN Eina_Bool e_policy_client_buffer_flush_enabled_get(E_Client *ec);
+
 #endif
index 7d51f9af1589e777f60eafae2a46a6cd3413f185..8185262b6231d8fadeb75c6aed3827e3080f555b 100644 (file)
@@ -1132,7 +1132,7 @@ _e_vis_client_cb_view_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);
 }