summaryrefslogtreecommitdiff
path: root/src/helpers/Monitor.hpp
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2024-01-28 01:57:13 +0000
committerVaxry <vaxry@vaxry.net>2024-01-28 01:57:13 +0000
commitbfcc2adbdab5c10eacb584dedc22764bce114a10 (patch)
treec71757ad816980c75f4d5f216d14ca4be7e99d5f /src/helpers/Monitor.hpp
parent9002657bcca1d4f69e2ebd0447d4129fdb950245 (diff)
monitor: wrap usage of wlr_output_state
for better control and convenience in usage. fixes #4546
Diffstat (limited to 'src/helpers/Monitor.hpp')
-rw-r--r--src/helpers/Monitor.hpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/helpers/Monitor.hpp b/src/helpers/Monitor.hpp
index 4681419c..43de8d12 100644
--- a/src/helpers/Monitor.hpp
+++ b/src/helpers/Monitor.hpp
@@ -25,6 +25,25 @@ struct SMonitorRule {
std::optional<int> vrr;
};
+class CMonitor;
+
+// Class for wrapping the wlr state
+class CMonitorState {
+ public:
+ CMonitorState(CMonitor* owner);
+ ~CMonitorState();
+
+ wlr_output_state* wlr();
+ void clear();
+ // commit() will also clear()
+ bool commit();
+ bool test();
+
+ private:
+ wlr_output_state m_state = {0};
+ CMonitor* m_pOwner;
+};
+
class CMonitor {
public:
CMonitor();
@@ -51,6 +70,8 @@ class CMonitor {
drmModeModeInfo customDrmMode = {};
+ CMonitorState state;
+
// WLR stuff
wlr_damage_ring damage;
wlr_output* output = nullptr;
@@ -63,7 +84,6 @@ class CMonitor {
bool gammaChanged = false;
float xwaylandScale = 1.f;
std::array<float, 9> projMatrix = {0};
- wlr_output_state outputState = {0}; // TODO: write a wrapper for this garbage
bool dpmsStatus = true;
bool vrrActive = false; // this can be TRUE even if VRR is not active in the case that this display does not support it.
@@ -128,7 +148,6 @@ class CMonitor {
void moveTo(const Vector2D& pos);
Vector2D middle();
void updateMatrix();
- void clearState();
bool m_bEnabled = false;
bool m_bRenderingInitPassed = false;