summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
Diffstat (limited to 'data')
-rw-r--r--data/menu.xml7
-rw-r--r--data/openbox.desktop12
-rw-r--r--data/rc.xml8
-rw-r--r--data/xsession/openbox-gnome-session.in54
-rw-r--r--data/xsession/openbox-kde-session.in5
-rw-r--r--data/xsession/openbox-session.in9
6 files changed, 83 insertions, 12 deletions
diff --git a/data/menu.xml b/data/menu.xml
index 61fba664..39da04d6 100644
--- a/data/menu.xml
+++ b/data/menu.xml
@@ -369,11 +369,6 @@
<item label="Reconfigure Openbox">
<action name="Reconfigure" />
</item>
- <item label="Exit Openbox">
- <action name="Exit">
- <prompt>yes</prompt>
- </action>
- </item>
</menu>
<menu id="root-menu" label="Openbox 3">
@@ -390,7 +385,7 @@
<menu id="system-menu"/>
<separator />
<item label="Log Out">
- <action name="SessionLogout">
+ <action name="Exit">
<prompt>yes</prompt>
</action>
</item>
diff --git a/data/openbox.desktop b/data/openbox.desktop
new file mode 100644
index 00000000..9c19e67e
--- /dev/null
+++ b/data/openbox.desktop
@@ -0,0 +1,12 @@
+[Desktop Entry]
+Type=Application
+Encoding=UTF-8
+Name=Openbox
+Exec=openbox
+Icon=openbox
+NoDisplay=true
+# name we put on the WM spec check window
+X-GNOME-WMName=Openbox
+X-GNOME-Autostart-Phase=WindowManager
+X-GNOME-Provides=windowmanager
+X-GNOME-Autostart-Notify=true
diff --git a/data/rc.xml b/data/rc.xml
index f223f678..4e96305d 100644
--- a/data/rc.xml
+++ b/data/rc.xml
@@ -35,10 +35,16 @@
<center>yes</center>
<!-- whether to place windows in the center of the free area found or
the top left corner -->
- <monitor>Any</monitor>
+ <monitor>Active</monitor>
<!-- with Smart placement on a multi-monitor system, try to place new windows
on: 'Any' - any monitor, 'Mouse' - where the mouse is, 'Active' - where
the active window is -->
+ <primaryMonitor>1</primaryMonitor>
+ <!-- The monitor where Openbox should place popup dialogs such as the
+ focus cycling popup, or the desktop switch popup. It can be an index
+ from 1, specifying a particular monitor. Or it can be one of the
+ following: 'Mouse' - where the mouse is, or
+ 'Active' - where the active window is -->
</placement>
<theme>
diff --git a/data/xsession/openbox-gnome-session.in b/data/xsession/openbox-gnome-session.in
index 278ac6a8..de46bec5 100644
--- a/data/xsession/openbox-gnome-session.in
+++ b/data/xsession/openbox-gnome-session.in
@@ -7,6 +7,54 @@ if test -n "$1"; then
exit
fi
-# Run GNOME with Openbox as its window manager
-export WINDOW_MANAGER="@bindir@/openbox"
-exec gnome-session --choose-session=openbox-session "$@"
+# Clean up after GDM
+xprop -root -remove _NET_NUMBER_OF_DESKTOPS \
+ -remove _NET_DESKTOP_NAMES \
+ -remove _NET_CURRENT_DESKTOP 2> /dev/null
+
+VER=$(gnome-session --version 2>/dev/null | \
+ sed -e 's/[^0-9.]*\([0-9.]\+\)/\1/')
+
+MAJOR=$(echo $VER | cut -d . -f 1)
+MINOR=$(echo $VER | cut -d . -f 2)
+
+# run GNOME with Openbox as its window manager
+
+if test $MAJOR -lt 2 || (test $MAJOR = 2 && test $MINOR -le 22); then
+ # old gnome-session was easy to work with
+ export WINDOW_MANAGER="@bindir@/openbox"
+ exec gnome-session --choose-session=openbox-session "$@"
+else
+ # new gnome-session requires openbox to be set in gconf and an
+ # openbox.desktop to be installed in the applications directory
+
+ SPATH=/desktop/gnome/session
+
+ # get the current default session
+ SESSION=$(gconftool-2 -g $SPATH/default_session 2> /dev/null)
+
+ # make sure openbox is going to be run
+ if test -z "$SESSION"; then
+ # if its empty then just run openbox
+ SESSION="[openbox]"
+ elif test -z $(echo "$SESSION" | grep -q openbox); then
+ # if openbox isn't in the session then append it
+ SESSION="${SESSION%]},openbox]"
+ fi
+
+ # get the current GNOME/Openbox session
+ OB_SESSION=$(gconftool-2 -g $SPATH/openbox_session 2> /dev/null)
+
+ # update the GNOME/Openbox session if needed
+ if x$OB_SESSION != x$SESSION; then
+ # the default session changed or we didn't run GNOME/Openbox before
+ gconftool-2 -t list --list-type=strings -s $SPATH/openbox_session \
+ "$SESSION" 2> /dev/null
+ fi
+
+ # run GNOME/Openbox
+ exec gnome-session --default-session-key $SPATH/openbox_session "$@"
+fi
+
+
+
diff --git a/data/xsession/openbox-kde-session.in b/data/xsession/openbox-kde-session.in
index 16017260..5299b045 100644
--- a/data/xsession/openbox-kde-session.in
+++ b/data/xsession/openbox-kde-session.in
@@ -7,6 +7,11 @@ if test -n "$1"; then
exit
fi
+# Clean up after GDM
+xprop -root -remove _NET_NUMBER_OF_DESKTOPS \
+ -remove _NET_DESKTOP_NAMES \
+ -remove _NET_CURRENT_DESKTOP 2> /dev/null
+
# Run KDE with Openbox as its window manager
export KDEWM="@bindir@/openbox"
exec startkde "$@"
diff --git a/data/xsession/openbox-session.in b/data/xsession/openbox-session.in
index 259dc580..fa1bb996 100644
--- a/data/xsession/openbox-session.in
+++ b/data/xsession/openbox-session.in
@@ -7,13 +7,18 @@ if test -n "$1"; then
exit
fi
+# Clean up after GDM
+xprop -root -remove _NET_NUMBER_OF_DESKTOPS \
+ -remove _NET_DESKTOP_NAMES \
+ -remove _NET_CURRENT_DESKTOP 2> /dev/null
+
AUTOSTART="${XDG_CONFIG_HOME:-"$HOME/.config"}/openbox/autostart.sh"
GLOBALAUTOSTART="@configdir@/openbox/autostart.sh"
-if test -e $AUTOSTART; then
+if test -r $AUTOSTART; then
. $AUTOSTART
else
- if test -e $GLOBALAUTOSTART; then
+ if test -r $GLOBALAUTOSTART; then
. $GLOBALAUTOSTART
fi
fi