summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Schmidt <stefan@osg.samsung.com>2015-08-26 14:08:25 +0200
committerStefan Schmidt <stefan@osg.samsung.com>2015-08-26 16:04:49 +0200
commit658a51b3acb6b573e3067c49c73586a337674289 (patch)
treefe3b9c5961fe0b73992d6826fdaa837b49ab9372
parent54695313dd081cc82da87b248f382f10b94f8213 (diff)
ecore_wayland: add wayland session recovery listener
Register and wait for the uuid event issued by the compositor once a new surface is created.
-rw-r--r--src/lib/ecore_wayland/ecore_wl_window.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/lib/ecore_wayland/ecore_wl_window.c b/src/lib/ecore_wayland/ecore_wl_window.c
index c2055c17af..036dc0387c 100644
--- a/src/lib/ecore_wayland/ecore_wl_window.c
+++ b/src/lib/ecore_wayland/ecore_wl_window.c
@@ -4,6 +4,7 @@
4 4
5#include "ecore_wl_private.h" 5#include "ecore_wl_private.h"
6#include "xdg-shell-client-protocol.h" 6#include "xdg-shell-client-protocol.h"
7#include "session-recovery-client-protocol.h"
7 8
8/* local function prototypes */ 9/* local function prototypes */
9static void _ecore_wl_window_cb_ping(void *data EINA_UNUSED, struct wl_shell_surface *shell_surface, unsigned int serial); 10static void _ecore_wl_window_cb_ping(void *data EINA_UNUSED, struct wl_shell_surface *shell_surface, unsigned int serial);
@@ -16,6 +17,7 @@ static char *_ecore_wl_window_id_str_get(unsigned int win_id);
16static void _ecore_xdg_handle_surface_configure(void *data, struct xdg_surface *xdg_surface, int32_t width, int32_t height,struct wl_array *states, uint32_t serial); 17static void _ecore_xdg_handle_surface_configure(void *data, struct xdg_surface *xdg_surface, int32_t width, int32_t height,struct wl_array *states, uint32_t serial);
17static void _ecore_xdg_handle_surface_delete(void *data, struct xdg_surface *xdg_surface); 18static void _ecore_xdg_handle_surface_delete(void *data, struct xdg_surface *xdg_surface);
18static void _ecore_xdg_handle_popup_done(void *data, struct xdg_popup *xdg_popup); 19static void _ecore_xdg_handle_popup_done(void *data, struct xdg_popup *xdg_popup);
20static void _ecore_session_recovery_uuid(void *data, struct session_recovery *session_recovery, const char *uuid);
19 21
20/* local variables */ 22/* local variables */
21static Eina_Hash *_windows = NULL; 23static Eina_Hash *_windows = NULL;
@@ -45,6 +47,11 @@ static const struct xdg_popup_listener _ecore_xdg_popup_listener =
45 _ecore_xdg_handle_popup_done, 47 _ecore_xdg_handle_popup_done,
46}; 48};
47 49
50static const struct session_recovery_listener _ecore_session_recovery_listener =
51{
52 _ecore_session_recovery_uuid,
53};
54
48/* internal functions */ 55/* internal functions */
49void 56void
50_ecore_wl_window_init(void) 57_ecore_wl_window_init(void)
@@ -271,6 +278,7 @@ ecore_wl_window_surface_create(Ecore_Wl_Window *win)
271 278
272 if (!win) return NULL; 279 if (!win) return NULL;
273 if (win->surface) return win->surface; 280 if (win->surface) return win->surface;
281 session_recovery_add_listener(_ecore_wl_disp->wl.session_recovery, &_ecore_session_recovery_listener, win);
274 win->surface = wl_compositor_create_surface(_ecore_wl_compositor_get()); 282 win->surface = wl_compositor_create_surface(_ecore_wl_compositor_get());
275 if (!win->surface) return NULL; 283 if (!win->surface) return NULL;
276 win->surface_id = wl_proxy_get_id((struct wl_proxy *)win->surface); 284 win->surface_id = wl_proxy_get_id((struct wl_proxy *)win->surface);
@@ -1063,6 +1071,15 @@ _ecore_xdg_handle_popup_done(void *data, struct xdg_popup *xdg_popup)
1063} 1071}
1064 1072
1065static void 1073static void
1074_ecore_session_recovery_uuid(void *data EINA_UNUSED, struct session_recovery *session_recovery, const char *uuid)
1075{
1076 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1077
1078 if (!session_recovery) return;
1079 DBG("UUID event received from compositor with UUID: %s", uuid);
1080}
1081
1082static void
1066_ecore_wl_window_cb_surface_enter(void *data, struct wl_surface *surface, struct wl_output *output EINA_UNUSED) 1083_ecore_wl_window_cb_surface_enter(void *data, struct wl_surface *surface, struct wl_output *output EINA_UNUSED)
1067{ 1084{
1068 Ecore_Wl_Window *win; 1085 Ecore_Wl_Window *win;