e_hwc_window: sync present subsurface when parent is moved 77/316977/1
authorChangyeon Lee <cyeon.lee@samsung.com>
Thu, 18 Jul 2024 10:33:40 +0000 (19:33 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Mon, 2 Sep 2024 06:32:20 +0000 (15:32 +0900)
Change-Id: Ia700bb948b77eb08fa9dc3cc0704788724bdfba0

src/bin/displaymgr/e_hwc_window.c

index de7e90de55d51b06116e1a6e8b70ccd48537957d..0c7029c0db30f59371a4e761cac17f40ac35dfc7 100644 (file)
@@ -560,6 +560,34 @@ _e_hwc_window_zone_set(E_Hwc_Window *hwc_window, E_Zone *zone)
      }
 }
 
+static void
+_e_hwc_window_client_subsurface_present_sync(E_Client *ec)
+{
+   E_Hwc_Window_State state;
+   Eina_List *l;
+   E_Client *subc;
+
+   if (!ec->hwc_window) return;
+
+   state = e_hwc_window_accepted_state_get(ec->hwc_window);
+   if ((state == E_HWC_WINDOW_STATE_DEVICE) || (state == E_HWC_WINDOW_STATE_VIDEO))
+     e_hwc_window_present_sync(ec->hwc_window);
+
+   if (!ec->comp_data) return;
+
+   EINA_LIST_FOREACH(ec->comp_data->sub.below_list_pending, l, subc)
+     {
+        if (!subc->hwc_window) continue;
+        _e_hwc_window_client_subsurface_present_sync(subc);
+     }
+
+   EINA_LIST_FOREACH(ec->comp_data->sub.below_list, l, subc)
+     {
+        if (!subc->hwc_window) continue;
+        _e_hwc_window_client_subsurface_present_sync(subc);
+     }
+}
+
 static void
 _e_hwc_window_free(E_Hwc_Window *hwc_window)
 {
@@ -651,6 +679,10 @@ static void
 _e_hwc_window_view_cb_move(struct wl_listener *listener, void *data)
 {
    E_Hwc_Window *hwc_window;
+   Eina_List *l;
+   E_Client *subc;
+   E_Hwc_Window_State state;
+   E_Client *ec;
 
    hwc_window = wl_container_of(listener, hwc_window, move_listener);
    if (!hwc_window) return;
@@ -667,6 +699,28 @@ _e_hwc_window_view_cb_move(struct wl_listener *listener, void *data)
         if ((hwc_window->evas_visible) && (e_hwc_window_client_geometry_visible_get(hwc_window)))
           e_hwc_window_changed_set(hwc_window, E_HWC_WINS_CHANGED_WIN_VISIBLE);
      }
+
+   ec = hwc_window->ec;
+   if (!ec) return;
+
+   if (!e_comp_wl_video_subsurface_has(ec) && !e_comp_wl_normal_subsurface_has(ec))
+     return;
+
+   /* if window is device state, sync is not needed */
+   state = e_hwc_window_accepted_state_get(hwc_window);
+   if (state != E_HWC_WINDOW_STATE_CLIENT) return;
+
+   EINA_LIST_FOREACH(ec->comp_data->sub.below_list_pending, l, subc)
+     {
+        if (!subc->hwc_window) continue;
+        _e_hwc_window_client_subsurface_present_sync(subc);
+     }
+
+   EINA_LIST_FOREACH(ec->comp_data->sub.below_list, l, subc)
+     {
+        if (!subc->hwc_window) continue;
+        _e_hwc_window_client_subsurface_present_sync(subc);
+     }
 }
 
 static void
@@ -1138,32 +1192,6 @@ _e_hwc_window_client_cb_del(void *data EINA_UNUSED, E_Client *ec)
    e_hwc_window_client_type_override(hwc_window);
 }
 
-static void
-_e_hwc_window_client_subsurface_present_sync(E_Client *ec)
-{
-   E_Hwc_Window_State state;
-   Eina_List *l;
-   E_Client *subc;
-
-   if (!ec->hwc_window) return;
-
-   state = e_hwc_window_accepted_state_get(ec->hwc_window);
-   if ((state == E_HWC_WINDOW_STATE_DEVICE) || (state == E_HWC_WINDOW_STATE_VIDEO))
-     e_hwc_window_present_sync(ec->hwc_window);
-
-   EINA_LIST_FOREACH(ec->comp_data->sub.below_list_pending, l, subc)
-     {
-        if (!subc->hwc_window) continue;
-        _e_hwc_window_client_subsurface_present_sync(subc);
-     }
-
-   EINA_LIST_FOREACH(ec->comp_data->sub.below_list, l, subc)
-     {
-        if (!subc->hwc_window) continue;
-        _e_hwc_window_client_subsurface_present_sync(subc);
-     }
-}
-
 static void
 _e_hwc_window_client_cb_transform_change(void *data EINA_UNUSED, E_Client *ec)
 {