mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-07-21 14:52:04 +00:00
[client] wayland: harden native HDR colour state
Serialize asynchronous image-description state and publish compositor capabilities safely across the Wayland and render threads. Use the predefined Windows-scRGB description, query each output image description for its configured reference white, and reapply HDR when the surface moves to an output with different colour settings.
This commit is contained in:
@@ -76,6 +76,7 @@ static void wlSurfaceEnterHandler(void * data, struct wl_surface * surface, stru
|
||||
node->output = output;
|
||||
wl_list_insert(&wlWm.surfaceOutputs, &node->link);
|
||||
waylandWindowUpdateScale();
|
||||
waylandOutputUpdateHDRWhiteLevel();
|
||||
}
|
||||
|
||||
static void wlSurfaceLeaveHandler(void * data, struct wl_surface * surface, struct wl_output * output)
|
||||
@@ -85,9 +86,11 @@ static void wlSurfaceLeaveHandler(void * data, struct wl_surface * surface, stru
|
||||
if (node->output == output)
|
||||
{
|
||||
wl_list_remove(&node->link);
|
||||
free(node);
|
||||
break;
|
||||
}
|
||||
waylandWindowUpdateScale();
|
||||
waylandOutputUpdateHDRWhiteLevel();
|
||||
}
|
||||
|
||||
static const struct wl_surface_listener wlSurfaceListener = {
|
||||
@@ -169,6 +172,14 @@ bool waylandWindowInit(const char * title, const char * appId, bool fullscreen,
|
||||
|
||||
void waylandWindowFree(void)
|
||||
{
|
||||
struct SurfaceOutput * output;
|
||||
struct SurfaceOutput * temp;
|
||||
wl_list_for_each_safe(output, temp, &wlWm.surfaceOutputs, link)
|
||||
{
|
||||
wl_list_remove(&output->link);
|
||||
free(output);
|
||||
}
|
||||
|
||||
if (wlWm.fractionalScaleInterface)
|
||||
wp_fractional_scale_v1_destroy(wlWm.fractionalScaleInterface);
|
||||
if (wlWm.contentType)
|
||||
|
||||
Reference in New Issue
Block a user