Restore m_isTouchpad property

This commit is contained in:
Marko Matovic 2025-12-09 17:54:38 +01:00
parent 3cbe6d3bd5
commit d5eba72cad
3 changed files with 7 additions and 0 deletions

View file

@ -0,0 +1 @@
Failed to connect to wayland display

View file

@ -112,6 +112,7 @@ class IPointer : public IHID {
std::string m_boundOutput = "";
bool m_flipX = false; // decide to invert horizontal movement
bool m_flipY = false; // decide to invert vertical movement
bool m_isTouchpad = false;
std::optional<float> m_scrollFactor = {};
WP<IPointer> m_self;

View file

@ -14,6 +14,11 @@ CMouse::CMouse(SP<Aquamarine::IPointer> mouse_) : m_mouse(mouse_) {
if (!m_mouse)
return;
if (auto handle = m_mouse->getLibinputHandle()) {
double w = 0, h = 0;
m_isTouchpad = libinput_device_has_capability(handle, LIBINPUT_DEVICE_CAP_POINTER) && libinput_device_get_size(handle, &w, &h) == 0;
}
m_listeners.destroy = m_mouse->events.destroy.listen([this] {
m_mouse.reset();
m_events.destroy.emit();