Bug#613587: gnome-session doesn't start alternative window manager, uses always metacity

Thomas Richter richter at rus.uni-stuttgart.de
Tue Feb 15 21:43:11 UTC 2011

Package: gnome-session
Version: 2.30.2-3
Severity: normal
Tags: patch

*** Please type your report below this line ***

If an alternative window manager such as sawfish is selected, and the link
/etc/alternatives/x-window-manager is set accordingly to point to the 
window manager, the gnome session nevertheless runs metacity, regardless 
of where
the link points to.

The problem seems to be in /usr/bin/gnome-wm, which reads:

if [ -z "$WINDOW_MANAGER" ] ; then
   # Create a list of window manager we can handle, trying to only use the
   # compositing ones when it makes sense

   KNOWN_WM="metacity mutter sawfish"

   for wm in $KNOWN_WM; do
     if [ -x /usr/bin/"$wm" ]; then


# Look for the default window manager on the system

if [ -z "$WINDOW_MANAGER" ] ; then
   WINDOW_MANAGER=$(readlink /etc/alternatives/x-window-manager 2>/dev/null)

Basically, it first checks for all available window managers, picks the 
first, and *only
if none* of these window managers exist, the link is evaluated. This 
leaves the user
with whatever window manager is installed and found first in the list, 
but not with whatever
window manager is prefered and selected in the alternatives.

A better solution is to *first* check the link, check whether it is 
valid, and only
if it is not to select a default manager. That is, the order of the 
checks should be

-- System Information:
Debian Release: 6.0
   APT prefers oldstable
   APT policy: (500, 'oldstable'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux (SMP w/2 CPU cores)
Locale: LANG=de_DE.iso-8859-1, LC_CTYPE=de_DE (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/bash

Versions of packages gnome-session depends on:
ii  gnome-panel                  2.30.2-2    launcher and docking 
facility for
ii  gnome-session-bin            2.30.2-3    The GNOME Session Manager - 
ii  gnome-session-common         2.30.2-3    Common files for the GNOME 
ii  gnome-settings-daemon        2.30.2-2    daemon handling the GNOME 
di  metacity                     1:2.30.1-3  lightweight GTK+ window manager
ii  nautilus                     2.30.1-2    file manager and graphical 
shell f
ii  policykit-1-gnome            0.96-3      GNOME authentication agent 
for Pol
ii  sawfish                      1: a window manager for X11

Versions of packages gnome-session recommends:
ii  gnome-power-manager           2.32.0-2   power management tool for 
the GNOM

Versions of packages gnome-session suggests:
ii  desktop-base                  6.0.5      common files for the Debian 
ii  gnome-keyring                 2.30.3-5   GNOME keyring services 
(daemon and
ii  gnome-user-guide              2.30.1-1   GNOME user's guide

-- Configuration Files:
/etc/X11/Xsession.d/55gnome-session_gnomerc changed [not included]

-- no debconf information

More information about the pkg-gnome-maintainers mailing list