Bug 5022 - openbox-gnome-session is incompatible with gnome3
Status: RESOLVED FIXED
Alias: None
Product: Openbox
Classification: Unclassified
Component: general
Version: 3.4.11.2
Hardware: PC Linux
: P1 normal
Assignee: Dana Jansens
QA Contact:
URL:
Depends on:
Blocks:
 
Reported: 2011-05-30 14:46 EDT by Felix
Modified: 2011-10-07 09:40:39 EDT
1 user (show)

See Also:


Attachments
A piece of gnome-session --debug output (1.43 KB, text/plain)
2011-08-27 06:16 EDT, Eugene
gnome-session 3.0+ support (3.02 KB, patch)
2011-10-07 02:31 EDT, dynamotwain

Description Felix 2011-05-30 14:46:33 EDT
Hello,
the openbox-gnome-session script doesn't work with gnome3, specifically with gnome-session-3.0.2-1 that is shipped by archlinux/testing. The script fails because gnome-session doesn't accept the --default-session-key anymore. The new flag is gnome-session --session SESSION. 

It works with a /usr/share/gnome-session/sessions/openbox-test.session file with the following content: 

[GNOME Session]
Name=GNOME fallback with Openbox
RequiredComponents=gnome-panel;gnome-settings-daemon;
RequiredProviders=windowmanager;notifications;
DefaultProvider-windowmanager=openbox
DefaultProvider-notifications=notification-daemon

and the command gnome-session --session openbox-test.

Furthermore, gnome-session --version, which is used to determine how to launch, does return an empty line here, though it seems like this functionality should still be present upstream:line 308: http://git.gnome.org/browse/gnome-session/tree/gnome-session/main.c this is not fatal however, because it still triggers the else statement. Is this intended?

This is my first bug report. I would like to try fixing this bug, but I'm not entirely sure if can do so.
Comment 1 Eugene 2011-08-27 06:16:27 EDT
Created attachment 2952 [details]
A piece of gnome-session --debug output
Comment 2 Eugene 2011-08-27 06:16:43 EDT
For me `gnome-session --version` prints "gnome-session 3.0.2" like it should.

I came here to note that after an upgrade from 3.4.11 to 3.5.0 the proposed method stopped to work fine (of course, after the upgrade I re-edited openbox-gnome-session script as needed).  With 3.5.0 after logging in in GDM desktop background is shown and openbox starts (I can see its context menu after right-clicking the desktop), but for 10 seconds or so no other applications start (neither the panel nor applications from the saved session).  After the delay GNOME shows the ugly "something went wrong" window which forses you to log out.  If I run a program from the openbox context menu, the ugly window is shown right after the program's window appears.

I attached a piece of output of `gnome-session --debug`.  There you can see "WARNING: Application 'openbox.desktop' failed to register before timeout" message, which is printed right after the 10-second delay ends.  Seems that gnome-session wants openbox to do something, but openbox no longer does it in 3.5.0.

I intentionally didn't open a new bugreport, because I think it would be more convenient for developers if all gnome3-and-openbox stuff was in one place.
Comment 3 Dana Jansens 2011-08-30 11:45:20 EDT
I wonder what it is expecting to be registered.  I will have to dig into some gnome-session code I guess (urg).

Also will apply the change to use --session.
Comment 4 Dana Jansens 2011-08-30 12:13:01 EDT
Oh word, I found a nice email from Eugene on the Mailing list about this.  I will copy in here..

Question is... Does this fix the "registration" business with gs3?




---


Recently I figured out how to use Openbox in Gnome 3 Fallback Mode.
What you need to do:

- use Openbox/Gnome session
- modify /usr/bin/openbox-gnome-session script
- create openbox-gnome.desktop file

Details are given below.  Ideally, the updated openbox-gnome-session
script and new openbox-gnome.desktop file could go to upstream, so that
everything works out of the box.  Currently you can use the recipe by
editing the files by hand.  As a result, after logging in into
Openbox/Gnome session you will have Openbox running, with correct
number of workspaces.

Openbox-gnome-session script should be modified to work
with gnome-session version 3, like this:

 if test $MAJOR -lt 2 || (test $MAJOR = 2 && test $MINOR -le 22); then
   # old gnome-session was easy to work with
   export WINDOW_MANAGER="/usr/bin/openbox"
   exec gnome-session --choose-session=openbox-session "$@"
 elif test $MAJOR = 2; then
   # new gnome-session requires openbox to be set in gconf and an
   # openbox.desktop to be installed in the applications directory
   exec gnome-session --default-session-key /desktop/gnome/session/openbox_session "$@"
 else
   # gnome-session 3 requires openbox.desktop in the applications directory
   # and openbox-gnome.session file in gnome-session/sessions/
   exec gnome-session --session openbox-gnome
 fi

Use this code instead of the 'if' at the end of the existing code.
Ignore the modifications I made for myself in the second case of 'if'.
In case this chunk of code will loose formatting, <http://pastie.org/2288907>

The new openbox-gnome.session file should look like this:

 [GNOME Session]
 Name=GNOME/Openbox
 RequiredComponents=openbox;gnome-settings-daemon

This file can be placed in ~/.config/gnome-session/sessions/ or globally
in /usr/share/gnome-session/sessions/ (where gnome.session file is).
More information: man gnome-session.
Comment 5 Dana Jansens 2011-08-30 15:17:30 EDT
Ok registration problem still exists after these changes.
Comment 6 dynamotwain 2011-10-07 02:31:23 EDT
Created attachment 2992 [details]
gnome-session 3.0+ support

patch tested and found to work against gnome-session 3.2.

http://git.gnome.org/browse/gnome-session/tree/NEWS?id=3.2.0 doesn't mention any breaking .session changes since 2.91.92 so it should work against gnome-session 3.0 as well.
Comment 7 Dana Jansens 2011-10-07 09:28:12 EDT
awesome, looks good. thanks !
Comment 8 Dana Jansens 2011-10-07 09:40:39 EDT
I don't have gnome 3 to test this with so I will take your word for it. :) Committed to git.  Thanks for the code !