Commit a552be57 authored by Guido Gunther's avatar Guido Gunther Committed by Guido Gunther
Browse files

monitor-manager: move DBus setup into idle callback



This makes sure we expose the DBus interface past setting
up all the monitor related wayland protocol listeners
Signed-off-by: Guido Gunther's avatarGuido Günther <guido.gunther@puri.sm>
parent 9bcea526
......@@ -1001,16 +1001,10 @@ phosh_monitor_manager_get_property (GObject *object,
}
}
static void
phosh_monitor_manager_constructed (GObject *object)
{
PhoshMonitorManager *self = PHOSH_MONITOR_MANAGER (object);
PhoshWayland *wl = phosh_wayland_get_default();
GHashTableIter iter;
struct wl_output *wl_output;
struct zwlr_output_manager_v1 *zwlr_output_manager_v1;
G_OBJECT_CLASS (phosh_monitor_manager_parent_class)->constructed (object);
static gboolean
on_idle (PhoshMonitorManager *self)
{
self->dbus_name_id = g_bus_own_name (G_BUS_TYPE_SESSION,
"org.gnome.Mutter.DisplayConfig",
G_BUS_NAME_OWNER_FLAGS_ALLOW_REPLACEMENT |
......@@ -1020,6 +1014,20 @@ phosh_monitor_manager_constructed (GObject *object)
on_name_lost,
g_object_ref (self),
g_object_unref);
return FALSE;
}
static void
phosh_monitor_manager_constructed (GObject *object)
{
PhoshMonitorManager *self = PHOSH_MONITOR_MANAGER (object);
PhoshWayland *wl = phosh_wayland_get_default();
GHashTableIter iter;
struct wl_output *wl_output;
struct zwlr_output_manager_v1 *zwlr_output_manager_v1;
G_OBJECT_CLASS (phosh_monitor_manager_parent_class)->constructed (object);
g_signal_connect (self, "notify::power-save-mode",
G_CALLBACK (power_save_mode_changed_cb), NULL);
......@@ -1039,6 +1047,8 @@ phosh_monitor_manager_constructed (GObject *object)
zwlr_output_manager_v1_add_listener (zwlr_output_manager_v1,
&zwlr_output_manager_v1_listener,
self);
g_idle_add ((GSourceFunc) on_idle, self);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment