stefan pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=658a51b3acb6b573e3067c49c73586a337674289

commit 658a51b3acb6b573e3067c49c73586a337674289
Author: Stefan Schmidt <ste...@osg.samsung.com>
Date:   Wed Aug 26 14:08:25 2015 +0200

    ecore_wayland: add wayland session recovery listener
    
    Register and wait for the uuid event issued by the compositor once a new
    surface is created.
---
 src/lib/ecore_wayland/ecore_wl_window.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/src/lib/ecore_wayland/ecore_wl_window.c 
b/src/lib/ecore_wayland/ecore_wl_window.c
index c2055c1..036dc03 100644
--- a/src/lib/ecore_wayland/ecore_wl_window.c
+++ b/src/lib/ecore_wayland/ecore_wl_window.c
@@ -4,6 +4,7 @@
 
 #include "ecore_wl_private.h"
 #include "xdg-shell-client-protocol.h"
+#include "session-recovery-client-protocol.h"
 
 /* local function prototypes */
 static 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);
 static 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);
 static void _ecore_xdg_handle_surface_delete(void *data, struct xdg_surface 
*xdg_surface);
 static void _ecore_xdg_handle_popup_done(void *data, struct xdg_popup 
*xdg_popup);
+static void _ecore_session_recovery_uuid(void *data, struct session_recovery 
*session_recovery, const char *uuid);
 
 /* local variables */
 static Eina_Hash *_windows = NULL;
@@ -45,6 +47,11 @@ static const struct xdg_popup_listener 
_ecore_xdg_popup_listener =
    _ecore_xdg_handle_popup_done,
 };
 
+static const struct session_recovery_listener _ecore_session_recovery_listener 
=
+{
+   _ecore_session_recovery_uuid,
+};
+
 /* internal functions */
 void
 _ecore_wl_window_init(void)
@@ -271,6 +278,7 @@ ecore_wl_window_surface_create(Ecore_Wl_Window *win)
 
    if (!win) return NULL;
    if (win->surface) return win->surface;
+   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;
    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)
 }
 
 static void
+_ecore_session_recovery_uuid(void *data EINA_UNUSED, struct session_recovery 
*session_recovery, const char *uuid)
+{
+   LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+   if (!session_recovery) return;
+   DBG("UUID event received from compositor with UUID: %s", uuid);
+}
+
+static void
 _ecore_wl_window_cb_surface_enter(void *data, struct wl_surface *surface, 
struct wl_output *output EINA_UNUSED)
 {
    Ecore_Wl_Window *win;

-- 


Reply via email to