summaryrefslogtreecommitdiff
path: root/src/helpers
diff options
context:
space:
mode:
authorvaxerski <vaxry@vaxry.net>2023-06-23 21:14:04 +0200
committervaxerski <vaxry@vaxry.net>2023-06-23 21:42:44 +0200
commit01f85a09a981eb6c8784d459f729d418c0dd19e3 (patch)
tree7539008648c010ec5e188f5104ebc94e4ccb0690 /src/helpers
parent69fae18e636ed154798c21ed5c1127672127c6ac (diff)
xwayland: send zero scaling to xwayland if enabled
Diffstat (limited to 'src/helpers')
-rw-r--r--src/helpers/Monitor.cpp2
-rw-r--r--src/helpers/Monitor.hpp1
-rw-r--r--src/helpers/Vector2D.cpp6
-rw-r--r--src/helpers/Vector2D.hpp8
4 files changed, 10 insertions, 7 deletions
diff --git a/src/helpers/Monitor.cpp b/src/helpers/Monitor.cpp
index 0f8dddd4..0691cd37 100644
--- a/src/helpers/Monitor.cpp
+++ b/src/helpers/Monitor.cpp
@@ -23,12 +23,14 @@ void CMonitor::onConnect(bool noRule) {
hyprListener_monitorDamage.removeCallback();
hyprListener_monitorNeedsFrame.removeCallback();
hyprListener_monitorCommit.removeCallback();
+ hyprListener_monitorBind.removeCallback();
hyprListener_monitorFrame.initCallback(&output->events.frame, &Events::listener_monitorFrame, this);
hyprListener_monitorDestroy.initCallback(&output->events.destroy, &Events::listener_monitorDestroy, this);
hyprListener_monitorStateRequest.initCallback(&output->events.request_state, &Events::listener_monitorStateRequest, this);
hyprListener_monitorDamage.initCallback(&output->events.damage, &Events::listener_monitorDamage, this);
hyprListener_monitorNeedsFrame.initCallback(&output->events.needs_frame, &Events::listener_monitorNeedsFrame, this);
hyprListener_monitorCommit.initCallback(&output->events.commit, &Events::listener_monitorCommit, this);
+ hyprListener_monitorBind.initCallback(&output->events.bind, &Events::listener_monitorBind, this);
if (m_bEnabled) {
wlr_output_enable(output, 1);
diff --git a/src/helpers/Monitor.hpp b/src/helpers/Monitor.hpp
index 9226e100..610fa656 100644
--- a/src/helpers/Monitor.hpp
+++ b/src/helpers/Monitor.hpp
@@ -72,6 +72,7 @@ class CMonitor {
DYNLISTENER(monitorDamage);
DYNLISTENER(monitorNeedsFrame);
DYNLISTENER(monitorCommit);
+ DYNLISTENER(monitorBind);
// hack: a group = workspaces on a monitor.
// I don't really care lol :P
diff --git a/src/helpers/Vector2D.cpp b/src/helpers/Vector2D.cpp
index 2d52eb9e..21701c97 100644
--- a/src/helpers/Vector2D.cpp
+++ b/src/helpers/Vector2D.cpp
@@ -24,15 +24,15 @@ double Vector2D::normalize() {
return max;
}
-Vector2D Vector2D::floor() {
+Vector2D Vector2D::floor() const {
return Vector2D(std::floor(x), std::floor(y));
}
-Vector2D Vector2D::clamp(const Vector2D& min, const Vector2D& max) {
+Vector2D Vector2D::clamp(const Vector2D& min, const Vector2D& max) const {
return Vector2D(std::clamp(this->x, min.x, max.x < min.x ? INFINITY : max.x), std::clamp(this->y, min.y, max.y < min.y ? INFINITY : max.y));
}
-double Vector2D::distance(const Vector2D& other) {
+double Vector2D::distance(const Vector2D& other) const {
double dx = x - other.x;
double dy = y - other.y;
return std::sqrt(dx * dx + dy * dy);
diff --git a/src/helpers/Vector2D.hpp b/src/helpers/Vector2D.hpp
index f2943b28..1178f734 100644
--- a/src/helpers/Vector2D.hpp
+++ b/src/helpers/Vector2D.hpp
@@ -42,10 +42,10 @@ class Vector2D {
Vector2D operator/(const Vector2D& a) const {
return Vector2D(this->x / a.x, this->y / a.y);
}
-
- double distance(const Vector2D& other);
- Vector2D clamp(const Vector2D& min, const Vector2D& max = Vector2D());
+ double distance(const Vector2D& other) const;
- Vector2D floor();
+ Vector2D clamp(const Vector2D& min, const Vector2D& max = Vector2D()) const;
+
+ Vector2D floor() const;
};