wayland: Actually sync the colorstate with the compositor

This commit is contained in:
Benjamin Otte 2024-07-27 06:59:34 +02:00
parent 514dbcacd4
commit adedb89779
2 changed files with 22 additions and 1 deletions

View File

@ -48,6 +48,7 @@ struct _GdkWaylandSurface
GdkWaylandPresentationTime *presentation_time;
unsigned int color_state_changed : 1;
unsigned int initial_configure_received : 1;
unsigned int has_uncommitted_ack_configure : 1;
unsigned int has_pending_subsurface_commits : 1;

View File

@ -772,6 +772,20 @@ gdk_wayland_surface_sync_viewport (GdkSurface *surface)
self->viewport_dirty = FALSE;
}
static void
gdk_wayland_surface_sync_color_state (GdkSurface *surface)
{
GdkWaylandSurface *self = GDK_WAYLAND_SURFACE (surface);
if (!self->color_state_changed)
return;
gdk_wayland_color_surface_set_color_state (self->display_server.color,
gdk_surface_get_color_state (surface));
self->color_state_changed = FALSE;
}
void
gdk_wayland_surface_sync (GdkSurface *surface)
{
@ -779,6 +793,7 @@ gdk_wayland_surface_sync (GdkSurface *surface)
gdk_wayland_surface_sync_opaque_region (surface);
gdk_wayland_surface_sync_input_region (surface);
gdk_wayland_surface_sync_buffer_scale (surface);
gdk_wayland_surface_sync_color_state (surface);
gdk_wayland_surface_sync_viewport (surface);
}
@ -791,6 +806,7 @@ gdk_wayland_surface_needs_commit (GdkSurface *surface)
self->opaque_region_dirty ||
self->input_region_dirty ||
self->buffer_scale_dirty ||
self->color_state_changed ||
self->viewport_dirty;
}
@ -910,7 +926,11 @@ preferred_changed (GdkWaylandColorSurface *color,
GdkColorState *color_state,
gpointer data)
{
gdk_surface_set_color_state (GDK_SURFACE (data), color_state);
GdkWaylandSurface *self = GDK_WAYLAND_SURFACE (data);
gdk_surface_set_color_state (GDK_SURFACE (self), color_state);
self->color_state_changed = TRUE;
}
static void