rust/cargo-c: update to 0.10.7+cargo-0.84.0
[oi-userland.git] / components / desktop / lightdm / patches / 21-suspend-hibernate.patch
blobc203b75dd461840c3ad725df571bdc4b9c7969e5
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);
9 static GVariant *
10 upower_call_function (const gchar *function, GError **error)
12 @@ -121,7 +123,11 @@ lightdm_get_can_suspend (void)
13 if (!getenv("XDG_VTNR"))
14 return FALSE;
16 +#if defined(__sun)
17 + g_autoptr(GVariant) r = ck_call_function ("CanSuspend", NULL, NULL);
18 +#else
19 g_autoptr(GVariant) r = login1_call_function ("CanSuspend", NULL, NULL);
20 +#endif
21 gboolean can_suspend = FALSE;
22 if (r)
24 @@ -168,7 +174,11 @@ lightdm_suspend (GError **error)
25 return FALSE;
27 g_autoptr(GError) login1_error = NULL;
28 +#if defined(__sun)
29 + g_autoptr(GVariant) login1_result = ck_call_function ("Suspend", g_variant_new("(b)", FALSE), NULL);
30 +#else
31 g_autoptr(GVariant) login1_result = login1_call_function ("Suspend", g_variant_new("(b)", FALSE), &login1_error);
32 +#endif
33 if (login1_result)
34 return TRUE;
36 @@ -199,7 +209,11 @@ lightdm_get_can_hibernate (void)
37 if (!getenv("XDG_VTNR"))
38 return FALSE;
40 +#if defined(__sun)
41 + g_autoptr(GVariant) r = ck_call_function ("CanHibernate", NULL, NULL);
42 +#else
43 g_autoptr(GVariant) r = login1_call_function ("CanHibernate", NULL, NULL);
44 +#endif
45 gboolean can_hibernate = FALSE;
46 if (r)
48 @@ -246,7 +260,11 @@ lightdm_hibernate (GError **error)
49 return FALSE;
51 g_autoptr(GError) login1_error = NULL;
52 +#if defined(__sun)
53 + g_autoptr(GVariant) login1_result = ck_call_function ("Hibernate", g_variant_new("(b)", FALSE), NULL);
54 +#else
55 g_autoptr(GVariant) login1_result = login1_call_function ("Hibernate", g_variant_new("(b)", FALSE), &login1_error);
56 +#endif
57 if (login1_result)
58 return TRUE;
60 @@ -277,7 +295,11 @@ lightdm_get_can_restart (void)
61 if (!getenv("XDG_VTNR"))
62 return FALSE;
64 +#if defined(__sun)
65 + g_autoptr(GVariant) r = ck_call_function ("CanReboot", NULL, NULL);
66 +#else
67 g_autoptr(GVariant) r = login1_call_function ("CanReboot", NULL, NULL);
68 +#endif
69 gboolean can_restart = FALSE;
70 if (r)
72 @@ -314,7 +336,11 @@ lightdm_restart (GError **error)
73 return FALSE;
75 g_autoptr(GError) login1_error = NULL;
76 +#if defined(__sun)
77 + g_autoptr(GVariant) login1_result = ck_call_function ("Reboot", g_variant_new("(b)", FALSE), NULL);
78 +#else
79 g_autoptr(GVariant) login1_result = login1_call_function ("Reboot", g_variant_new("(b)", FALSE), &login1_error);
80 +#endif
81 if (login1_result)
82 return TRUE;
84 @@ -336,7 +362,11 @@ lightdm_get_can_shutdown (void)
85 if (!getenv("XDG_VTNR"))
86 return FALSE;
88 +#if defined(__sun)
89 + g_autoptr(GVariant) r = ck_call_function ("CanPowerOff", NULL, NULL);
90 +#else
91 g_autoptr(GVariant) r = login1_call_function ("CanPowerOff", NULL, NULL);
92 +#endif
93 gboolean can_shutdown = FALSE;
94 if (r)
96 @@ -373,7 +403,11 @@ lightdm_shutdown (GError **error)
97 return FALSE;
99 g_autoptr(GError) login1_error = NULL;
100 +#if defined(__sun)
101 + g_autoptr(GVariant) login1_result = ck_call_function ("PowerOff", g_variant_new("(b)", FALSE), NULL);
102 +#else
103 g_autoptr(GVariant) login1_result = login1_call_function ("PowerOff", g_variant_new("(b)", FALSE), &login1_error);
104 +#endif
105 if (login1_result)
106 return TRUE;