From 81bf4eccba449bfe2b6adfb51260108aec710d4f Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Thu, 28 Aug 2025 11:20:29 +0200 Subject: input: Add fully configurable trackpad gestures (#11490) Adds configurable trackpad gestures --- src/layout/IHyprLayout.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/layout/IHyprLayout.hpp') diff --git a/src/layout/IHyprLayout.hpp b/src/layout/IHyprLayout.hpp index 1e1141da..027c95a5 100644 --- a/src/layout/IHyprLayout.hpp +++ b/src/layout/IHyprLayout.hpp @@ -26,6 +26,14 @@ enum eRectCorner : uint8_t { CORNER_BOTTOMLEFT = (1 << 3), }; +inline eRectCorner cornerFromBox(const CBox& box, const Vector2D& pos) { + const auto CENTER = box.middle(); + + if (pos.x < CENTER.x) + return pos.y < CENTER.y ? CORNER_TOPLEFT : CORNER_BOTTOMLEFT; + return pos.y < CENTER.y ? CORNER_TOPRIGHT : CORNER_BOTTOMRIGHT; +} + enum eSnapEdge : uint8_t { SNAP_INVALID = 0, SNAP_UP = (1 << 0), -- cgit v1.2.3