1 --- lightdm-1.26.0/liblightdm-gobject/power.c 2018-06-01 20:51:13.240325293 +0000
2 +++ lightdm-1.26.0/liblightdm-gobject/power.c.new 2018-06-01 23:31:21.650022888 +0000
10 #include "lightdm/power.h"
11 @@ -116,6 +116,10 @@ ck_call_function (const gchar *function,
13 lightdm_get_can_suspend (void)
15 + /* It is not local X11 session */
16 + if (!getenv("XDG_VTNR"))
19 g_autoptr(GVariant) r = login1_call_function ("CanSuspend", NULL, NULL);
20 gboolean can_suspend = FALSE;
22 @@ -158,6 +158,10 @@ lightdm_get_can_suspend (void)
24 lightdm_suspend (GError **error)
26 + /* It is not local X11 session */
27 + if (!getenv("XDG_VTNR"))
30 g_autoptr(GError) login1_error = NULL;
31 g_autoptr(GVariant) login1_result = login1_call_function ("Suspend", g_variant_new("(b)", FALSE), &login1_error);
33 @@ -186,6 +186,10 @@ lightdm_suspend (GError **error)
35 lightdm_get_can_hibernate (void)
37 + /* It is not local X11 session */
38 + if (!getenv("XDG_VTNR"))
41 g_autoptr(GVariant) r = login1_call_function ("CanHibernate", NULL, NULL);
42 gboolean can_hibernate = FALSE;
44 @@ -228,6 +228,10 @@ lightdm_get_can_hibernate (void)
46 lightdm_hibernate (GError **error)
48 + /* It is not local X11 session */
49 + if (!getenv("XDG_VTNR"))
52 g_autoptr(GError) login1_error = NULL;
53 g_autoptr(GVariant) login1_result = login1_call_function ("Hibernate", g_variant_new("(b)", FALSE), &login1_error);
55 @@ -256,6 +256,10 @@ lightdm_hibernate (GError **error)
57 lightdm_get_can_restart (void)
59 + /* It is not local X11 session */
60 + if (!getenv("XDG_VTNR"))
63 g_autoptr(GVariant) r = login1_call_function ("CanReboot", NULL, NULL);
64 gboolean can_restart = FALSE;
66 @@ -288,6 +288,10 @@ lightdm_get_can_restart (void)
68 lightdm_restart (GError **error)
70 + /* It is not local X11 session */
71 + if (!getenv("XDG_VTNR"))
74 g_autoptr(GError) login1_error = NULL;
75 g_autoptr(GVariant) login1_result = login1_call_function ("Reboot", g_variant_new("(b)", FALSE), &login1_error);
77 @@ -307,6 +307,10 @@ lightdm_restart (GError **error)
79 lightdm_get_can_shutdown (void)
81 + /* It is not local X11 session */
82 + if (!getenv("XDG_VTNR"))
85 g_autoptr(GVariant) r = login1_call_function ("CanPowerOff", NULL, NULL);
86 gboolean can_shutdown = FALSE;
88 @@ -339,6 +339,10 @@ lightdm_get_can_shutdown (void)
90 lightdm_shutdown (GError **error)
92 + /* It is not local X11 session */
93 + if (!getenv("XDG_VTNR"))
96 g_autoptr(GError) login1_error = NULL;
97 g_autoptr(GVariant) login1_result = login1_call_function ("PowerOff", g_variant_new("(b)", FALSE), &login1_error);