summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2017-01-13 11:34:07 -0500
committerMike Blumenkrantz <zmike@osg.samsung.com>2017-01-13 11:33:59 -0500
commitde1a6d6f4294ccb25d73d96f765420cc6cb3fff6 (patch)
tree54a1cb5cb126b95dae9eda6fb17b25290683eb3f /src
parent0ea378802d60276f0e3eed4da5ee793fcafec454 (diff)
ecore-wl2: make session recovery listener global
global proxies have a single instance and do not work with multiple listeners @fix
Diffstat (limited to 'src')
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_display.c15
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_window.c17
2 files changed, 16 insertions, 16 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_display.c b/src/lib/ecore_wl2/ecore_wl2_display.c
index e25aa75694..139e2ff058 100644
--- a/src/lib/ecore_wl2/ecore_wl2_display.c
+++ b/src/lib/ecore_wl2/ecore_wl2_display.c
@@ -70,6 +70,19 @@ static const struct zxdg_shell_v6_listener _zxdg_shell_listener =
70}; 70};
71 71
72static void 72static void
73_session_recovery_create_uuid(void *data EINA_UNUSED, struct zwp_e_session_recovery *session_recovery EINA_UNUSED, struct wl_surface *surface, const char *uuid)
74{
75 Ecore_Wl2_Window *win = wl_surface_get_user_data(surface);
76
77 eina_stringshare_replace(&win->uuid, uuid);
78}
79
80static const struct zwp_e_session_recovery_listener _session_listener =
81{
82 _session_recovery_create_uuid,
83};
84
85static void
73_cb_global_event_free(void *data EINA_UNUSED, void *event) 86_cb_global_event_free(void *data EINA_UNUSED, void *event)
74{ 87{
75 Ecore_Wl2_Event_Global *ev; 88 Ecore_Wl2_Event_Global *ev;
@@ -185,6 +198,8 @@ _cb_global_add(void *data, struct wl_registry *registry, unsigned int id, const
185 ewd->wl.session_recovery = 198 ewd->wl.session_recovery =
186 wl_registry_bind(registry, id, 199 wl_registry_bind(registry, id,
187 &zwp_e_session_recovery_interface, 1); 200 &zwp_e_session_recovery_interface, 1);
201 zwp_e_session_recovery_add_listener(ewd->wl.session_recovery,
202 &_session_listener, ewd);
188 } 203 }
189 else if (!strcmp(interface, "zwp_teamwork")) 204 else if (!strcmp(interface, "zwp_teamwork"))
190 { 205 {
diff --git a/src/lib/ecore_wl2/ecore_wl2_window.c b/src/lib/ecore_wl2/ecore_wl2_window.c
index 444b5c3f43..327185c084 100644
--- a/src/lib/ecore_wl2/ecore_wl2_window.c
+++ b/src/lib/ecore_wl2/ecore_wl2_window.c
@@ -35,18 +35,6 @@ _ecore_wl_window_semi_free(Ecore_Wl2_Window *window)
35 window->surface_id = -1; 35 window->surface_id = -1;
36} 36}
37 37
38static void
39_session_recovery_create_uuid(void *data, struct zwp_e_session_recovery *session_recovery EINA_UNUSED, struct wl_surface *surface EINA_UNUSED, const char *uuid)
40{
41 Ecore_Wl2_Window *win = data;
42
43 eina_stringshare_replace(&win->uuid, uuid);
44}
45
46static const struct zwp_e_session_recovery_listener _session_listener =
47{
48 _session_recovery_create_uuid,
49};
50 38
51static void 39static void
52_ecore_wl2_window_configure_send(Ecore_Wl2_Window *window, int w, int h, unsigned int edges, Eina_Bool fs, Eina_Bool max) 40_ecore_wl2_window_configure_send(Ecore_Wl2_Window *window, int w, int h, unsigned int edges, Eina_Bool fs, Eina_Bool max)
@@ -592,13 +580,10 @@ _ecore_wl2_window_surface_create(Ecore_Wl2_Window *window)
592 ERR("Failed to create surface for window"); 580 ERR("Failed to create surface for window");
593 return; 581 return;
594 } 582 }
583 wl_surface_set_user_data(window->surface, window);
595 584
596 window->surface_id = 585 window->surface_id =
597 wl_proxy_get_id((struct wl_proxy *)window->surface); 586 wl_proxy_get_id((struct wl_proxy *)window->surface);
598
599 if (window->display->wl.session_recovery)
600 zwp_e_session_recovery_add_listener(window->display->wl.session_recovery,
601 &_session_listener, window);
602 } 587 }
603} 588}
604 589