From 8ea6d260713d1392be14b8d6506db540f81d5583 Mon Sep 17 00:00:00 2001 From: Doyoun Kang Date: Mon, 24 Jun 2019 16:51:30 +0900 Subject: [PATCH] e_comp_wl_rsm/e_client: capture window in e_client_iconify Window was captured in E_CLIENT_HOOK_ICONIFY hook function. We move this code into e_client_iconify function. For this change, the capture thread can run before calling evas_object_hide(ec->frame). So, buffer reference count is not dropped to 0 until finishing capture window. Change-Id: Ic118feb753ce62ea9cb38733a4bae2f980504c05 --- src/bin/e_client.c | 4 ++++ src/bin/e_comp_wl_rsm.c | 24 +++++++----------------- src/bin/e_comp_wl_rsm.h | 1 + 3 files changed, 12 insertions(+), 17 deletions(-) diff --git a/src/bin/e_client.c b/src/bin/e_client.c index 2106908..22e0de9 100644 --- a/src/bin/e_client.c +++ b/src/bin/e_client.c @@ -5762,6 +5762,8 @@ e_client_iconify(E_Client *ec) TRACE_DS_BEGIN(CLIENT:ICONIFY); + e_comp_wl_remote_surface_image_save(ec); + ec->iconic = 1; ec->want_focus = ec->take_focus = 0; ec->changes.visible = 0; @@ -5806,6 +5808,8 @@ e_client_uniconify(E_Client *ec) TRACE_DS_BEGIN(CLIENT:UNICONIFY); + e_comp_wl_remote_surface_image_save_cancel(ec); + desk = e_desk_current_get(ec->desk->zone); e_client_desk_set(ec, desk); not_raise = ec->exp_iconify.not_raise; diff --git a/src/bin/e_comp_wl_rsm.c b/src/bin/e_comp_wl_rsm.c index 617c2b8..46cdcaf 100644 --- a/src/bin/e_comp_wl_rsm.c +++ b/src/bin/e_comp_wl_rsm.c @@ -2456,18 +2456,6 @@ _image_save_type_check(E_Client *ec) } static void -_e_comp_wl_remote_cb_client_iconify(void *data, E_Client *ec) -{ - e_comp_wl_remote_surface_image_save(ec); -} - -static void -_e_comp_wl_remote_cb_client_uniconify(void *data, E_Client *ec) -{ - e_comp_wl_capture_client_image_save_cancel(ec); -} - -static void _e_comp_wl_remote_cb_client_del(void *data, E_Client *ec) { E_Comp_Wl_Remote_Provider *provider; @@ -3057,6 +3045,13 @@ e_comp_wl_remote_surface_image_save(E_Client *ec) } E_API void +e_comp_wl_remote_surface_image_save_cancel(E_Client *ec) +{ + if (!ec) return; + e_comp_wl_capture_client_image_save_cancel(ec); +} + +E_API void e_comp_wl_remote_surface_image_save_skip_set(E_Client *ec, Eina_Bool set) { if (e_object_is_del(E_OBJECT(ec))) return; @@ -3308,11 +3303,6 @@ e_comp_wl_remote_surface_init(void) /* client hook */ E_CLIENT_HOOK_APPEND(rs_manager->client_hooks, E_CLIENT_HOOK_DEL, _e_comp_wl_remote_cb_client_del, NULL); - if (e_config->save_win_buffer) - { - E_CLIENT_HOOK_APPEND(rs_manager->client_hooks, E_CLIENT_HOOK_ICONIFY, _e_comp_wl_remote_cb_client_iconify, NULL); - E_CLIENT_HOOK_APPEND(rs_manager->client_hooks, E_CLIENT_HOOK_UNICONIFY, _e_comp_wl_remote_cb_client_uniconify, NULL); - } /* client event */ E_LIST_HANDLER_APPEND(rs_manager->event_hdlrs, diff --git a/src/bin/e_comp_wl_rsm.h b/src/bin/e_comp_wl_rsm.h index 18bf653..0e04edf 100644 --- a/src/bin/e_comp_wl_rsm.h +++ b/src/bin/e_comp_wl_rsm.h @@ -8,6 +8,7 @@ EINTERN void e_comp_wl_remote_surface_init(void); EINTERN void e_comp_wl_remote_surface_shutdown(void); EINTERN Eina_Bool e_comp_wl_remote_surface_commit(E_Client *ec); E_API void e_comp_wl_remote_surface_image_save(E_Client *ec); +E_API void e_comp_wl_remote_surface_image_save_cancel(E_Client *ec); E_API void e_comp_wl_remote_surface_image_save_skip_set(E_Client *ec, Eina_Bool set); E_API Eina_Bool e_comp_wl_remote_surface_image_save_skip_get(E_Client *ec); EINTERN void e_comp_wl_remote_surface_debug_info_get(Eldbus_Message_Iter *iter); -- 2.7.4