mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-27 19:40:08 +01:00
tools: don't apply config options on device removed
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
c32bd79af5
commit
96a0e8ed66
2 changed files with 5 additions and 4 deletions
|
|
@ -782,11 +782,13 @@ handle_and_print_events(struct libinput *li)
|
|||
case LIBINPUT_EVENT_NONE:
|
||||
abort();
|
||||
case LIBINPUT_EVENT_DEVICE_ADDED:
|
||||
case LIBINPUT_EVENT_DEVICE_REMOVED:
|
||||
print_device_notify(ev);
|
||||
tools_device_apply_config(libinput_event_get_device(ev),
|
||||
&options);
|
||||
break;
|
||||
case LIBINPUT_EVENT_DEVICE_REMOVED:
|
||||
print_device_notify(ev);
|
||||
break;
|
||||
case LIBINPUT_EVENT_KEYBOARD_KEY:
|
||||
print_key_event(li, ev);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -820,6 +820,8 @@ handle_event_device_notify(struct libinput_event *ev)
|
|||
if (libinput_event_get_type(ev) == LIBINPUT_EVENT_DEVICE_ADDED) {
|
||||
type = "added";
|
||||
register_evdev_device(w, dev);
|
||||
tools_device_apply_config(libinput_event_get_device(ev),
|
||||
&w->options);
|
||||
} else {
|
||||
type = "removed";
|
||||
unregister_evdev_device(w, dev);
|
||||
|
|
@ -830,9 +832,6 @@ handle_event_device_notify(struct libinput_event *ev)
|
|||
libinput_device_get_name(dev),
|
||||
type);
|
||||
|
||||
tools_device_apply_config(libinput_event_get_device(ev),
|
||||
&w->options);
|
||||
|
||||
if (libinput_event_get_type(ev) == LIBINPUT_EVENT_DEVICE_ADDED) {
|
||||
for (i = 0; i < ARRAY_LENGTH(w->devices); i++) {
|
||||
if (w->devices[i] == NULL) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue