From 32af25ebb93abd2f8c48713ebc46be5965771a2d Mon Sep 17 00:00:00 2001 From: Chris Michael Date: Mon, 25 Jul 2016 10:54:17 -0400 Subject: elput: Fix issue of losing mouse input when removing a device When we are adding new input devices, if we already have an existing one (keyboard, pointer, touch, etc) then we should just be incrementing the device count and returning from the init function. Previous code here would increment the device count, then continue on and create a new internal representation of the device. This was causing issues when a device gets removed. Fixes T4192 @fix Signed-off-by: Chris Michael --- src/lib/elput/elput_evdev.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/lib/elput/elput_evdev.c b/src/lib/elput/elput_evdev.c index 7a1b1cb0b3..cab7f8a5a6 100644 --- a/src/lib/elput/elput_evdev.c +++ b/src/lib/elput/elput_evdev.c @@ -212,10 +212,8 @@ _keyboard_init(Elput_Seat *seat, struct xkb_keymap *keymap) { seat->count.kbd += 1; if (seat->count.kbd == 1) - { - _seat_caps_update(seat); - return EINA_TRUE; - } + _seat_caps_update(seat); + return EINA_TRUE; } kbd = _keyboard_create(seat); @@ -548,10 +546,8 @@ _pointer_init(Elput_Seat *seat) { seat->count.ptr += 1; if (seat->count.ptr == 1) - { - _seat_caps_update(seat); - return EINA_TRUE; - } + _seat_caps_update(seat); + return EINA_TRUE; } ptr = _pointer_create(seat); @@ -598,10 +594,8 @@ _touch_init(Elput_Seat *seat) { seat->count.touch += 1; if (seat->count.touch == 1) - { - _seat_caps_update(seat); - return EINA_TRUE; - } + _seat_caps_update(seat); + return EINA_TRUE; } touch = _touch_create(seat); -- cgit v1.2.1