~ubuntu-branches/ubuntu/natty/gnome-desktop/natty

« back to all changes in this revision

Viewing changes to debian/patches/100_load_desired_settings.patch

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche, Chris Coulson, Didier Roche
  • Date: 2010-02-17 19:19:03 UTC
  • Revision ID: james.westby@ubuntu.com-20100217191903-76ooym9vs1lyev0j
Tags: 1:2.29.90-0ubuntu3
[ Chris Coulson ]
* debian/patches/100_load_desired_settings.patch:
  - Update to ensure that gnome_rr_config_apply_from_filename_with_time()
    always sets a GError when the call fails. Thanks to James Westby for
    contributing to this too (LP: #384439)

[ Didier Roche ]
* debian/patches/02_add_wallpaper_cache.patch:
  - keep maximum quality when saving the cached image in jpeg
  - support multimonitor: only clean wallpaper cache with same
    transformation and resolution
  - some refactoring, cleanage

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
diff -Nur -x '*.orig' -x '*~' gnome-desktop-2.27.91/libgnome-desktop/gnome-rr-config.c gnome-desktop-2.27.91.new/libgnome-desktop/gnome-rr-config.c
2
 
--- gnome-desktop-2.27.91/libgnome-desktop/gnome-rr-config.c    2009-08-20 04:13:53.000000000 +1000
3
 
+++ gnome-desktop-2.27.91.new/libgnome-desktop/gnome-rr-config.c        2009-08-27 10:49:56.000000000 +1000
 
1
diff -Nur -x '*.orig' -x '*~' gnome-desktop-2.29.90/libgnome-desktop/gnome-rr-config.c gnome-desktop-2.29.90.new/libgnome-desktop/gnome-rr-config.c
 
2
--- gnome-desktop-2.29.90/libgnome-desktop/gnome-rr-config.c    2009-10-30 11:23:56.000000000 +0000
 
3
+++ gnome-desktop-2.29.90.new/libgnome-desktop/gnome-rr-config.c        2010-02-15 00:01:14.463252030 +0000
4
4
@@ -41,6 +41,7 @@
5
5
 
6
6
 #define CONFIG_INTENDED_BASENAME "monitors.xml"
20
20
 typedef struct Parser Parser;
21
21
 
22
22
 /* Parser for monitor configurations */
23
 
@@ -410,6 +415,15 @@
 
23
@@ -410,6 +415,16 @@
24
24
        NULL, /* error */
25
25
     };
26
26
 
28
28
+       if (!g_file_test (filename, G_FILE_TEST_EXISTS))
29
29
+    {
30
30
+       result = NULL;
31
 
+       
 
31
+       g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_NOENT,
 
32
+                    "No such file: %s", filename);     
32
33
+       return result;
33
34
+    }
34
35
+
36
37
     parser->config_file_version = 0;
37
38
     parser->configurations = g_ptr_array_new ();
38
39
     parser->outputs = g_ptr_array_new ();
39
 
@@ -916,6 +930,65 @@
 
40
@@ -916,6 +931,65 @@
40
41
     return g_build_filename (g_get_user_config_dir (), CONFIG_INTENDED_BASENAME, NULL);
41
42
 }
42
43
 
102
103
 static const char *
103
104
 get_rotation_name (GnomeRRRotation r)
104
105
 {
105
 
@@ -1057,13 +1130,13 @@
 
106
@@ -1057,13 +1131,13 @@
106
107
 }
107
108
 
108
109
 
119
120
     gchar *backup_filename;
120
121
     gboolean result;
121
122
 
122
 
@@ -1073,7 +1146,7 @@
 
123
@@ -1073,7 +1147,7 @@
123
124
     output = g_string_new ("");
124
125
 
125
126
     backup_filename = gnome_rr_config_get_backup_filename ();
128
129
 
129
130
     configurations = configurations_read_from_file (intended_filename, NULL); /* NULL-GError */
130
131
     
131
 
@@ -1108,6 +1181,37 @@
 
132
@@ -1108,6 +1182,37 @@
132
133
     return result;
133
134
 }
134
135
 
166
167
 static GnomeRRConfig *
167
168
 gnome_rr_config_copy (GnomeRRConfig *config)
168
169
 {
169
 
@@ -1127,7 +1231,7 @@
 
170
@@ -1127,7 +1232,7 @@
170
171
 }
171
172
 
172
173
 static GnomeRRConfig *
175
176
 {
176
177
     GnomeRRConfig *current;
177
178
     GnomeRRConfig **configs;
178
 
@@ -1138,7 +1242,7 @@
 
179
@@ -1138,7 +1243,7 @@
179
180
     
180
181
     current = gnome_rr_config_new_current (screen);
181
182
     
184
185
 
185
186
     result = NULL;
186
187
     if (configs)
187
 
@@ -1154,9 +1258,11 @@
 
188
@@ -1154,10 +1259,53 @@
188
189
            }
189
190
        }
190
191
 
193
194
            g_set_error (error, GNOME_RR_ERROR, GNOME_RR_ERROR_NO_MATCHING_CONFIG,
194
195
                         _("none of the saved display configurations matched the active configuration"));
