rust/cargo-c: update to 0.10.7+cargo-0.84.0
[oi-userland.git] / components / desktop / lightdm / patches / 19-disable-shutdown-buttons.patch
blob4f8f015eb3fae706c14ecc879fcd0cd549107dfa
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
3 @@ -11,6 +11,7 @@
4 #include <config.h>
6 #include <string.h>
7 +#include <stdlib.h>
8 #include <gio/gio.h>
10 #include "lightdm/power.h"
11 @@ -116,6 +116,10 @@ ck_call_function (const gchar *function,
12 gboolean
13 lightdm_get_can_suspend (void)
15 + /* It is not local X11 session */
16 + if (!getenv("XDG_VTNR"))
17 + return FALSE;
19 g_autoptr(GVariant) r = login1_call_function ("CanSuspend", NULL, NULL);
20 gboolean can_suspend = FALSE;
21 if (r)
22 @@ -158,6 +158,10 @@ lightdm_get_can_suspend (void)
23 gboolean
24 lightdm_suspend (GError **error)
26 + /* It is not local X11 session */
27 + if (!getenv("XDG_VTNR"))
28 + return FALSE;
30 g_autoptr(GError) login1_error = NULL;
31 g_autoptr(GVariant) login1_result = login1_call_function ("Suspend", g_variant_new("(b)", FALSE), &login1_error);
32 if (login1_result)
33 @@ -186,6 +186,10 @@ lightdm_suspend (GError **error)
34 gboolean
35 lightdm_get_can_hibernate (void)
37 + /* It is not local X11 session */
38 + if (!getenv("XDG_VTNR"))
39 + return FALSE;
41 g_autoptr(GVariant) r = login1_call_function ("CanHibernate", NULL, NULL);
42 gboolean can_hibernate = FALSE;
43 if (r)
44 @@ -228,6 +228,10 @@ lightdm_get_can_hibernate (void)
45 gboolean
46 lightdm_hibernate (GError **error)
48 + /* It is not local X11 session */
49 + if (!getenv("XDG_VTNR"))
50 + return FALSE;
52 g_autoptr(GError) login1_error = NULL;
53 g_autoptr(GVariant) login1_result = login1_call_function ("Hibernate", g_variant_new("(b)", FALSE), &login1_error);
54 if (login1_result)
55 @@ -256,6 +256,10 @@ lightdm_hibernate (GError **error)
56 gboolean
57 lightdm_get_can_restart (void)
59 + /* It is not local X11 session */
60 + if (!getenv("XDG_VTNR"))
61 + return FALSE;
63 g_autoptr(GVariant) r = login1_call_function ("CanReboot", NULL, NULL);
64 gboolean can_restart = FALSE;
65 if (r)
66 @@ -288,6 +288,10 @@ lightdm_get_can_restart (void)
67 gboolean
68 lightdm_restart (GError **error)
70 + /* It is not local X11 session */
71 + if (!getenv("XDG_VTNR"))
72 + return FALSE;
74 g_autoptr(GError) login1_error = NULL;
75 g_autoptr(GVariant) login1_result = login1_call_function ("Reboot", g_variant_new("(b)", FALSE), &login1_error);
76 if (login1_result)
77 @@ -307,6 +307,10 @@ lightdm_restart (GError **error)
78 gboolean
79 lightdm_get_can_shutdown (void)
81 + /* It is not local X11 session */
82 + if (!getenv("XDG_VTNR"))
83 + return FALSE;
85 g_autoptr(GVariant) r = login1_call_function ("CanPowerOff", NULL, NULL);
86 gboolean can_shutdown = FALSE;
87 if (r)
88 @@ -339,6 +339,10 @@ lightdm_get_can_shutdown (void)
89 gboolean
90 lightdm_shutdown (GError **error)
92 + /* It is not local X11 session */
93 + if (!getenv("XDG_VTNR"))
94 + return FALSE;
96 g_autoptr(GError) login1_error = NULL;
97 g_autoptr(GVariant) login1_result = login1_call_function ("PowerOff", g_variant_new("(b)", FALSE), &login1_error);
98 if (login1_result)