summaryrefslogtreecommitdiff
path: root/extra/gnome-settings-daemon/git-fixes.patch
blob: a56033ce189f57361d74194367d8fb090ff24979 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
diff --git a/data/gnome-settings-daemon.desktop.in.in b/data/gnome-settings-daemon.desktop.in.in
index c5a5518..ff71eee 100644
--- a/data/gnome-settings-daemon.desktop.in.in
+++ b/data/gnome-settings-daemon.desktop.in.in
@@ -1,7 +1,7 @@
 [Desktop Entry]
 Type=Application
 _Name=GNOME Settings Daemon
-Exec=@libexecdir@/gnome-settings-daemon
+Exec=@libexecdir@/gnome-settings-daemon-localeexec
 OnlyShowIn=GNOME;
 NoDisplay=true
 X-GNOME-Autostart-Phase=Initialization
diff --git a/gnome-settings-daemon/Makefile.am b/gnome-settings-daemon/Makefile.am
index 194a7cc..94b3861 100644
--- a/gnome-settings-daemon/Makefile.am
+++ b/gnome-settings-daemon/Makefile.am
@@ -48,6 +48,15 @@ gsddir = $(libexecdir)
 gsd_PROGRAMS = \
 	gnome-settings-daemon
 
+gsd_SCRIPTS = \
+	gnome-settings-daemon-localeexec
+
+EXTRA_DIST = \
+	gnome-settings-daemon-localeexec.in
+
+gnome-settings-daemon-localeexec: gnome-settings-daemon-localeexec.in
+	$(AM_V_GEN) sed -e "s|\@libexecdir\@|$(libexecdir)|" -e "s|\@prefix\@|$(prefix)|"  $< > $@.tmp && mv $@.tmp $@
+
 apidir   = $(includedir)/gnome-settings-daemon-$(GSD_API_VERSION)/gnome-settings-daemon
 api_DATA = 				\
 	gnome-settings-plugin.h
