From 7b1eaca84014d88a420bcbd3f97467f74e82ab33 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sun, 17 Apr 2022 21:40:04 +0200 Subject: Implemented mouse constraints has some todos but mostly works --- src/helpers/WLClasses.hpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/helpers') diff --git a/src/helpers/WLClasses.hpp b/src/helpers/WLClasses.hpp index 295ec41f..4011dc06 100644 --- a/src/helpers/WLClasses.hpp +++ b/src/helpers/WLClasses.hpp @@ -60,6 +60,32 @@ struct SKeyboard { } }; +struct SMouse { + wlr_input_device* mouse = nullptr; + + wlr_pointer_constraint_v1* currentConstraint = nullptr; + + pixman_region32_t confinedTo; + + DYNLISTENER(commitConstraint); + + bool operator==(const SMouse& b) { + return mouse == b.mouse; + } +}; + +struct SConstraint { + SMouse* pMouse = nullptr; + wlr_pointer_constraint_v1* constraint = nullptr; + + DYNLISTENER(setConstraintRegion); + DYNLISTENER(destroyConstraint); + + bool operator==(const SConstraint& b) { + return constraint == b.constraint; + } +}; + struct SMonitor; struct SXDGPopup { @@ -87,6 +113,8 @@ struct SXDGPopup { struct SSeat { wlr_seat* seat = nullptr; wl_client* exclusiveClient = nullptr; + + SMouse* mouse = nullptr; }; struct SDrag { -- cgit v1.2.3