diff options
author | Vaxry <[email protected]> | 2024-07-22 17:24:24 +0200 |
---|---|---|
committer | Vaxry <[email protected]> | 2024-07-22 17:24:30 +0200 |
commit | 77b134e23baf769aecdf2ea8ed14d55d00228ce1 (patch) | |
tree | 414143686432f629553059972da066efb4cc5c0c /src/devices/VirtualPointer.cpp | |
parent | 87db950189d87eb00d01b9df9959b36ba0f4d5c7 (diff) | |
download | Hyprland-77b134e23baf769aecdf2ea8ed14d55d00228ce1.tar.gz Hyprland-77b134e23baf769aecdf2ea8ed14d55d00228ce1.zip |
virtual-pointer: fixup virtual pointer warp events
fixes #6976
Diffstat (limited to 'src/devices/VirtualPointer.cpp')
-rw-r--r-- | src/devices/VirtualPointer.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/devices/VirtualPointer.cpp b/src/devices/VirtualPointer.cpp index faca27dc..f9a1c409 100644 --- a/src/devices/VirtualPointer.cpp +++ b/src/devices/VirtualPointer.cpp @@ -20,7 +20,12 @@ CVirtualPointer::CVirtualPointer(SP<CVirtualPointerV1Resource> resource) : point }); listeners.motion = pointer->events.move.registerListener([this](std::any d) { pointerEvents.motion.emit(d); }); - listeners.motionAbsolute = pointer->events.warp.registerListener([this](std::any d) { pointerEvents.motionAbsolute.emit(d); }); + listeners.motionAbsolute = pointer->events.warp.registerListener([this](std::any d) { + // we need to unpack the event and add our device here because it's required to calculate the position correctly + auto E = std::any_cast<SMotionAbsoluteEvent>(d); + E.device = self.lock(); + pointerEvents.motionAbsolute.emit(E); + }); listeners.button = pointer->events.button.registerListener([this](std::any d) { pointerEvents.button.emit(d); }); listeners.axis = pointer->events.axis.registerListener([this](std::any d) { pointerEvents.axis.emit(d); }); listeners.frame = pointer->events.frame.registerListener([this](std::any d) { pointerEvents.frame.emit(); }); |