diff --git a/gnome-settings-daemon/gnome-settings-daemon-localeexec.in b/gnome-settings-daemon/gnome-settings-daemon-localeexec.in
new file mode 100755
index 0000000..eed91a4
--- /dev/null
+++ b/gnome-settings-daemon/gnome-settings-daemon-localeexec.in
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+SETTING=$(gsettings get org.gnome.system.locale region)
+REGION=${SETTING#\'}
+REGION=${REGION%\'}
+
+if [ -n "$REGION" ]; then
+  export LC_TIME=$REGION
+  export LC_NUMERIC=$REGION
+  export LC_MONETARY=$REGION
+  export LC_MEASUREMENT=$REGION
+  export LC_PAPER=$REGION
+fi
+
+if [ -x @prefix@/bin/ibus-daemon ]; then
+  export QT_IM_MODULE=ibus
+  export XMODIFIERS=@im=ibus
+fi
+
+exec @libexecdir@/gnome-settings-daemon
diff --git a/gnome-settings-daemon/main.c b/gnome-settings-daemon/main.c
index 24c1598..16017df 100644
--- a/gnome-settings-daemon/main.c
+++ b/gnome-settings-daemon/main.c
@@ -279,37 +279,6 @@ set_legacy_ibus_env_vars (GDBusProxy *proxy)
 }
 #endif
 
-/* Keep synchronised with set_locale() and
- * set_legacy_ibus_env_vars() above */
-static void
-set_locale_env (void)
-{
-        GSettings *locale_settings;
-        gchar *region;
-
-        /* Set locale environment */
-        locale_settings = g_settings_new ("org.gnome.system.locale");
-        region = g_settings_get_string (locale_settings, "region");
-        if (region[0]) {
-                g_setenv ("LC_TIME", region, TRUE);
-                g_setenv ("LC_NUMERIC", region, TRUE);
-                g_setenv ("LC_MONETARY", region, TRUE);
-                g_setenv ("LC_MEASUREMENT", region, TRUE);
-                g_setenv ("LC_PAPER", region, TRUE);
-        }
-        g_free (region);
-        g_object_unref (locale_settings);
-
-#ifdef HAVE_IBUS
-        /* Set IBus legacy environment */
-        if (is_program_in_path ("ibus-daemon") &&
-            keyboard_plugin_is_enabled ()) {
-                g_setenv ("QT_IM_MODULE", "ibus", TRUE);
-                g_setenv ("XMODIFIERS", "@im=ibus", TRUE);
-        }
-#endif
-}
-
 static void
 register_with_gnome_session (GDBusProxy *proxy)
 {
@@ -499,8 +468,6 @@ main (int argc, char *argv[])
 
         g_log_set_default_handler (gsd_log_default_handler, NULL);
 
-        set_locale_env ();
-
         notify_init ("gnome-settings-daemon");
 
         bus_register ();
diff --git a/plugins/housekeeping/gsd-housekeeping-manager.c b/plugins/housekeeping/gsd-housekeeping-manager.c
index 45393ec..f51d520 100644
--- a/plugins/housekeeping/gsd-housekeeping-manager.c
+++ b/plugins/housekeeping/gsd-housekeeping-manager.c
@@ -372,12 +372,20 @@ gboolean
 gsd_housekeeping_manager_start (GsdHousekeepingManager *manager,
                                 GError                **error)
 {
+        gchar *dir;
+
         g_debug ("Starting housekeeping manager");
         gnome_settings_profile_start (NULL);
 
         /* Create ~/.local/ as early as possible */
         g_mkdir_with_parents(g_get_user_data_dir (), 0700);
 
+        /* Create ~/.local/share/applications/, see
+         * https://bugzilla.gnome.org/show_bug.cgi?id=703048 */
+        dir = g_build_filename (g_get_user_data_dir (), "applications", NULL);
+        g_mkdir (dir, 0700);
+        g_free (dir);
+
         gsd_ldsm_setup (FALSE);
 
         manager->priv->settings = g_settings_new (THUMB_PREFIX);
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index e6380bd..96da3d1 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -261,11 +261,12 @@ gsd_power_manager_error_quark (void)
 }
 
 static void
-notify_close_if_showing (NotifyNotification *notification)
+notify_close_if_showing (NotifyNotification **notification)
 {
-        if (notification == NULL)
+        if (*notification == NULL)
                 return;
-        notify_notification_close (notification, NULL);
+        notify_notification_close (*notification, NULL);
+        g_clear_object (notification);
 }
 
 typedef enum {
@@ -1214,7 +1215,7 @@ engine_ups_discharging (GsdPowerManager *manager, UpDevice *device)
         icon = gpm_upower_get_device_icon (device, TRUE);
 
         /* close any existing notification of this class */
-        notify_close_if_showing (manager->priv->notification_ups_discharging);
+        notify_close_if_showing (&manager->priv->notification_ups_discharging);
 
         /* create a new notification */
         create_notification (title, message->str,
@@ -1424,7 +1425,7 @@ engine_charge_low (GsdPowerManager *manager, UpDevice *device)
         icon = gpm_upower_get_device_icon (device, TRUE);
 
         /* close any existing notification of this class */
-        notify_close_if_showing (manager->priv->notification_low);
+        notify_close_if_showing (&manager->priv->notification_low);
 
         /* create a new notification */
         create_notification (title, message,
@@ -1597,7 +1598,7 @@ engine_charge_critical (GsdPowerManager *manager, UpDevice *device)
         icon = gpm_upower_get_device_icon (device, TRUE);
 
         /* close any existing notification of this class */
-        notify_close_if_showing (manager->priv->notification_low);
+        notify_close_if_showing (&manager->priv->notification_low);
 
         /* create a new notification */
         create_notification (title, message,
@@ -1735,7 +1736,7 @@ engine_charge_action (GsdPowerManager *manager, UpDevice *device)
         icon = gpm_upower_get_device_icon (device, TRUE);
 
         /* close any existing notification of this class */
-        notify_close_if_showing (manager->priv->notification_low);
+        notify_close_if_showing (&manager->priv->notification_low);
 
         /* create a new notification */
         create_notification (title, message,
@@ -1797,8 +1798,8 @@ engine_device_changed_cb (UpClient *client, UpDevice *device, GsdPowerManager *m
                 } else if (state == UP_DEVICE_STATE_FULLY_CHARGED ||
                            state == UP_DEVICE_STATE_CHARGING) {
                         g_debug ("fully charged or charging, hiding notifications if any");
-                        notify_close_if_showing (manager->priv->notification_low);
-                        notify_close_if_showing (manager->priv->notification_ups_discharging);
+                        notify_close_if_showing (&manager->priv->notification_low);
+                        notify_close_if_showing (&manager->priv->notification_ups_discharging);
                         main_battery_or_ups_low_changed (manager, FALSE);
                 }
 
@@ -2268,7 +2269,7 @@ up_client_changed_cb (UpClient *client, GsdPowerManager *manager)
         if (!up_client_get_on_battery (client)) {
             /* if we are playing a critical charge sound loop on AC, stop it */
             play_loop_stop (&manager->priv->critical_alert_timeout_id);
-            notify_close_if_showing (manager->priv->notification_low);
+            notify_close_if_showing (&manager->priv->notification_low);
             main_battery_or_ups_low_changed (manager, FALSE);
         }
 
@@ -2638,7 +2639,7 @@ idle_configure (GsdPowerManager *manager)
                                   &manager->priv->idle_dim_id);
                 clear_idle_watch (manager->priv->idle_monitor,
                                   &manager->priv->idle_sleep_warning_id);
-                notify_close_if_showing (manager->priv->notification_sleep_warning);
+                notify_close_if_showing (&manager->priv->notification_sleep_warning);
                 return;
         }
 
@@ -2705,7 +2706,7 @@ idle_configure (GsdPowerManager *manager)
         }
 
         if (manager->priv->idle_sleep_warning_id == 0)
-                notify_close_if_showing (manager->priv->notification_sleep_warning);
+                notify_close_if_showing (&manager->priv->notification_sleep_warning);
 
         /* set up dim callback for when the screen lock is not active,
          * but only if we actually want to dim. */
@@ -3038,7 +3039,7 @@ static void
 show_sleep_warning (GsdPowerManager *manager)
 {
         /* close any existing notification of this class */
-        notify_close_if_showing (manager->priv->notification_sleep_warning);
+        notify_close_if_showing (&manager->priv->notification_sleep_warning);
 
         /* create a new notification */
         switch (manager->priv->sleep_action_type) {
@@ -3109,7 +3110,7 @@ idle_became_active_cb (GnomeIdleMonitor *monitor,
         set_temporary_unidle_on_ac (manager, FALSE);
 
         /* close any existing notification about idleness */
-        notify_close_if_showing (manager->priv->notification_sleep_warning);
+        notify_close_if_showing (&manager->priv->notification_sleep_warning);
 
         idle_set_mode (manager, GSD_POWER_IDLE_MODE_NORMAL);
 }
@@ -3344,8 +3345,8 @@ handle_resume_actions (GsdPowerManager *manager)
 {
         /* close existing notifications on resume, the system power
          * state is probably different now */
-        notify_close_if_showing (manager->priv->notification_low);
-        notify_close_if_showing (manager->priv->notification_ups_discharging);
+        notify_close_if_showing (&manager->priv->notification_low);
+        notify_close_if_showing (&manager->priv->notification_ups_discharging);
         main_battery_or_ups_low_changed (manager, FALSE);
 
         /* ensure we turn the panel back on after resume */