diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4c054b1c..015e6a74 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -104,7 +104,7 @@ find_package(OpenGL REQUIRED COMPONENTS ${GLES_VERSION})
pkg_check_modules(aquamarine_dep REQUIRED IMPORTED_TARGET aquamarine>=0.4.5)
pkg_check_modules(hyprlang_dep REQUIRED IMPORTED_TARGET hyprlang>=0.3.2)
pkg_check_modules(hyprcursor_dep REQUIRED IMPORTED_TARGET hyprcursor>=0.1.7)
-pkg_check_modules(hyprutils_dep REQUIRED IMPORTED_TARGET hyprutils>=0.2.3)
+pkg_check_modules(hyprutils_dep REQUIRED IMPORTED_TARGET hyprutils>=0.3.3)
pkg_check_modules(hyprgraphics_dep REQUIRED IMPORTED_TARGET hyprgraphics>=0.1.1)
add_compile_definitions(AQUAMARINE_VERSION="${aquamarine_dep_VERSION}")
@@ -316,6 +316,8 @@ protocolnew("protocols" "kde-server-decoration" true)
protocolnew("protocols" "wlr-data-control-unstable-v1" true)
protocolnew("${HYPRLAND_PROTOCOLS}/protocols" "hyprland-focus-grab-v1" true)
protocolnew("protocols" "wlr-layer-shell-unstable-v1" true)
+protocolnew("protocols" "xx-color-management-v4" true)
+protocolnew("protocols" "frog-color-management-v1" true)
protocolnew("protocols" "wayland-drm" true)
protocolnew("${HYPRLAND_PROTOCOLS}/protocols" "hyprland-ctm-control-v1" true)
protocolnew("${HYPRLAND_PROTOCOLS}/protocols" "hyprland-surface-v1" true)
diff --git a/example/hyprland.conf b/example/hyprland.conf
index fe1a831a..c2b1a071 100644
--- a/example/hyprland.conf
+++ b/example/hyprland.conf
@@ -81,6 +81,7 @@ general {
# https://wiki.hyprland.org/Configuring/Variables/#decoration
decoration {
rounding = 10
+ rounding_power = 2
# Change transparency of focused and unfocused windows
active_opacity = 1.0
diff --git a/flake.lock b/flake.lock
index 76d371bc..f16ecaa7 100644
--- a/flake.lock
+++ b/flake.lock
@@ -16,11 +16,11 @@
]
},
"locked": {
- "lastModified": 1734906446,
- "narHash": "sha256-6OWluVE2A8xi+8V3jN9KA72RCgJjYdyyuLBUjxZ2q2U=",
+ "lastModified": 1736102453,
+ "narHash": "sha256-5qb4kb7Xbt8jJFL/oDqOor9Z2+E+A+ql3PiyDvsfWZ0=",
"owner": "hyprwm",
"repo": "aquamarine",
- "rev": "eecb74dc79bb6752a2a507e6edee3042390a6091",
+ "rev": "4846091641f3be0ad7542086d52769bb7932bde6",
"type": "github"
},
"original": {
@@ -105,11 +105,11 @@
]
},
"locked": {
- "lastModified": 1734906236,
- "narHash": "sha256-vH/ysV2ONGQgYZPtcJKwc8jJivzyVxru2aaOxC20ZOE=",
+ "lastModified": 1736115290,
+ "narHash": "sha256-Jcn6yAzfUMcxy3tN/iZRbi/QgrYm7XLyVRl9g/nbUl4=",
"owner": "hyprwm",
"repo": "hyprgraphics",
- "rev": "6dea3fba08fd704dd624b6d4b261638fb4003c9c",
+ "rev": "52202272d89da32a9f866c0d10305a5e3d954c50",
"type": "github"
},
"original": {
@@ -128,11 +128,11 @@
]
},
"locked": {
- "lastModified": 1735734474,
- "narHash": "sha256-9OV4lOqrEJVLdOrpNN/9msNwAhI6FQTu4N7fufilG08=",
+ "lastModified": 1735774328,
+ "narHash": "sha256-vIRwLS9w+N99EU1aJ+XNOU6mJTxrUBa31i1r82l0V7s=",
"owner": "hyprwm",
"repo": "hyprland-protocols",
- "rev": "271df559dd30e4bc5ec6af02d017ac0aaabd63a7",
+ "rev": "e3b6af97ddcfaafbda8e2828c719a5af84f662cb",
"type": "github"
},
"original": {
@@ -154,11 +154,11 @@
]
},
"locked": {
- "lastModified": 1734906472,
- "narHash": "sha256-pWPRv/GA/X/iAwoE6gMNUqn/ZeJX1IeLPRpZI0tTPK0=",
+ "lastModified": 1736114838,
+ "narHash": "sha256-FxbuGQExtN37ToWYnGmO6weOYN6WPHN/RAqbr7gNPek=",
"owner": "hyprwm",
"repo": "hyprland-qtutils",
- "rev": "c77109d7e1ddbcdb87cafd32ce411f76328ae152",
+ "rev": "6997fe382dcf396704227d2b98ffdd5066da6959",
"type": "github"
},
"original": {
@@ -180,11 +180,11 @@
]
},
"locked": {
- "lastModified": 1734906259,
- "narHash": "sha256-P79t/7HbACO4/PuJBroGpTptvCWJtXTv+gWsF+sM6MI=",
+ "lastModified": 1735393019,
+ "narHash": "sha256-NPpqA8rtmDLsEmZOmz+qR67zsB6Y503Jnv+nSFLKJZ8=",
"owner": "hyprwm",
"repo": "hyprlang",
- "rev": "0404833ea18d543df44df935ebf1b497310eb046",
+ "rev": "55608efdaa387af7bfdc0eddb404c409958efa43",
"type": "github"
},
"original": {
@@ -203,11 +203,11 @@
]
},
"locked": {
- "lastModified": 1735316583,
- "narHash": "sha256-AiiUwHWHfEdpFzXy7l1x3zInCUa1xcRMrbZ1XRSkzwU=",
+ "lastModified": 1736164519,
+ "narHash": "sha256-1LimBKvDpBbeX+qW7T240WEyw+DBVpDotZB4JYm8Aps=",
"owner": "hyprwm",
"repo": "hyprutils",
- "rev": "8f15d45b120b33712f6db477fe5ffb18034d0ea8",
+ "rev": "3c895da64b0eb19870142196fa48c07090b441c4",
"type": "github"
},
"original": {
@@ -226,11 +226,11 @@
]
},
"locked": {
- "lastModified": 1734793513,
- "narHash": "sha256-rrrHcXapXJvGFqX+L/Bb0182L25jofAZ0fm1FInvrTQ=",
+ "lastModified": 1735493474,
+ "narHash": "sha256-fktzv4NaqKm94VAkAoVqO/nqQlw+X0/tJJNAeCSfzK4=",
"owner": "hyprwm",
"repo": "hyprwayland-scanner",
- "rev": "4d7367b6eee87397e2dbca2e78078dd0a4ef4c61",
+ "rev": "de913476b59ee88685fdc018e77b8f6637a2ae0b",
"type": "github"
},
"original": {
@@ -241,11 +241,11 @@
},
"nixpkgs": {
"locked": {
- "lastModified": 1735291276,
- "narHash": "sha256-NYVcA06+blsLG6wpAbSPTCyLvxD/92Hy4vlY9WxFI1M=",
+ "lastModified": 1736012469,
+ "narHash": "sha256-/qlNWm/IEVVH7GfgAIyP6EsVZI6zjAx1cV5zNyrs+rI=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "634fd46801442d760e09493a794c4f15db2d0cbb",
+ "rev": "8f3e1f807051e32d8c95cd12b9b421623850a34d",
"type": "github"
},
"original": {
@@ -255,37 +255,20 @@
"type": "github"
}
},
- "nixpkgs-stable": {
- "locked": {
- "lastModified": 1730741070,
- "narHash": "sha256-edm8WG19kWozJ/GqyYx2VjW99EdhjKwbY3ZwdlPAAlo=",
- "owner": "NixOS",
- "repo": "nixpkgs",
- "rev": "d063c1dd113c91ab27959ba540c0d9753409edf3",
- "type": "github"
- },
- "original": {
- "owner": "NixOS",
- "ref": "nixos-24.05",
- "repo": "nixpkgs",
- "type": "github"
- }
- },
"pre-commit-hooks": {
"inputs": {
"flake-compat": "flake-compat",
"gitignore": "gitignore",
"nixpkgs": [
"nixpkgs"
- ],
- "nixpkgs-stable": "nixpkgs-stable"
+ ]
},
"locked": {
- "lastModified": 1734797603,
- "narHash": "sha256-ulZN7ps8nBV31SE+dwkDvKIzvN6hroRY8sYOT0w+E28=",
+ "lastModified": 1735882644,
+ "narHash": "sha256-3FZAG+pGt3OElQjesCAWeMkQ7C/nB1oTHLRQ8ceP110=",
"owner": "cachix",
"repo": "git-hooks.nix",
- "rev": "f0f0dc4920a903c3e08f5bdb9246bb572fcae498",
+ "rev": "a5a961387e75ae44cc20f0a57ae463da5e959656",
"type": "github"
},
"original": {
diff --git a/protocols/frog-color-management-v1.xml b/protocols/frog-color-management-v1.xml
new file mode 100644
index 00000000..aab235a7
--- /dev/null
+++ b/protocols/frog-color-management-v1.xml
@@ -0,0 +1,366 @@
+
+
+
+
+ Copyright © 2023 Joshua Ashton for Valve Software
+ Copyright © 2023 Xaver Hugl
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice (including the next
+ paragraph) shall be included in all copies or substantial portions of the
+ Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+
+
+
+ The aim of this color management extension is to get HDR games working quickly,
+ and have an easy way to test implementations in the wild before the upstream
+ protocol is ready to be merged.
+ For that purpose it's intentionally limited and cut down and does not serve
+ all uses cases.
+
+
+
+
+ The color management factory singleton creates color managed surface objects.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Interface for changing surface color management and HDR state.
+
+ An implementation must: support every part of the version
+ of the frog_color_managed_surface interface it exposes.
+ Including all known enums associated with a given version.
+
+
+
+
+ Destroying the color managed surface resets all known color
+ state for the surface back to 'undefined' implementation-specific
+ values.
+
+
+
+
+
+ Extended information on the transfer functions described
+ here can be found in the Khronos Data Format specification:
+ https://registry.khronos.org/DataFormat/specs/1.3/dataformat.1.3.html
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Extended information on render intents described
+ here can be found in ICC.1:2022:
+
+ https://www.color.org/specification/ICC.1-2022-05.pdf
+
+
+
+
+
+
+ NOTE: On a surface with "perceptual" (default) render intent, handling of the container's
+ color volume
+ is implementation-specific, and may differ between different transfer functions it is paired
+ with:
+ ie. sRGB + 709 rendering may have it's primaries widened to more of the available display's
+ gamut
+ to be be more pleasing for the viewer.
+ Compared to scRGB Linear + 709 being treated faithfully as 709
+ (including utilizing negatives out of the 709 gamut triangle)
+
+
+
+
+
+
+ Forwards HDR metadata from the client to the compositor.
+
+ HDR Metadata Infoframe as per CTA 861.G spec.
+
+ Usage of this HDR metadata is implementation specific and
+ outside of the scope of this protocol.
+
+
+
+ Mastering Red Color Primary X Coordinate of the Data.
+
+ Coded as unsigned 16-bit values in units of
+ 0.00002, where 0x0000 represents zero and 0xC350
+ represents 1.0000.
+
+
+
+
+ Mastering Red Color Primary Y Coordinate of the Data.
+
+ Coded as unsigned 16-bit values in units of
+ 0.00002, where 0x0000 represents zero and 0xC350
+ represents 1.0000.
+
+
+
+
+ Mastering Green Color Primary X Coordinate of the Data.
+
+ Coded as unsigned 16-bit values in units of
+ 0.00002, where 0x0000 represents zero and 0xC350
+ represents 1.0000.
+
+
+
+
+ Mastering Green Color Primary Y Coordinate of the Data.
+
+ Coded as unsigned 16-bit values in units of
+ 0.00002, where 0x0000 represents zero and 0xC350
+ represents 1.0000.
+
+
+
+
+ Mastering Blue Color Primary X Coordinate of the Data.
+
+ Coded as unsigned 16-bit values in units of
+ 0.00002, where 0x0000 represents zero and 0xC350
+ represents 1.0000.
+
+
+
+
+ Mastering Blue Color Primary Y Coordinate of the Data.
+
+ Coded as unsigned 16-bit values in units of
+ 0.00002, where 0x0000 represents zero and 0xC350
+ represents 1.0000.
+
+
+
+
+ Mastering White Point X Coordinate of the Data.
+
+ These are coded as unsigned 16-bit values in units of
+ 0.00002, where 0x0000 represents zero and 0xC350
+ represents 1.0000.
+
+
+
+
+ Mastering White Point Y Coordinate of the Data.
+
+ These are coded as unsigned 16-bit values in units of
+ 0.00002, where 0x0000 represents zero and 0xC350
+ represents 1.0000.
+
+
+
+
+ Max Mastering Display Luminance.
+ This value is coded as an unsigned 16-bit value in units of 1 cd/m2,
+ where 0x0001 represents 1 cd/m2 and 0xFFFF represents 65535 cd/m2.
+
+
+
+
+ Min Mastering Display Luminance.
+ This value is coded as an unsigned 16-bit value in units of
+ 0.0001 cd/m2, where 0x0001 represents 0.0001 cd/m2 and 0xFFFF
+ represents 6.5535 cd/m2.
+
+
+
+
+ Max Content Light Level.
+ This value is coded as an unsigned 16-bit value in units of 1 cd/m2,
+ where 0x0001 represents 1 cd/m2 and 0xFFFF represents 65535 cd/m2.
+
+
+
+
+ Max Frame Average Light Level.
+ This value is coded as an unsigned 16-bit value in units of 1 cd/m2,
+ where 0x0001 represents 1 cd/m2 and 0xFFFF represents 65535 cd/m2.
+
+
+
+
+
+
+ Current preferred metadata for a surface.
+ The application should use this information to tone-map its buffers
+ to this target before committing.
+
+ This metadata does not necessarily correspond to any physical output, but
+ rather what the compositor thinks would be best for a given surface.
+
+
+
+ Specifies a known transfer function that corresponds to the
+ output the surface is targeting.
+
+
+
+
+ Output Red Color Primary X Coordinate of the Data.
+
+ Coded as unsigned 16-bit values in units of
+ 0.00002, where 0x0000 represents zero and 0xC350
+ represents 1.0000.
+
+
+
+
+ Output Red Color Primary Y Coordinate of the Data.
+
+ Coded as unsigned 16-bit values in units of
+ 0.00002, where 0x0000 represents zero and 0xC350
+ represents 1.0000.
+
+
+
+
+ Output Green Color Primary X Coordinate of the Data.
+
+ Coded as unsigned 16-bit values in units of
+ 0.00002, where 0x0000 represents zero and 0xC350
+ represents 1.0000.
+
+
+
+
+ Output Green Color Primary Y Coordinate of the Data.
+
+ Coded as unsigned 16-bit values in units of
+ 0.00002, where 0x0000 represents zero and 0xC350
+ represents 1.0000.
+
+
+
+
+ Output Blue Color Primary X Coordinate of the Data.
+
+ Coded as unsigned 16-bit values in units of
+ 0.00002, where 0x0000 represents zero and 0xC350
+ represents 1.0000.
+
+
+
+
+ Output Blue Color Primary Y Coordinate of the Data.
+
+ Coded as unsigned 16-bit values in units of
+ 0.00002, where 0x0000 represents zero and 0xC350
+ represents 1.0000.
+
+
+
+
+ Output White Point X Coordinate of the Data.
+
+ These are coded as unsigned 16-bit values in units of
+ 0.00002, where 0x0000 represents zero and 0xC350
+ represents 1.0000.
+
+
+
+
+ Output White Point Y Coordinate of the Data.
+
+ These are coded as unsigned 16-bit values in units of
+ 0.00002, where 0x0000 represents zero and 0xC350
+ represents 1.0000.
+
+
+
+
+ Max Output Luminance
+ The max luminance in nits that the output is capable of rendering in small areas.
+ Content should: not exceed this value to avoid clipping.
+
+ This value is coded as an unsigned 16-bit value in units of 1 cd/m2,
+ where 0x0001 represents 1 cd/m2 and 0xFFFF represents 65535 cd/m2.
+
+
+
+
+ Min Output Luminance
+ The min luminance that the output is capable of rendering.
+ Content should: not exceed this value to avoid clipping.
+
+ This value is coded as an unsigned 16-bit value in units of
+ 0.0001 cd/m2, where 0x0001 represents 0.0001 cd/m2 and 0xFFFF
+ represents 6.5535 cd/m2.
+
+
+
+
+ Max Full Frame Luminance
+ The max luminance in nits that the output is capable of rendering for the
+ full frame sustained.
+
+ This value is coded as an unsigned 16-bit value in units of 1 cd/m2,
+ where 0x0001 represents 1 cd/m2 and 0xFFFF represents 65535 cd/m2.
+
+
+
+
+
\ No newline at end of file
diff --git a/protocols/meson.build b/protocols/meson.build
index b26f140a..c283962b 100644
--- a/protocols/meson.build
+++ b/protocols/meson.build
@@ -33,6 +33,8 @@ protocols = [
'wayland-drm.xml',
'wlr-data-control-unstable-v1.xml',
'wlr-screencopy-unstable-v1.xml',
+ 'xx-color-management-v4.xml',
+ 'frog-color-management-v1.xml',
hyprland_protocol_dir / 'protocols/hyprland-global-shortcuts-v1.xml',
hyprland_protocol_dir / 'protocols/hyprland-toplevel-export-v1.xml',
hyprland_protocol_dir / 'protocols/hyprland-focus-grab-v1.xml',
diff --git a/protocols/xx-color-management-v4.xml b/protocols/xx-color-management-v4.xml
new file mode 100644
index 00000000..23ff716e
--- /dev/null
+++ b/protocols/xx-color-management-v4.xml
@@ -0,0 +1,1457 @@
+
+
+
+ Copyright 2019 Sebastian Wick
+ Copyright 2019 Erwin Burema
+ Copyright 2020 AMD
+ Copyright 2020-2024 Collabora, Ltd.
+ Copyright 2024 Xaver Hugl
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice (including the next
+ paragraph) shall be included in all copies or substantial portions of the
+ Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+
+
+
+ The aim of the color management extension is to allow clients to know
+ the color properties of outputs, and to tell the compositor about the color
+ properties of their content on surfaces. Doing this enables a compositor
+ to perform automatic color management of content for different outputs
+ according to how content is intended to look like.
+
+ The color properties are represented as an image description object which
+ is immutable after it has been created. A wl_output always has an
+ associated image description that clients can observe. A wl_surface
+ always has an associated preferred image description as a hint chosen by
+ the compositor that clients can also observe. Clients can set an image
+ description on a wl_surface to denote the color characteristics of the
+ surface contents.
+
+ An image description includes SDR and HDR colorimetry and encoding, HDR
+ metadata, and viewing environment parameters. An image description does
+ not include the properties set through color-representation extension.
+ It is expected that the color-representation extension is used in
+ conjunction with the color management extension when necessary,
+ particularly with the YUV family of pixel formats.
+
+ Recommendation ITU-T H.273
+ "Coding-independent code points for video signal type identification"
+ shall be referred to as simply H.273 here.
+
+ The color-and-hdr repository
+ (https://gitlab.freedesktop.org/pq/color-and-hdr) contains
+ background information on the protocol design and legacy color management.
+ It also contains a glossary, learning resources for digital color, tools,
+ samples and more.
+
+ The terminology used in this protocol is based on common color science and
+ color encoding terminology where possible. The glossary in the color-and-hdr
+ repository shall be the authority on the definition of terms in this
+ protocol.
+
+
+
+
+ A global interface used for getting color management extensions for
+ wl_surface and wl_output objects, and for creating client defined image
+ description objects. The extension interfaces allow
+ getting the image description of outputs and setting the image
+ description of surfaces.
+
+
+
+
+ Destroy the xx_color_manager_v4 object. This does not affect any other
+ objects in any way.
+
+
+
+
+
+
+
+
+
+
+ See the ICC.1:2022 specification from the International Color Consortium
+ for more details about rendering intents.
+
+ The principles of ICC defined rendering intents apply with all types of
+ image descriptions, not only those with ICC file profiles.
+
+ Compositors must support the perceptual rendering intent. Other
+ rendering intents are optional.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The compositor supports set_mastering_display_primaries request with a
+ target color volume fully contained inside the primary color volume.
+
+
+
+
+ The compositor additionally supports target color volumes that
+ extend outside of the primary color volume.
+
+ This can only be advertised if feature set_mastering_display_primaries
+ is supported as well.
+
+
+
+
+
+
+ Named color primaries used to encode well-known sets of primaries. H.273
+ is the authority, when it comes to the exact values of primaries and
+ authoritative specifications, where an equivalent code point exists.
+
+ Descriptions do list the specifications for convenience.
+
+
+
+
+ Color primaries as defined by
+ - Rec. ITU-R BT.709-6
+ - Rec. ITU-R BT.1361-0 conventional colour gamut system and extended
+ colour gamut system (historical)
+ - IEC 61966-2-1 sRGB or sYCC
+ - IEC 61966-2-4
+ - Society of Motion Picture and Television Engineers (SMPTE) RP 177
+ (1993) Annex B
+ Equivalent to H.273 ColourPrimaries code point 1.
+
+
+
+
+ Color primaries as defined by
+ - Rec. ITU-R BT.470-6 System M (historical)
+ - United States National Television System Committee 1953
+ Recommendation for transmission standards for color television
+ - United States Federal Communications Commission (2003) Title 47 Code
+ of Federal Regulations 73.682 (a)(20)
+ Equivalent to H.273 ColourPrimaries code point 4.
+
+
+
+
+ Color primaries as defined by
+ - Rec. ITU-R BT.470-6 System B, G (historical)
+ - Rec. ITU-R BT.601-7 625
+ - Rec. ITU-R BT.1358-0 625 (historical)
+ - Rec. ITU-R BT.1700-0 625 PAL and 625 SECAM
+ Equivalent to H.273 ColourPrimaries code point 5.
+
+
+
+
+ Color primaries as defined by
+ - Rec. ITU-R BT.601-7 525
+ - Rec. ITU-R BT.1358-1 525 or 625 (historical)
+ - Rec. ITU-R BT.1700-0 NTSC
+ - SMPTE 170M (2004)
+ - SMPTE 240M (1999) (historical)
+ Equivalent to H.273 ColourPrimaries code point 6 and 7.
+
+
+
+
+ Color primaries as defined by H.273 for generic film.
+ Equivalent to H.273 ColourPrimaries code point 8.
+
+
+
+
+ Color primaries as defined by
+ - Rec. ITU-R BT.2020-2
+ - Rec. ITU-R BT.2100-0
+ Equivalent to H.273 ColourPrimaries code point 9.
+
+
+
+
+ Color primaries as defined as the maximum of the CIE 1931 XYZ color
+ space by
+ - SMPTE ST 428-1
+ - (CIE 1931 XYZ as in ISO 11664-1)
+ Equivalent to H.273 ColourPrimaries code point 10.
+
+
+
+
+ Color primaries as defined by Digital Cinema System and published in
+ SMPTE RP 431-2 (2011). Equivalent to H.273 ColourPrimaries code point
+ 11.
+
+
+
+
+ Color primaries as defined by Digital Cinema System and published in
+ SMPTE EG 432-1 (2010).
+ Equivalent to H.273 ColourPrimaries code point 12.
+
+
+
+
+ Color primaries as defined by Adobe as "Adobe RGB" and later published
+ by ISO 12640-4 (2011).
+
+
+
+
+
+
+ Named transfer functions used to encode well-known transfer
+ characteristics. H.273 is the authority, when it comes to the exact
+ formulas and authoritative specifications, where an equivalent code
+ point exists.
+
+ Descriptions do list the specifications for convenience.
+
+
+
+
+ Transfer characteristics as defined by
+ - Rec. ITU-R BT.709-6
+ - Rec. ITU-R BT.1361-0 conventional colour gamut system (historical)
+ Equivalent to H.273 TransferCharacteristics code point 1, 6, 14, 15.
+
+
+
+
+ Transfer characteristics as defined by
+ - Rec. ITU-R BT.470-6 System M (historical)
+ - United States National Television System Committee 1953
+ Recommendation for transmission standards for color television
+ - United States Federal Communications Commission (2003) Title 47 Code
+ of Federal Regulations 73.682 (a) (20)
+ - Rec. ITU-R BT.1700-0 625 PAL and 625 SECAM
+ Equivalent to H.273 TransferCharacteristics code point 4.
+
+
+
+
+ Transfer characteristics as defined by
+ - Rec. ITU-R BT.470-6 System B, G (historical)
+ Equivalent to H.273 TransferCharacteristics code point 5.
+
+
+
+
+ Transfer characteristics as defined by
+ - SMPTE ST 240 (1999)
+ Equivalent to H.273 TransferCharacteristics code point 7.
+
+
+
+
+ Linear transfer characteristics.
+ Equivalent to H.273 TransferCharacteristics code point 8.
+
+
+
+
+ Logarithmic transfer characteristic (100:1 range).
+ Equivalent to H.273 TransferCharacteristics code point 9.
+
+
+
+
+ Logarithmic transfer characteristic (100 * Sqrt(10) : 1 range).
+ Equivalent to H.273 TransferCharacteristics code point 10.
+
+
+
+
+ Transfer characteristics as defined by
+ - IEC 61966-2-4
+ Equivalent to H.273 TransferCharacteristics code point 11.
+
+
+
+
+ Transfer characteristics as defined by
+ - Rec. ITU-R BT.1361-0 extended colour gamut system (historical)
+ Equivalent to H.273 TransferCharacteristics code point 12.
+
+
+
+
+ Transfer characteristics as defined by
+ - IEC 61966-2-1 sRGB
+ Equivalent to H.273 TransferCharacteristics code point 13 with
+ MatrixCoefficients set to 0.
+
+
+
+
+ Transfer characteristics as defined by
+ - IEC 61966-2-1 sYCC
+ Equivalent to H.273 TransferCharacteristics code point 13 with
+ MatrixCoefficients set to anything but 0.
+
+
+
+
+ Transfer characteristics as defined by
+ - SMPTE ST 2084 (2014) for 10-, 12-, 14- and 16-bit systems
+ - Rec. ITU-R BT.2100-2 perceptual quantization (PQ) system
+ Equivalent to H.273 TransferCharacteristics code point 16.
+
+ This TF implies these default luminances
+ - primary color volume minimum: 0.005 cd/m²
+ - primary color volume maximum: 10000 cd/m²
+ - reference white: 203 cd/m²
+
+
+
+
+ Transfer characteristics as defined by
+ - SMPTE ST 428-1 (2019)
+ Equivalent to H.273 TransferCharacteristics code point 17.
+
+
+
+
+ Transfer characteristics as defined by
+ - ARIB STD-B67 (2015)
+ - Rec. ITU-R BT.2100-2 hybrid log-gamma (HLG) system
+ Equivalent to H.273 TransferCharacteristics code point 18.
+
+ This TF implies these default luminances
+ - primary color volume minimum: 0.005 cd/m²
+ - primary color volume maximum: 1000 cd/m²
+ - reference white: 203 cd/m²
+ Note: HLG is a scene referred signal. All absolute luminance values
+ used here for HLG assume a 1000 cd/m² display.
+
+
+
+
+
+
+ This creates a new xx_color_management_output_v4 object for the
+ given wl_output.
+
+ See the xx_color_management_output_v4 interface for more details.
+
+
+
+
+
+
+
+
+ If a xx_color_management_surface_v4 object already exists for the given
+ wl_surface, the protocol error surface_exists is raised.
+
+ This creates a new color xx_color_management_surface_v4 object for the
+ given wl_surface.
+
+ See the xx_color_management_surface_v4 interface for more details.
+
+
+
+
+
+
+
+
+ This creates a new color xx_color_management_feedback_surface_v4 object
+ for the given wl_surface.
+
+ See the xx_color_management_feedback_surface_v4 interface for more
+ details.
+
+
+
+
+
+
+
+
+ Makes a new ICC-based image description creator object with all
+ properties initially unset. The client can then use the object's
+ interface to define all the required properties for an image description
+ and finally create a xx_image_description_v4 object.
+
+ This request can be used when the compositor advertises
+ xx_color_manager_v4.feature.icc_v2_v4.
+ Otherwise this request raises the protocol error unsupported_feature.
+
+
+
+
+
+
+
+ Makes a new parametric image description creator object with all
+ properties initially unset. The client can then use the object's
+ interface to define all the required properties for an image description
+ and finally create a xx_image_description_v4 object.
+
+ This request can be used when the compositor advertises
+ xx_color_manager_v4.feature.parametric.
+ Otherwise this request raises the protocol error unsupported_feature.
+
+
+
+
+
+
+
+ When this object is created, it shall immediately send this event once
+ for each rendering intent the compositor supports.
+
+
+
+
+
+
+
+ When this object is created, it shall immediately send this event once
+ for each compositor supported feature listed in the enumeration.
+
+
+
+
+
+
+
+ When this object is created, it shall immediately send this event once
+ for each named transfer function the compositor supports with the
+ parametric image description creator.
+
+
+
+
+
+
+
+ When this object is created, it shall immediately send this event once
+ for each named set of primaries the compositor supports with the
+ parametric image description creator.
+
+
+
+
+
+
+
+
+ A xx_color_management_output_v4 describes the color properties of an
+ output.
+
+ The xx_color_management_output_v4 is associated with the wl_output global
+ underlying the wl_output object. Therefore the client destroying the
+ wl_output object has no impact, but the compositor removing the output
+ global makes the xx_color_management_output_v4 object inert.
+
+
+
+
+ Destroy the color xx_color_management_output_v4 object. This does not
+ affect any remaining protocol objects.
+
+
+
+
+
+ This event is sent whenever the image description of the output changed,
+ followed by one wl_output.done event common to output events across all
+ extensions.
+
+ If the client wants to use the updated image description, it needs to do
+ get_image_description again, because image description objects are
+ immutable.
+
+
+
+
+
+ This creates a new xx_image_description_v4 object for the current image
+ description of the output. There always is exactly one image description
+ active for an output so the client should destroy the image description
+ created by earlier invocations of this request. This request is usually
+ sent as a reaction to the image_description_changed event or when
+ creating a xx_color_management_output_v4 object.
+
+ The image description of an output represents the color encoding the
+ output expects. There might be performance and power advantages, as well
+ as improved color reproduction, if a content update matches the image
+ description of the output it is being shown on. If a content update is
+ shown on any other output than the one it matches the image description
+ of, then the color reproduction on those outputs might be considerably
+ worse.
+
+ The created xx_image_description_v4 object preserves the image
+ description of the output from the time the object was created.
+
+ The resulting image description object allows get_information request.
+
+ If this protocol object is inert, the resulting image description object
+ shall immediately deliver the xx_image_description_v4.failed event with
+ the no_output cause.
+
+ If the interface version is inadequate for the output's image
+ description, meaning that the client does not support all the events
+ needed to deliver the crucial information, the resulting image
+ description object shall immediately deliver the
+ xx_image_description_v4.failed event with the low_version cause.
+
+ Otherwise the object shall immediately deliver the ready event.
+
+
+
+
+
+
+
+
+ A xx_color_management_surface_v4 allows the client to set the color
+ space and HDR properties of a surface.
+
+ If the wl_surface associated with the xx_color_management_surface_v4 is
+ destroyed, the xx_color_management_surface_v4 object becomes inert.
+
+
+
+
+ Destroy the xx_color_management_surface_v4 object and do the same as
+ unset_image_description.
+
+
+
+
+
+
+
+
+
+
+
+ Set the image description of the underlying surface. The image
+ description and rendering intent are double-buffered state, see
+ wl_surface.commit.
+
+ It is the client's responsibility to understand the image description
+ it sets on a surface, and to provide content that matches that image
+ description. Compositors might convert images to match their own or any
+ other image descriptions.
+
+ Image description whose creation gracefully failed (received
+ xx_image_description_v4.failed) are forbidden in this request, and in
+ such case the protocol error image_description is raised.
+
+ All image descriptions whose creation succeeded (received
+ xx_image_description_v4.ready) are allowed and must always be accepted
+ by the compositor.
+
+ A rendering intent provides the client's preference on how content
+ colors should be mapped to each output. The render_intent value must
+ be one advertised by the compositor with
+ xx_color_manager_v4.render_intent event, otherwise the protocol error
+ render_intent is raised.
+
+ By default, a surface does not have an associated image description
+ nor a rendering intent. The handling of color on such surfaces is
+ compositor implementation defined. Compositors should handle such
+ surfaces as sRGB but may handle them differently if they have specific
+ requirements.
+
+
+
+
+
+
+
+
+ This request removes any image description from the surface. See
+ set_image_description for how a compositor handles a surface without
+ an image description. This is double-buffered state, see
+ wl_surface.commit.
+
+
+
+
+
+
+ A xx_color_management_feedback_surface_v4 allows the client to get the
+ preferred color description of a surface.
+
+ If the wl_surface associated with this object is destroyed, the
+ xx_color_management_feedback_surface_v4 object becomes inert.
+
+
+
+
+ Destroy the xx_color_management_feedback_surface_v4 object.
+
+
+
+
+
+
+
+
+
+
+ The preferred image description is the one which likely has the most
+ performance and/or quality benefits for the compositor if used by the
+ client for its wl_surface contents. This event is sent whenever the
+ compositor changes the wl_surface's preferred image description.
+
+ This event is merely a notification. When the client wants to know
+ what the preferred image description is, it shall use the get_preferred
+ request.
+
+ The preferred image description is not automatically used for anything.
+ It is only a hint, and clients may set any valid image description with
+ set_image_description but there might be performance and color accuracy
+ improvements by providing the wl_surface contents in the preferred
+ image description. Therefore clients that can, should render according
+ to the preferred image description
+
+
+
+
+
+ If this protocol object is inert, the protocol error inert is raised.
+
+ The preferred image description represents the compositor's preferred
+ color encoding for this wl_surface at the current time. There might be
+ performance and power advantages, as well as improved color
+ reproduction, if the image description of a content update matches the
+ preferred image description.
+
+ This creates a new xx_image_description_v4 object for the currently
+ preferred image description for the wl_surface. The client should
+ stop using and destroy the image descriptions created by earlier
+ invocations of this request for the associated wl_surface.
+ This request is usually sent as a reaction to the preferred_changed
+ event or when creating a xx_color_management_feedback_surface_v4 object
+ if the client is capable of adapting to image descriptions.
+
+ The created xx_image_description_v4 object preserves the preferred image
+ description of the wl_surface from the time the object was created.
+
+ The resulting image description object allows get_information request.
+
+ If the interface version is inadequate for the preferred image
+ description, meaning that the client does not support all the
+ events needed to deliver the crucial information, the resulting image
+ description object shall immediately deliver the
+ xx_image_description_v4.failed event with the low_version cause,
+ otherwise the object shall immediately deliver the ready event.
+
+
+
+
+
+
+
+
+ This type of object is used for collecting all the information required
+ to create a xx_image_description_v4 object from an ICC file. A complete
+ set of required parameters consists of these properties:
+ - ICC file
+
+ Each required property must be set exactly once if the client is to create
+ an image description. The set requests verify that a property was not
+ already set. The create request verifies that all required properties are
+ set. There may be several alternative requests for setting each property,
+ and in that case the client must choose one of them.
+
+ Once all properties have been set, the create request must be used to
+ create the image description object, destroying the creator in the
+ process.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Create an image description object based on the ICC information
+ previously set on this object. A compositor must parse the ICC data in
+ some undefined but finite amount of time.
+
+ The completeness of the parameter set is verified. If the set is not
+ complete, the protocol error incomplete_set is raised. For the
+ definition of a complete set, see the description of this interface.
+
+ If the particular combination of the information is not supported
+ by the compositor, the resulting image description object shall
+ immediately deliver the xx_image_description_v4.failed event with the
+ 'unsupported' cause. If a valid image description was created from the
+ information, the xx_image_description_v4.ready event will eventually
+ be sent instead.
+
+ This request destroys the xx_image_description_creator_icc_v4 object.
+
+ The resulting image description object does not allow get_information
+ request.
+
+
+
+
+
+
+
+ Sets the ICC profile file to be used as the basis of the image
+ description.
+
+ The data shall be found through the given fd at the given offset, having
+ the given length. The fd must seekable and readable. Violating these
+ requirements raises the bad_fd protocol error.
+
+ If reading the data fails due to an error independent of the client, the
+ compositor shall send the xx_image_description_v4.failed event on the
+ created xx_image_description_v4 with the 'operating_system' cause.
+
+ The maximum size of the ICC profile is 4 MB. If length is greater than
+ that or zero, the protocol error bad_size is raised. If offset + length
+ exceeds the file size, the protocol error out_of_file is raised.
+
+ A compositor may read the file at any time starting from this request
+ and only until whichever happens first:
+ - If create request was issued, the xx_image_description_v4 object
+ delivers either failed or ready event; or
+ - if create request was not issued, this
+ xx_image_description_creator_icc_v4 object is destroyed.
+
+ A compositor shall not modify the contents of the file, and the fd may
+ be sealed for writes and size changes. The client must ensure to its
+ best ability that the data does not change while the compositor is
+ reading it.
+
+ The data must represent a valid ICC profile. The ICC profile version
+ must be 2 or 4, it must be a 3 channel profile and the class must be
+ Display or ColorSpace. Violating these requirements will not result in a
+ protocol error but will eventually send the
+ xx_image_description_v4.failed event on the created
+ xx_image_description_v4 with the 'unsupported' cause.
+
+ See the International Color Consortium specification ICC.1:2022 for more
+ details about ICC profiles.
+
+ If ICC file has already been set on this object, the protocol error
+ already_set is raised.
+
+
+
+
+
+
+
+
+
+
+ This type of object is used for collecting all the parameters required
+ to create a xx_image_description_v4 object. A complete set of required
+ parameters consists of these properties:
+ - transfer characteristic function (tf)
+ - chromaticities of primaries and white point (primary color volume)
+
+ The following properties are optional and have a well-defined default
+ if not explicitly set:
+ - primary color volume luminance range
+ - reference white luminance level
+ - mastering display primaries and white point (target color volume)
+ - mastering luminance range
+ - maximum content light level
+ - maximum frame-average light level
+
+ Each required property must be set exactly once if the client is to create
+ an image description. The set requests verify that a property was not
+ already set. The create request verifies that all required properties are
+ set. There may be several alternative requests for setting each property,
+ and in that case the client must choose one of them.
+
+ Once all properties have been set, the create request must be used to
+ create the image description object, destroying the creator in the
+ process.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Create an image description object based on the parameters previously
+ set on this object.
+
+ The completeness of the parameter set is verified. If the set is not
+ complete, the protocol error incomplete_set is raised. For the
+ definition of a complete set, see the description of this interface.
+
+ Also, the combination of the parameter set is verified. If the set is
+ not consistent, the protocol error inconsistent_set is raised.
+
+ If the particular combination of the parameter set is not supported
+ by the compositor, the resulting image description object shall
+ immediately deliver the xx_image_description_v4.failed event with the
+ 'unsupported' cause. If a valid image description was created from the
+ parameter set, the xx_image_description_v4.ready event will eventually
+ be sent instead.
+
+ This request destroys the xx_image_description_creator_params_v4
+ object.
+
+ The resulting image description object does not allow get_information
+ request.
+
+
+
+
+
+
+
+ Sets the transfer characteristic using explicitly enumerated named
+ functions.
+
+ When the resulting image description is attached to an image, the
+ content should be encoded and decoded according to the industry standard
+ practices for the transfer characteristic.
+
+ Only names advertised with xx_color_manager_v4 event supported_tf_named
+ are allowed. Other values shall raise the protocol error invalid_tf.
+
+ If transfer characteristic has already been set on this object, the
+ protocol error already_set is raised.
+
+
+
+
+
+
+
+ Sets the color component transfer characteristic to a power curve with
+ the given exponent. This curve represents the conversion from electrical
+ to optical pixel or color values.
+
+ When the resulting image description is attached to an image, the
+ content should be encoded with the inverse of the power curve.
+
+ The curve exponent shall be multiplied by 10000 to get the argument eexp
+ value to carry the precision of 4 decimals.
+
+ The curve exponent must be at least 1.0 and at most 10.0. Otherwise the
+ protocol error invalid_tf is raised.
+
+ If transfer characteristic has already been set on this object, the
+ protocol error already_set is raised.
+
+ This request can be used when the compositor advertises
+ xx_color_manager_v4.feature.set_tf_power. Otherwise this request raises
+ the protocol error unsupported_feature.
+
+
+
+
+
+
+
+ Sets the color primaries and white point using explicitly named sets.
+ This describes the primary color volume which is the basis for color
+ value encoding.
+
+ Only names advertised with xx_color_manager_v4 event
+ supported_primaries_named are allowed. Other values shall raise the
+ protocol error invalid_primaries.
+
+ If primaries have already been set on this object, the protocol error
+ already_set is raised.
+
+
+
+
+
+
+
+ Sets the color primaries and white point using CIE 1931 xy chromaticity
+ coordinates. This describes the primary color volume which is the basis
+ for color value encoding.
+
+ Each coordinate value is multiplied by 10000 to get the argument value
+ to carry precision of 4 decimals.
+
+ If primaries have already been set on this object, the protocol error
+ already_set is raised.
+
+ This request can be used if the compositor advertises
+ xx_color_manager_v4.feature.set_primaries. Otherwise this request raises
+ the protocol error unsupported_feature.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Sets the primary color volume luminance range and the reference white
+ luminance level.
+
+ The default luminances are
+ - primary color volume minimum: 0.2 cd/m²
+ - primary color volume maximum: 80 cd/m²
+ - reference white: 80 cd/m²
+
+ Setting a named transfer characteristic can imply other default
+ luminances.
+
+ The default luminances get overwritten when this request is used.
+
+ 'min_lum' and 'max_lum' specify the minimum and maximum luminances of
+ the primary color volume as reproduced by the targeted display.
+
+ 'reference_lum' specifies the luminance of the reference white as
+ reproduced by the targeted display, and reflects the targeted viewing
+ environment.
+
+ Compositors should make sure that all content is anchored, meaning that
+ an input signal level of 'reference_lum' on one image description and
+ another input signal level of 'reference_lum' on another image
+ description should produce the same output level, even though the
+ 'reference_lum' on both image representations can be different.
+
+ If 'max_lum' is less than the 'reference_lum', or 'reference_lum' is
+ less than or equal to 'min_lum', the protocol error invalid_luminance is
+ raised.
+
+ The minimum luminance is multiplied by 10000 to get the argument
+ 'min_lum' value and carries precision of 4 decimals. The maximum
+ luminance and reference white luminance values are unscaled.
+
+ If the primary color volume luminance range and the reference white
+ luminance level have already been set on this object, the protocol error
+ already_set is raised.
+
+ This request can be used if the compositor advertises
+ xx_color_manager_v4.feature.set_luminances. Otherwise this request
+ raises the protocol error unsupported_feature.
+
+
+
+
+
+
+
+
+
+ Provides the color primaries and white point of the mastering display
+ using CIE 1931 xy chromaticity coordinates. This is compatible with the
+ SMPTE ST 2086 definition of HDR static metadata.
+
+ The mastering display primaries define the target color volume.
+
+ If mastering display primaries are not explicitly set, the target color
+ volume is assumed to be equal to the primary color volume.
+
+ The target color volume is defined by all tristimulus values between 0.0
+ and 1.0 (inclusive) of the color space defined by the given mastering
+ display primaries and white point. The colorimetry is identical between
+ the container color space and the mastering display color space,
+ including that no chromatic adaptation is applied even if the white
+ points differ.
+
+ The target color volume can exceed the primary color volume to allow for
+ a greater color volume with an existing color space definition (for
+ example scRGB). It can be smaller than the primary color volume to
+ minimize gamut and tone mapping distances for big color spaces (HDR
+ metadata).
+
+ To make use of the entire target color volume a suitable pixel format
+ has to be chosen (e.g. floating point to exceed the primary color
+ volume, or abusing limited quantization range as with xvYCC).
+
+ Each coordinate value is multiplied by 10000 to get the argument value
+ to carry precision of 4 decimals.
+
+ If mastering display primaries have already been set on this object, the
+ protocol error already_set is raised.
+
+ This request can be used if the compositor advertises
+ xx_color_manager_v4.feature.set_mastering_display_primaries. Otherwise
+ this request raises the protocol error unsupported_feature. The
+ advertisement implies support only for target color volumes fully
+ contained within the primary color volume.
+
+ If a compositor additionally supports target color volume exceeding the
+ primary color volume, it must advertise
+ xx_color_manager_v4.feature.extended_target_volume. If a client uses
+ target color volume exceeding the primary color volume and the
+ compositor does not support it, the result is implementation defined.
+ Compositors are recommended to detect this case and fail the image
+ description gracefully, but it may as well result in color artifacts.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Sets the luminance range that was used during the content mastering
+ process as the minimum and maximum absolute luminance L. This is
+ compatible with the SMPTE ST 2086 definition of HDR static metadata.
+
+ The mastering luminance range is undefined by default.
+
+ If max L is less than or equal to min L, the protocol error
+ invalid_luminance is raised.
+
+ Min L value is multiplied by 10000 to get the argument min_lum value
+ and carry precision of 4 decimals. Max L value is unscaled for max_lum.
+
+
+
+
+
+
+
+
+ Sets the maximum content light level (max_cll) as defined by CTA-861-H.
+
+ This can only be set when set_tf_cicp is used to set the transfer
+ characteristic to Rec. ITU-R BT.2100-2 perceptual quantization system.
+ Otherwise, 'create' request shall raise inconsistent_set protocol
+ error.
+
+ max_cll is undefined by default.
+
+
+
+
+
+
+
+ Sets the maximum frame-average light level (max_fall) as defined by
+ CTA-861-H.
+
+ This can only be set when set_tf_cicp is used to set the transfer
+ characteristic to Rec. ITU-R BT.2100-2 perceptual quantization system.
+ Otherwise, 'create' request shall raise inconsistent_set protocol error.
+
+ max_fall is undefined by default.
+
+
+
+
+
+
+
+
+ An image description carries information about the color encoding used on
+ a surface when attached to a wl_surface via
+ xx_color_management_surface_v4.set_image_description. A compositor can use
+ this information to decode pixel values into colorimetrically meaningful
+ quantities.
+
+ Note, that the xx_image_description_v4 object is not ready to be used
+ immediately after creation. The object eventually delivers either the
+ 'ready' or the 'failed' event, specified in all requests creating it. The
+ object is deemed "ready" after receiving the 'ready' event.
+
+ An object which is not ready is illegal to use, it can only be destroyed.
+ Any other request in this interface shall result in the 'not_ready'
+ protocol error. Attempts to use an object which is not ready through other
+ interfaces shall raise protocol errors defined there.
+
+ Once created and regardless of how it was created, a
+ xx_image_description_v4 object always refers to one fixed image
+ description. It cannot change after creation.
+
+
+
+
+ Destroy this object. It is safe to destroy an object which is not ready.
+
+ Destroying a xx_image_description_v4 object has no side-effects, not
+ even if a xx_color_management_surface_v4.set_image_description has not
+ yet been followed by a wl_surface.commit.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ If creating a xx_image_description_v4 object fails for a reason that is
+ not defined as a protocol error, this event is sent.
+
+ The requests that create image description objects define whether and
+ when this can occur. Only such creation requests can trigger this event.
+ This event cannot be triggered after the image description was
+ successfully formed.
+
+ Once this event has been sent, the xx_image_description_v4 object will
+ never become ready and it can only be destroyed.
+
+
+
+
+
+
+
+
+ Once this event has been sent, the xx_image_description_v4 object is
+ deemed "ready". Ready objects can be used to send requests and can be
+ used through other interfaces.
+
+ Every ready xx_image_description_v4 protocol object refers to an
+ underlying image description record in the compositor. Multiple protocol
+ objects may end up referring to the same record. Clients may identify
+ these "copies" by comparing their id numbers: if the numbers from two
+ protocol objects are identical, the protocol objects refer to the same
+ image description record. Two different image description records
+ cannot have the same id number simultaneously. The id number does not
+ change during the lifetime of the image description record.
+
+ The id number is valid only as long as the protocol object is alive. If
+ all protocol objects referring to the same image description record are
+ destroyed, the id number may be recycled for a different image
+ description record.
+
+ Image description id number is not a protocol object id. Zero is
+ reserved as an invalid id number. It shall not be possible for a client
+ to refer to an image description by its id number in protocol. The id
+ numbers might not be portable between Wayland connections.
+
+ This identity allows clients to de-duplicate image description records
+ and avoid get_information request if they already have the image
+ description information.
+
+
+
+
+
+
+
+ Creates a xx_image_description_info_v4 object which delivers the
+ information that makes up the image description.
+
+ Not all image description protocol objects allow get_information
+ request. Whether it is allowed or not is defined by the request that
+ created the object. If get_information is not allowed, the protocol
+ error no_information is raised.
+
+
+
+
+
+
+
+
+ Sends all matching events describing an image description object exactly
+ once and finally sends the 'done' event.
+
+ Once a xx_image_description_info_v4 object has delivered a 'done' event it
+ is automatically destroyed.
+
+ Every xx_image_description_info_v4 created from the same
+ xx_image_description_v4 shall always return the exact same data.
+
+
+
+
+ Signals the end of information events and destroys the object.
+
+
+
+
+
+ The icc argument provides a file descriptor to the client which may be
+ memory-mapped to provide the ICC profile matching the image description.
+ The fd is read-only, and if mapped then it must be mapped with
+ MAP_PRIVATE by the client.
+
+ The ICC profile version and other details are determined by the
+ compositor. There is no provision for a client to ask for a specific
+ kind of a profile.
+
+
+
+
+
+
+
+
+
+ Delivers the primary color volume primaries and white point using CIE
+ 1931 xy chromaticity coordinates.
+
+ Each coordinate value is multiplied by 10000 to get the argument value
+ to carry precision of 4 decimals.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Delivers the primary color volume primaries and white point using an
+ explicitly enumerated named set.
+
+
+
+
+
+
+
+ The color component transfer characteristic of this image description is
+ a pure power curve. This event provides the exponent of the power
+ function. This curve represents the conversion from electrical to
+ optical pixel or color values.
+
+ The curve exponent has been multiplied by 10000 to get the argument eexp
+ value to carry the precision of 4 decimals.
+
+
+
+
+
+
+
+ Delivers the transfer characteristic using an explicitly enumerated
+ named function.
+
+
+
+
+
+
+
+ Delivers the primary color volume luminance range and the reference
+ white luminance level.
+
+ The minimum luminance is multiplied by 10000 to get the argument
+ 'min_lum' value and carries precision of 4 decimals. The maximum
+ luminance and reference white luminance values are unscaled.
+
+
+
+
+
+
+
+
+
+ Provides the color primaries and white point of the target color volume
+ using CIE 1931 xy chromaticity coordinates. This is compatible with the
+ SMPTE ST 2086 definition of HDR static metadata for mastering displays.
+
+ While primary color volume is about how color is encoded, the target
+ color volume is the actually displayable color volume. If target color
+ volume is equal to the primary color volume, then this event is not
+ sent.
+
+ Each coordinate value is multiplied by 10000 to get the argument value
+ to carry precision of 4 decimals.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Provides the luminance range that the image description is targeting as
+ the minimum and maximum absolute luminance L. This is compatible with
+ the SMPTE ST 2086 definition of HDR static metadata.
+
+ This luminance range is only theoretical and may not correspond to the
+ luminance of light emitted on an actual display.
+
+ Min L value is multiplied by 10000 to get the argument min_lum value and
+ carry precision of 4 decimals. Max L value is unscaled for max_lum.
+
+
+
+
+
+
+
+
+ Provides the targeted max_cll of the image description. max_cll is
+ defined by CTA-861-H.
+
+ This luminance is only theoretical and may not correspond to the
+ luminance of light emitted on an actual display.
+
+
+
+
+
+
+
+ Provides the targeted max_fall of the image description. max_fall is
+ defined by CTA-861-H.
+
+ This luminance is only theoretical and may not correspond to the
+ luminance of light emitted on an actual display.
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Compositor.cpp b/src/Compositor.cpp
index c80f05e6..3d159042 100644
--- a/src/Compositor.cpp
+++ b/src/Compositor.cpp
@@ -31,6 +31,7 @@
#include "protocols/XDGShell.hpp"
#include "protocols/XDGOutput.hpp"
#include "protocols/SecurityContext.hpp"
+#include "protocols/ColorManagement.hpp"
#include "protocols/core/Compositor.hpp"
#include "protocols/core/Subcompositor.hpp"
#include "desktop/LayerSurface.hpp"
@@ -569,7 +570,7 @@ void CCompositor::initManagers(eManagersInitStage stage) {
g_pKeybindManager = std::make_unique();
Debug::log(LOG, "Creating the AnimationManager!");
- g_pAnimationManager = std::make_unique();
+ g_pAnimationManager = std::make_unique();
Debug::log(LOG, "Creating the ConfigManager!");
g_pConfigManager = std::make_unique();
@@ -964,11 +965,11 @@ SP CCompositor::vectorWindowToSurface(const Vector2D& pos, P
if (PPOPUP) {
const auto OFF = PPOPUP->coordsRelativeToParent();
- sl = pos - pWindow->m_vRealPosition.goal() - OFF;
+ sl = pos - pWindow->m_vRealPosition->goal() - OFF;
return PPOPUP->m_pWLSurface->resource();
}
- auto [surf, local] = pWindow->m_pWLSurface->resource()->at(pos - pWindow->m_vRealPosition.goal(), true);
+ auto [surf, local] = pWindow->m_pWLSurface->resource()->at(pos - pWindow->m_vRealPosition->goal(), true);
if (surf) {
sl = local;
return surf;
@@ -982,7 +983,7 @@ Vector2D CCompositor::vectorToSurfaceLocal(const Vector2D& vec, PHLWINDOW pWindo
return {};
if (pWindow->m_bIsX11)
- return vec - pWindow->m_vRealPosition.goal();
+ return vec - pWindow->m_vRealPosition->goal();
const auto PPOPUP = pWindow->m_pPopupHead->at(vec);
if (PPOPUP)
@@ -1001,9 +1002,9 @@ Vector2D CCompositor::vectorToSurfaceLocal(const Vector2D& vec, PHLWINDOW pWindo
CBox geom = pWindow->m_pXDGSurface->current.geometry;
if (std::get<1>(iterData) == Vector2D{-1337, -1337})
- return vec - pWindow->m_vRealPosition.goal();
+ return vec - pWindow->m_vRealPosition->goal();
- return vec - pWindow->m_vRealPosition.goal() - std::get<1>(iterData) + Vector2D{geom.x, geom.y};
+ return vec - pWindow->m_vRealPosition->goal() - std::get<1>(iterData) + Vector2D{geom.x, geom.y};
}
PHLMONITOR CCompositor::getMonitorFromOutput(SP out) {
@@ -1211,7 +1212,7 @@ void CCompositor::focusSurface(SP pSurface, PHLWINDOW pWindo
SP CCompositor::vectorToLayerPopupSurface(const Vector2D& pos, PHLMONITOR monitor, Vector2D* sCoords, PHLLS* ppLayerSurfaceFound) {
for (auto const& lsl : monitor->m_aLayerSurfaceLayers | std::views::reverse) {
for (auto const& ls : lsl | std::views::reverse) {
- if (ls->fadingOut || !ls->layerSurface || (ls->layerSurface && !ls->layerSurface->mapped) || ls->alpha.value() == 0.f)
+ if (ls->fadingOut || !ls->layerSurface || (ls->layerSurface && !ls->layerSurface->mapped) || ls->alpha->value() == 0.f)
continue;
auto SURFACEAT = ls->popupHead->at(pos, true);
@@ -1229,7 +1230,7 @@ SP CCompositor::vectorToLayerPopupSurface(const Vector2D& po
SP CCompositor::vectorToLayerSurface(const Vector2D& pos, std::vector* layerSurfaces, Vector2D* sCoords, PHLLS* ppLayerSurfaceFound) {
for (auto const& ls : *layerSurfaces | std::views::reverse) {
- if (ls->fadingOut || !ls->layerSurface || (ls->layerSurface && !ls->layerSurface->surface->mapped) || ls->alpha.value() == 0.f)
+ if (ls->fadingOut || !ls->layerSurface || (ls->layerSurface && !ls->layerSurface->surface->mapped) || ls->alpha->value() == 0.f)
continue;
auto [surf, local] = ls->layerSurface->surface->at(pos - ls->geometry.pos(), true);
@@ -1378,7 +1379,7 @@ void CCompositor::cleanupFadingOut(const MONITORID& monid) {
if (w->monitorID() != monid && w->m_pMonitor)
continue;
- if (!w->m_bFadingOut || w->m_fAlpha.value() == 0.f) {
+ if (!w->m_bFadingOut || w->m_fAlpha->value() == 0.f) {
w->m_bFadingOut = false;
@@ -1831,8 +1832,8 @@ void CCompositor::updateWindowAnimatedDecorationValues(PHLWINDOW pWindow) {
pWindow->m_cRealBorderColorPrevious = pWindow->m_cRealBorderColor;
pWindow->m_cRealBorderColor = grad;
- pWindow->m_fBorderFadeAnimationProgress.setValueAndWarp(0.f);
- pWindow->m_fBorderFadeAnimationProgress = 1.f;
+ pWindow->m_fBorderFadeAnimationProgress->setValueAndWarp(0.f);
+ *pWindow->m_fBorderFadeAnimationProgress = 1.f;
};
const bool IS_SHADOWED_BY_MODAL = pWindow->m_pXDGSurface && pWindow->m_pXDGSurface->toplevel && pWindow->m_pXDGSurface->toplevel->anyChildModal();
@@ -1855,18 +1856,18 @@ void CCompositor::updateWindowAnimatedDecorationValues(PHLWINDOW pWindow) {
}
// tick angle if it's not running (aka dead)
- if (!pWindow->m_fBorderAngleAnimationProgress.isBeingAnimated())
- pWindow->m_fBorderAngleAnimationProgress.setValueAndWarp(0.f);
+ if (!pWindow->m_fBorderAngleAnimationProgress->isBeingAnimated())
+ pWindow->m_fBorderAngleAnimationProgress->setValueAndWarp(0.f);
// opacity
const auto PWORKSPACE = pWindow->m_pWorkspace;
if (pWindow->isEffectiveInternalFSMode(FSMODE_FULLSCREEN)) {
- pWindow->m_fActiveInactiveAlpha = pWindow->m_sWindowData.alphaFullscreen.valueOrDefault().applyAlpha(*PFULLSCREENALPHA);
+ *pWindow->m_fActiveInactiveAlpha = pWindow->m_sWindowData.alphaFullscreen.valueOrDefault().applyAlpha(*PFULLSCREENALPHA);
} else {
if (pWindow == m_pLastWindow)
- pWindow->m_fActiveInactiveAlpha = pWindow->m_sWindowData.alpha.valueOrDefault().applyAlpha(*PACTIVEALPHA);
+ *pWindow->m_fActiveInactiveAlpha = pWindow->m_sWindowData.alpha.valueOrDefault().applyAlpha(*PACTIVEALPHA);
else
- pWindow->m_fActiveInactiveAlpha = pWindow->m_sWindowData.alphaInactive.valueOrDefault().applyAlpha(*PINACTIVEALPHA);
+ *pWindow->m_fActiveInactiveAlpha = pWindow->m_sWindowData.alphaInactive.valueOrDefault().applyAlpha(*PINACTIVEALPHA);
}
// dim
@@ -1879,16 +1880,16 @@ void CCompositor::updateWindowAnimatedDecorationValues(PHLWINDOW pWindow) {
if (IS_SHADOWED_BY_MODAL)
goalDim += (1.F - goalDim) / 2.F;
- pWindow->m_fDimPercent = goalDim;
+ *pWindow->m_fDimPercent = goalDim;
// shadow
if (!pWindow->isX11OverrideRedirect() && !pWindow->m_bX11DoesntWantBorders) {
if (pWindow == m_pLastWindow)
- pWindow->m_cRealShadowColor = CHyprColor(*PSHADOWCOL);
+ *pWindow->m_cRealShadowColor = CHyprColor(*PSHADOWCOL);
else
- pWindow->m_cRealShadowColor = CHyprColor(*PSHADOWCOLINACTIVE != INT64_MAX ? *PSHADOWCOLINACTIVE : *PSHADOWCOL);
+ *pWindow->m_cRealShadowColor = CHyprColor(*PSHADOWCOLINACTIVE != INT64_MAX ? *PSHADOWCOLINACTIVE : *PSHADOWCOL);
} else {
- pWindow->m_cRealShadowColor.setValueAndWarp(CHyprColor(0, 0, 0, 0)); // no shadow
+ pWindow->m_cRealShadowColor->setValueAndWarp(CHyprColor(0, 0, 0, 0)); // no shadow
}
pWindow->updateWindowDecos();
@@ -1932,11 +1933,11 @@ void CCompositor::swapActiveWorkspaces(PHLMONITOR pMonitorA, PHLMONITOR pMonitor
// additionally, move floating and fs windows manually
if (w->m_bIsFloating)
- w->m_vRealPosition = w->m_vRealPosition.goal() - pMonitorA->vecPosition + pMonitorB->vecPosition;
+ *w->m_vRealPosition = w->m_vRealPosition->goal() - pMonitorA->vecPosition + pMonitorB->vecPosition;
if (w->isFullscreen()) {
- w->m_vRealPosition = pMonitorB->vecPosition;
- w->m_vRealSize = pMonitorB->vecSize;
+ *w->m_vRealPosition = pMonitorB->vecPosition;
+ *w->m_vRealSize = pMonitorB->vecSize;
}
w->updateToplevel();
@@ -1957,11 +1958,11 @@ void CCompositor::swapActiveWorkspaces(PHLMONITOR pMonitorA, PHLMONITOR pMonitor
// additionally, move floating and fs windows manually
if (w->m_bIsFloating)
- w->m_vRealPosition = w->m_vRealPosition.goal() - pMonitorB->vecPosition + pMonitorA->vecPosition;
+ *w->m_vRealPosition = w->m_vRealPosition->goal() - pMonitorB->vecPosition + pMonitorA->vecPosition;
if (w->isFullscreen()) {
- w->m_vRealPosition = pMonitorA->vecPosition;
- w->m_vRealSize = pMonitorA->vecSize;
+ *w->m_vRealPosition = pMonitorA->vecPosition;
+ *w->m_vRealSize = pMonitorA->vecSize;
}
w->updateToplevel();
@@ -2135,14 +2136,14 @@ void CCompositor::moveWorkspaceToMonitor(PHLWORKSPACE pWorkspace, PHLMONITOR pMo
if (w->m_bIsMapped && !w->isHidden()) {
if (POLDMON) {
if (w->m_bIsFloating)
- w->m_vRealPosition = w->m_vRealPosition.goal() - POLDMON->vecPosition + pMonitor->vecPosition;
+ *w->m_vRealPosition = w->m_vRealPosition->goal() - POLDMON->vecPosition + pMonitor->vecPosition;
if (w->isFullscreen()) {
- w->m_vRealPosition = pMonitor->vecPosition;
- w->m_vRealSize = pMonitor->vecSize;
+ *w->m_vRealPosition = pMonitor->vecPosition;
+ *w->m_vRealSize = pMonitor->vecSize;
}
} else {
- w->m_vRealPosition = Vector2D{(int)w->m_vRealPosition.goal().x % (int)pMonitor->vecSize.x, (int)w->m_vRealPosition.goal().y % (int)pMonitor->vecSize.y};
+ *w->m_vRealPosition = Vector2D{(int)w->m_vRealPosition->goal().x % (int)pMonitor->vecSize.x, (int)w->m_vRealPosition->goal().y % (int)pMonitor->vecSize.y};
}
}
@@ -2216,9 +2217,9 @@ void CCompositor::updateFullscreenFadeOnWorkspace(PHLWORKSPACE pWorkspace) {
continue;
if (!FULLSCREEN)
- w->m_fAlpha = 1.f;
+ *w->m_fAlpha = 1.f;
else if (!w->isFullscreen())
- w->m_fAlpha = !w->m_bCreatedOverFullscreen ? 0.f : 1.f;
+ *w->m_fAlpha = !w->m_bCreatedOverFullscreen ? 0.f : 1.f;
}
}
@@ -2227,7 +2228,7 @@ void CCompositor::updateFullscreenFadeOnWorkspace(PHLWORKSPACE pWorkspace) {
if (pWorkspace->m_iID == PMONITOR->activeWorkspaceID() || pWorkspace->m_iID == PMONITOR->activeSpecialWorkspaceID()) {
for (auto const& ls : PMONITOR->m_aLayerSurfaceLayers[ZWLR_LAYER_SHELL_V1_LAYER_TOP]) {
if (!ls->fadingOut)
- ls->alpha = FULLSCREEN && pWorkspace->m_efFullscreenMode == FSMODE_FULLSCREEN ? 0.f : 1.f;
+ *ls->alpha = FULLSCREEN && pWorkspace->m_efFullscreenMode == FSMODE_FULLSCREEN ? 0.f : 1.f;
}
}
}
@@ -2317,7 +2318,7 @@ void CCompositor::setWindowFullscreenState(const PHLWINDOW PWINDOW, SFullscreenS
updateFullscreenFadeOnWorkspace(PWORKSPACE);
- g_pXWaylandManager->setWindowSize(PWINDOW, PWINDOW->m_vRealSize.goal(), true);
+ g_pXWaylandManager->setWindowSize(PWINDOW, PWINDOW->m_vRealSize->goal(), true);
PWORKSPACE->forceReportSizesToWindows();
@@ -2573,7 +2574,7 @@ PHLWORKSPACE CCompositor::createNewWorkspace(const WORKSPACEID& id, const MONITO
const auto PWORKSPACE = m_vWorkspaces.emplace_back(CWorkspace::create(id, getMonitorFromID(monID), NAME, SPECIAL, isEmpty));
- PWORKSPACE->m_fAlpha.setValueAndWarp(0);
+ PWORKSPACE->m_fAlpha->setValueAndWarp(0);
return PWORKSPACE;
}
@@ -2659,7 +2660,7 @@ void CCompositor::moveWindowToWorkspaceSafe(PHLWINDOW pWindow, PHLWORKSPACE pWor
const PHLWINDOW pFirstWindowOnWorkspace = pWorkspace->getFirstWindow();
const int visibleWindowsOnWorkspace = pWorkspace->getWindows(std::nullopt, true);
const auto PWINDOWMONITOR = pWindow->m_pMonitor.lock();
- const auto POSTOMON = pWindow->m_vRealPosition.goal() - PWINDOWMONITOR->vecPosition;
+ const auto POSTOMON = pWindow->m_vRealPosition->goal() - PWINDOWMONITOR->vecPosition;
const auto PWORKSPACEMONITOR = pWorkspace->m_pMonitor.lock();
if (!pWindow->m_bIsFloating)
@@ -2696,7 +2697,7 @@ void CCompositor::moveWindowToWorkspaceSafe(PHLWINDOW pWindow, PHLWORKSPACE pWor
g_pLayoutManager->getCurrentLayout()->onWindowCreatedTiling(pWindow);
if (pWindow->m_bIsFloating)
- pWindow->m_vRealPosition = POSTOMON + PWORKSPACEMONITOR->vecPosition;
+ *pWindow->m_vRealPosition = POSTOMON + PWORKSPACEMONITOR->vecPosition;
}
pWindow->updateToplevel();
@@ -2721,8 +2722,8 @@ void CCompositor::moveWindowToWorkspaceSafe(PHLWINDOW pWindow, PHLWORKSPACE pWor
g_pCompositor->updateSuspendedStates();
if (!WASVISIBLE && pWindow->m_pWorkspace && pWindow->m_pWorkspace->isVisible()) {
- pWindow->m_fMovingFromWorkspaceAlpha.setValueAndWarp(0.F);
- pWindow->m_fMovingFromWorkspaceAlpha = 1.F;
+ pWindow->m_fMovingFromWorkspaceAlpha->setValueAndWarp(0.F);
+ *pWindow->m_fMovingFromWorkspaceAlpha = 1.F;
}
}
@@ -2985,4 +2986,22 @@ void CCompositor::onNewMonitor(SP output) {
g_pHyprRenderer->damageMonitor(PNEWMONITOR);
PNEWMONITOR->onMonitorFrame();
+
+ if (PROTO::colorManagement && shouldChangePreferredImageDescription())
+ PROTO::colorManagement->onImagePreferredChanged();
+}
+
+SImageDescription CCompositor::getPreferredImageDescription() {
+ if (!PROTO::colorManagement) {
+ Debug::log(ERR, "FIXME: color management protocol is not enabled, returning empty image description");
+ return SImageDescription{};
+ }
+ Debug::log(WARN, "FIXME: color management protocol is enabled, determine correct preferred image description");
+ // should determine some common settings to avoid unnecessary transformations while keeping maximum displayable precision
+ return SImageDescription{.primaries = NColorPrimaries::BT709};
+}
+
+bool CCompositor::shouldChangePreferredImageDescription() {
+ Debug::log(WARN, "FIXME: color management protocol is enabled and outputs changed, check preferred image description changes");
+ return false;
}
diff --git a/src/Compositor.hpp b/src/Compositor.hpp
index 4c428fca..629b71bc 100644
--- a/src/Compositor.hpp
+++ b/src/Compositor.hpp
@@ -23,6 +23,7 @@
#include "helpers/Monitor.hpp"
#include "desktop/Workspace.hpp"
#include "desktop/Window.hpp"
+#include "protocols/types/ColorManagement.hpp"
#include "render/Renderer.hpp"
#include "render/OpenGL.hpp"
#include "hyprerror/HyprError.hpp"
@@ -169,6 +170,9 @@ class CCompositor {
void updateSuspendedStates();
void onNewMonitor(SP output);
+ SImageDescription getPreferredImageDescription();
+ bool shouldChangePreferredImageDescription();
+
std::string explicitConfigPath;
private:
diff --git a/src/config/ConfigDescriptions.hpp b/src/config/ConfigDescriptions.hpp
index 17657983..686b996a 100644
--- a/src/config/ConfigDescriptions.hpp
+++ b/src/config/ConfigDescriptions.hpp
@@ -139,6 +139,12 @@ inline static const std::vector CONFIG_OPTIONS = {
.type = CONFIG_OPTION_INT,
.data = SConfigOptionDescription::SRangeData{0, 0, 20},
},
+ SConfigOptionDescription{
+ .value = "decoration:rounding_power",
+ .description = "rouding power of corners (2 is a circle)",
+ .type = CONFIG_OPTION_FLOAT,
+ .data = SConfigOptionDescription::SFloatData{2, 2, 10},
+ },
SConfigOptionDescription{
.value = "decoration:active_opacity",
.description = "opacity of active windows. [0.0 - 1.0]",
@@ -1626,6 +1632,12 @@ inline static const std::vector CONFIG_OPTIONS = {
.type = CONFIG_OPTION_INT,
.data = SConfigOptionDescription::SRangeData{2, 0, 10}, //##TODO RANGE?
},
+ SConfigOptionDescription{
+ .value = "master:center_master_slaves_on_right",
+ .description = "set if the slaves should appear on right of master when slave_count_for_center_master > 2",
+ .type = CONFIG_OPTION_BOOL,
+ .data = SConfigOptionDescription::SBoolData{true},
+ },
SConfigOptionDescription{
.value = "master:center_ignores_reserved",
.description = "centers the master window on monitor ignoring reserved areas",
@@ -1646,4 +1658,22 @@ inline static const std::vector CONFIG_OPTIONS = {
.type = CONFIG_OPTION_BOOL,
.data = SConfigOptionDescription::SBoolData{true},
},
+ SConfigOptionDescription{
+ .value = "experimental:wide_color_gamut",
+ .description = "force wide color gamut for all supported outputs",
+ .type = CONFIG_OPTION_BOOL,
+ .data = SConfigOptionDescription::SBoolData{false},
+ },
+ SConfigOptionDescription{
+ .value = "experimental:hdr",
+ .description = "force static hdr for all supported outputs",
+ .type = CONFIG_OPTION_BOOL,
+ .data = SConfigOptionDescription::SBoolData{false},
+ },
+ SConfigOptionDescription{
+ .value = "experimental:xx_color_management_v4",
+ .description = "enable color management protocol",
+ .type = CONFIG_OPTION_BOOL,
+ .data = SConfigOptionDescription::SBoolData{false},
+ },
};
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp
index bdce573f..def15f26 100644
--- a/src/config/ConfigManager.cpp
+++ b/src/config/ConfigManager.cpp
@@ -11,6 +11,7 @@
#include "../protocols/LayerShell.hpp"
#include "../xwayland/XWayland.hpp"
#include "../protocols/OutputManagement.hpp"
+#include "managers/AnimationManager.hpp"
#include
#include
@@ -32,6 +33,7 @@
#include
#include
using namespace Hyprutils::String;
+using namespace Hyprutils::Animation;
//NOLINTNEXTLINE
extern "C" char** environ;
@@ -427,6 +429,7 @@ CConfigManager::CConfigManager() {
m_pConfig->addConfigValue("debug:colored_stdout_logs", Hyprlang::INT{1});
m_pConfig->addConfigValue("decoration:rounding", Hyprlang::INT{0});
+ m_pConfig->addConfigValue("decoration:rounding_power", {2.F});
m_pConfig->addConfigValue("decoration:blur:enabled", Hyprlang::INT{1});
m_pConfig->addConfigValue("decoration:blur:size", Hyprlang::INT{8});
m_pConfig->addConfigValue("decoration:blur:passes", Hyprlang::INT{1});
@@ -478,6 +481,7 @@ CConfigManager::CConfigManager() {
m_pConfig->addConfigValue("master:mfact", {0.55f});
m_pConfig->addConfigValue("master:new_status", {"slave"});
m_pConfig->addConfigValue("master:slave_count_for_center_master", Hyprlang::INT{2});
+ m_pConfig->addConfigValue("master:center_master_slaves_on_right", Hyprlang::INT{1});
m_pConfig->addConfigValue("master:center_ignores_reserved", Hyprlang::INT{0});
m_pConfig->addConfigValue("master:new_on_active", {"none"});
m_pConfig->addConfigValue("master:new_on_top", Hyprlang::INT{0});
@@ -574,7 +578,7 @@ CConfigManager::CConfigManager() {
m_pConfig->addConfigValue("opengl:nvidia_anti_flicker", Hyprlang::INT{1});
m_pConfig->addConfigValue("opengl:force_introspection", Hyprlang::INT{1}); // TODO: remove this. I don't think it does us any good to disable intro.
- m_pConfig->addConfigValue("cursor:no_hardware_cursors", Hyprlang::INT{2});
+ m_pConfig->addConfigValue("cursor:no_hardware_cursors", Hyprlang::INT{0});
m_pConfig->addConfigValue("cursor:no_break_fs_vrr", Hyprlang::INT{0});
m_pConfig->addConfigValue("cursor:min_refresh_rate", Hyprlang::INT{24});
m_pConfig->addConfigValue("cursor:hotspot_padding", Hyprlang::INT{0});
@@ -589,7 +593,7 @@ CConfigManager::CConfigManager() {
m_pConfig->addConfigValue("cursor:sync_gsettings_theme", Hyprlang::INT{1});
m_pConfig->addConfigValue("cursor:hide_on_key_press", Hyprlang::INT{0});
m_pConfig->addConfigValue("cursor:hide_on_touch", Hyprlang::INT{1});
- m_pConfig->addConfigValue("cursor:use_cpu_buffer", Hyprlang::INT{0});
+ m_pConfig->addConfigValue("cursor:use_cpu_buffer", Hyprlang::INT{2});
m_pConfig->addConfigValue("cursor:warp_back_after_non_mouse_input", Hyprlang::INT{0});
m_pConfig->addConfigValue("autogenerated", Hyprlang::INT{0});
@@ -618,6 +622,10 @@ CConfigManager::CConfigManager() {
m_pConfig->addConfigValue("ecosystem:no_update_news", Hyprlang::INT{0});
+ m_pConfig->addConfigValue("experimental:wide_color_gamut", Hyprlang::INT{0});
+ m_pConfig->addConfigValue("experimental:hdr", Hyprlang::INT{0});
+ m_pConfig->addConfigValue("experimental:xx_color_management_v4", Hyprlang::INT{0});
+
// devices
m_pConfig->addSpecialCategory("device", {"name"});
m_pConfig->addSpecialConfigValue("device", "sensitivity", {0.F});
@@ -679,7 +687,6 @@ CConfigManager::CConfigManager() {
m_pConfig->commence();
- setDefaultAnimationVars();
resetHLConfig();
Debug::log(INFO,
@@ -778,76 +785,46 @@ void CConfigManager::reload() {
}
void CConfigManager::setDefaultAnimationVars() {
- if (isFirstLaunch) {
- INITANIMCFG("__internal_fadeCTM");
+ m_AnimationTree.createNode("__internal_fadeCTM");
+ m_AnimationTree.createNode("global");
- INITANIMCFG("global");
- INITANIMCFG("windows");
- INITANIMCFG("layers");
- INITANIMCFG("fade");
- INITANIMCFG("border");
- INITANIMCFG("borderangle");
+ // global
+ m_AnimationTree.createNode("windows", "global");
+ m_AnimationTree.createNode("layers", "global");
+ m_AnimationTree.createNode("fade", "global");
+ m_AnimationTree.createNode("border", "global");
+ m_AnimationTree.createNode("borderangle", "global");
+ m_AnimationTree.createNode("workspaces", "global");
- // windows
- INITANIMCFG("windowsIn");
- INITANIMCFG("windowsOut");
- INITANIMCFG("windowsMove");
+ // layer
+ m_AnimationTree.createNode("layersIn", "layers");
+ m_AnimationTree.createNode("layersOut", "layers");
- // layers
- INITANIMCFG("layersIn");
- INITANIMCFG("layersOut");
+ // windows
+ m_AnimationTree.createNode("windowsIn", "windows");
+ m_AnimationTree.createNode("windowsOut", "windows");
+ m_AnimationTree.createNode("windowsMove", "windows");
- // fade
- INITANIMCFG("fadeIn");
- INITANIMCFG("fadeOut");
- INITANIMCFG("fadeSwitch");
- INITANIMCFG("fadeShadow");
- INITANIMCFG("fadeDim");
+ // fade
+ m_AnimationTree.createNode("fadeIn", "fade");
+ m_AnimationTree.createNode("fadeOut", "fade");
+ m_AnimationTree.createNode("fadeSwitch", "fade");
+ m_AnimationTree.createNode("fadeShadow", "fade");
+ m_AnimationTree.createNode("fadeDim", "fade");
+ m_AnimationTree.createNode("fadeLayers", "fade");
+ m_AnimationTree.createNode("fadeLayersIn", "fadeLayers");
+ m_AnimationTree.createNode("fadeLayersOut", "fadeLayers");
- // border
+ // workspaces
+ m_AnimationTree.createNode("workspacesIn", "workspaces");
+ m_AnimationTree.createNode("workspacesOut", "workspaces");
+ m_AnimationTree.createNode("specialWorkspace", "workspaces");
+ m_AnimationTree.createNode("specialWorkspaceIn", "specialWorkspace");
+ m_AnimationTree.createNode("specialWorkspaceOut", "specialWorkspace");
- // workspaces
- INITANIMCFG("workspaces");
- INITANIMCFG("workspacesIn");
- INITANIMCFG("workspacesOut");
- INITANIMCFG("specialWorkspace");
- INITANIMCFG("specialWorkspaceIn");
- INITANIMCFG("specialWorkspaceOut");
- }
-
- // init the values
- animationConfig["global"] = {false, "default", "", 8.f, 1, &animationConfig["general"], nullptr};
-
- animationConfig["__internal_fadeCTM"] = {false, "linear", "", 5.F, 1, &animationConfig["__internal_fadeCTM"], nullptr};
-
- CREATEANIMCFG("windows", "global");
- CREATEANIMCFG("layers", "global");
- CREATEANIMCFG("fade", "global");
- CREATEANIMCFG("border", "global");
- CREATEANIMCFG("borderangle", "global");
- CREATEANIMCFG("workspaces", "global");
-
- CREATEANIMCFG("layersIn", "layers");
- CREATEANIMCFG("layersOut", "layers");
-
- CREATEANIMCFG("windowsIn", "windows");
- CREATEANIMCFG("windowsOut", "windows");
- CREATEANIMCFG("windowsMove", "windows");
-
- CREATEANIMCFG("fadeIn", "fade");
- CREATEANIMCFG("fadeOut", "fade");
- CREATEANIMCFG("fadeSwitch", "fade");
- CREATEANIMCFG("fadeShadow", "fade");
- CREATEANIMCFG("fadeDim", "fade");
- CREATEANIMCFG("fadeLayers", "fade");
- CREATEANIMCFG("fadeLayersIn", "fadeLayers");
- CREATEANIMCFG("fadeLayersOut", "fadeLayers");
-
- CREATEANIMCFG("workspacesIn", "workspaces");
- CREATEANIMCFG("workspacesOut", "workspaces");
- CREATEANIMCFG("specialWorkspace", "workspaces");
- CREATEANIMCFG("specialWorkspaceIn", "specialWorkspace");
- CREATEANIMCFG("specialWorkspaceOut", "specialWorkspace");
+ // init the root nodes
+ m_AnimationTree.setConfigForNode("global", 1, 8.f, "", "default");
+ m_AnimationTree.setConfigForNode("__internal_fadeCTM", 1, 5.f, "", "linear");
}
std::optional CConfigManager::resetHLConfig() {
@@ -855,6 +832,8 @@ std::optional CConfigManager::resetHLConfig() {
m_vWindowRules.clear();
g_pKeybindManager->clearKeybinds();
g_pAnimationManager->removeAllBeziers();
+ g_pAnimationManager->addBezierWithName("linear", Vector2D(0.0, 0.0), Vector2D(1.0, 1.0));
+
m_mAdditionalReservedAreas.clear();
m_dBlurLSNamespaces.clear();
m_vWorkspaceRules.clear();
@@ -1645,8 +1624,8 @@ void CConfigManager::ensureVRR(PHLMONITOR pMonitor) {
}
}
-SAnimationPropertyConfig* CConfigManager::getAnimationPropertyConfig(const std::string& name) {
- return &animationConfig[name];
+SP CConfigManager::getAnimationPropertyConfig(const std::string& name) {
+ return m_AnimationTree.getConfig(name);
}
void CConfigManager::addParseError(const std::string& err) {
@@ -1709,8 +1688,8 @@ ICustomConfigValueData::~ICustomConfigValueData() {
; // empty
}
-std::unordered_map CConfigManager::getAnimationConfig() {
- return animationConfig;
+const std::unordered_map>& CConfigManager::getAnimationConfig() {
+ return m_AnimationTree.getFullConfig();
}
void CConfigManager::addPluginConfigVar(HANDLE handle, const std::string& name, const Hyprlang::CConfigValue& value) {
@@ -2056,17 +2035,6 @@ std::optional CConfigManager::handleBezier(const std::string& comma
return {};
}
-void CConfigManager::setAnimForChildren(SAnimationPropertyConfig* const ANIM) {
- for (auto& [name, anim] : animationConfig) {
- if (anim.pParentAnimation == ANIM && !anim.overridden) {
- // if a child isnt overridden, set the values of the parent
- anim.pValues = ANIM->pValues;
-
- setAnimForChildren(&anim);
- }
- }
-};
-
std::optional CConfigManager::handleAnimation(const std::string& command, const std::string& args) {
const auto ARGS = CVarList(args);
@@ -2075,14 +2043,9 @@ std::optional CConfigManager::handleAnimation(const std::string& co
// anim name
const auto ANIMNAME = ARGS[0];
- const auto PANIM = animationConfig.find(ANIMNAME);
-
- if (PANIM == animationConfig.end())
+ if (!m_AnimationTree.nodeExists(ANIMNAME))
return "no such animation";
- PANIM->second.overridden = true;
- PANIM->second.pValues = &PANIM->second;
-
// This helper casts strings like "1", "true", "off", "yes"... to int.
int64_t enabledInt = configStringToInt(ARGS[1]).value_or(0) == 1;
@@ -2090,43 +2053,36 @@ std::optional CConfigManager::handleAnimation(const std::string& co
if (enabledInt != 0 && enabledInt != 1)
return "invalid animation on/off state";
- PANIM->second.internalEnabled = configStringToInt(ARGS[1]).value_or(0) == 1;
+ int64_t speed = -1;
- if (PANIM->second.internalEnabled) {
- // speed
- if (isNumber(ARGS[2], true)) {
- PANIM->second.internalSpeed = std::stof(ARGS[2]);
+ // speed
+ if (isNumber(ARGS[2], true)) {
+ speed = std::stof(ARGS[2]);
- if (PANIM->second.internalSpeed <= 0) {
- PANIM->second.internalSpeed = 1.f;
- return "invalid speed";
- }
- } else {
- PANIM->second.internalSpeed = 10.f;
+ if (speed <= 0) {
+ speed = 1.f;
return "invalid speed";
}
-
- // curve
- PANIM->second.internalBezier = ARGS[3];
-
- if (!g_pAnimationManager->bezierExists(ARGS[3])) {
- PANIM->second.internalBezier = "default";
- return "no such bezier";
- }
-
- // style
- PANIM->second.internalStyle = ARGS[4];
-
- if (ARGS[4] != "") {
- auto ERR = g_pAnimationManager->styleValidInConfigVar(ANIMNAME, ARGS[4]);
-
- if (ERR != "")
- return ERR;
- }
+ } else {
+ speed = 10.f;
+ return "invalid speed";
}
- // now, check for children, recursively
- setAnimForChildren(&PANIM->second);
+ std::string bezierName = ARGS[3];
+ m_AnimationTree.setConfigForNode(ANIMNAME, enabledInt, speed, ARGS[3], ARGS[4]);
+
+ if (!g_pAnimationManager->bezierExists(bezierName)) {
+ const auto PANIMNODE = m_AnimationTree.getConfig(ANIMNAME);
+ PANIMNODE->internalBezier = "default";
+ return "no such bezier";
+ }
+
+ if (ARGS[4] != "") {
+ auto ERR = g_pAnimationManager->styleValidInConfigVar(ANIMNAME, ARGS[4]);
+
+ if (ERR != "")
+ return ERR;
+ }
return {};
}
@@ -2785,7 +2741,7 @@ bool CConfigManager::shouldUseSoftwareCursors() {
switch (*PNOHW) {
case 0: return false;
case 1: return true;
- default: return g_pHyprRenderer->isNvidia();
+ default: break;
}
return true;
diff --git a/src/config/ConfigManager.hpp b/src/config/ConfigManager.hpp
index 0cd0a0a4..53772401 100644
--- a/src/config/ConfigManager.hpp
+++ b/src/config/ConfigManager.hpp
@@ -1,5 +1,6 @@
#pragma once
+#include
#define CONFIG_MANAGER_H
#include