aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Zeni <simon@bl4ckb0ne.ca>2022-03-02 16:48:57 -0500
committerKirill Primak <vyivel@eclair.cafe>2022-03-07 16:37:41 +0000
commit1bb2631c5c05e4b74c1a3163ab030ae42c7d8fe8 (patch)
treea1f5ff8f60c6effa0772ed38600974fbb78f5b8f
parent9d8dc026e50e9497b9268be40b5a7d2766cffe72 (diff)
types/wlr_input_device: remove wlr_input_device_destroy
-rw-r--r--backend/wayland/seat.c3
-rw-r--r--include/wlr/types/wlr_input_device.h7
-rw-r--r--types/wlr_input_device.c37
3 files changed, 3 insertions, 44 deletions
diff --git a/backend/wayland/seat.c b/backend/wayland/seat.c
index de756d80..e9785d9a 100644
--- a/backend/wayland/seat.c
+++ b/backend/wayland/seat.c
@@ -571,9 +571,6 @@ void destroy_wl_input_device(struct wlr_wl_input_device *dev) {
wlr_touch_finish(wlr_dev->touch);
free(wlr_dev->touch);
break;
- default:
- wlr_input_device_destroy(wlr_dev);
- break;
}
}
wl_list_remove(&dev->link);
diff --git a/include/wlr/types/wlr_input_device.h b/include/wlr/types/wlr_input_device.h
index 1690a5b9..73d90fa5 100644
--- a/include/wlr/types/wlr_input_device.h
+++ b/include/wlr/types/wlr_input_device.h
@@ -61,11 +61,4 @@ void wlr_input_device_init(struct wlr_input_device *wlr_device,
*/
void wlr_input_device_finish(struct wlr_input_device *wlr_device);
-/**
- * Calls the specialized input device destroy function.
- * If the wlr_input_device is not owned by a specialized input device, the
- * function will finish the wlr_input_device and free it.
- */
-void wlr_input_device_destroy(struct wlr_input_device *dev);
-
#endif
diff --git a/types/wlr_input_device.c b/types/wlr_input_device.c
index 69c1536a..23ee4177 100644
--- a/types/wlr_input_device.c
+++ b/types/wlr_input_device.c
@@ -1,9 +1,8 @@
#define _POSIX_C_SOURCE 200809L
+
#include <stdlib.h>
#include <string.h>
-#include <wayland-server-core.h>
#include <wlr/types/wlr_input_device.h>
-#include <wlr/util/log.h>
#include "util/signal.h"
void wlr_input_device_init(struct wlr_input_device *dev,
@@ -23,38 +22,8 @@ void wlr_input_device_finish(struct wlr_input_device *wlr_device) {
wlr_signal_emit_safe(&wlr_device->events.destroy, wlr_device);
+ wl_list_remove(&wlr_device->events.destroy.listener_list);
+
free(wlr_device->name);
free(wlr_device->output_name);
}
-
-void wlr_input_device_destroy(struct wlr_input_device *dev) {
- if (!dev) {
- return;
- }
-
- if (dev->_device) {
- switch (dev->type) {
- case WLR_INPUT_DEVICE_KEYBOARD:
- wlr_log(WLR_ERROR, "wlr_keyboard will not be destroyed");
- break;
- case WLR_INPUT_DEVICE_POINTER:
- wlr_log(WLR_ERROR, "wlr_pointer will not be destroyed");
- break;
- case WLR_INPUT_DEVICE_SWITCH:
- wlr_log(WLR_ERROR, "wlr_switch will not be destroyed");
- break;
- case WLR_INPUT_DEVICE_TOUCH:
- wlr_log(WLR_ERROR, "wlr_touch will not be destroyed");
- break;
- case WLR_INPUT_DEVICE_TABLET_TOOL:
- wlr_log(WLR_ERROR, "wlr_tablet_tool will not be destroyed");
- break;
- case WLR_INPUT_DEVICE_TABLET_PAD:
- wlr_log(WLR_ERROR, "wlr_tablet_pad will not be destroyed");
- break;
- }
- } else {
- wlr_input_device_finish(dev);
- free(dev);
- }
-}