summaryrefslogtreecommitdiff
path: root/src/lib/ecore_wayland/ecore_wl_window.c
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2014-10-01 09:07:11 -0400
committerChris Michael <cp.michael@samsung.com>2014-10-01 16:15:37 -0400
commita0a4257018c236856c00548875964c4dd0e5fe89 (patch)
tree63dcf0bc168d487d1e75d5e584725eec2ee2f0c4 /src/lib/ecore_wayland/ecore_wl_window.c
parentbbf196ad79402c7e37961b51f866ec15932310be (diff)
ecore-wayland: Add support for handling surface delete callback
Summary: This adds a private function to call when a surface gets deleted so we can cleanup properly. @fix Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/lib/ecore_wayland/ecore_wl_window.c')
-rw-r--r--src/lib/ecore_wayland/ecore_wl_window.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/lib/ecore_wayland/ecore_wl_window.c b/src/lib/ecore_wayland/ecore_wl_window.c
index 23f0b9dee6..da83e7f91f 100644
--- a/src/lib/ecore_wayland/ecore_wl_window.c
+++ b/src/lib/ecore_wayland/ecore_wl_window.c
@@ -14,6 +14,7 @@ static void _ecore_wl_window_cb_surface_leave(void *data, struct wl_surface *sur
14static void _ecore_wl_window_configure_send(Ecore_Wl_Window *win, int w, int h, int edges); 14static void _ecore_wl_window_configure_send(Ecore_Wl_Window *win, int w, int h, int edges);
15static char *_ecore_wl_window_id_str_get(unsigned int win_id); 15static 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); 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_delete(void *data, struct xdg_surface *xdg_surface);
17static void _ecore_xdg_handle_popup_done(void *data, struct xdg_popup *xdg_popup, unsigned int serial); 18static void _ecore_xdg_handle_popup_done(void *data, struct xdg_popup *xdg_popup, unsigned int serial);
18 19
19/* local variables */ 20/* local variables */
@@ -36,6 +37,7 @@ static const struct wl_shell_surface_listener _ecore_wl_shell_surface_listener =
36static const struct xdg_surface_listener _ecore_xdg_surface_listener = 37static const struct xdg_surface_listener _ecore_xdg_surface_listener =
37{ 38{
38 _ecore_xdg_handle_surface_configure, 39 _ecore_xdg_handle_surface_configure,
40 _ecore_xdg_handle_surface_delete,
39}; 41};
40 42
41static const struct xdg_popup_listener _ecore_xdg_popup_listener = 43static const struct xdg_popup_listener _ecore_xdg_popup_listener =
@@ -263,6 +265,8 @@ ecore_wl_window_buffer_attach(Ecore_Wl_Window *win, struct wl_buffer *buffer, in
263EAPI struct wl_surface* 265EAPI struct wl_surface*
264ecore_wl_window_surface_create(Ecore_Wl_Window *win) 266ecore_wl_window_surface_create(Ecore_Wl_Window *win)
265{ 267{
268 LOGFN(__FILE__, __LINE__, __FUNCTION__);
269
266 if (!win) return NULL; 270 if (!win) return NULL;
267 if (win->surface) return win->surface; 271 if (win->surface) return win->surface;
268 win->surface = wl_compositor_create_surface(_ecore_wl_compositor_get()); 272 win->surface = wl_compositor_create_surface(_ecore_wl_compositor_get());
@@ -973,11 +977,13 @@ _ecore_wl_window_cb_configure(void *data, struct wl_shell_surface *shell_surface
973static void 977static void
974_ecore_xdg_handle_surface_configure(void *data, struct xdg_surface *xdg_surface EINA_UNUSED, int32_t width, int32_t height, struct wl_array *states, uint32_t serial) 978_ecore_xdg_handle_surface_configure(void *data, struct xdg_surface *xdg_surface EINA_UNUSED, int32_t width, int32_t height, struct wl_array *states, uint32_t serial)
975{ 979{
976 Ecore_Wl_Window *win = data; 980 Ecore_Wl_Window *win;
977 uint32_t *p; 981 uint32_t *p;
978 982
979 LOGFN(__FILE__, __LINE__, __FUNCTION__); 983 LOGFN(__FILE__, __LINE__, __FUNCTION__);
980 984
985 if (!(win = data)) return;
986
981 win->maximized = EINA_FALSE; 987 win->maximized = EINA_FALSE;
982 win->fullscreen = EINA_FALSE; 988 win->fullscreen = EINA_FALSE;
983 win->resizing = EINA_FALSE; 989 win->resizing = EINA_FALSE;
@@ -1017,6 +1023,17 @@ _ecore_xdg_handle_surface_configure(void *data, struct xdg_surface *xdg_surface
1017} 1023}
1018 1024
1019static void 1025static void
1026_ecore_xdg_handle_surface_delete(void *data, struct xdg_surface *xdg_surface EINA_UNUSED)
1027{
1028 Ecore_Wl_Window *win;
1029
1030 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1031
1032 if (!(win = data)) return;
1033 ecore_wl_window_free(win);
1034}
1035
1036static void
1020_ecore_wl_window_cb_popup_done(void *data, struct wl_shell_surface *shell_surface) 1037_ecore_wl_window_cb_popup_done(void *data, struct wl_shell_surface *shell_surface)
1021{ 1038{
1022 Ecore_Wl_Window *win; 1039 Ecore_Wl_Window *win;