2008-05-13 15:57:30 +02:00
|
|
|
diff -aurp gnome-session-2.22.1.1/gnome-session/main.c gnome-session-2.22.1.1-patched/gnome-session/main.c
|
2008-04-21 18:43:54 +02:00
|
|
|
--- gnome-session-2.22.1.1/gnome-session/main.c 2008-04-10 16:32:20.000000000 +0200
|
2008-05-13 15:57:30 +02:00
|
|
|
+++ gnome-session-2.22.1.1-patched/gnome-session/main.c 2008-05-13 10:56:24.000221000 +0200
|
|
|
|
@@ -47,6 +47,8 @@
|
2006-12-27 12:49:58 +01:00
|
|
|
#include "command.h"
|
|
|
|
#include "splash-widget.h"
|
|
|
|
#include "util.h"
|
|
|
|
+#include "prop.h"
|
|
|
|
+#include "session.h"
|
2007-03-12 01:55:48 +01:00
|
|
|
#include "gsm-dbus.h"
|
2006-12-27 12:49:58 +01:00
|
|
|
#include "gsm-sound.h"
|
|
|
|
#include "gsm-gsd.h"
|
2008-05-13 15:57:30 +02:00
|
|
|
@@ -600,6 +602,71 @@ gsm_shutdown_gconfd (void)
|
2007-03-12 01:55:48 +01:00
|
|
|
g_free (command);
|
2006-12-27 12:49:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
+static void
|
|
|
|
+fix_wm (Session *session)
|
|
|
|
+{
|
|
|
|
+ GSList *cl, *p;
|
|
|
|
+ Client *client = NULL;
|
|
|
|
+ SmProp *prop = NULL;
|
2008-05-13 15:57:30 +02:00
|
|
|
+ char *compiz_enable_path;
|
|
|
|
+ gboolean compiz_enabled = FALSE;
|
|
|
|
+
|
|
|
|
+ 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);
|
2006-12-27 12:49:58 +01:00
|
|
|
+
|
|
|
|
+ for (cl = session->client_list; cl; cl = cl->next)
|
|
|
|
+ {
|
|
|
|
+ client = cl->data;
|
|
|
|
+ if (client->match_rule != MATCH_ID)
|
|
|
|
+ continue;
|
|
|
|
+
|
|
|
|
+ prop = find_property_by_name (client, SmRestartCommand);
|
|
|
|
+ if (!prop)
|
|
|
|
+ continue;
|
|
|
|
+
|
|
|
|
+ if (!strcmp (prop->vals[0].value, "gnome-wm"))
|
|
|
|
+ return;
|
2008-05-13 15:57:30 +02:00
|
|
|
+ else if (((!strcmp (prop->vals[0].value, "metacity") || !strcmp (prop->vals[0].value, "/usr/bin/metacity")) && compiz_enabled) ||
|
|
|
|
+ (!strcmp (prop->vals[0].value, "compiz") || !strcmp (prop->vals[0].value, "/usr/bin/compiz")))
|
2006-12-27 12:49:58 +01:00
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (!cl)
|
|
|
|
+ return;
|
|
|
|
+
|
2008-05-13 15:57:30 +02:00
|
|
|
+ /* At this point, either client is compiz or client is metacity and we're
|
|
|
|
+ * supposed to run compiz-manager. Either way, replace it with gnome-wm. */
|
2006-12-27 12:49:58 +01:00
|
|
|
+
|
|
|
|
+ for (p = client->properties; p; p = p->next)
|
|
|
|
+ SmFreeProperty (p->data);
|
|
|
|
+ g_slist_free (client->properties);
|
|
|
|
+
|
|
|
|
+ client->properties = NULL;
|
|
|
|
+
|
|
|
|
+ prop = malloc (sizeof (SmProp));
|
|
|
|
+ prop->name = strdup (SmRestartCommand);
|
|
|
|
+ prop->type = strdup (SmLISTofARRAY8);
|
2008-05-13 15:57:30 +02:00
|
|
|
+ prop->num_vals = 3;
|
|
|
|
+ prop->vals = malloc (3 * sizeof (SmPropValue));
|
2006-12-27 12:49:58 +01:00
|
|
|
+ prop->vals[0].value = strdup ("gnome-wm");
|
|
|
|
+ prop->vals[0].length = strlen (prop->vals[0].value);
|
2008-05-13 15:57:30 +02:00
|
|
|
+ prop->vals[1].value = strdup ("--sm-client-id");
|
2006-12-27 12:49:58 +01:00
|
|
|
+ prop->vals[1].length = strlen (prop->vals[1].value);
|
2008-05-13 15:57:30 +02:00
|
|
|
+ prop->vals[2].value = strdup (client->id);
|
2006-12-27 12:49:58 +01:00
|
|
|
+ prop->vals[2].length = strlen (prop->vals[2].value);
|
|
|
|
+ client->properties = g_slist_prepend (client->properties, prop);
|
|
|
|
+
|
|
|
|
+ prop = malloc (sizeof (SmProp));
|
|
|
|
+ prop->name = strdup (GsmPriority);
|
|
|
|
+ prop->type = strdup (SmCARD8);
|
|
|
|
+ prop->num_vals = 1;
|
|
|
|
+ prop->vals = malloc (sizeof (SmPropValue));
|
|
|
|
+ prop->vals[0].value = calloc (2, 1);
|
|
|
|
+ prop->vals[0].length = 1;
|
|
|
|
+ client->properties = g_slist_prepend (client->properties, prop);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
int
|
|
|
|
main (int argc, char *argv[])
|
|
|
|
{
|
2008-05-13 15:57:30 +02:00
|
|
|
@@ -777,6 +844,8 @@ main (int argc, char *argv[])
|
2008-04-21 18:43:54 +02:00
|
|
|
g_setenv ("GNOME_DESKTOP_SESSION_ID", session_name, TRUE);
|
2006-12-27 12:49:58 +01:00
|
|
|
the_session = read_session (session_name);
|
|
|
|
|
|
|
|
+ fix_wm (the_session);
|
|
|
|
+
|
|
|
|
gsm_remote_desktop_start ();
|
2008-04-21 18:43:54 +02:00
|
|
|
|
|
|
|
if (splashing)
|