summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2018-05-18 09:11:34 -0500
committerDerek Foreman <derekf@osg.samsung.com>2018-05-18 09:29:58 -0500
commitd746b9ff5cbe5f41297002da40f5612a3f916f6b (patch)
treeb45f97a5f994665e68f319890c73e0606a7ae2c7
parentd04a625e029b1eaf59bde4e25430eeb3f98d4b6b (diff)
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.c8
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
1193 { 1193 {
1194 _ecore_evas_wl_common_device_event_add 1194 _ecore_evas_wl_common_device_event_add
1195 (ECORE_WL2_EVENT_DEVICE_REMOVED, 1195 (ECORE_WL2_EVENT_DEVICE_REMOVED,
1196 ECORE_WL2_DEVICE_TYPE_POINTER, ev->id, NULL, ee); 1196 ECORE_WL2_DEVICE_TYPE_POINTER, ev->id,
1197 device->pointer, ee);
1197 1198
1198 evas_device_del(device->pointer); 1199 evas_device_del(device->pointer);
1199 device->pointer = NULL; 1200 device->pointer = NULL;
@@ -1217,7 +1218,8 @@ _ecore_evas_wl_common_cb_seat_capabilities_changed(void *d EINA_UNUSED, int t EI
1217 { 1218 {
1218 _ecore_evas_wl_common_device_event_add 1219 _ecore_evas_wl_common_device_event_add
1219 (ECORE_WL2_EVENT_DEVICE_REMOVED, 1220 (ECORE_WL2_EVENT_DEVICE_REMOVED,
1220 ECORE_WL2_DEVICE_TYPE_KEYBOARD, ev->id, NULL, ee); 1221 ECORE_WL2_DEVICE_TYPE_KEYBOARD, ev->id,
1222 device->keyboard, ee);
1221 1223
1222 evas_device_del(device->keyboard); 1224 evas_device_del(device->keyboard);
1223 device->keyboard = NULL; 1225 device->keyboard = NULL;
@@ -1242,7 +1244,7 @@ _ecore_evas_wl_common_cb_seat_capabilities_changed(void *d EINA_UNUSED, int t EI
1242 _ecore_evas_wl_common_device_event_add 1244 _ecore_evas_wl_common_device_event_add
1243 (ECORE_WL2_EVENT_DEVICE_REMOVED, 1245 (ECORE_WL2_EVENT_DEVICE_REMOVED,
1244 ECORE_WL2_DEVICE_TYPE_TOUCH, 1246 ECORE_WL2_DEVICE_TYPE_TOUCH,
1245 ev->id, NULL, ee); 1247 ev->id, device->touch, ee);
1246 1248
1247 evas_device_del(device->touch); 1249 evas_device_del(device->touch);
1248 device->touch = NULL; 1250 device->touch = NULL;