diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2025-12-05 14:16:22 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-12-05 14:16:22 +0000 |
| commit | 9264436f35e2c4e94adfdf2a8ea23a346ace3a65 (patch) | |
| tree | 9fe48ff4728060445e655d8a3b528999fd124ff8 /src/helpers/Monitor.hpp | |
| parent | d5c52ef58e57b371a9df8fd4404c5d55a1b26f34 (diff) | |
desktop: rewrite reserved area handling + improve tests (#12383)
Diffstat (limited to 'src/helpers/Monitor.hpp')
| -rw-r--r-- | src/helpers/Monitor.hpp | 47 |
1 files changed, 24 insertions, 23 deletions
diff --git a/src/helpers/Monitor.hpp b/src/helpers/Monitor.hpp index f1f46669..94c8cc15 100644 --- a/src/helpers/Monitor.hpp +++ b/src/helpers/Monitor.hpp @@ -13,6 +13,7 @@ #include <xf86drmMode.h> #include "time/Timer.hpp" #include "math/Math.hpp" +#include "../desktop/reserved/ReservedArea.hpp" #include <optional> #include "../protocols/types/ColorManagement.hpp" #include "signal/Signal.hpp" @@ -37,25 +38,26 @@ enum eAutoDirs : uint8_t { }; struct SMonitorRule { - eAutoDirs autoDir = DIR_AUTO_NONE; - std::string name = ""; - Vector2D resolution = Vector2D(1280, 720); - Vector2D offset = Vector2D(0, 0); - float scale = 1; - float refreshRate = 60; // Hz - bool disabled = false; - wl_output_transform transform = WL_OUTPUT_TRANSFORM_NORMAL; - std::string mirrorOf = ""; - bool enable10bit = false; - NCMType::eCMType cmType = NCMType::CM_SRGB; - int sdrEotf = 0; - float sdrSaturation = 1.0f; // SDR -> HDR - float sdrBrightness = 1.0f; // SDR -> HDR - - bool supportsWideColor = false; // false does nothing, true overrides EDID - bool supportsHDR = false; // false does nothing, true overrides EDID - float sdrMinLuminance = 0.2f; // SDR -> HDR - int sdrMaxLuminance = 80; // SDR -> HDR + eAutoDirs autoDir = DIR_AUTO_NONE; + std::string name = ""; + Vector2D resolution = Vector2D(1280, 720); + Vector2D offset = Vector2D(0, 0); + float scale = 1; + float refreshRate = 60; // Hz + bool disabled = false; + wl_output_transform transform = WL_OUTPUT_TRANSFORM_NORMAL; + std::string mirrorOf = ""; + bool enable10bit = false; + NCMType::eCMType cmType = NCMType::CM_SRGB; + int sdrEotf = 0; + float sdrSaturation = 1.0f; // SDR -> HDR + float sdrBrightness = 1.0f; // SDR -> HDR + Desktop::CReservedArea reservedArea; + + bool supportsWideColor = false; // false does nothing, true overrides EDID + bool supportsHDR = false; // false does nothing, true overrides EDID + float sdrMinLuminance = 0.2f; // SDR -> HDR + int sdrMaxLuminance = 80; // SDR -> HDR // Incorrect values will result in reduced luminance range or incorrect tonemapping. Shouldn't damage the HW. Use with care in case of a faulty monitor firmware. float minLuminance = -1.0f; // >= 0 overrides EDID @@ -108,11 +110,10 @@ class CMonitor { std::string m_description = ""; std::string m_shortDescription = ""; - Vector2D m_reservedTopLeft = Vector2D(0, 0); - Vector2D m_reservedBottomRight = Vector2D(0, 0); - drmModeModeInfo m_customDrmMode = {}; + Desktop::CReservedArea m_reservedArea; + CMonitorState m_state; CDamageRing m_damage; @@ -298,7 +299,7 @@ class CMonitor { WORKSPACEID activeWorkspaceID(); WORKSPACEID activeSpecialWorkspaceID(); CBox logicalBox(); - CBox logicalBoxMinusExtents(); + CBox logicalBoxMinusReserved(); void scheduleDone(); uint32_t isSolitaryBlocked(bool full = false); void recheckSolitary(); |
