e_comp_wl_rsm/e_client: capture window in e_client_iconify 95/207595/2 accepted/tizen/5.0/unified/20190611.012201 submit/tizen_5.0/20190610.061231 submit/tizen_5.0/20190610.075734
authorDoyoun Kang <doyoun.kang@samsung.com>
Wed, 5 Jun 2019 05:06:13 +0000 (14:06 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Mon, 10 Jun 2019 03:04:02 +0000 (03:04 +0000)
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: Ie82211a57d066bb18f0368fe33c3174bc391a15b

src/bin/e_client.c
src/bin/e_comp_wl_rsm.c
src/bin/e_comp_wl_rsm.h

index 84918316251fb8030ae2048637237247641240de..ee8090de5bc551e01bb637e15580ec5c513328d2 100644 (file)
@@ -5652,6 +5652,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;
@@ -5700,6 +5702,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;
index 32cf0b697f0d7ed9dd31c6b622362b7de6b5dd06..0b23304f22d0b00c7d6c0a1201a8102ed38c8d50 100644 (file)
@@ -3148,18 +3148,6 @@ _image_save_type_check(E_Client *ec)
    return EINA_TRUE;
 }
 
-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)
-{
-   _remote_source_save_start_cancel(ec);
-}
-
 static void
 _e_comp_wl_remote_cb_client_del(void *data, E_Client *ec)
 {
@@ -3722,6 +3710,13 @@ end:
 #endif /* HAVE_REMOTE_SURFACE */
 }
 
+E_API void
+e_comp_wl_remote_surface_image_save_cancel(E_Client *ec)
+{
+   if (!ec) return;
+   _remote_source_save_start_cancel(ec);
+}
+
 EAPI void
 e_comp_wl_remote_surface_image_save_skip_set(E_Client *ec, Eina_Bool set)
 {
@@ -3960,11 +3955,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,
index ec2850aa350fa5604ca478d5c3a7090614d5019b..2983e0344e6768eec475d5d0150ba81c1db53df1 100644 (file)
@@ -19,6 +19,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);
 EAPI    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);
 EAPI    void      e_comp_wl_remote_surface_image_save_skip_set(E_Client *ec, Eina_Bool set);
 EAPI    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);