From 138bd166929b06ab4a2c0aac026bb1dec1609cb0 Mon Sep 17 00:00:00 2001 From: Changyeon Lee Date: Thu, 18 Jul 2024 19:33:40 +0900 Subject: [PATCH] e_hwc_window: sync present subsurface when parent is moved Change-Id: Ia700bb948b77eb08fa9dc3cc0704788724bdfba0 --- src/bin/displaymgr/e_hwc_window.c | 80 ++++++++++++++++++++++++++------------- 1 file changed, 54 insertions(+), 26 deletions(-) diff --git a/src/bin/displaymgr/e_hwc_window.c b/src/bin/displaymgr/e_hwc_window.c index de7e90d..0c7029c 100644 --- a/src/bin/displaymgr/e_hwc_window.c +++ b/src/bin/displaymgr/e_hwc_window.c @@ -561,6 +561,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) { E_Hwc *hwc; @@ -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 @@ -1139,32 +1193,6 @@ _e_hwc_window_client_cb_del(void *data EINA_UNUSED, E_Client *ec) } 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) { E_Output *output; -- 2.7.4