diff options
author | Derek Foreman <derekf@osg.samsung.com> | 2018-05-18 09:11:34 -0500 |
---|---|---|
committer | Derek Foreman <derekf@osg.samsung.com> | 2018-05-18 09:29:58 -0500 |
commit | d746b9ff5cbe5f41297002da40f5612a3f916f6b (patch) | |
tree | b45f97a5f994665e68f319890c73e0606a7ae2c7 | |
parent | d04a625e029b1eaf59bde4e25430eeb3f98d4b6b (diff) | |
download | efl-devs/derekf/wayland.tar.gz |
ee_wayland: Fix device leak on disconnectdevs/derekf/wayland
A reference was taken on these when they were added, so by passing NULL
here we're not allowing that reference to be dropped. This results in
not only leaking the device forever, but also potentially leaving it as
a default device after it's removed so that no new attach will replace it.
Under weston all devices are removed on a VT switch, and when you switch
back the default device is wrong, which leads to problems with events
like "mouse in" which, for legacy reasons, don't take a seat, but
instead look up the default seat.
This allows the delete callback to be fired for the first time ever,
and while I've tried to fix some bugs this has revealed, I'm not
actually sure I've caught them all.
-rw-r--r-- | src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c index e0f9e6e49c..73a7c40f1d 100644 --- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c +++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c @@ -1193,7 +1193,8 @@ _ecore_evas_wl_common_cb_seat_capabilities_changed(void *d EINA_UNUSED, int t EI { _ecore_evas_wl_common_device_event_add (ECORE_WL2_EVENT_DEVICE_REMOVED, - ECORE_WL2_DEVICE_TYPE_POINTER, ev->id, NULL, ee); + ECORE_WL2_DEVICE_TYPE_POINTER, ev->id, + device->pointer, ee); evas_device_del(device->pointer); device->pointer = NULL; @@ -1217,7 +1218,8 @@ _ecore_evas_wl_common_cb_seat_capabilities_changed(void *d EINA_UNUSED, int t EI { _ecore_evas_wl_common_device_event_add (ECORE_WL2_EVENT_DEVICE_REMOVED, - ECORE_WL2_DEVICE_TYPE_KEYBOARD, ev->id, NULL, ee); + ECORE_WL2_DEVICE_TYPE_KEYBOARD, ev->id, + device->keyboard, ee); evas_device_del(device->keyboard); device->keyboard = NULL; @@ -1242,7 +1244,7 @@ _ecore_evas_wl_common_cb_seat_capabilities_changed(void *d EINA_UNUSED, int t EI _ecore_evas_wl_common_device_event_add (ECORE_WL2_EVENT_DEVICE_REMOVED, ECORE_WL2_DEVICE_TYPE_TOUCH, - ev->id, NULL, ee); + ev->id, device->touch, ee); evas_device_del(device->touch); device->touch = NULL; |