aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ecore_wayland
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 /src/lib/ecore_wayland
parentecore_wayland: bind and destroy session_recovery interface correctly. (diff)
downloadefl-658a51b3acb6b573e3067c49c73586a337674289.tar.gz
ecore_wayland: add wayland session recovery listener
Register and wait for the uuid event issued by the compositor once a new surface is created.
Diffstat (limited to 'src/lib/ecore_wayland')
-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 @@
#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;