diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c index cea36ed45..1abbc2bdd 100644 --- a/src/bin/e_comp_wl.c +++ b/src/bin/e_comp_wl.c @@ -1427,6 +1427,7 @@ _e_comp_wl_surface_destroy(struct wl_resource *resource) if (!(ec = wl_resource_get_user_data(resource))) return; + e_pixmap_alias(ec->pixmap, E_PIXMAP_TYPE_WL, wl_resource_get_id(resource)); e_object_del(E_OBJECT(ec)); evas_object_hide(ec->frame); } @@ -2243,7 +2244,10 @@ _e_comp_wl_client_cb_del(void *data EINA_UNUSED, E_Client *ec) wl_resource_destroy(cb); if (ec->comp_data->surface) - wl_resource_set_user_data(ec->comp_data->surface, NULL); + { + e_pixmap_alias(ec->pixmap, E_PIXMAP_TYPE_WL, wl_resource_get_id(ec->comp_data->surface)); + wl_resource_set_user_data(ec->comp_data->surface, NULL); + } if (ec->internal_elm_win) evas_object_hide(ec->frame); diff --git a/src/bin/e_win.c b/src/bin/e_win.c index 2e0ba1412..31667ebc9 100644 --- a/src/bin/e_win.c +++ b/src/bin/e_win.c @@ -73,7 +73,7 @@ _e_elm_win_trap_show(void *data, Evas_Object *o) E_Client *ec; Ecore_Window win; #ifdef HAVE_WAYLAND - int64_t wl_win_id; + int64_t wl_win_id = -1; #endif E_Pixmap_Type type = E_PIXMAP_TYPE_X; @@ -96,12 +96,7 @@ _e_elm_win_trap_show(void *data, Evas_Object *o) ctx->pointer = e_pointer_window_new(win, EINA_TRUE); } -#ifdef HAVE_WAYLAND - if (type == E_PIXMAP_TYPE_WL) - ec = e_pixmap_find_client(type, wl_win_id); - else -#endif - ec = e_pixmap_find_client(type, win); + ec = e_pixmap_find_client(type, win); if (ec) ctx->client = ec; else @@ -118,13 +113,12 @@ _e_elm_win_trap_show(void *data, Evas_Object *o) title = "E"; ecore_evas_title_set(ee, title); -#ifdef HAVE_WAYLAND - if (type == E_PIXMAP_TYPE_WL) - cp = e_pixmap_new(type, wl_win_id); - else -#endif - cp = e_pixmap_new(type, win); + cp = e_pixmap_new(type, win); EINA_SAFETY_ON_NULL_RETURN_VAL(cp, EINA_TRUE); +#ifdef HAVE_WAYLAND + if (wl_win_id >= 0) + e_pixmap_alias(cp, type, wl_win_id); +#endif current_win = ctx; ctx->client = e_client_new(cp, 0, 1);