cursor-renderer/native: Invalidate state for output color state changes

When the output color state changes, we have to re-create the color
state transform. This is especially noticable when the luminance is
adjusted and the cursor is not affected.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3935
Fixes: a72ee3be0d ("cursor-renderer/native: Transform cursor sprite into output color state")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4315>
This commit is contained in:
Sebastian Wick 2025-03-03 16:43:57 +01:00 committed by Marge Bot
parent 603742d98c
commit ef21f2307e

View File

@ -139,6 +139,19 @@ get_cursor_stage_view (MetaStageView *view)
quark_cursor_stage_view);
}
static void
on_output_color_state_changed (MetaStageView *view,
gpointer user_data)
{
CursorStageView *cursor_stage_view;
cursor_stage_view = get_cursor_stage_view (view);
if (!cursor_stage_view)
return;
cursor_stage_view->is_hw_cursor_valid = FALSE;
}
static CursorStageView *
ensure_cursor_stage_view (MetaStageView *view)
{
@ -149,6 +162,12 @@ ensure_cursor_stage_view (MetaStageView *view)
{
cursor_stage_view = g_new0 (CursorStageView, 1);
cursor_stage_view->is_hw_cursor_valid = FALSE;
g_signal_connect (G_OBJECT (view),
"notify::output-color-state",
G_CALLBACK (on_output_color_state_changed),
NULL);
g_object_set_qdata_full (G_OBJECT (view),
quark_cursor_stage_view,
cursor_stage_view,