summaryrefslogtreecommitdiff
path: root/src/devices/Mouse.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/Mouse.cpp')
-rw-r--r--src/devices/Mouse.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/devices/Mouse.cpp b/src/devices/Mouse.cpp
index 87f6d33b..600ae5a8 100644
--- a/src/devices/Mouse.cpp
+++ b/src/devices/Mouse.cpp
@@ -14,6 +14,11 @@ CMouse::CMouse(SP<Aquamarine::IPointer> mouse_) : mouse(mouse_) {
if (!mouse)
return;
+ if (auto handle = mouse->getLibinputHandle()) {
+ double w = 0, h = 0;
+ isTouchpad = libinput_device_has_capability(handle, LIBINPUT_DEVICE_CAP_POINTER) && libinput_device_get_size(handle, &w, &h) == 0;
+ }
+
listeners.destroy = mouse->events.destroy.registerListener([this](std::any d) {
mouse.reset();
events.destroy.emit();