gnome-session/gnome-session-wm-switch.patch

46 lines
1.8 KiB
Diff
Raw Normal View History

--- gnome-session-2.23.4.1-pre/gnome-session/session.c 2008-06-17 08:24:45.000000000 -0500
+++ gnome-session-2.23.4.1-work/gnome-session/session.c 2008-07-20 22:32:00.000000000 -0500
@@ -347,6 +347,8 @@ append_legacy_session_apps (GsmSession *
{
GKeyFile *saved;
int num_clients, i;
+ gchar *compiz_enable_path;
+ gboolean compiz_enabled = FALSE;
saved = g_key_file_new ();
if (!g_key_file_load_from_file (saved, session_filename, 0, NULL))
@@ -356,12 +358,33 @@ append_legacy_session_apps (GsmSession *
return;
}
+ /* See if compiz is enabled; if it is, we have to replace legacy metacity/compiz
+ * entries with gnome-wm */
+ compiz_enable_path = g_build_filename (g_get_user_config_dir (), "compiz", "enable-compiz", NULL);
+ compiz_enabled = compiz_enable_path && g_file_test (compiz_enable_path, G_FILE_TEST_IS_REGULAR);
+ g_free (compiz_enable_path);
+
num_clients = g_key_file_get_integer (saved, "Default", "num_clients", NULL);
for (i = 0; i < num_clients; i++)
{
GsmApp *app = gsm_app_resumed_new_from_legacy_session (saved, i);
if (app)
+ {
+ GsmAppResumed *app_resumed = (GsmAppResumed *) app;
+
+ /* Maybe replace legacy metacity/compiz with gnome-wm */
+ if (app_resumed->restart_command &&
+ (((!strcmp (app_resumed->restart_command, "metacity") ||
+ !strcmp (app_resumed->restart_command, "/usr/bin/metacity")) && compiz_enabled) ||
+ (!strcmp (app_resumed->restart_command, "compiz") ||
+ !strcmp (app_resumed->restart_command, "/usr/bin/compiz"))))
+ {
+ g_free (app_resumed->restart_command);
+ app_resumed->restart_command = g_strdup ("gnome-wm");
+ }
+
append_app (session, app);
+ }
}
g_key_file_free (saved);