195
196
+       */
196
 
 
197
 
        configurations_free (configs);
198
 
     }
199
 
@@ -1166,6 +1272,47 @@
200
 
     return result;
201
 
 }
202
 
 
 
197
+
 
198
+       configurations_free (configs);
 
199
+    }
 
200
+
 
201
+    gnome_rr_config_free (current);
 
202
+    
 
203
+    return result;
 
204
+}
 
205
+
203
206
+
204
207
+static GnomeRRConfig *
205
208
+config_new_stored (GnomeRRScreen *screen, const char *filename, GError **error)
207
210
+    GnomeRRConfig *current;
208
211
+    GnomeRRConfig **configs;
209
212
+    GnomeRRConfig *result;
210
 
+
 
213
 
211
214
+    g_return_val_if_fail (screen != NULL, NULL);
212
215
+    g_return_val_if_fail (error == NULL || *error == NULL, NULL);
213
216
+    
233
236
+           g_set_error (error, GNOME_RR_ERROR, GNOME_RR_ERROR_NO_MATCHING_CONFIG,
234
237
+                        _("none of the saved display configurations matched the active configuration"));
235
238
+    */
236
 
+       configurations_free (configs);
237
 
+    }
238
 
+
239
 
+    gnome_rr_config_free (current);
240
 
+    
241
 
+    return result;
242
 
+}
243
 
+
244
 
 GnomeRRConfig *
245
 
 gnome_rr_config_new_stored (GnomeRRScreen *screen, GError **error)
246
 
 {
247
 
@@ -1191,6 +1338,65 @@
 
239
        configurations_free (configs);
 
240
     }
 
241
 
 
242
@@ -1191,6 +1339,65 @@
248
243
 }
249
244
 #endif
250
245
 
310
305
 gboolean
311
306
 gnome_rr_config_apply_with_time (GnomeRRConfig *config,
312
307
                                 GnomeRRScreen *screen,
313
 
@@ -1324,6 +1530,7 @@
 
308
@@ -1324,6 +1531,7 @@
314
309
 gnome_rr_config_apply_from_filename_with_time (GnomeRRScreen *screen, const char *filename, guint32 timestamp, GError **error)
315
310
 {
316
311
     GnomeRRConfig *stored;
318
313
     GError *my_error;
319
314
 
320
315
     g_return_val_if_fail (screen != NULL, FALSE);
321
 
@@ -1340,22 +1547,68 @@
 
316
@@ -1340,22 +1548,71 @@
322
317
            /* This means the screen didn't change, so just proceed */
323
318
     }
324
319
 
339
334
+    
340
335
+    /* If the desired file exists */
341
336
+    if ((g_file_test(desired_filename, G_FILE_TEST_EXISTS))) {
342
 
+        stored = gnome_rr_desired_config_new_stored (screen, error);
 
337
+        stored = gnome_rr_desired_config_new_stored (screen, NULL);
343
338
+        
344
339
+        /* If the desired file can't be applied */
345
340
+        if (!stored) {
379
374
+                /* Try to save the desired settings to the default
380
375
+                 * settings file
381
376
+                 */
382
 
+                error = NULL;
 
377
+                g_clear_error (error);
383
378
+                gnome_rr_config_sanitize (stored);
384
 
+                gnome_rr_config_save (stored, &error);
 
379
+                result = gnome_rr_config_save (stored, error);
385
380
+               }
386
381
+       
387
 
+       }
 
382
+       } else {
 
383
+               g_set_error (error, GNOME_RR_ERROR, GNOME_RR_ERROR_UNKNOWN,
 
384
+                               "X server does not support size requested");
 
385
+       }
388
386
+       
389
387
+       gnome_rr_config_free (stored);
390
388
+       
400
398
 }
401
399
 
402
400
 /*
403
 
diff -Nur -x '*.orig' -x '*~' gnome-desktop-2.27.91/libgnome-desktop/libgnomeui/gnome-rr-config.h gnome-desktop-2.27.91.new/libgnome-desktop/libgnomeui/gnome-rr-config.h
404
 
--- gnome-desktop-2.27.91/libgnome-desktop/libgnomeui/gnome-rr-config.h 2009-08-20 04:13:53.000000000 +1000
405
 
+++ gnome-desktop-2.27.91.new/libgnome-desktop/libgnomeui/gnome-rr-config.h     2009-08-27 10:49:56.000000000 +1000
 
401
diff -Nur -x '*.orig' -x '*~' gnome-desktop-2.29.90/libgnome-desktop/libgnomeui/gnome-rr-config.h gnome-desktop-2.29.90.new/libgnome-desktop/libgnomeui/gnome-rr-config.h
 
402
--- gnome-desktop-2.29.90/libgnome-desktop/libgnomeui/gnome-rr-config.h 2009-08-19 19:13:53.000000000 +0100
 
403
+++ gnome-desktop-2.29.90.new/libgnome-desktop/libgnomeui/gnome-rr-config.h     2010-02-14 23:58:02.013254194 +0000
406
404
@@ -123,6 +123,11 @@
407
405
 char *gnome_rr_config_get_backup_filename (void);
408
406
 char *gnome_rr_config_get_intended_filename (void);