diff options
author | Ikalco <[email protected]> | 2024-11-26 07:52:43 -0600 |
---|---|---|
committer | GitHub <[email protected]> | 2024-11-26 13:52:43 +0000 |
commit | 1fb720b62aeb474873ba43426ddc53afde1e6cdd (patch) | |
tree | 546fac08bacc7e9521d77169e726a6ecd4d0683e | |
parent | 268778823676ef2bbda42050d78946e1fc27fc31 (diff) | |
download | Hyprland-1fb720b62aeb474873ba43426ddc53afde1e6cdd.tar.gz Hyprland-1fb720b62aeb474873ba43426ddc53afde1e6cdd.zip |
seat: fix double scrolling in some applications (#8583)
-rw-r--r-- | src/managers/SeatManager.cpp | 6 | ||||
-rw-r--r-- | src/protocols/core/Seat.cpp | 4 | ||||
-rw-r--r-- | src/protocols/core/Seat.hpp | 1 |
3 files changed, 9 insertions, 2 deletions
diff --git a/src/managers/SeatManager.cpp b/src/managers/SeatManager.cpp index b40d6cad..665805f6 100644 --- a/src/managers/SeatManager.cpp +++ b/src/managers/SeatManager.cpp @@ -332,8 +332,10 @@ void CSeatManager::sendPointerAxis(uint32_t timeMs, wl_pointer_axis axis, double p->sendAxisRelativeDirection(axis, relative); if (source == 0) { - p->sendAxisValue120(axis, value120); - p->sendAxisDiscrete(axis, discrete); + if (p->version() >= 8) + p->sendAxisValue120(axis, value120); + else + p->sendAxisDiscrete(axis, discrete); } else if (value == 0) p->sendAxisStop(timeMs, axis); } diff --git a/src/protocols/core/Seat.cpp b/src/protocols/core/Seat.cpp index d95e0e12..7c31b67c 100644 --- a/src/protocols/core/Seat.cpp +++ b/src/protocols/core/Seat.cpp @@ -136,6 +136,10 @@ CWLPointerResource::CWLPointerResource(SP<CWlPointer> resource_, SP<CWLSeatResou sendEnter(g_pSeatManager->state.pointerFocus.lock(), {-1, -1} /* Coords don't really matter that much, they will be updated next move */); } +int CWLPointerResource::version() { + return resource->version(); +} + bool CWLPointerResource::good() { return resource->resource(); } diff --git a/src/protocols/core/Seat.hpp b/src/protocols/core/Seat.hpp index 1b43dd04..b5670237 100644 --- a/src/protocols/core/Seat.hpp +++ b/src/protocols/core/Seat.hpp @@ -73,6 +73,7 @@ class CWLPointerResource { CWLPointerResource(SP<CWlPointer> resource_, SP<CWLSeatResource> owner_); bool good(); + int version(); void sendEnter(SP<CWLSurfaceResource> surface, const Vector2D& local); void sendLeave(); void sendMotion(uint32_t timeMs, const Vector2D& local); |