16810
|
1 |
diff -urN -x'*.orig' gnome-session-2.28.0/gnome-session/gsm-manager.c ../SUNWgnome-session-2.28.0.hacked/gnome-session-2.28.0/gnome-session/gsm-manager.c
|
|
2 |
--- gnome-session-2.28.0/gnome-session/gsm-manager.c 2009-10-19 16:38:47.843586847 +0100
|
16827
|
3 |
+++ ../SUNWgnome-session-2.28.0.hacked/gnome-session-2.28.0/gnome-session/gsm-manager.c 2009-10-21 11:07:57.284947656 +0100
|
|
4 |
@@ -3404,14 +3404,40 @@
|
16524
|
5 |
}
|
|
6 |
|
|
7 |
while ((name = g_dir_read_name (dir))) {
|
|
8 |
- char *desktop_file;
|
|
9 |
+ char *desktop_file;
|
|
10 |
+ char **provides;
|
|
11 |
+ GError *error=NULL;
|
|
12 |
+ gsize len;
|
|
13 |
+ EggDesktopFile *egg_df;
|
|
14 |
|
|
15 |
if (!g_str_has_suffix (name, ".desktop")) {
|
|
16 |
continue;
|
|
17 |
}
|
|
18 |
|
|
19 |
desktop_file = g_build_filename (path, name, NULL);
|
|
20 |
- gsm_manager_add_autostart_app (manager, desktop_file, NULL);
|
|
21 |
+ egg_df = egg_desktop_file_new ( desktop_file , &error);
|
|
22 |
+ if (egg_df == NULL) {
|
|
23 |
+ g_warning ("Could not parse desktop file %s: %s", desktop_file, error->message);
|
|
24 |
+ g_error_free (error);
|
16592
|
25 |
+ continue;
|
16524
|
26 |
+ }
|
16592
|
27 |
+ else {
|
|
28 |
+ error = NULL;
|
|
29 |
+ provides = NULL;
|
|
30 |
+ provides = egg_desktop_file_get_string_list (egg_df,
|
16524
|
31 |
+ GSM_AUTOSTART_APP_PROVIDES_KEY,
|
|
32 |
+ &len, &error);
|
16592
|
33 |
+ if (!provides) {
|
|
34 |
+ g_debug ("GsmManager: *** desktop file: %s doesnot have Provides key\n", desktop_file);
|
|
35 |
+ gsm_manager_add_autostart_app (manager, desktop_file, NULL);
|
|
36 |
+ }
|
|
37 |
+ else {
|
|
38 |
+ g_debug ("GsmManager: *** desktop file: %s provides %s\n", desktop_file, provides[0]);
|
|
39 |
+ gsm_manager_add_autostart_app (manager, desktop_file, provides[0]);
|
|
40 |
+ }
|
16524
|
41 |
+ g_strfreev (provides);
|
|
42 |
+ egg_desktop_file_free (egg_df);
|
|
43 |
+ }
|
|
44 |
g_free (desktop_file);
|
|
45 |
}
|
|
46 |
|
16810
|
47 |
diff -urN -x'*.orig' gnome-session-2.28.0/gnome-session/main.c ../SUNWgnome-session-2.28.0.hacked/gnome-session-2.28.0/gnome-session/main.c
|
|
48 |
--- gnome-session-2.28.0/gnome-session/main.c 2009-10-19 16:38:47.829824877 +0100
|
|
49 |
+++ ../SUNWgnome-session-2.28.0.hacked/gnome-session-2.28.0/gnome-session/main.c 2009-10-19 16:43:20.143550467 +0100
|
16524
|
50 |
@@ -210,7 +210,8 @@
|
|
51 |
}
|
|
52 |
|
|
53 |
static void
|
|
54 |
-append_required_apps (GsmManager *manager)
|
|
55 |
+append_required_apps (GsmManager *manager,
|
|
56 |
+ char **autostart_dirs)
|
|
57 |
{
|
|
58 |
GSList *required_components;
|
|
59 |
GSList *r;
|
|
60 |
@@ -247,7 +248,7 @@
|
|
61 |
if (default_provider != NULL) {
|
|
62 |
char *app_path;
|
|
63 |
|
|
64 |
- app_path = gsm_util_find_desktop_file_for_app_name (default_provider, NULL);
|
|
65 |
+ app_path = gsm_util_find_desktop_file_for_app_name (default_provider, autostart_dirs);
|
|
66 |
if (app_path != NULL) {
|
|
67 |
gsm_manager_add_autostart_app (manager, app_path, component);
|
|
68 |
} else {
|
|
69 |
@@ -308,7 +309,7 @@
|
|
70 |
/* We do this at the end in case a saved session contains an
|
|
71 |
* application that already provides one of the components. */
|
|
72 |
append_default_apps (manager, default_session_key, autostart_dirs);
|
|
73 |
- append_required_apps (manager);
|
|
74 |
+ append_required_apps (manager, autostart_dirs);
|
|
75 |
|
|
76 |
g_strfreev (autostart_dirs);
|
|
77 |
}
|