From ac4eb64015fd052245b68eecc1ffc7b845e7d409 Mon Sep 17 00:00:00 2001 From: Christopher Michael Date: Fri, 3 Aug 2012 13:27:05 +0000 Subject: [PATCH] Ecore (Wayland): Patch from Robert Bradford to check for valid surfaces for events received from Wayland where the surface has already been destroyed. SVN revision: 74847 --- legacy/ecore/ChangeLog | 7 +++++++ legacy/ecore/src/lib/ecore_wayland/ecore_wl_input.c | 6 ++++++ legacy/ecore/src/lib/ecore_wayland/ecore_wl_window.c | 4 ++++ 3 files changed, 17 insertions(+) diff --git a/legacy/ecore/ChangeLog b/legacy/ecore/ChangeLog index dad80f6f7b..d1a54eb7c4 100644 --- a/legacy/ecore/ChangeLog +++ b/legacy/ecore/ChangeLog @@ -841,3 +841,10 @@ Wayland backend. Removing the need to have our own function to do this and increasing the range of supported keysms. Fixes #1105. +2012-08-03 Rob Bradford + + * In the Wayland backend handle the case that events can be received + for surfaces that have been since destroyed - the client side + marshaller changes the pointer to NULL to when the object is destroyed + on the client side. Fixes #1258. + diff --git a/legacy/ecore/src/lib/ecore_wayland/ecore_wl_input.c b/legacy/ecore/src/lib/ecore_wayland/ecore_wl_input.c index 61b4bf92a3..a5f52512cb 100644 --- a/legacy/ecore/src/lib/ecore_wayland/ecore_wl_input.c +++ b/legacy/ecore/src/lib/ecore_wayland/ecore_wl_input.c @@ -631,6 +631,7 @@ _ecore_wl_input_cb_pointer_leave(void *data, struct wl_pointer *pointer __UNUSED LOGFN(__FILE__, __LINE__, __FUNCTION__); + if (!surface) return; if (!(input = data)) return; input->display->serial = serial; @@ -660,6 +661,7 @@ _ecore_wl_input_cb_keyboard_enter(void *data, struct wl_keyboard *keyboard __UNU LOGFN(__FILE__, __LINE__, __FUNCTION__); + if (!surface) return; if (!(input = data)) return; if (!input->timestamp) @@ -688,6 +690,7 @@ _ecore_wl_input_cb_keyboard_leave(void *data, struct wl_keyboard *keyboard __UNU LOGFN(__FILE__, __LINE__, __FUNCTION__); + if (!surface) return; if (!(input = data)) return; if (!input->timestamp) @@ -716,6 +719,7 @@ _ecore_wl_input_cb_touch_down(void *data, struct wl_touch *touch __UNUSED__, uns LOGFN(__FILE__, __LINE__, __FUNCTION__); + if (!surface) return; if (!(input = data)) return; /* FIXME: NB: Not sure yet if input->timestamp should be set here. @@ -788,6 +792,8 @@ _ecore_wl_input_cb_data_enter(void *data, struct wl_data_device *data_device, un { LOGFN(__FILE__, __LINE__, __FUNCTION__); + if (!surface) return; + _ecore_wl_dnd_enter(data, data_device, timestamp, surface, x, y, offer); } diff --git a/legacy/ecore/src/lib/ecore_wayland/ecore_wl_window.c b/legacy/ecore/src/lib/ecore_wayland/ecore_wl_window.c index 5cdf010a27..3ebe4b26de 100644 --- a/legacy/ecore/src/lib/ecore_wayland/ecore_wl_window.c +++ b/legacy/ecore/src/lib/ecore_wayland/ecore_wl_window.c @@ -583,6 +583,7 @@ ecore_wl_window_parent_set(Ecore_Wl_Window *win, Ecore_Wl_Window *parent) static void _ecore_wl_window_cb_ping(void *data __UNUSED__, struct wl_shell_surface *shell_surface, unsigned int serial) { + if (!shell_surface) return; wl_shell_surface_pong(shell_surface, serial); } @@ -616,6 +617,7 @@ _ecore_wl_window_cb_popup_done(void *data, struct wl_shell_surface *shell_surfac LOGFN(__FILE__, __LINE__, __FUNCTION__); + if (!shell_surface) return; if (!(win = data)) return; ecore_wl_input_ungrab(win->pointer_device); } @@ -627,6 +629,7 @@ _ecore_wl_window_cb_surface_enter(void *data, struct wl_surface *surface, struct LOGFN(__FILE__, __LINE__, __FUNCTION__); + if (!surface) return; if (!(win = data)) return; } @@ -637,6 +640,7 @@ _ecore_wl_window_cb_surface_leave(void *data, struct wl_surface *surface, struct LOGFN(__FILE__, __LINE__, __FUNCTION__); + if (!surface) return; if (!(win = data)) return; }