ee_wayland: Fix device leak on disconnect

Summary:
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.
Depends on D6182

Reviewers: zmike

Reviewed By: zmike

Subscribers: cedric, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6183
This commit is contained in:
Derek Foreman 2018-05-18 13:46:47 -04:00 committed by Mike Blumenkrantz
parent 83e1a456a4
commit 27316746f5
1 changed files with 5 additions and 3 deletions

View File

@ -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;