1 --- lightdm-1.26.0/liblightdm-gobject/power.c 2018-06-02 09:37:42.900744191 +0000
2 +++ lightdm-1.26.0/liblightdm-gobject/power.c 2018-06-02 09:55:40.723462201 +0000
3 @@ -29,6 +29,8 @@ static GDBusProxy *upower_proxy = NULL;
4 static GDBusProxy *ck_proxy = NULL;
5 static GDBusProxy *login1_proxy = NULL;
7 +static GVariant * ck_call_function (const gchar *function, GVariant *parameters, GError **error);
10 upower_call_function (const gchar *function, GError **error)
12 @@ -121,7 +123,11 @@ lightdm_get_can_suspend (void)
13 if (!getenv("XDG_VTNR"))
17 + g_autoptr(GVariant) r = ck_call_function ("CanSuspend", NULL, NULL);
19 g_autoptr(GVariant) r = login1_call_function ("CanSuspend", NULL, NULL);
21 gboolean can_suspend = FALSE;
24 @@ -168,7 +174,11 @@ lightdm_suspend (GError **error)
27 g_autoptr(GError) login1_error = NULL;
29 + g_autoptr(GVariant) login1_result = ck_call_function ("Suspend", g_variant_new("(b)", FALSE), NULL);
31 g_autoptr(GVariant) login1_result = login1_call_function ("Suspend", g_variant_new("(b)", FALSE), &login1_error);
36 @@ -199,7 +209,11 @@ lightdm_get_can_hibernate (void)
37 if (!getenv("XDG_VTNR"))
41 + g_autoptr(GVariant) r = ck_call_function ("CanHibernate", NULL, NULL);
43 g_autoptr(GVariant) r = login1_call_function ("CanHibernate", NULL, NULL);
45 gboolean can_hibernate = FALSE;
48 @@ -246,7 +260,11 @@ lightdm_hibernate (GError **error)
51 g_autoptr(GError) login1_error = NULL;
53 + g_autoptr(GVariant) login1_result = ck_call_function ("Hibernate", g_variant_new("(b)", FALSE), NULL);
55 g_autoptr(GVariant) login1_result = login1_call_function ("Hibernate", g_variant_new("(b)", FALSE), &login1_error);
60 @@ -277,7 +295,11 @@ lightdm_get_can_restart (void)
61 if (!getenv("XDG_VTNR"))
65 + g_autoptr(GVariant) r = ck_call_function ("CanReboot", NULL, NULL);
67 g_autoptr(GVariant) r = login1_call_function ("CanReboot", NULL, NULL);
69 gboolean can_restart = FALSE;
72 @@ -314,7 +336,11 @@ lightdm_restart (GError **error)
75 g_autoptr(GError) login1_error = NULL;
77 + g_autoptr(GVariant) login1_result = ck_call_function ("Reboot", g_variant_new("(b)", FALSE), NULL);
79 g_autoptr(GVariant) login1_result = login1_call_function ("Reboot", g_variant_new("(b)", FALSE), &login1_error);
84 @@ -336,7 +362,11 @@ lightdm_get_can_shutdown (void)
85 if (!getenv("XDG_VTNR"))
89 + g_autoptr(GVariant) r = ck_call_function ("CanPowerOff", NULL, NULL);
91 g_autoptr(GVariant) r = login1_call_function ("CanPowerOff", NULL, NULL);
93 gboolean can_shutdown = FALSE;
96 @@ -373,7 +403,11 @@ lightdm_shutdown (GError **error)
99 g_autoptr(GError) login1_error = NULL;
101 + g_autoptr(GVariant) login1_result = ck_call_function ("PowerOff", g_variant_new("(b)", FALSE), NULL);
103 g_autoptr(GVariant) login1_result = login1_call_function ("PowerOff", g_variant_new("(b)", FALSE), &login1_error);