diff options
author | Simon Zeni <simon@bl4ckb0ne.ca> | 2022-03-02 14:17:31 -0500 |
---|---|---|
committer | Kirill Primak <vyivel@eclair.cafe> | 2022-03-07 16:37:41 +0000 |
commit | 0d2be496a899a0c6736dc504ba482e647bd3aa03 (patch) | |
tree | 52dc80ee5ea11fd3454280f8d32d1d0e276ba680 /backend | |
parent | 51cd3c07264e1c4967c5baea3f6629ac01334e97 (diff) |
interface/wlr_switch: rework destroy sequence
The destroy callback in wlr_switch_impl has been removed. The function
`wlr_switch_finish` has been introduced to clean up the resources owned by a
wlr_switch.
`wlr_input_device_destroy` no longer destroys the wlr_switch, attempting to
destroy a wlr_switch will result in a no-op.
The field `name` has been added to the wlr_switch_impl to be able to identify
a given wlr_switch device.
Diffstat (limited to 'backend')
-rw-r--r-- | backend/libinput/events.c | 2 | ||||
-rw-r--r-- | backend/libinput/switch.c | 6 | ||||
-rw-r--r-- | backend/wayland/seat.c | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/backend/libinput/events.c b/backend/libinput/events.c index 22fdab55..dcf46bee 100644 --- a/backend/libinput/events.c +++ b/backend/libinput/events.c @@ -21,7 +21,7 @@ void destroy_libinput_input_device(struct wlr_libinput_input_device *dev) { wlr_pointer_finish(&dev->pointer); } if (dev->switch_device.impl) { - wlr_switch_destroy(&dev->switch_device); + wlr_switch_finish(&dev->switch_device); } if (dev->touch.impl) { wlr_touch_destroy(&dev->touch); diff --git a/backend/libinput/switch.c b/backend/libinput/switch.c index f2d5409b..586ec0c8 100644 --- a/backend/libinput/switch.c +++ b/backend/libinput/switch.c @@ -4,12 +4,8 @@ #include "backend/libinput.h" #include "util/signal.h" -static void switch_destroy(struct wlr_switch *wlr_switch) { - /* wlr_switch belongs to the wlr_libinput_input_device */ -} - const struct wlr_switch_impl libinput_switch_impl = { - .destroy = switch_destroy, + .name = "libinput-switch", }; void init_device_switch(struct wlr_libinput_input_device *dev) { diff --git a/backend/wayland/seat.c b/backend/wayland/seat.c index 1edd0f2c..02d4d874 100644 --- a/backend/wayland/seat.c +++ b/backend/wayland/seat.c @@ -12,6 +12,7 @@ #include <wlr/interfaces/wlr_keyboard.h> #include <wlr/interfaces/wlr_output.h> #include <wlr/interfaces/wlr_pointer.h> +#include <wlr/interfaces/wlr_switch.h> #include <wlr/interfaces/wlr_touch.h> #include <wlr/interfaces/wlr_tablet_tool.h> #include <wlr/interfaces/wlr_tablet_pad.h> @@ -555,6 +556,9 @@ void destroy_wl_input_device(struct wlr_wl_input_device *dev) { /* Owned by wlr_wl_pointer */ pointer_destroy(wlr_dev->pointer); break; + case WLR_INPUT_DEVICE_SWITCH: + wlr_switch_finish(wlr_dev->switch_device); + break; default: wlr_input_device_destroy(wlr_dev); break; |