mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-04 20:55:58 +01:00
backend/headless: unlink input device on destroy
Removing an input device requires unlinking it from the list of all headless input devices. For that implement a destroy function.
This commit is contained in:
parent
4a8e681a5f
commit
8274c85d21
1 changed files with 8 additions and 1 deletions
|
@ -11,7 +11,14 @@
|
|||
#include "backend/headless.h"
|
||||
#include "util/signal.h"
|
||||
|
||||
static const struct wlr_input_device_impl input_device_impl = { 0 };
|
||||
static void input_device_destroy(struct wlr_input_device *wlr_dev) {
|
||||
wl_list_remove(&wlr_dev->link);
|
||||
free(wlr_dev);
|
||||
}
|
||||
|
||||
static const struct wlr_input_device_impl input_device_impl = {
|
||||
.destroy = input_device_destroy,
|
||||
};
|
||||
|
||||
bool wlr_input_device_is_headless(struct wlr_input_device *wlr_dev) {
|
||||
return wlr_dev->impl == &input_device_impl;
|
||||
|
|
Loading…
Reference in a new issue