Hello community,
here is the log from the commit of package gnome-session
checked in at Wed Aug 2 12:41:19 CEST 2006.
--------
--- GNOME/gnome-session/gnome-session.changes 2006-06-16 16:46:07.000000000 +0200
+++ gnome-session/gnome-session.changes 2006-08-01 22:26:57.000000000 +0200
@@ -1,0 +2,7 @@
+Tue Aug 1 22:25:53 CEST 2006 - danw@suse.de
+
+- If the session explicitly specifies metacity or compiz, but
+ the "wrong" X server for that wm is running, switch back to
+ gnome-wm. #180506
+
+-------------------------------------------------------------------
New:
----
gnome-session-wm-switch.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ gnome-session.spec ++++++
--- /var/tmp/diff_new_pack.2ZwJBc/_old 2006-08-02 12:32:53.000000000 +0200
+++ /var/tmp/diff_new_pack.2ZwJBc/_new 2006-08-02 12:32:53.000000000 +0200
@@ -18,7 +18,7 @@
Group: System/GUI/GNOME
Autoreqprov: on
Version: 2.12.0
-Release: 118
+Release: 121
Summary: Session Tools for the GNOME 2.x Desktop
Source: gnome-session-%{version}.tar.bz2
Source1: gnome
@@ -49,6 +49,7 @@
Patch26: gnome-session-compiz.patch
Patch27: gnome-session-migrate-session-manual.patch
Patch28: gnome-session-compiz-replace.patch
+Patch29: gnome-session-wm-switch.patch
URL: http://www.gnome.org
BuildRoot: %{_tmppath}/%{name}-%{version}-build
PreReq: filesystem gconf2
@@ -98,6 +99,7 @@
%patch26
%patch27 -p1
%patch28
+%patch29
%endif
gnome-patch-translation-update
@@ -154,6 +156,10 @@
%dir /usr/share/xsessions
%changelog -n gnome-session
+* Tue Aug 01 2006 - danw@suse.de
+- If the session explicitly specifies metacity or compiz, but
+ the "wrong" X server for that wm is running, switch back to
+ gnome-wm. #180506
* Fri Jun 16 2006 - danw@suse.de
- Pass --replace to compiz and gnome-window-decorator in case the
copies run by gdm don't exit properly. #185296
++++++ gnome-session-wm-switch.patch ++++++
--- gnome-session/Makefile.am
+++ gnome-session/Makefile.am
@@ -28,7 +28,7 @@
-DDATADIR=\""$(datadir)"\" \
$(NULL)
-gnome_session_LDADD = $(X_LIBS) $(GNOME_SESSION_LIBS) $(LIBWRAP_LIBS) $(LIBNOTIFY_LIBS)
+gnome_session_LDADD = -lGL $(X_LIBS) $(GNOME_SESSION_LIBS) $(LIBWRAP_LIBS) $(LIBNOTIFY_LIBS)
gnome_session_save_LDADD = $(GNOME_SESSION_LIBS)
gnome_session_remove_LDADD = $(GNOME_SESSION_LIBS)
gnome_session_properties_LDADD = $(GNOME_SESSION_LIBS)
--- gnome-session/main.c
+++ gnome-session/main.c
@@ -43,12 +43,17 @@
#include
#include
+#include
+#include
+
#include "manager.h"
#include "ice.h"
#include "save.h"
#include "command.h"
#include "splash-widget.h"
#include "util.h"
+#include "prop.h"
+#include "session.h"
#include "gsm-sound.h"
#include "gsm-gsd.h"
#include "gsm-keyring.h"
@@ -268,6 +273,86 @@
default_keyring = g_strdup ("default");
}
+static void
+fix_wm (Session *session)
+{
+ GSList *cl, *p;
+ Client *client = NULL;
+ SmProp *prop = NULL;
+ const char *glxExtensions;
+
+ 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;
+ else if (!strcmp (prop->vals[0].value, "metacity") ||
+ !strcmp (prop->vals[0].value, "compiz"))
+ break;
+ }
+
+ if (!cl)
+ return;
+
+ glxExtensions = glXQueryServerString (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), 0, GLX_EXTENSIONS);
+ if (!glxExtensions || !strstr (glxExtensions, "GLX_EXT_texture_from_pixmap"))
+ {
+ /* Xorg */
+ if (!strcmp (prop->vals[0].value, "metacity"))
+ return;
+ }
+ else
+ {
+ /* Xgl */
+ if (!strcmp (prop->vals[0].value, "compiz"))
+ return;
+ }
+
+ /* At this point, either client is compiz and we're using Xorg, or
+ * client is metacity and we're using Xgl. Either way, replace it
+ * with gnome-wm.
+ */
+
+ 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);
+ prop->num_vals = 5;
+ prop->vals = malloc (5 * sizeof (SmPropValue));
+ prop->vals[0].value = strdup ("gnome-wm");
+ prop->vals[0].length = strlen (prop->vals[0].value);
+ prop->vals[1].value = strdup ("--default-wm");
+ prop->vals[1].length = strlen (prop->vals[1].value);
+ prop->vals[2].value = strdup ("gnome-wm");
+ prop->vals[2].length = strlen (prop->vals[2].value);
+ prop->vals[3].value = strdup ("--sm-client-id");
+ prop->vals[3].length = strlen (prop->vals[3].value);
+ prop->vals[4].value = strdup (client->id);
+ prop->vals[4].length = strlen (prop->vals[4].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[])
{
@@ -416,6 +501,7 @@
putenv (session_name_env);
the_session = read_session (session_name);
//g_free (session_name);
+ fix_wm (the_session);
gsm_sound_login ();
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...