ecore_wayland: add listener for uuid and provide already existing one

Setup a listener to receive an uid from the compositor. If we already have
one during creation, aka we are re-connecting to recover a session, we provide
it to the compositor so it can look our attributes up based on it. Again hidden
behind and env var to avoid problems with other developments, for now.

ref T2922
This commit is contained in:
Stefan Schmidt 2015-12-08 00:08:20 +01:00
parent d4d3f63653
commit 680eec5c5c
1 changed files with 13 additions and 2 deletions

View File

@ -395,11 +395,22 @@ ecore_wl_window_surface_create(Ecore_Wl_Window *win)
EINA_SAFETY_ON_NULL_RETURN_VAL(win, NULL);
char uuid[37];
if (win->surface) return win->surface;
if (_ecore_wl_disp->wl.session_recovery && getenv("EFL_WAYLAND_SESSION_RECOVERY"))
session_recovery_add_listener(_ecore_wl_disp->wl.session_recovery, &_ecore_session_recovery_listener, win);
win->surface = wl_compositor_create_surface(_ecore_wl_compositor_get());
if (!win->surface) return NULL;
if (_ecore_wl_disp->wl.session_recovery && getenv("EFL_WAYLAND_SESSION_RECOVERY"))
{
session_recovery_add_listener(_ecore_wl_disp->wl.session_recovery,
&_ecore_session_recovery_listener, win);
if (!uuid_is_null(win->uuid))
{
uuid_unparse(win->uuid, uuid);
session_recovery_provide_uuid(_ecore_wl_disp->wl.session_recovery, uuid);
}
}
win->surface_id = wl_proxy_get_id((struct wl_proxy *)win->surface);
return win->surface;
}