summaryrefslogtreecommitdiff
path: root/src/helpers
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-04-17 21:40:04 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-04-17 21:40:04 +0200
commit7b1eaca84014d88a420bcbd3f97467f74e82ab33 (patch)
treee5147e4b6eeed31a9e1827e582e79852ed74e5f9 /src/helpers
parentb0f5e4ab5656fb3b72efa7ce646d4b47ae82b814 (diff)
Implemented mouse constraints
has some todos but mostly works
Diffstat (limited to 'src/helpers')
-rw-r--r--src/helpers/WLClasses.hpp28
1 files changed, 28 insertions, 0 deletions
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 {