1
0
Fork 0

backends: Let the color manager know about monitor changes earlier

This makes it possible to set monitor/output properties before the stage
views get re-created.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3904>
This commit is contained in:
Sebastian Wick 2024-07-16 19:53:09 +02:00
parent a539071548
commit 357e5c92f2
3 changed files with 8 additions and 8 deletions

View file

@ -53,6 +53,7 @@
#include <stdlib.h>
#include "backends/meta-barrier-private.h"
#include "backends/meta-color-manager-private.h"
#include "backends/meta-cursor-renderer.h"
#include "backends/meta-cursor-tracker-private.h"
#include "backends/meta-dbus-session-watcher.h"
@ -353,6 +354,9 @@ update_cursors (MetaBackend *backend)
void
meta_backend_monitors_changed (MetaBackend *backend)
{
MetaColorManager *color_manager = meta_backend_get_color_manager (backend);
meta_color_manager_monitors_changed (color_manager);
meta_backend_update_stage (backend);
update_cursors (backend);
}

View file

@ -28,6 +28,8 @@ struct _MetaColorManagerClass
GObjectClass parent_class;
};
void meta_color_manager_monitors_changed (MetaColorManager *color_manager);
CdClient * meta_color_manager_get_cd_client (MetaColorManager *color_manager);
META_EXPORT_TEST

View file

@ -258,9 +258,8 @@ update_device_properties (MetaColorManager *color_manager)
}
}
static void
on_monitors_changed (MetaMonitorManager *monitor_manager,
MetaColorManager *color_manager)
void
meta_color_manager_monitors_changed (MetaColorManager *color_manager)
{
update_devices (color_manager);
update_device_properties (color_manager);
@ -275,8 +274,6 @@ cd_client_connect_cb (GObject *source_object,
MetaColorManager *color_manager = META_COLOR_MANAGER (user_data);
MetaColorManagerPrivate *priv =
meta_color_manager_get_instance_private (color_manager);
MetaMonitorManager *monitor_manager =
meta_backend_get_monitor_manager (priv->backend);
g_autoptr (GError) error = NULL;
if (!cd_client_connect_finish (client, res, &error))
@ -295,9 +292,6 @@ cd_client_connect_cb (GObject *source_object,
priv->color_store = meta_color_store_new (color_manager);
update_devices (color_manager);
g_signal_connect (monitor_manager, "monitors-changed-internal",
G_CALLBACK (on_monitors_changed),
color_manager);
priv->is_ready = TRUE;
g_signal_emit (color_manager, signals[READY], 0);