summaryrefslogtreecommitdiff
path: root/src/backends/meta-monitor-manager.c
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2018-04-16 10:54:08 +0200
committerJonas Ã…dahl <jadahl@gmail.com>2018-07-18 10:17:34 +0000
commit644a618fb15d90056107bc4e1fbd7397f17219a8 (patch)
treea3917b525189b7de129133b79dd5d1859b0e9e5d /src/backends/meta-monitor-manager.c
parent1e3ac3cf2c9325d29b846eca30143d0c7dc01f43 (diff)
downloadmutter-644a618fb15d90056107bc4e1fbd7397f17219a8.tar.gz
monitor-manager: Don't throw an error if UPower isn't running
Don't try to connect to a UpClient signal if creating the client failed, because UPower isn't running for example.
Diffstat (limited to 'src/backends/meta-monitor-manager.c')
-rw-r--r--src/backends/meta-monitor-manager.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/backends/meta-monitor-manager.c b/src/backends/meta-monitor-manager.c
index c2244743a..5c7eae8e9 100644
--- a/src/backends/meta-monitor-manager.c
+++ b/src/backends/meta-monitor-manager.c
@@ -733,8 +733,11 @@ meta_monitor_manager_constructed (GObject *object)
if (manager_class->is_lid_closed == meta_monitor_manager_real_is_lid_closed)
{
manager->up_client = up_client_new ();
- g_signal_connect_object (manager->up_client, "notify::lid-is-closed",
- G_CALLBACK (lid_is_closed_changed), manager, 0);
+ if (manager->up_client)
+ {
+ g_signal_connect_object (manager->up_client, "notify::lid-is-closed",
+ G_CALLBACK (lid_is_closed_changed), manager, 0);
+ }
}
g_signal_connect_object (manager, "notify::power-save-mode",