merge r6533-6557 from trunk
authorDana Jansens <danakj@orodu.net>
Tue, 15 May 2007 15:20:56 +0000 (15:20 +0000)
committerDana Jansens <danakj@orodu.net>
Tue, 15 May 2007 15:20:56 +0000 (15:20 +0000)
30 files changed:
Makefile.am
data/autostart.sh [new file with mode: 0644]
data/gnome-wm-properties/openbox.desktop
data/rc-gnome.xml [deleted file]
data/rc-kde.xml [deleted file]
data/xsession/openbox-gnome-session.in
data/xsession/openbox-gnome.desktop.in [moved from data/xsession/openbox-gnome.desktop with 83% similarity]
data/xsession/openbox-kde-session.in
data/xsession/openbox-kde.desktop.in [moved from data/xsession/openbox-kde.desktop with 83% similarity]
data/xsession/openbox-session.in [new file with mode: 0644]
data/xsession/openbox.desktop.in [moved from data/xsession/openbox.desktop with 70% similarity]
doc/openbox-gnome-session.1
doc/openbox-gnome-session.1.sgml
doc/openbox-kde-session.1
doc/openbox-kde-session.1.sgml
doc/openbox-session.1.sgml [new file with mode: 0644]
doc/openbox.1.in [deleted file]
doc/openbox.1.sgml
openbox/action.c
openbox/action.h
openbox/client.c
openbox/client.h
openbox/event.c
openbox/focus.c
openbox/keyboard.c
openbox/moveresize.c
openbox/openbox.c
openbox/screen.c
openbox/screen.h
openbox/stacking.h

index 8b9f2fb505b7294fa69b38f7afec8c8500bb857f..75b206dc36b0574f8f4aa2efca67aed9e4d8a035 100644 (file)
@@ -31,7 +31,8 @@ bin_PROGRAMS = \
        openbox/openbox \
        tools/gnome-panel-control/gnome-panel-control
 
-bin_SCRIPTS = \
+nodist_bin_SCRIPTS = \
+       data/xsession/openbox-session \
        data/xsession/openbox-gnome-session \
        data/xsession/openbox-kde-session
 
@@ -341,9 +342,8 @@ dist_pixmap_DATA = \
        data/openbox.png
 
 dist_rc_DATA = \
+       data/autostart.sh \
        data/rc.xml \
-       data/rc-gnome.xml \
-       data/rc-kde.xml \
        data/menu.xml
 
 edit = $(SED) \
@@ -351,6 +351,27 @@ edit = $(SED) \
        -e 's!@configdir\@!$(configdir)!' \
        -e 's!@bindir\@!$(bindir)!'
 
+data/xsession/openbox-gnome.desktop: \
+               $(srcdir)/data/xsession/openbox-gnome.desktop.in
+       @echo make: creating $@
+       @mkdir data 2>/dev/null || true
+       @mkdir data/xsession 2>/dev/null || true
+       @$(edit) $< >$@
+
+data/xsession/openbox-kde.desktop: \
+               $(srcdir)/data/xsession/openbox-kde.desktop.in
+       @echo make: creating $@
+       @mkdir data 2>/dev/null || true
+       @mkdir data/xsession 2>/dev/null || true
+       @$(edit) $< >$@
+
+data/xsession/openbox.desktop: \
+               $(srcdir)/data/xsession/openbox.desktop.in
+       @echo make: creating $@
+       @mkdir data 2>/dev/null || true
+       @mkdir data/xsession 2>/dev/null || true
+       @$(edit) $< >$@
+
 data/xsession/openbox-gnome-session: \
                $(srcdir)/data/xsession/openbox-gnome-session.in
        @echo make: creating $@
@@ -367,49 +388,56 @@ data/xsession/openbox-kde-session: \
        @$(edit) $< >$@
        @chmod a+x $@
 
-doc/openbox.1.in: $(srcdir)/doc/openbox.1.sgml
+data/xsession/openbox-session: \
+               $(srcdir)/data/xsession/openbox-session.in
+       @echo make: creating $@
+       @mkdir data 2>/dev/null || true
+       @mkdir data/xsession 2>/dev/null || true
+       @$(edit) $< >$@
+       @chmod a+x $@
+
+doc/openbox.1: $(srcdir)/doc/openbox.1.sgml
        @echo make: creating $@
        @mkdir doc 2>/dev/null || true
-       @docbook-to-man $< > $@
+       @$(edit) $< | docbook-to-man - >$@
 
-doc/openbox.1: doc/openbox.1.in
+doc/openbox-session.1: $(srcdir)/doc/openbox-session.1.sgml
        @echo make: creating $@
        @mkdir doc 2>/dev/null || true
-       @$(edit) $< >$@
+       @$(edit) $< | docbook-to-man - >$@
 
 doc/openbox-gnome-session.1: $(srcdir)/doc/openbox-gnome-session.1.sgml
        @echo make: creating $@
        @mkdir doc 2>/dev/null || true
-       @docbook-to-man $< > $@
+       @$(edit) $< | docbook-to-man - >$@
 
 doc/openbox-kde-session.1: $(srcdir)/doc/openbox-kde-session.1.sgml
        @echo make: creating $@
        @mkdir doc 2>/dev/null || true
-       @docbook-to-man $< > $@
+       @$(edit) $< | docbook-to-man - >$@
 
 dist_gnomewmfiles_DATA = \
        data/gnome-wm-properties/openbox.desktop
 
-dist_xsessions_DATA = \
+nodist_xsessions_DATA = \
        data/xsession/openbox.desktop \
        data/xsession/openbox-gnome.desktop \
        data/xsession/openbox-kde.desktop
 
 dist_noinst_DATA = \
-       debian/changelog.in \
-       debian/compat \
-       debian/conffiles \
-       debian/control \
-       debian/copyright \
-       debian/menu \
-       debian/postinst \
-       debian/postrm \
-       debian/rules \
        version.h.in \
        data/rc.xsd \
        data/menu.xsd \
+       data/xsession/openbox.desktop.in \
+       data/xsession/openbox-gnome.desktop.in \
+       data/xsession/openbox-kde.desktop.in \
+       data/xsession/openbox-session.in \
        data/xsession/openbox-gnome-session.in \
        data/xsession/openbox-kde-session.in \
+       doc/openbox.1.sgml \
+       doc/openbox-session.1.sgml \
+       doc/openbox-gnome-session.1.sgml \
+       doc/openbox-kde-session.1.sgml \
        render/obrender-3.0.pc.in \
        parser/obparser-3.0.pc.in \
        tools/themeupdate/themeupdate.py \
@@ -434,20 +462,30 @@ dist_doc_DATA = \
        COMPLIANCE \
        README \
        AUTHORS \
+       CHANGELOG \
+       COPYING \
        data/rc.xsd \
        data/menu.xsd \
        doc/rc-mouse-focus.xml
 
 dist_man_MANS = \
        doc/openbox.1 \
+       doc/openbox-session.1 \
        doc/openbox-gnome-session.1 \
        doc/openbox-kde-session.1
 
 EXTRA_DIST = \
+       debian/changelog.in \
+       debian/compat \
+       debian/conffiles \
+       debian/control \
+       debian/copyright \
+       debian/menu \
+       debian/postinst \
+       debian/postrm \
+       debian/rules \
        config.rpath \
-       mkinstalldirs \
-       CHANGELOG \
-       COPYING
+       mkinstalldirs
 
 #doc:
 #       $(MAKE) -$(MAKEFLAGS) -C doc/doxygen doc
diff --git a/data/autostart.sh b/data/autostart.sh
new file mode 100644 (file)
index 0000000..962cae0
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+# Set a background color
+BG=""
+if which hsetroot >/dev/null; then
+    BG=hsetroot
+else
+    if which esetroot >/dev/null; then
+       BG=esetroot
+    else
+       if which xsetroot >/dev/null; then
+           BG=xsetroot
+       fi
+    fi
+fi
+test -z $BG || $BG -solid "#303030"
+
+# D-bus
+if which dbus-launch >/dev/null && test -z "$DBUS_SESSION_BUS_ADDRESS"; then
+       eval `dbus-launch --sh-syntax --exit-with-session`
+fi
+
+# Make GTK apps look and behave how they were set up in the gnome config tools
+if which gnome-settings-daemon >/dev/null; then
+  gnome-settings-daemon &
+fi
+
+# Preload stuff for KDE apps
+if which start_kdeinit >/dev/null; then
+  LD_BIND_NOW=true start_kdeinit --new-startup +kcminit_startup &
+fi
index 96418613767b2151f9861825d71fb218c9b2f06f..eee0dd60a0ad5e55339d97803c58551092478aaf 100644 (file)
@@ -3,7 +3,7 @@ Name=Openbox
 Exec=openbox
 
 # name we put on the WM spec check window
-X-GNOME-WMName=openbox
+X-GNOME-WMName=Openbox
 
 # our config tool
 ConfigExec=obconf
diff --git a/data/rc-gnome.xml b/data/rc-gnome.xml
deleted file mode 100644 (file)
index 20b20c5..0000000
+++ /dev/null
@@ -1,546 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- Do not edit this file, it will be overwritten on install.
-        Copy the file to $HOME/.config/openbox/ instead. -->
-
-<openbox_config xmlns="http://openbox.org/4.0/rc">
-
-<resistance>
-  <strength>10</strength>
-  <screen_edge_strength>20</screen_edge_strength>
-</resistance>
-
-<focus>
-  <focusNew>yes</focusNew>
-  <focusLast>yes</focusLast>
-  <followMouse>no</followMouse>
-  <focusDelay>200</focusDelay>
-  <raiseOnFocus>no</raiseOnFocus>
-</focus>
-
-<placement>
-  <policy>Smart</policy>
-  <!-- 'Smart' or 'UnderMouse' -->
-</placement>
-
-<theme>
-  <name>Clearlooks</name>
-  <titleLayout>NLIMC</titleLayout>
-  <titleNumber>yes</titleNumber>
-  <!--
-      avaible characters are NDSLIMC, each can occur at most once.
-      N: window icon
-      L: window label (AKA title).
-      I: iconify
-      M: maximize
-      C: close
-      S: shade (roll up/down)
-      D: omnipresent (on all desktops).
-  -->
-  <keepBorder>yes</keepBorder>
-  <animateIconify>yes</animateIconify>
-  <font place="ActiveWindow">
-    <name>sans</name>
-    <size>8</size>
-    <!-- font size in points -->
-    <weight>bold</weight>
-    <!-- 'bold' or 'normal' -->
-    <slant>normal</slant>
-    <!-- 'italic' or 'normal' -->
-  </font>
-  <font place="InactiveWindow">
-    <name>sans</name>
-    <size>8</size>
-    <!-- font size in points -->
-    <weight>bold</weight>
-    <!-- 'bold' or 'normal' -->
-    <slant>normal</slant>
-    <!-- 'italic' or 'normal' -->
-  </font>
-  <font place="MenuHeader">
-    <name>sans</name>
-    <size>9</size>
-    <!-- font size in points -->
-    <weight>normal</weight>
-    <!-- 'bold' or 'normal' -->
-    <slant>normal</slant>
-    <!-- 'italic' or 'normal' -->
-  </font>
-  <font place="MenuItem">
-    <name>sans</name>
-    <size>9</size>
-    <!-- font size in points -->
-    <weight>normal</weight>
-    <!-- 'bold' or 'normal' -->
-    <slant>normal</slant>
-    <!-- 'italic' or 'normal' -->
-  </font>
-  <font place="OnScreenDisplay">
-    <name>sans</name>
-    <size>9</size>
-    <!-- font size in points -->
-    <weight>bold</weight>
-    <!-- 'bold' or 'normal' -->
-    <slant>normal</slant>
-    <!-- 'italic' or 'normal' -->
-  </font>
-</theme>
-
-<desktops>
-  <!-- this stuff is only used at startup, pagers allow you to change them
-       during a session -->
-  <number>4</number>
-  <firstdesk>1</firstdesk>
-  <names>
-    <name>desktop one</name>
-    <name>desktop two</name>
-    <name>desktop three</name>
-    <name>desktop four</name>
-  </names>
-</desktops>
-
-<resize>
-  <drawContents>yes</drawContents>
-  <popupShow>Nonpixel</popupShow>
-  <!-- 'Always', 'Never', or 'Nonpixel' (xterms and such) -->
-  <popupPosition>Center</popupPosition>
-  <!-- 'Center' or 'Top' -->
-</resize>
-
-<dock>
-  <position>TopLeft</position>
-  <!-- (Top|Bottom)(Left|Right|)|Top|Bottom|Left|Right|Floating -->
-  <floatingX>0</floatingX>
-  <floatingY>0</floatingY>
-  <noStrut>no</noStrut>
-  <stacking>Above</stacking>
-  <!-- 'Above', 'Normal', or 'Below' -->
-  <direction>Vertical</direction>
-  <!-- 'Vertical' or 'Horizontal' -->
-  <autoHide>no</autoHide>
-  <hideDelay>300</hideDelay>
-  <!-- in milliseconds (1000 = 1 second) -->
-  <showDelay>300</showDelay>
-  <!-- in milliseconds (1000 = 1 second) -->
-  <moveButton>Middle</moveButton>
-  <!-- 'Left', 'Middle', 'Right' -->
-</dock>
-
-<keyboard>
-  <chainQuitKey>C-g</chainQuitKey>
-
-  <!-- Keybindings for desktop switching -->
-  <keybind key="C-A-Left">
-    <action name="DesktopLeft"><wrap>no</wrap></action>
-  </keybind>
-  <keybind key="C-A-Right">
-    <action name="DesktopRight"><wrap>no</wrap></action>
-  </keybind>
-  <keybind key="C-A-Up">
-    <action name="DesktopUp"><wrap>no</wrap></action>
-  </keybind>
-  <keybind key="C-A-Down">
-    <action name="DesktopDown"><wrap>no</wrap></action>
-  </keybind>
-  <keybind key="S-A-Left">
-    <action name="SendToDesktopLeft"><wrap>no</wrap></action>
-  </keybind>
-  <keybind key="S-A-Right">
-    <action name="SendToDesktopRight"><wrap>no</wrap></action>
-  </keybind>
-  <keybind key="S-A-Up">
-    <action name="SendToDesktopUp"><wrap>no</wrap></action>
-  </keybind>
-  <keybind key="S-A-Down">
-    <action name="SendToDesktopDown"><wrap>no</wrap></action>
-  </keybind>
-  <keybind key="W-F1">
-    <action name="Desktop"><desktop>1</desktop></action>
-  </keybind>
-  <keybind key="W-F2">
-    <action name="Desktop"><desktop>1</desktop></action>
-  </keybind>
-  <keybind key="W-F3">
-    <action name="Desktop"><desktop>1</desktop></action>
-  </keybind>
-  <keybind key="W-F4">
-    <action name="Desktop"><desktop>1</desktop></action>
-  </keybind>
-  <keybind key="W-d">
-    <action name="ToggleShowDesktop"/>
-  </keybind>
-
-  <!-- Keybindings for windows -->
-  <keybind key="A-F4">
-    <action name="Close"/>
-  </keybind>
-  <keybind key="A-Escape">
-    <action name="Lower"/>
-    <action name="FocusToBottom"/>
-    <action name="Unfocus"/>
-  </keybind>
-  <keybind key="A-space">
-    <action name="ShowMenu"><menu>client-menu</menu></action>
-  </keybind>
-
-  <!-- Keybindings for window switching -->
-  <keybind key="A-Tab">
-    <action name="NextWindow"/>
-  </keybind>
-  <keybind key="A-S-Tab">
-    <action name="PreviousWindow"/>
-  </keybind>
-  <keybind key="C-A-Tab">
-    <action name="NextWindow">
-      <panels>yes</panels><desktop>yes</desktop>
-    </action>
-  </keybind>
-
-  <!-- Keybindings for running applications -->
-  <keybind key="W-e">
-    <action name="Execute">
-      <startupnotify>
-        <enabled>true</enabled>
-        <name>Konqueror</name>
-      </startupnotify>
-      <execute>kfmclient openProfile filemanagement</execute>
-    </action>
-  </keybind>
-</keyboard>
-
-<mouse>
-  <dragThreshold>3</dragThreshold>
-  <!-- number of pixels the mouse must move before a drag begins -->
-  <doubleClickTime>200</doubleClickTime>
-  <!-- in milliseconds (1000 = 1 second) -->
-
-  <context name="Frame">
-    <mousebind button="A-Left" action="Press">
-      <action name="Activate"/>
-    </mousebind>
-    <mousebind button="A-Left" action="Drag">
-      <action name="Move"/>
-    </mousebind>
-
-    <mousebind button="A-Right" action="Press">
-      <action name="Activate"/>
-    </mousebind>
-    <mousebind button="A-Right" action="Drag">
-      <action name="Resize"/>
-    </mousebind> 
-
-    <mousebind button="A-Middle" action="Press">
-      <action name="Lower"/>
-      <action name="FocusToBottom"/>
-      <action name="Unfocus"/>
-    </mousebind>
-
-    <mousebind button="A-Up" action="Click">
-      <action name="DesktopPrevious"/>
-    </mousebind>
-    <mousebind button="A-Down" action="Click">
-      <action name="DesktopNext"/>
-    </mousebind>
-    <mousebind button="A-S-Up" action="Click">
-      <action name="SendToDesktopPrevious"/>
-    </mousebind>
-    <mousebind button="A-S-Down" action="Click">
-      <action name="SendToDesktopNext"/>
-    </mousebind>
-  </context>
-
-  <context name="Titlebar">
-    <mousebind button="Left" action="Press">
-      <action name="Activate"/>
-    </mousebind>
-    <mousebind button="Left" action="Drag">
-      <action name="Move"/>
-    </mousebind>
-    <mousebind button="Left" action="DoubleClick">
-      <action name="ToggleMaximizeFull"/>
-    </mousebind>
-
-    <mousebind button="Middle" action="Press">
-      <action name="Lower"/>
-      <action name="FocusToBottom"/>
-      <action name="Unfocus"/>
-    </mousebind>
-
-    <mousebind button="Up" action="Click">
-      <action name="Shade"/>
-      <action name="FocusToBottom"/>
-      <action name="Unfocus"/>
-    </mousebind>
-    <mousebind button="Down" action="Click">
-      <action name="Unshade"/>
-    </mousebind>
-
-    <mousebind button="Right" action="Press">
-      <action name="Activate"/>
-      <action name="ShowMenu"><menu>client-menu</menu></action>
-    </mousebind>
-  </context>
-
-  <context name="Top">
-    <mousebind button="Left" action="Press">
-      <action name="Activate"/>
-    </mousebind>
-    <mousebind button="Left" action="Drag">
-      <action name="Resize"><edge>top</edge></action>
-    </mousebind>
-  </context>
-
-  <context name="Bottom">
-    <mousebind button="Left" action="Press">
-      <action name="Activate"/>
-    </mousebind>
-    <mousebind button="Left" action="Drag">
-      <action name="Resize"><edge>bottom</edge></action>
-    </mousebind>
-
-    <mousebind button="Middle" action="Press">
-      <action name="Lower"/>
-      <action name="FocusToBottom"/>
-      <action name="Unfocus"/>
-    </mousebind>
-
-    <mousebind button="Right" action="Press">
-      <action name="Activate"/>
-      <action name="ShowMenu"><menu>client-menu</menu></action>
-    </mousebind>
-  </context>
-
-  <context name="BLCorner">
-    <mousebind button="Left" action="Press">
-      <action name="Activate"/>
-    </mousebind>
-    <mousebind button="Left" action="Drag">
-      <action name="Resize"/>
-    </mousebind>
-  </context>
-
-  <context name="BRCorner">
-    <mousebind button="Left" action="Press">
-      <action name="Activate"/>
-    </mousebind>
-    <mousebind button="Left" action="Drag">
-      <action name="Resize"/>
-    </mousebind>
-  </context>
-
-  <context name="TLCorner">
-    <mousebind button="Left" action="Press">
-      <action name="Activate"/>
-    </mousebind>
-    <mousebind button="Left" action="Drag">
-      <action name="Resize"/>
-    </mousebind>
-  </context>
-
-  <context name="TRCorner">
-    <mousebind button="Left" action="Press">
-      <action name="Activate"/>
-    </mousebind>
-    <mousebind button="Left" action="Drag">
-      <action name="Resize"/>
-    </mousebind>
-  </context>
-
-  <context name="Client">
-    <mousebind button="Left" action="Press">
-      <action name="Activate"/>
-    </mousebind>
-    <mousebind button="Middle" action="Press">
-      <action name="Activate"/>
-    </mousebind>
-    <mousebind button="Right" action="Press">
-      <action name="Activate"/>
-    </mousebind>
-  </context>
-
-  <context name="Icon">
-    <mousebind button="Left" action="Press">
-      <action name="Activate"/>
-      <action name="ShowMenu"><menu>client-menu</menu></action>
-    </mousebind>
-    <mousebind button="Right" action="Press">
-      <action name="Activate"/>
-      <action name="ShowMenu"><menu>client-menu</menu></action>
-    </mousebind>
-  </context>
-
-  <context name="AllDesktops">
-    <mousebind button="Left" action="Press">
-      <action name="Activate"/>
-    </mousebind>
-    <mousebind button="Left" action="Click">
-      <action name="ToggleOmnipresent"/>
-    </mousebind>
-  </context>
-
-  <context name="Shade">
-    <mousebind button="Left" action="Press">
-      <action name="Activate"/>
-    </mousebind>
-    <mousebind button="Left" action="Click">
-      <action name="ToggleShade"/>
-    </mousebind>
-  </context>
-
-  <context name="Iconify">
-    <mousebind button="Left" action="Press">
-      <action name="Activate"/>
-    </mousebind>
-    <mousebind button="Left" action="Click">
-      <action name="Iconify"/>
-    </mousebind>
-  </context>
-
-  <context name="Maximize">
-    <mousebind button="Left" action="Press">
-      <action name="Activate"/>
-    </mousebind>
-    <mousebind button="Middle" action="Press">
-      <action name="Activate"/>
-    </mousebind>
-    <mousebind button="Right" action="Press">
-      <action name="Activate"/>
-    </mousebind>
-    <mousebind button="Left" action="Click">
-      <action name="ToggleMaximizeFull"/>
-    </mousebind>
-    <mousebind button="Middle" action="Click">
-      <action name="ToggleMaximizeVert"/>
-    </mousebind>
-    <mousebind button="Right" action="Click">
-      <action name="ToggleMaximizeHorz"/>
-    </mousebind>
-  </context>
-
-  <context name="Close">
-    <mousebind button="Left" action="Press">
-      <action name="Activate"/>
-    </mousebind>
-    <mousebind button="Left" action="Click">
-      <action name="Close"/>
-    </mousebind>
-  </context>
-
-  <context name="Desktop">
-    <mousebind button="Up" action="Press">
-      <action name="DesktopPrevious"/>
-    </mousebind>
-    <mousebind button="Down" action="Press">
-      <action name="DesktopNext"/>
-    </mousebind>
-
-    <mousebind button="A-Up" action="Press">
-      <action name="DesktopPrevious"/>
-    </mousebind>
-    <mousebind button="A-Down" action="Press">
-      <action name="DesktopNext"/>
-    </mousebind>
-
-    <mousebind button="Left" action="Press">
-      <action name="Activate"/>
-    </mousebind>
-
-    <!-- Menus are disabled since the DE will provide root window menus -->
-    <!--
-    <mousebind button="Middle" action="Press">
-      <action name="ShowMenu"><menu>client-list-combined-menu</menu></action>
-    </mousebind> 
-    <mousebind button="Right" action="Press">
-      <action name="ShowMenu"><menu>root-menu</menu></action>
-    </mousebind>
-    -->
-  </context>
-
-  <context name="MoveResize">
-    <mousebind button="Up" action="Press">
-      <action name="DesktopPrevious"/>
-    </mousebind>
-    <mousebind button="Down" action="Press">
-      <action name="DesktopNext"/>
-    </mousebind>
-    <mousebind button="A-Up" action="Press">
-      <action name="DesktopPrevious"/>
-    </mousebind>
-    <mousebind button="A-Down" action="Press">
-      <action name="DesktopNext"/>
-    </mousebind>
-  </context>
-</mouse>
-
-<menu>
-  <!-- You can specify more than one menu file in here and they are all loaded,
-       just don't make menu ids clash or, well, it'll be kind of pointless -->
-
-  <!-- default menu file (or custom one in $HOME/.config/openbox/) -->
-  <file>menu.xml</file>
-  <hideDelay>200</hideDelay>
-  <middle>no</middle>
-  <submenuShowDelay>100</submenuShowDelay>
-  <applicationIcons>yes</applicationIcons>
-</menu>
-
-<!-- this section is commented out.. remove this and the ending comment if you
-     want to use it -->
-<applications>
-  <!-- the name or the class can be set, or both. this is used to match
-       windows when they appear
-
-       role can optionally be set, and only as much as you provide will be 
-       checked to see if it matches, eg. if you set role="abc" and the window's
-       role is actually "abcde" it would match.
- -->
-  <application name="first element of window's WM_CLASS property (see xprop)"
-              class="second element of window's WM_CLASS property (see xprop)"
-               role="the window's WM_WINDOW_ROLE property (see xprop)">
-
-    <!-- each element can be left out or set to 'default' to specify to not 
-         change that attribute of the window -->
-
-    <decor>yes</decor>
-
-    <shade>no</shade>
-
-    <position>
-      <!-- the position is only used if both an x and y coordinate are provided
-           (and not set to 'default') -->
-      <x>center</x>
-      <!-- a number or 'center' to center on screen -->
-      <y>200</y>
-      <!-- a number or 'center' to center on screen -->
-      <monitor>1</monitor>
-      <!-- specifies the monitor in a xinerama setup.
-           1 is the first head, or 'mouse' for wherever the mouse is -->
-    </position>
-
-    <focus>yes</focus>
-    <!-- if the window should try be given focus when it appears -->
-
-    <desktop>1</desktop>
-    <!-- 1 is the first desktop, 'all' for all desktops -->
-
-    <layer>normal</layer>
-    <!-- 'above', 'normal', or 'below' -->
-
-    <iconic>no</iconic>
-
-    <skip_pager>no</skip_pager>
-    <!-- asks to not be shown in pagers -->
-
-    <skip_taskbar>no</skip_taskbar>
-    <!-- asks to not be shown in taskbars. window cycling actions will also
-         skip past such windows -->
-
-    <fullscreen>yes</fullscreen>
-
-    <maximized>true</maximized>
-    <!-- 'Horizontal', 'Vertical' or boolean (yes/no/on/off/true/false) -->
-  </application>
-</applications>
- -->
-
-</openbox_config>
diff --git a/data/rc-kde.xml b/data/rc-kde.xml
deleted file mode 100644 (file)
index 20b20c5..0000000
+++ /dev/null
@@ -1,546 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- Do not edit this file, it will be overwritten on install.
-        Copy the file to $HOME/.config/openbox/ instead. -->
-
-<openbox_config xmlns="http://openbox.org/4.0/rc">
-
-<resistance>
-  <strength>10</strength>
-  <screen_edge_strength>20</screen_edge_strength>
-</resistance>
-
-<focus>
-  <focusNew>yes</focusNew>
-  <focusLast>yes</focusLast>
-  <followMouse>no</followMouse>
-  <focusDelay>200</focusDelay>
-  <raiseOnFocus>no</raiseOnFocus>
-</focus>
-
-<placement>
-  <policy>Smart</policy>
-  <!-- 'Smart' or 'UnderMouse' -->
-</placement>
-
-<theme>
-  <name>Clearlooks</name>
-  <titleLayout>NLIMC</titleLayout>
-  <titleNumber>yes</titleNumber>
-  <!--
-      avaible characters are NDSLIMC, each can occur at most once.
-      N: window icon
-      L: window label (AKA title).
-      I: iconify
-      M: maximize
-      C: close
-      S: shade (roll up/down)
-      D: omnipresent (on all desktops).
-  -->
-  <keepBorder>yes</keepBorder>
-  <animateIconify>yes</animateIconify>
-  <font place="ActiveWindow">
-    <name>sans</name>
-    <size>8</size>
-    <!-- font size in points -->
-    <weight>bold</weight>
-    <!-- 'bold' or 'normal' -->
-    <slant>normal</slant>
-    <!-- 'italic' or 'normal' -->
-  </font>
-  <font place="InactiveWindow">
-    <name>sans</name>
-    <size>8</size>
-    <!-- font size in points -->
-    <weight>bold</weight>
-    <!-- 'bold' or 'normal' -->
-    <slant>normal</slant>
-    <!-- 'italic' or 'normal' -->
-  </font>
-  <font place="MenuHeader">
-    <name>sans</name>
-    <size>9</size>
-    <!-- font size in points -->
-    <weight>normal</weight>
-    <!-- 'bold' or 'normal' -->
-    <slant>normal</slant>
-    <!-- 'italic' or 'normal' -->
-  </font>
-  <font place="MenuItem">
-    <name>sans</name>
-    <size>9</size>
-    <!-- font size in points -->
-    <weight>normal</weight>
-    <!-- 'bold' or 'normal' -->
-    <slant>normal</slant>
-    <!-- 'italic' or 'normal' -->
-  </font>
-  <font place="OnScreenDisplay">
-    <name>sans</name>
-    <size>9</size>
-    <!-- font size in points -->
-    <weight>bold</weight>
-    <!-- 'bold' or 'normal' -->
-    <slant>normal</slant>
-    <!-- 'italic' or 'normal' -->
-  </font>
-</theme>
-
-<desktops>
-  <!-- this stuff is only used at startup, pagers allow you to change them
-       during a session -->
-  <number>4</number>
-  <firstdesk>1</firstdesk>
-  <names>
-    <name>desktop one</name>
-    <name>desktop two</name>
-    <name>desktop three</name>
-    <name>desktop four</name>
-  </names>
-</desktops>
-
-<resize>
-  <drawContents>yes</drawContents>
-  <popupShow>Nonpixel</popupShow>
-  <!-- 'Always', 'Never', or 'Nonpixel' (xterms and such) -->
-  <popupPosition>Center</popupPosition>
-  <!-- 'Center' or 'Top' -->
-</resize>
-
-<dock>
-  <position>TopLeft</position>
-  <!-- (Top|Bottom)(Left|Right|)|Top|Bottom|Left|Right|Floating -->
-  <floatingX>0</floatingX>
-  <floatingY>0</floatingY>
-  <noStrut>no</noStrut>
-  <stacking>Above</stacking>
-  <!-- 'Above', 'Normal', or 'Below' -->
-  <direction>Vertical</direction>
-  <!-- 'Vertical' or 'Horizontal' -->
-  <autoHide>no</autoHide>
-  <hideDelay>300</hideDelay>
-  <!-- in milliseconds (1000 = 1 second) -->
-  <showDelay>300</showDelay>
-  <!-- in milliseconds (1000 = 1 second) -->
-  <moveButton>Middle</moveButton>
-  <!-- 'Left', 'Middle', 'Right' -->
-</dock>
-
-<keyboard>
-  <chainQuitKey>C-g</chainQuitKey>
-
-  <!-- Keybindings for desktop switching -->
-  <keybind key="C-A-Left">
-    <action name="DesktopLeft"><wrap>no</wrap></action>
-  </keybind>
-  <keybind key="C-A-Right">
-    <action name="DesktopRight"><wrap>no</wrap></action>
-  </keybind>
-  <keybind key="C-A-Up">
-    <action name="DesktopUp"><wrap>no</wrap></action>
-  </keybind>
-  <keybind key="C-A-Down">
-    <action name="DesktopDown"><wrap>no</wrap></action>
-  </keybind>
-  <keybind key="S-A-Left">
-    <action name="SendToDesktopLeft"><wrap>no</wrap></action>
-  </keybind>
-  <keybind key="S-A-Right">
-    <action name="SendToDesktopRight"><wrap>no</wrap></action>
-  </keybind>
-  <keybind key="S-A-Up">
-    <action name="SendToDesktopUp"><wrap>no</wrap></action>
-  </keybind>
-  <keybind key="S-A-Down">
-    <action name="SendToDesktopDown"><wrap>no</wrap></action>
-  </keybind>
-  <keybind key="W-F1">
-    <action name="Desktop"><desktop>1</desktop></action>
-  </keybind>
-  <keybind key="W-F2">
-    <action name="Desktop"><desktop>1</desktop></action>
-  </keybind>
-  <keybind key="W-F3">
-    <action name="Desktop"><desktop>1</desktop></action>
-  </keybind>
-  <keybind key="W-F4">
-    <action name="Desktop"><desktop>1</desktop></action>
-  </keybind>
-  <keybind key="W-d">
-    <action name="ToggleShowDesktop"/>
-  </keybind>
-
-  <!-- Keybindings for windows -->
-  <keybind key="A-F4">
-    <action name="Close"/>
-  </keybind>
-  <keybind key="A-Escape">
-    <action name="Lower"/>
-    <action name="FocusToBottom"/>
-    <action name="Unfocus"/>
-  </keybind>
-  <keybind key="A-space">
-    <action name="ShowMenu"><menu>client-menu</menu></action>
-  </keybind>
-
-  <!-- Keybindings for window switching -->
-  <keybind key="A-Tab">
-    <action name="NextWindow"/>
-  </keybind>
-  <keybind key="A-S-Tab">
-    <action name="PreviousWindow"/>
-  </keybind>
-  <keybind key="C-A-Tab">
-    <action name="NextWindow">
-      <panels>yes</panels><desktop>yes</desktop>
-    </action>
-  </keybind>
-
-  <!-- Keybindings for running applications -->
-  <keybind key="W-e">
-    <action name="Execute">
-      <startupnotify>
-        <enabled>true</enabled>
-        <name>Konqueror</name>
-      </startupnotify>
-      <execute>kfmclient openProfile filemanagement</execute>
-    </action>
-  </keybind>
-</keyboard>
-
-<mouse>
-  <dragThreshold>3</dragThreshold>
-  <!-- number of pixels the mouse must move before a drag begins -->
-  <doubleClickTime>200</doubleClickTime>
-  <!-- in milliseconds (1000 = 1 second) -->
-
-  <context name="Frame">
-    <mousebind button="A-Left" action="Press">
-      <action name="Activate"/>
-    </mousebind>
-    <mousebind button="A-Left" action="Drag">
-      <action name="Move"/>
-    </mousebind>
-
-    <mousebind button="A-Right" action="Press">
-      <action name="Activate"/>
-    </mousebind>
-    <mousebind button="A-Right" action="Drag">
-      <action name="Resize"/>
-    </mousebind> 
-
-    <mousebind button="A-Middle" action="Press">
-      <action name="Lower"/>
-      <action name="FocusToBottom"/>
-      <action name="Unfocus"/>
-    </mousebind>
-
-    <mousebind button="A-Up" action="Click">
-      <action name="DesktopPrevious"/>
-    </mousebind>
-    <mousebind button="A-Down" action="Click">
-      <action name="DesktopNext"/>
-    </mousebind>
-    <mousebind button="A-S-Up" action="Click">
-      <action name="SendToDesktopPrevious"/>
-    </mousebind>
-    <mousebind button="A-S-Down" action="Click">
-      <action name="SendToDesktopNext"/>
-    </mousebind>
-  </context>
-
-  <context name="Titlebar">
-    <mousebind button="Left" action="Press">
-      <action name="Activate"/>
-    </mousebind>
-    <mousebind button="Left" action="Drag">
-      <action name="Move"/>
-    </mousebind>
-    <mousebind button="Left" action="DoubleClick">
-      <action name="ToggleMaximizeFull"/>
-    </mousebind>
-
-    <mousebind button="Middle" action="Press">
-      <action name="Lower"/>
-      <action name="FocusToBottom"/>
-      <action name="Unfocus"/>
-    </mousebind>
-
-    <mousebind button="Up" action="Click">
-      <action name="Shade"/>
-      <action name="FocusToBottom"/>
-      <action name="Unfocus"/>
-    </mousebind>
-    <mousebind button="Down" action="Click">
-      <action name="Unshade"/>
-    </mousebind>
-
-    <mousebind button="Right" action="Press">
-      <action name="Activate"/>
-      <action name="ShowMenu"><menu>client-menu</menu></action>
-    </mousebind>
-  </context>
-
-  <context name="Top">
-    <mousebind button="Left" action="Press">
-      <action name="Activate"/>
-    </mousebind>
-    <mousebind button="Left" action="Drag">
-      <action name="Resize"><edge>top</edge></action>
-    </mousebind>
-  </context>
-
-  <context name="Bottom">
-    <mousebind button="Left" action="Press">
-      <action name="Activate"/>
-    </mousebind>
-    <mousebind button="Left" action="Drag">
-      <action name="Resize"><edge>bottom</edge></action>
-    </mousebind>
-
-    <mousebind button="Middle" action="Press">
-      <action name="Lower"/>
-      <action name="FocusToBottom"/>
-      <action name="Unfocus"/>
-    </mousebind>
-
-    <mousebind button="Right" action="Press">
-      <action name="Activate"/>
-      <action name="ShowMenu"><menu>client-menu</menu></action>
-    </mousebind>
-  </context>
-
-  <context name="BLCorner">
-    <mousebind button="Left" action="Press">
-      <action name="Activate"/>
-    </mousebind>
-    <mousebind button="Left" action="Drag">
-      <action name="Resize"/>
-    </mousebind>
-  </context>
-
-  <context name="BRCorner">
-    <mousebind button="Left" action="Press">
-      <action name="Activate"/>
-    </mousebind>
-    <mousebind button="Left" action="Drag">
-      <action name="Resize"/>
-    </mousebind>
-  </context>
-
-  <context name="TLCorner">
-    <mousebind button="Left" action="Press">
-      <action name="Activate"/>
-    </mousebind>
-    <mousebind button="Left" action="Drag">
-      <action name="Resize"/>
-    </mousebind>
-  </context>
-
-  <context name="TRCorner">
-    <mousebind button="Left" action="Press">
-      <action name="Activate"/>
-    </mousebind>
-    <mousebind button="Left" action="Drag">
-      <action name="Resize"/>
-    </mousebind>
-  </context>
-
-  <context name="Client">
-    <mousebind button="Left" action="Press">
-      <action name="Activate"/>
-    </mousebind>
-    <mousebind button="Middle" action="Press">
-      <action name="Activate"/>
-    </mousebind>
-    <mousebind button="Right" action="Press">
-      <action name="Activate"/>
-    </mousebind>
-  </context>
-
-  <context name="Icon">
-    <mousebind button="Left" action="Press">
-      <action name="Activate"/>
-      <action name="ShowMenu"><menu>client-menu</menu></action>
-    </mousebind>
-    <mousebind button="Right" action="Press">
-      <action name="Activate"/>
-      <action name="ShowMenu"><menu>client-menu</menu></action>
-    </mousebind>
-  </context>
-
-  <context name="AllDesktops">
-    <mousebind button="Left" action="Press">
-      <action name="Activate"/>
-    </mousebind>
-    <mousebind button="Left" action="Click">
-      <action name="ToggleOmnipresent"/>
-    </mousebind>
-  </context>
-
-  <context name="Shade">
-    <mousebind button="Left" action="Press">
-      <action name="Activate"/>
-    </mousebind>
-    <mousebind button="Left" action="Click">
-      <action name="ToggleShade"/>
-    </mousebind>
-  </context>
-
-  <context name="Iconify">
-    <mousebind button="Left" action="Press">
-      <action name="Activate"/>
-    </mousebind>
-    <mousebind button="Left" action="Click">
-      <action name="Iconify"/>
-    </mousebind>
-  </context>
-
-  <context name="Maximize">
-    <mousebind button="Left" action="Press">
-      <action name="Activate"/>
-    </mousebind>
-    <mousebind button="Middle" action="Press">
-      <action name="Activate"/>
-    </mousebind>
-    <mousebind button="Right" action="Press">
-      <action name="Activate"/>
-    </mousebind>
-    <mousebind button="Left" action="Click">
-      <action name="ToggleMaximizeFull"/>
-    </mousebind>
-    <mousebind button="Middle" action="Click">
-      <action name="ToggleMaximizeVert"/>
-    </mousebind>
-    <mousebind button="Right" action="Click">
-      <action name="ToggleMaximizeHorz"/>
-    </mousebind>
-  </context>
-
-  <context name="Close">
-    <mousebind button="Left" action="Press">
-      <action name="Activate"/>
-    </mousebind>
-    <mousebind button="Left" action="Click">
-      <action name="Close"/>
-    </mousebind>
-  </context>
-
-  <context name="Desktop">
-    <mousebind button="Up" action="Press">
-      <action name="DesktopPrevious"/>
-    </mousebind>
-    <mousebind button="Down" action="Press">
-      <action name="DesktopNext"/>
-    </mousebind>
-
-    <mousebind button="A-Up" action="Press">
-      <action name="DesktopPrevious"/>
-    </mousebind>
-    <mousebind button="A-Down" action="Press">
-      <action name="DesktopNext"/>
-    </mousebind>
-
-    <mousebind button="Left" action="Press">
-      <action name="Activate"/>
-    </mousebind>
-
-    <!-- Menus are disabled since the DE will provide root window menus -->
-    <!--
-    <mousebind button="Middle" action="Press">
-      <action name="ShowMenu"><menu>client-list-combined-menu</menu></action>
-    </mousebind> 
-    <mousebind button="Right" action="Press">
-      <action name="ShowMenu"><menu>root-menu</menu></action>
-    </mousebind>
-    -->
-  </context>
-
-  <context name="MoveResize">
-    <mousebind button="Up" action="Press">
-      <action name="DesktopPrevious"/>
-    </mousebind>
-    <mousebind button="Down" action="Press">
-      <action name="DesktopNext"/>
-    </mousebind>
-    <mousebind button="A-Up" action="Press">
-      <action name="DesktopPrevious"/>
-    </mousebind>
-    <mousebind button="A-Down" action="Press">
-      <action name="DesktopNext"/>
-    </mousebind>
-  </context>
-</mouse>
-
-<menu>
-  <!-- You can specify more than one menu file in here and they are all loaded,
-       just don't make menu ids clash or, well, it'll be kind of pointless -->
-
-  <!-- default menu file (or custom one in $HOME/.config/openbox/) -->
-  <file>menu.xml</file>
-  <hideDelay>200</hideDelay>
-  <middle>no</middle>
-  <submenuShowDelay>100</submenuShowDelay>
-  <applicationIcons>yes</applicationIcons>
-</menu>
-
-<!-- this section is commented out.. remove this and the ending comment if you
-     want to use it -->
-<applications>
-  <!-- the name or the class can be set, or both. this is used to match
-       windows when they appear
-
-       role can optionally be set, and only as much as you provide will be 
-       checked to see if it matches, eg. if you set role="abc" and the window's
-       role is actually "abcde" it would match.
- -->
-  <application name="first element of window's WM_CLASS property (see xprop)"
-              class="second element of window's WM_CLASS property (see xprop)"
-               role="the window's WM_WINDOW_ROLE property (see xprop)">
-
-    <!-- each element can be left out or set to 'default' to specify to not 
-         change that attribute of the window -->
-
-    <decor>yes</decor>
-
-    <shade>no</shade>
-
-    <position>
-      <!-- the position is only used if both an x and y coordinate are provided
-           (and not set to 'default') -->
-      <x>center</x>
-      <!-- a number or 'center' to center on screen -->
-      <y>200</y>
-      <!-- a number or 'center' to center on screen -->
-      <monitor>1</monitor>
-      <!-- specifies the monitor in a xinerama setup.
-           1 is the first head, or 'mouse' for wherever the mouse is -->
-    </position>
-
-    <focus>yes</focus>
-    <!-- if the window should try be given focus when it appears -->
-
-    <desktop>1</desktop>
-    <!-- 1 is the first desktop, 'all' for all desktops -->
-
-    <layer>normal</layer>
-    <!-- 'above', 'normal', or 'below' -->
-
-    <iconic>no</iconic>
-
-    <skip_pager>no</skip_pager>
-    <!-- asks to not be shown in pagers -->
-
-    <skip_taskbar>no</skip_taskbar>
-    <!-- asks to not be shown in taskbars. window cycling actions will also
-         skip past such windows -->
-
-    <fullscreen>yes</fullscreen>
-
-    <maximized>true</maximized>
-    <!-- 'Horizontal', 'Vertical' or boolean (yes/no/on/off/true/false) -->
-  </application>
-</applications>
- -->
-
-</openbox_config>
index b52235528634301eb3f59ce51d2443eb880b80c7..c2bc9399401b831ed6aa467991fbd000ec7cb982 100644 (file)
@@ -2,5 +2,4 @@
 
 # Run GNOME with Openbox as its window manager
 export WINDOW_MANAGER="@bindir@/openbox"
-export OPENBOX_CONFIG_NAMESPACE="gnome"
 exec gnome-session "$@"
similarity index 83%
rename from data/xsession/openbox-gnome.desktop
rename to data/xsession/openbox-gnome.desktop.in
index da15d1f567eb8e4f70633171e880afbcf9f724c4..19ae82e094c4542f541633a1a9bfe26898e6cbbc 100644 (file)
@@ -2,7 +2,7 @@
 Encoding=UTF-8
 Name=GNOME/Openbox
 Comment=Use the Openbox window manager inside of the GNOME desktop environment
-Exec=openbox-gnome-session
+Exec=@bindir@/openbox-gnome-session
 TryExec=gnome-session
 Icon=openbox.png
 Type=XSession
index a125e4cd06707fab0dc82d75b7a520424f7d9cad..0fe009408a6fef68b1f93dac4f803b711cf9fb29 100644 (file)
@@ -2,5 +2,4 @@
 
 # Run KDE with Openbox as its window manager
 export KDEWM="@bindir@/openbox"
-export OPENBOX_CONFIG_NAMESPACE="kde"
 exec startkde "$@"
similarity index 83%
rename from data/xsession/openbox-kde.desktop
rename to data/xsession/openbox-kde.desktop.in
index 1244d8d99b0114901fbe07ce1d861c45dcad288d..ddfc72d714c41b6b98cebe948636b5db58b29092 100644 (file)
@@ -2,7 +2,7 @@
 Encoding=UTF-8
 Name=KDE/Openbox
 Comment=Use the Openbox window manager inside of the K Desktop Environment
-Exec=openbox-kde-session
+Exec=@bindir@/openbox-kde-session
 TryExec=startkde
 Icon=openbox.png
 Type=XSession
diff --git a/data/xsession/openbox-session.in b/data/xsession/openbox-session.in
new file mode 100644 (file)
index 0000000..c466f17
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+AUTOSTART="$HOME/.config/openbox/autostart.sh"
+GLOBALAUTOSTART="@configdir@/openbox/autostart.sh"
+
+if test -e $AUTOSTART; then
+    # sleep for 1 second so Openbox is there before anything else
+    (sleep 1 && . $AUTOSTART) &
+else
+    if test -e $GLOBALAUTOSTART; then
+        # sleep for 1 second so Openbox is there before anything else
+        (sleep 1 && . $GLOBALAUTOSTART) &
+    fi
+fi
+
+exec @bindir@/openbox "$@"
similarity index 70%
rename from data/xsession/openbox.desktop
rename to data/xsession/openbox.desktop.in
index 77de117a9d4d85bd2a8e5655186861404f369033..f8cb9f36fed11053b5e72726fd4662b8fc73b6d2 100644 (file)
@@ -2,7 +2,7 @@
 Encoding=UTF-8
 Name=Openbox
 Comment=Log in using the Openbox window manager (without a session manager)
-Exec=openbox
-TryExec=openbox
+Exec=@bindir@/openbox-session
+TryExec=@bidir@/openbox-session
 Icon=openbox.png
 Type=XSession
index 843801fff613265c0ed6a71b65d9d0a96f08e1c1..d6a5a644605c368d31bb26ad6137706d255bc7ff 100644 (file)
@@ -8,7 +8,7 @@ openbox-gnome-session \(em Run a GNOME session with Openbox as the window manage
 Openbox as the window manager. 
 .SH "SEE ALSO" 
 .PP 
-openbox(1), openbox-kde-session (1). 
+openbox(1), openbox-kde-session (1), openbox-session(1)
  
 .PP 
 The program's full documentation is available on the website: 
@@ -16,4 +16,4 @@ The program's full documentation is available on the website:
 .PP 
 Please report bugs to: \fBhttp://bugzilla.icculus.org/ 
 \fP 
-.\" created by instant / docbook-to-man, Sun 13 May 2007, 17:59 
+.\" created by instant / docbook-to-man, Tue 15 May 2007, 11:21 
index 702fab704d37921499d0e457fa0b42016e2e011a..01236aff7bab9e34fde2446935f99d2a85855426 100644 (file)
@@ -38,14 +38,11 @@ manpage.1: manpage.sgml
 
     <para><command>&dhpackage;</command> runs a GNOME session with
       Openbox as the window manager.</para>
-
-    <para>When running inside GNOME like this, Openbox will use the
-      <literal>rc-gnome.xml</literal> configuration file.</para>
   </refsect1>
   <refsect1>
     <title>SEE ALSO</title>
 
-    <para>openbox(1), openbox-kde-session (1).
+    <para>openbox(1), openbox-kde-session (1), openbox-session(1).
       </para>
 
     <para>The program's full documentation is available on the website:
index 1c87fb8ce0ab6c5356b1aa086183d8694a910b09..7e18944bbdc53284d8b06cb44b2d7572702fe577 100644 (file)
@@ -8,7 +8,7 @@ openbox-kde-session \(em Run a KDE session with Openbox as the window manager
 Openbox as the window manager. 
 .SH "SEE ALSO" 
 .PP 
-openbox(1), openbox-gnome-session (1). 
+openbox(1), openbox-gnome-session (1), openbox-session (1)
  
 .PP 
 The program's full documentation is available on the website: 
@@ -16,4 +16,4 @@ The program's full documentation is available on the website:
 .PP 
 Please report bugs to: \fBhttp://bugzilla.icculus.org/ 
 \fP 
-.\" created by instant / docbook-to-man, Sun 13 May 2007, 17:59 
+.\" created by instant / docbook-to-man, Tue 15 May 2007, 11:21 
index d481ff020d329caeb31f7bf7f889c65690f6ab1c..aeb114a4fc8eb1a5756808a75eb34742b786e548 100644 (file)
@@ -38,14 +38,11 @@ manpage.1: manpage.sgml
 
     <para><command>&dhpackage;</command> runs a KDE session with
       Openbox as the window manager.</para>
-
-    <para>When running inside KDE like this, Openbox will use the
-      <literal>rc-kde.xml</literal> configuration file.</para>
   </refsect1>
   <refsect1>
     <title>SEE ALSO</title>
 
-    <para>openbox(1), openbox-gnome-session (1).
+    <para>openbox(1), openbox-gnome-session (1), openbox-session (1).
       </para>
 
     <para>The program's full documentation is available on the website:
diff --git a/doc/openbox-session.1.sgml b/doc/openbox-session.1.sgml
new file mode 100644 (file)
index 0000000..e32c48e
--- /dev/null
@@ -0,0 +1,90 @@
+<!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
+
+<!-- Process this file with docbook-to-man to generate an nroff manual
+     page: `docbook-to-man manpage.sgml > manpage.1'.  You may view
+     the manual page with: `docbook-to-man manpage.sgml | nroff -man |
+     less'.  A typical entry in a Makefile or Makefile.am is:
+
+manpage.1: manpage.sgml
+       docbook-to-man $< > $@
+
+    
+       The docbook-to-man binary is found in the docbook-to-man package.
+       Please remember that if you create the nroff version in one of the
+       debian/rules file targets (such as build), you will need to include
+       docbook-to-man in your Build-Depends control field.
+
+  -->
+
+  <!ENTITY dhsection   "<manvolnum>1</manvolnum>">
+  <!ENTITY dhucpackage "<refentrytitle>OPENBOX</refentrytitle>">
+  <!ENTITY dhpackage   "openbox-session">
+]>
+
+<refentry>
+  <refmeta>
+    &dhucpackage;
+
+    &dhsection;
+  </refmeta>
+  <refnamediv>
+    <refname>&dhpackage;</refname>
+
+    <refpurpose>Runs an Openbox session without any session manager.
+      </refpurpose>
+  </refnamediv>
+  <refsect1>
+    <title>DESCRIPTION</title>
+
+    <para><command>&dhpackage;</command> runs an openbox session without
+      any session manager. Without a session manager, you will not be able
+      to save your state from one log in to the next.</para>
+
+    <para>On log in, <command>&dhpackage;</command> will run the
+      ~/.config/openbox/autostart.sh script if it exists, and will run the
+      system-wide script @configdir@/openbox/autostart.sh otherwise. You may
+      place anything you want to run automatically in those files, for example:
+      </para>
+
+    <blockquote><literallayout>
+      xsetroot -solid grey &
+      gnome-settings-daemon &</literallayout></blockquote>
+
+    <para>Make sure that each line is followed by a "&" or else the script will
+      stop there and further commands will not be executed. You can use the
+      @configdir@/openbox/autostart.sh file as an example for creating your
+      own.</para>
+
+  </refsect1>
+  <refsect1>
+    <title>SEE ALSO</title>
+
+    <para>openbox(1), openbox-kde-session (1), openbox-gnome-session (1).
+      </para>
+
+    <para>The program's full documentation is available on the website:
+      <literal>http://openbox.org/</literal></para>
+
+    <para>Please report bugs to: <literal>http://bugzilla.icculus.org/
+      </literal></para>
+  </refsect1>
+</refentry>
+
+<!-- Keep this comment at the end of the file
+Local variables:
+mode: sgml
+sgml-omittag:t
+sgml-shorttag:t
+sgml-minimize-attributes:nil
+sgml-always-quote-attributes:t
+sgml-indent-step:2
+sgml-indent-data:t
+sgml-parent-document:nil
+sgml-default-dtd-file:nil
+sgml-exposed-tags:nil
+sgml-local-catalogs:nil
+sgml-local-ecat-files:nil
+End:
+-->
+
+
diff --git a/doc/openbox.1.in b/doc/openbox.1.in
deleted file mode 100644 (file)
index 7962235..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-.TH "OPENBOX" "1" 
-.SH "NAME" 
-openbox \(em Next generation, highly configurable window manager 
-.SH "SYNOPSIS" 
-.PP 
-\fBopenbox\fR [\fB\-\-help\fP]  [\fB\-\-version\fP]  [\fB\-\-replace\fP]  [\fB\-\-reconfigure\fP]  [\fB\-\-sm-disable\fP]  [\fB\-\-sync\fP]  [\fB\-\-debug\fP]  [\fB\-\-debug-focus\fP]  [\fB\-\-debug-xinerama\fP]  
-.SH "DESCRIPTION" 
-.PP 
-Openbox is a next generation, highly 
-configurable window manager. Openbox is compliant with the 
-latest window manager standards. 
-.PP 
-You can start Openbox in three ways: 
-.PP 
-If you run a display manager such as GDM, you will find 3 entries 
-in the login session type menu for Openbox: 
-\fBGNOME/Openbox\fR, \fBKDE/Openbox\fR       and \fBOpenbox\fR. If you want to use Openbox 
-within GNOME or KDE, you can choose the appropriate entry, and it will 
-launch GNOME or KDE with Openbox as the window manager. 
-.PP 
-If you don't want to run Openbox within a desktop environment, then 
-it is recommended that you instead set up a ~/.xsession file and 
-use the \fBDefault\fR session type. The ~/.xsession file 
-should start any applications you want to run at startup, and then run 
-\fBopenbox\fR at the end, such as: 
-.PP 
-.RS 
-.PP 
-.nf 
-xsetroot \-solid grey & 
-gnome-settings-daemon & 
-exec \fBopenbox\fR 
-.fi 
-.RE 
-.PP 
-Lastly, if you use \fBstartx\fR to launch your X 
-session, you should set up a ~/.xinitrc file, exactly the same as the 
-above ~/.xsession file. 
-.PP 
-You can use the \fBobconf\fR tool to configure Openbox 
-easily with a graphical interface, however more in-depth configuration 
-is possible by editing the configuration files by hand. Please note that 
-\fBobconf\fR older than version 2.0 may not work at all 
-for you. 
-.PP 
-The default configuration files are installed in 
-@configdir@/openbox/, and the user configuration is placed in 
-~/.config/openbox/. You can copy the default configuration 
-to ~/.config/openbox and edit it to your liking. 
-.PP 
-There are 3 default configuration files, \fBrc.xml\fP, 
-\fBrc-gnome.xml\fP, and \fBrc-kde.xml\fP. The 
-rc-gnome.xml is used when you run 
-\fBopenbox-gnome-session\fR and the rc-kde.xml is used when 
-you run \fBopenbox-kde-session\fR. The configuration 
-files should be named the same in ~/.config/openbox/. 
-.SH "OPTIONS" 
-.PP 
-These are the possible options that \fBopenbox\fR accepts: 
-.IP "\fB\-\-help\fP" 10 
-Show a summary of the options available. 
-.IP "\fB\-\-version\fP" 10 
-Show the version of the program. 
-.IP "\fB\-\-replace\fP" 10 
-Replace the currently running window manager. 
-.IP "\fB\-\-reconfigure\fP" 10 
-If Openbox is already running on the display, tell it to 
-reload its configuration. 
-.IP "\fB\-\-sm-disable\fP" 10 
-Do not connect to the session manager. 
-.IP "\fB\-\-sync\fP" 10 
-Run in synchronous mode (for debugging). 
-.IP "\fB\-\-debug\fP" 10 
-Display debugging output. 
-.IP "\fB\-\-debug-focus\fP" 10 
-Display debugging output for focus handling. 
-.IP "\fB\-\-debug-xinerama\fP" 10 
-Split the display into two fake xinerama regions, if 
-xinerama is not already enabled. This is for debugging 
-xinerama support. 
-.SH "SEE ALSO" 
-.PP 
-obconf (1), openbox-gnome-session (1), openbox-kde-session (1). 
-.PP 
-The program's full documentation is available on the website: 
-\fBhttp://openbox.org/\fP 
-.PP 
-Please report bugs to: \fBhttp://bugzilla.icculus.org/ 
-\fP 
-.\" created by instant / docbook-to-man, Sun 13 May 2007, 20:35 
index b173655414ce21bbbd55b8034ded7b4ec11aae6d..70766ba468f9f3b4ba7e3c1bdf70f544fabb0c9f 100644 (file)
@@ -63,20 +63,31 @@ manpage.1: manpage.sgml
       within GNOME or KDE, you can choose the appropriate entry, and it will
       launch GNOME or KDE with Openbox as the window manager.</para>
 
-    <para>If you don't want to run Openbox within a desktop environment, then
-      it is recommended that you instead set up a ~/.xsession file and
-      use the <command>Default</command> session type. The ~/.xsession file
-      should start any applications you want to run at startup, and then run
-      <command>&dhpackage;</command> at the end, such as:</para>
+    <para>The third option at log in, which is <command>Openbox</command>
+      without a session manager, uses the <command>openbox-session</command>
+      command to start Openbox. On log in, <command>&dhpackage;</command> will
+      run the ~/.config/openbox/autostart.sh script if it exists, and will run
+      the system-wide script @configdir@/openbox/autostart.sh otherwise. You
+      may place anything you want to run automatically in those files, for
+      example:
+      </para>
 
-      <blockquote><literallayout>
+    <blockquote><literallayout>
       xsetroot -solid grey &
-      gnome-settings-daemon &
-      exec <command>&dhpackage;</command></literallayout></blockquote>
+      gnome-settings-daemon &</literallayout></blockquote>
+
+    <para>Make sure that each line is followed by a "&" or else the script will
+      stop there and further commands will not be executed. You can use the
+      @configdir@/openbox/autostart.sh file as an example for creating your
+      own.</para>
+
+    <para>The default @configdir@/openbox/autostart.sh runs a number of things
+      with Openbox.</para>
 
     <para>Lastly, if you use <command>startx</command> to launch your X
-      session, you should set up a ~/.xinitrc file, exactly the same as the
-      above ~/.xsession file.</para>
+      session, you can set up a ~/.xinitrc file to run
+      <command>openbox-session</command> and follow the same directions as
+      above regarding the autostart.sh file.</para>
 
     <para>You can use the <command>obconf</command> tool to configure Openbox
       easily with a graphical interface, however more in-depth configuration
@@ -84,18 +95,10 @@ manpage.1: manpage.sgml
       <command>obconf</command> older than version 2.0 may not work at all
       for you.</para>
 
-    <para>The default configuration files are installed in
+    <para>The default configuration and menu files are installed in
       @configdir@/openbox/, and the user configuration is placed in
-      ~/.config/openbox/. You can copy the default configuration
+      ~/.config/openbox/. You can copy the default configuration and menus
       to ~/.config/openbox and edit it to your liking.</para>
-
-    <para>There are 3 default configuration files, <literal>rc.xml</literal>,
-      <literal>rc-gnome.xml</literal>, and <literal>rc-kde.xml</literal>. The
-      rc-gnome.xml is used when you run
-      <command>openbox-gnome-session</command> and the rc-kde.xml is used when
-      you run <command>openbox-kde-session</command>. The configuration
-      files should be named the same in ~/.config/openbox/.</para>
-
   </refsect1>
   <refsect1>
     <title>OPTIONS</title>
index aa9465b8eb7fe366541db0b9ac9904e6aadd2e03..501918599f59ded0a4ce5625a7c5416be78a4ea1 100644 (file)
@@ -260,7 +260,9 @@ void setup_action_send_to_desktop_down(ObAction **a, ObUserAction uact)
 
 void setup_action_desktop(ObAction **a, ObUserAction uact)
 {
+/*
     (*a)->data.desktop.inter.any.interactive = FALSE;
+*/
 }
 
 void setup_action_desktop_prev(ObAction **a, ObUserAction uact)
@@ -1013,9 +1015,11 @@ ObAction *action_parse(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
                 if ((n = parse_find_node("desktop", node->xmlChildrenNode)))
                     act->data.desktop.desk = parse_int(doc, n);
                 if (act->data.desktop.desk > 0) act->data.desktop.desk--;
+/*
                 if ((n = parse_find_node("dialog", node->xmlChildrenNode)))
                     act->data.desktop.inter.any.interactive =
                         parse_bool(doc, n);
+*/
            } else if (act->func == action_send_to_desktop) {
                 if ((n = parse_find_node("desktop", node->xmlChildrenNode)))
                     act->data.sendto.desk = parse_int(doc, n);
@@ -1206,27 +1210,14 @@ void action_execute(union ActionData *data)
     GError *e = NULL;
     gchar *cmd, **argv = 0;
     if (data->execute.path) {
-        /* Ungrab the keyboard before running the action.
-
-           If there is an interactive action going on, then cancel it to
-           release the keyboard. If not, then call XUngrabKeyboard().
-
-           We call XUngrabKeyboard because a key press causes a passive
-           grab on the keyboard, and so if program we are executing wants to
-           grab the keyboard, it will fail if the button is still held down
-           (which is likely).
-
-           Use the X function not out own, because we're not considering
-           a grab to be in place at all so our function won't try ungrab
-           anything.
-        */
-        if (keyboard_interactively_grabbed())
-            keyboard_interactive_cancel();
-        else
-            XUngrabKeyboard(ob_display, data->any.time);
-
         cmd = g_filename_from_utf8(data->execute.path, -1, NULL, NULL, NULL);
         if (cmd) {
+            /* If there is an interactive action going on, then cancel it
+               to release the keyboard, so that the run application
+               can grab the keyboard if it wants to. */
+            if (keyboard_interactively_grabbed())
+                keyboard_interactive_cancel();
+
             if (!g_shell_parse_argv (cmd, NULL, &argv, &e)) {
                 g_message(_("Failed to execute '%s': %s"),
                           cmd, e->message);
@@ -1305,7 +1296,7 @@ void action_focus(union ActionData *data)
                go moving on us */
             event_halt_focus_delay();
 
-            client_focus(data->client.any.c);
+            client_focus(data->client.any.c, FALSE);
         }
     } else {
         /* focus action on something other than a client, make keybindings
@@ -1600,18 +1591,15 @@ void action_send_to_desktop(union ActionData *data)
 
 void action_desktop(union ActionData *data)
 {
-    if (!data->inter.any.interactive ||
-        (!data->inter.cancel && !data->inter.final))
+    /* XXX add the interactive/dialog option back again once the dialog
+       has been made to not use grabs */
+    if (data->desktop.desk < screen_num_desktops ||
+        data->desktop.desk == DESKTOP_ALL)
     {
-        if (data->desktop.desk < screen_num_desktops ||
-            data->desktop.desk == DESKTOP_ALL)
-        {
-            screen_set_desktop(data->desktop.desk, TRUE);
-            if (data->inter.any.interactive)
-                screen_desktop_popup(data->desktop.desk, TRUE);
-        }
-    } else
-        screen_desktop_popup(0, FALSE);
+        screen_set_desktop(data->desktop.desk, TRUE);
+        if (data->inter.any.interactive)
+            screen_desktop_popup(data->desktop.desk, TRUE);
+    }
 }
 
 void action_desktop_dir(union ActionData *data)
index 7c48f37b30bb6adeb4e95a16396384aeaf56eaaf..38452e44081747b0b984432a134df992e9ac0a26 100644 (file)
@@ -115,7 +115,7 @@ struct SendToDesktopDirection {
 };
 
 struct Desktop {
-    struct InteractiveAction inter;
+    struct AnyAction inter;
     guint desk;
 };
 
index c1df47865c547d987d4f35e2beedc87317bf155f..fa4aae9545c37258bcb90056f125bd7092a99c88 100644 (file)
@@ -65,7 +65,6 @@ typedef struct
 GList            *client_list          = NULL;
 
 static GSList *client_destroy_notifies = NULL;
-static GSList *client_hide_notifies    = NULL;
 
 static void client_get_all(ObClient *self, gboolean real);
 static void client_toggle_border(ObClient *self, gboolean show);
@@ -139,29 +138,6 @@ void client_remove_destroy_notify(ObClientCallback func)
     }
 }
 
-void client_add_hide_notify(ObClientCallback func, gpointer data)
-{
-    ClientCallback *d = g_new(ClientCallback, 1);
-    d->func = func;
-    d->data = data;
-    client_hide_notifies = g_slist_prepend(client_hide_notifies, d);
-}
-
-void client_remove_hide_notify(ObClientCallback func)
-{
-    GSList *it;
-
-    for (it = client_hide_notifies; it; it = g_slist_next(it)) {
-        ClientCallback *d = it->data;
-        if (d->func == func) {
-            g_free(d);
-            client_hide_notifies =
-                g_slist_delete_link(client_hide_notifies, it);
-            break;
-        }
-    }
-}
-
 void client_set_list()
 {
     Window *windows, *win_it;
@@ -2423,11 +2399,13 @@ gboolean client_should_show(ObClient *self)
     return FALSE;
 }
 
-void client_show(ObClient *self)
+gboolean client_show(ObClient *self)
 {
+    gboolean show = FALSE;
 
     if (client_should_show(self)) {
         frame_show(self->frame);
+        show = TRUE;
     }
 
     /* According to the ICCCM (sec 4.1.3.1) when a window is not visible, it
@@ -2435,14 +2413,28 @@ void client_show(ObClient *self)
        desktop!
     */
     client_change_wm_state(self);
+    return show;
 }
 
-void client_hide(ObClient *self)
+gboolean client_hide(ObClient *self)
 {
+    gboolean hide = FALSE;
+
     if (!client_should_show(self)) {
-        frame_hide(self->frame);
+        if (self == focus_client) {
+            /* if there is a grab going on, then we need to cancel it. if we
+               move focus during the grab, applications will get
+               NotifyWhileGrabbed events and ignore them !
+
+               actions should not rely on being able to move focus during an
+               interactive grab.
+            */
+            if (keyboard_interactively_grabbed())
+                keyboard_interactive_cancel();
+        }
 
-        client_call_notifies(self, client_hide_notifies);
+        frame_hide(self->frame);
+        hide = TRUE;
     }
 
     /* According to the ICCCM (sec 4.1.3.1) when a window is not visible, it
@@ -2450,19 +2442,13 @@ void client_hide(ObClient *self)
        desktop!
     */
     client_change_wm_state(self);
+    return hide;
 }
 
 void client_showhide(ObClient *self)
 {
-
-    if (client_should_show(self)) {
-        frame_show(self->frame);
-    }
-    else {
-        frame_hide(self->frame);
-
-        client_call_notifies(self, client_hide_notifies);
-    }
+    if (!client_show(self))
+        client_hide(self);
 
     /* According to the ICCCM (sec 4.1.3.1) when a window is not visible, it
        needs to be in IconicState. This includes when it is on another
@@ -2814,7 +2800,6 @@ void client_fullscreen(ObClient *self, gboolean fs)
 
     self->fullscreen = fs;
     client_change_state(self); /* change the state hints on the client */
-    client_calc_layer(self);   /* and adjust out layer/stacking */
 
     if (fs) {
         self->pre_fullscreen_area = self->area;
@@ -2850,8 +2835,15 @@ void client_fullscreen(ObClient *self, gboolean fs)
 
     client_move_resize(self, x, y, w, h);
 
-    /* try focus us when we go into fullscreen mode */
-    client_focus(self);
+    /* and adjust our layer/stacking. do this after resizing the window,
+       and applying decorations, because windows which fill the screen are
+       considered "fullscreen" and it affects their layer */
+    client_calc_layer(self);
+
+    if (fs) {
+        /* try focus us when we go into fullscreen mode */
+        client_focus(self, FALSE);
+    }
 }
 
 static void client_iconify_recursive(ObClient *self,
@@ -3332,8 +3324,6 @@ ObClient *client_focus_target(ObClient *self)
 
 gboolean client_can_focus(ObClient *self)
 {
-    XEvent ev;
-
     /* choose the correct target */
     self = client_focus_target(self);
 
@@ -3346,7 +3336,7 @@ gboolean client_can_focus(ObClient *self)
     return TRUE;
 }
 
-gboolean client_focus(ObClient *self)
+gboolean client_focus(ObClient *self, gboolean checkinvalid)
 {
     /* choose the correct target */
     self = client_focus_target(self);
@@ -3373,13 +3363,15 @@ gboolean client_focus(ObClient *self)
     if (keyboard_interactively_grabbed())
         keyboard_interactive_cancel();
 
+    if (checkinvalid)
+        xerror_set_ignore(TRUE);
+    xerror_occured = FALSE;
+
     if (self->can_focus) {
         /* This can cause a BadMatch error with CurrentTime, or if an app
            passed in a bad time for _NET_WM_ACTIVE_WINDOW. */
-        xerror_set_ignore(TRUE);
         XSetInputFocus(ob_display, self->window, RevertToPointerRoot,
                        event_curtime);
-        xerror_set_ignore(FALSE);
     }
 
     if (self->focus_notify) {
@@ -3397,17 +3389,10 @@ gboolean client_focus(ObClient *self)
         XSendEvent(ob_display, self->window, FALSE, NoEventMask, &ce);
     }
 
-#ifdef DEBUG_FOCUS
-    ob_debug("%sively focusing %lx at %d\n",
-             (self->can_focus ? "act" : "pass"),
-             self->window, (gint) event_curtime);
-#endif
+    if (checkinvalid)
+        xerror_set_ignore(FALSE);
 
-    /* Cause the FocusIn to come back to us. Important for desktop switches,
-       since otherwise we'll have no FocusIn on the queue and send it off to
-       the focus_backup. */
-    XSync(ob_display, FALSE);
-    return TRUE;
+    return !xerror_occured;
 }
 
 /*! Present the client to the user.
@@ -3441,7 +3426,7 @@ static void client_present(ObClient *self, gboolean here, gboolean raise)
     if (raise)
         stacking_raise(CLIENT_AS_WINDOW(self));
 
-    client_focus(self);
+    client_focus(self, FALSE);
 }
 
 void client_activate(ObClient *self, gboolean here, gboolean user)
index c4815d4c83e0cfb56b796d5b4a7b771798caa215..9019c62dcc863691b86e1a36ebdadee769bfeafd 100644 (file)
@@ -314,10 +314,6 @@ typedef void (*ObClientCallback)(ObClient *client, gpointer data);
 void client_add_destroy_notify(ObClientCallback func, gpointer data);
 void client_remove_destroy_notify(ObClientCallback func);
 
-/*! Get notified when the client is hidden */
-void client_add_hide_notify(ObClientCallback func, gpointer data);
-void client_remove_hide_notify(ObClientCallback func);
-
 /*! Manages all existing windows */
 void client_manage_all();
 /*! Manages a given window
@@ -497,11 +493,11 @@ void client_kill(ObClient *self);
 */
 void client_set_desktop(ObClient *self, guint target, gboolean donthide);
 
-/*! Show the client if it should be shown. */
-void client_show(ObClient *self);
+/*! Show the client if it should be shown. Returns if the window is shown. */
+gboolean client_show(ObClient *self);
 
-/*! Show the client if it should be shown. */
-void client_hide(ObClient *self);
+/*! Show the client if it should be shown. Returns if the window is hidden. */
+gboolean client_hide(ObClient *self);
 
 /*! Show the client if it should be shown, and hide it if it should be
   hidden. This is for example, when switching desktops.
@@ -536,9 +532,10 @@ ObClient *client_focus_target(ObClient *self);
 gboolean client_can_focus(ObClient *self);
 
 /*! Attempt to focus the client window
-  NOTE: You should validate the client before calling this !! (client_validate)
-*/
-gboolean client_focus(ObClient *self);
+  If you care if focus actually went to the window or not, pass checkinvalid
+  as TRUE.
+ */
+gboolean client_focus(ObClient *self, gboolean checkinvalid);
 
 /*! Activates the client for use, focusing, uniconifying it, etc. To be used
   when the user deliberately selects a window for use.
index a2571f0e112dac34c82fca7e537b48b07d003b6b..1fa5e11f601538f45784631fffda7571078a5179 100644 (file)
@@ -307,10 +307,6 @@ static gboolean wanted_focusevent(XEvent *e, gboolean in_client_only)
                 return FALSE;
         }
 
-        /* This means focus moved to the frame window */
-        if (detail == NotifyInferior && !in_client_only)
-            return TRUE;
-
         /* It was on a client, was it a valid one?
            It's possible to get a FocusIn event for a client that was managed
            but has disappeared.
@@ -351,9 +347,6 @@ static gboolean wanted_focusevent(XEvent *e, gboolean in_client_only)
         /* This means focus moved from one client to another */
         if (detail == NotifyNonlinearVirtual)
             return TRUE;
-        /* This means focus had moved to our frame window and now moved off */
-        if (detail == NotifyNonlinear)
-            return TRUE;
 
         /* Otherwise.. */
         return FALSE;
@@ -484,9 +477,7 @@ static void event_process(const XEvent *ec, gpointer data)
         {
             XEvent ce;
 
-            ob_debug_type(OB_DEBUG_FOCUS,
-                          "Focus went to pointer root/none or to our frame "
-                          "window\n");
+            ob_debug_type(OB_DEBUG_FOCUS, "Focus went to pointer root/none\n");
 
             /* If another FocusIn is in the queue then don't fallback yet. This
                fixes the fun case of:
@@ -508,40 +499,24 @@ static void event_process(const XEvent *ec, gpointer data)
                 ob_debug_type(OB_DEBUG_FOCUS,
                               "  but another FocusIn is coming\n");
             } else {
-                /* Focus has been reverted to the root window, nothing, or to
-                   our frame window.
+                /* Focus has been reverted to the root window or nothing.
 
                    FocusOut events come after UnmapNotify, so we don't need to
                    worry about focusing an invalid window
                 */
 
-                /* In this case we know focus is in our screen */
-                if (e->xfocus.detail == NotifyInferior)
-                    focus_left_screen = FALSE;
-
                 if (!focus_left_screen)
                     focus_fallback(TRUE);
             }
         }
         else if (!client)
         {
-            XEvent ce;
-
             ob_debug_type(OB_DEBUG_FOCUS,
                           "Focus went to a window that is already gone\n");
 
             /* If you send focus to a window and then it disappears, you can
-               get the FocusIn FocusOut for it, after it is unmanaged.
-            */
-            if (XCheckIfEvent(ob_display, &ce, event_look_for_focusin_client,
-                              NULL))
-            {
-                XPutBackEvent(ob_display, &ce);
-                ob_debug_type(OB_DEBUG_FOCUS,
-                              "  but another FocusIn is coming\n");
-            } else {
-                focus_fallback(TRUE);
-            }
+               get the FocusIn for it, after it is unmanaged.
+               Just wait for the next FocusOut/FocusIn pair. */
         }
         else if (client != focus_client) {
             focus_left_screen = FALSE;
@@ -1718,7 +1693,7 @@ static gboolean focus_delay_func(gpointer data)
 
     event_curtime = d->time;
     if (focus_client != d->client) {
-        if (client_focus(d->client) && config_focus_raise)
+        if (client_focus(d->client, FALSE) && config_focus_raise)
             stacking_raise(CLIENT_AS_WINDOW(d->client));
     }
     event_curtime = old;
index 88ef01047160472775c7ac1ad58284cc776fcda7..60e6ea99e6f4f3a58162b97041f224d207801ba6 100644 (file)
@@ -44,14 +44,6 @@ ObClient *focus_client = NULL;
 GList *focus_order = NULL;
 ObClient *focus_cycle_target = NULL;
 
-/*! This variable is used for focus fallback. If we fallback to a window, we
-  set this to the window. And when focus goes somewhere after that, it will
-  be set to NULL. If between falling back to that window and something
-  getting focused, the window gets unmanaged, then if there are no incoming
-  FocusIn events, we fallback again because focus has just gotten itself lost.
- */
-static ObClient *focus_tried = NULL;
-
 struct {
     InternalWindow top;
     InternalWindow left;
@@ -69,7 +61,6 @@ static gboolean valid_focus_target(ObClient *ft,
                                    gboolean dock_windows,
                                    gboolean desktop_windows);
 static void focus_cycle_destroy_notify(ObClient *client, gpointer data);
-static void focus_tried_hide_notify(ObClient *client, gpointer data);
 
 static Window createWindow(Window parent, gulong mask,
                            XSetWindowAttributes *attrib)
@@ -88,8 +79,6 @@ void focus_startup(gboolean reconfig)
         XSetWindowAttributes attr;
 
         client_add_destroy_notify(focus_cycle_destroy_notify, NULL);
-        client_add_destroy_notify(focus_tried_hide_notify, NULL);
-        client_add_hide_notify(focus_tried_hide_notify, NULL);
 
         /* start with nothing focused */
         focus_nothing();
@@ -143,8 +132,6 @@ void focus_shutdown(gboolean reconfig)
 
     if (!reconfig) {
         client_remove_destroy_notify(focus_cycle_destroy_notify);
-        client_remove_destroy_notify(focus_tried_hide_notify);
-        client_remove_hide_notify(focus_tried_hide_notify);
 
         /* reset focus to root */
         XSetInputFocus(ob_display, PointerRoot, RevertToNone, CurrentTime);
@@ -173,6 +160,9 @@ void focus_set_client(ObClient *client)
     ob_debug_type(OB_DEBUG_FOCUS,
                   "focus_set_client 0x%lx\n", client ? client->window : 0);
 
+    if (focus_client == client)
+        return;
+
     /* uninstall the old colormap, and install the new one */
     screen_install_colormap(focus_client, FALSE);
     screen_install_colormap(client, TRUE);
@@ -198,102 +188,88 @@ void focus_set_client(ObClient *client)
         PROP_SET32(RootWindow(ob_display, ob_screen),
                    net_active_window, window, active);
     }
-
-
-    focus_tried = NULL; /* focus isn't "trying" to go anywhere now */
-    ob_debug_type(OB_DEBUG_FOCUS, "focus tried = NULL\n");
 }
 
-static ObClient* focus_fallback_target(gboolean allow_refocus, ObClient *old)
+static ObClient* focus_fallback_target(gboolean allow_refocus)
 {
     GList *it;
-    ObClient *target = NULL;
-    ObClient *desktop = NULL;
+    ObClient *c;
+    ObClient *old = focus_client;
 
     ob_debug_type(OB_DEBUG_FOCUS, "trying pointer stuff\n");
     if (config_focus_follow && !config_focus_last)
-    {
-        if ((target = client_under_pointer()))
-            if (allow_refocus || target != old)
-                if (client_normal(target) && client_can_focus(target)) {
-                    ob_debug_type(OB_DEBUG_FOCUS, "found in pointer stuff\n");
-                    return target;
-                }
-    }
-
-#if 0
-        /* try for group relations */
-        if (old->group) {
-            GSList *sit;
-
-            for (it = focus_order[screen_desktop]; it; it = g_list_next(it))
-                for (sit = old->group->members; sit; sit = g_slist_next(sit))
-                    if (sit->data == it->data)
-                        if (sit->data != old && client_normal(sit->data))
-                            if (client_can_focus(sit->data))
-                                return sit->data;
+        if ((c = client_under_pointer()) &&
+            (allow_refocus || c != old) &&
+            (client_normal(c) &&
+             client_focus(c, TRUE)))
+        {
+            ob_debug_type(OB_DEBUG_FOCUS, "found in pointer stuff\n");
+            return c;
         }
-#endif
 
     ob_debug_type(OB_DEBUG_FOCUS, "trying omnipresentness\n");
-    if (allow_refocus && old && old->desktop == DESKTOP_ALL &&
-        client_normal(old))
+    if (allow_refocus && old &&
+        old->desktop == DESKTOP_ALL &&
+        client_normal(old) &&
+        client_focus(old, TRUE))
     {
+        ob_debug_type(OB_DEBUG_FOCUS, "found in omnipresentness\n");
         return old;
     }
 
 
     ob_debug_type(OB_DEBUG_FOCUS, "trying the focus order\n");
-    for (it = focus_order; it; it = g_list_next(it))
-        if (allow_refocus || it->data != old) {
-            ObClient *c = it->data;
-            /* fallback focus to a window if:
-               1. it is actually focusable, cuz if it's not then we're sending
-               focus off to nothing. this includes if it is visible right now
-               2. it is on the current desktop. this ignores omnipresent
-               windows, which are problematic in their own rite.
-               3. it is a normal type window, don't fall back onto a dock or
-               a splashscreen or a desktop window (save the desktop as a
-               backup fallback though)
-            */
-            if (client_can_focus(c))
-            {
-                if (c->desktop == screen_desktop && client_normal(c)) {
-                    ob_debug_type(OB_DEBUG_FOCUS, "found in focus order\n");
-                    return it->data;
-                } else if (c->type == OB_CLIENT_TYPE_DESKTOP && 
-                           desktop == NULL)
-                    desktop = c;
-            }
+    for (it = focus_order; it; it = g_list_next(it)) {
+        c = it->data;
+        /* fallback focus to a window if:
+           1. it is on the current desktop. this ignores omnipresent
+           windows, which are problematic in their own rite.
+           2. it is a normal type window, don't fall back onto a dock or
+           a splashscreen or a desktop window (save the desktop as a
+           backup fallback though)
+        */
+        if (c->desktop == screen_desktop &&
+            client_normal(c) &&
+            (allow_refocus || c != old) &&
+            client_focus(c, TRUE))
+        {
+            ob_debug_type(OB_DEBUG_FOCUS, "found in focus order\n");
+            return c;
         }
+    }
 
-    /* as a last resort fallback to the desktop window if there is one.
-       (if there's more than one, then the one most recently focused.)
-    */
-    ob_debug_type(OB_DEBUG_FOCUS, "found desktop: \n", !!desktop);
-    return desktop;   
+    ob_debug_type(OB_DEBUG_FOCUS, "trying a desktop window\n");
+    for (it = focus_order; it; it = g_list_next(it)) {
+        c = it->data;
+        /* fallback focus to a window if:
+           1. it is on the current desktop. this ignores omnipresent
+           windows, which are problematic in their own rite.
+           2. it is a normal type window, don't fall back onto a dock or
+           a splashscreen or a desktop window (save the desktop as a
+           backup fallback though)
+        */
+        if (c->type == OB_CLIENT_TYPE_DESKTOP &&
+            (allow_refocus || c != old) &&
+            client_focus(c, TRUE))
+        {
+            ob_debug_type(OB_DEBUG_FOCUS, "found a desktop window\n");
+            return c;
+        }
+    }
+
+    return NULL;
 }
 
 ObClient* focus_fallback(gboolean allow_refocus)
 {
     ObClient *new;
-    ObClient *old;
-
-    old = focus_client;
-    new = focus_fallback_target(allow_refocus, focus_client);
 
     /* unfocus any focused clients.. they can be focused by Pointer events
        and such, and then when we try focus them, we won't get a FocusIn
        event at all for them. */
     focus_nothing();
 
-    if (new) {
-        client_focus(new);
-        /* remember that we tried to send focus here */
-        focus_tried = new;
-
-        ob_debug_type(OB_DEBUG_FOCUS, "focus tried = %s\n", new->title);
-    }
+    new = focus_fallback_target(allow_refocus);
 
     return new;
 }
@@ -313,9 +289,6 @@ void focus_nothing()
     focus_client = NULL;
     */
 
-    focus_tried = NULL; /* focus isn't "trying" to go anywhere now */
-    ob_debug_type(OB_DEBUG_FOCUS, "focus tried = NULL\n");
-
     /* if there is a grab going on, then we need to cancel it. if we move
        focus during the grab, applications will get NotifyWhileGrabbed events
        and ignore them !
@@ -963,28 +936,3 @@ ObClient *focus_order_find_first(guint desktop)
     }
     return NULL;
 }
-
-static void focus_tried_hide_notify(ObClient *client, gpointer data)
-{
-    XEvent ce;
-
-    ob_debug_type(OB_DEBUG_FOCUS, "checking focus tried (%s) against %s\n",
-                  (focus_tried?focus_tried->title:"(null)"), client->title);
-
-    if (client == focus_tried) {
-        /* we were trying to focus this window but it's gone */
-
-        focus_tried = NULL;
-
-        ob_debug_type(OB_DEBUG_FOCUS, "Tried to focus window 0x%x and it "
-                      "is being unmanaged:\n");
-        if (XCheckIfEvent(ob_display, &ce, event_look_for_focusin_client,NULL))
-        {
-            XPutBackEvent(ob_display, &ce);
-            ob_debug_type(OB_DEBUG_FOCUS, "  but another FocusIn is coming\n");
-        } else {
-            ob_debug_type(OB_DEBUG_FOCUS, "  so falling back focus again.\n");
-            focus_fallback(TRUE);
-        }
-    }
-}
index b834046b9cdc4282a51f19093346c53d1d6852c0..ab9d05b09859c631b026bbf31d307adeba1b0c83 100644 (file)
@@ -311,6 +311,14 @@ void keyboard_event(ObClient *client, const XEvent *e)
             else {
                 keyboard_reset_chains(0);
 
+                /* If we don't have the keyboard grabbed, then ungrab it with
+                   XUngrabKeyboard, so that there is not a passive grab left
+                   on from the KeyPress. If the grab is left on, and focus
+                   moves during that time, it will be NotifyWhileGrabbed, and
+                   applications like to ignore those! */
+                if (!keyboard_interactively_grabbed())
+                    XUngrabKeyboard(ob_display, e->xkey.time);
+
                 action_run_key(p->actions, client, e->xkey.state,
                                e->xkey.x_root, e->xkey.y_root,
                                e->xkey.time);
index b5fe6cb00564b1c0e0bda67f8f223a1b485ffe8e..837f3e92feec451dd59993944d42fa9f785fc36e 100644 (file)
@@ -162,27 +162,27 @@ void moveresize_start(ObClient *c, gint x, gint y, guint b, guint32 cnr)
           (c->functions & OB_CLIENT_FUNC_RESIZE)))
         return;
 
-    if (corner == prop_atoms.net_wm_moveresize_size_topleft)
+    if (cnr == prop_atoms.net_wm_moveresize_size_topleft)
         cur = OB_CURSOR_NORTHWEST;
-    else if (corner == prop_atoms.net_wm_moveresize_size_top)
+    else if (cnr == prop_atoms.net_wm_moveresize_size_top)
         cur = OB_CURSOR_NORTH;
-    else if (corner == prop_atoms.net_wm_moveresize_size_topright)
+    else if (cnr == prop_atoms.net_wm_moveresize_size_topright)
         cur = OB_CURSOR_NORTHEAST;
-    else if (corner == prop_atoms.net_wm_moveresize_size_right)
+    else if (cnr == prop_atoms.net_wm_moveresize_size_right)
         cur = OB_CURSOR_EAST;
-    else if (corner == prop_atoms.net_wm_moveresize_size_bottomright)
+    else if (cnr == prop_atoms.net_wm_moveresize_size_bottomright)
         cur = OB_CURSOR_SOUTHEAST;
-    else if (corner == prop_atoms.net_wm_moveresize_size_bottom)
+    else if (cnr == prop_atoms.net_wm_moveresize_size_bottom)
         cur = OB_CURSOR_SOUTH;
-    else if (corner == prop_atoms.net_wm_moveresize_size_bottomleft)
+    else if (cnr == prop_atoms.net_wm_moveresize_size_bottomleft)
         cur = OB_CURSOR_SOUTHWEST;
-    else if (corner == prop_atoms.net_wm_moveresize_size_left)
+    else if (cnr == prop_atoms.net_wm_moveresize_size_left)
         cur = OB_CURSOR_WEST;
-    else if (corner == prop_atoms.net_wm_moveresize_size_keyboard)
+    else if (cnr == prop_atoms.net_wm_moveresize_size_keyboard)
         cur = OB_CURSOR_SOUTHEAST;
-    else if (corner == prop_atoms.net_wm_moveresize_move)
+    else if (cnr == prop_atoms.net_wm_moveresize_move)
         cur = OB_CURSOR_MOVE;
-    else if (corner == prop_atoms.net_wm_moveresize_move_keyboard)
+    else if (cnr == prop_atoms.net_wm_moveresize_move_keyboard)
         cur = OB_CURSOR_MOVE;
     else
         g_assert_not_reached();
index 303f809b4c677fd684314ab96ee1f9a4b22320ee..419d2b55f932f65d0a3de4d52986da4c1b8e004e 100644 (file)
@@ -101,7 +101,6 @@ static KeyCode   keys[OB_NUM_KEYS];
 static gint      exitcode = 0;
 static guint     remote_control = 0;
 static gboolean  being_replaced = FALSE;
-static gchar    *config_type = NULL;
 
 static void signal_handler(gint signal, gpointer data);
 static void remove_args(gint *argc, gchar **argv, gint index, gint num);
@@ -213,7 +212,7 @@ gint main(gint argc, gchar **argv)
     prop_startup(); /* get atoms values for the display */
     extensions_query_all(); /* find which extensions are present */
 
-    if (screen_annex(program_name)) { /* it will be ours! */
+    if (screen_annex()) { /* it will be ours! */
         do {
             modkeys_startup(reconfigure);
 
@@ -238,15 +237,17 @@ gint main(gint argc, gchar **argv)
                 config_startup(i);
 
                 /* parse/load user options */
-                if (parse_load_rc(config_type, &doc, &node)) {
+                if (parse_load_rc(NULL, &doc, &node)) {
                     parse_tree(i, doc, node->xmlChildrenNode);
                     parse_close(doc);
                 } else
                     g_message(_("Unable to find a valid config file, using some simple defaults"));
 
+/*
                 if (config_type != NULL)
                     PROP_SETS(RootWindow(ob_display, ob_screen),
                               ob_config, config_type);
+*/
 
                 /* we're done with parsing now, kill it */
                 parse_shutdown(i);
@@ -310,7 +311,7 @@ gint main(gint argc, gchar **argv)
                     (w = g_hash_table_lookup(window_map, &xid)) &&
                     WINDOW_IS_CLIENT(w))
                 {
-                    client_focus(WINDOW_AS_CLIENT(w));
+                    client_focus(WINDOW_AS_CLIENT(w), FALSE);
                 }
             } else {
                 GList *it;
@@ -489,8 +490,6 @@ static void parse_env()
 {
     /* unset this so we don't pass it on unknowingly */
     unsetenv("DESKTOP_STARTUP_ID");
-
-    config_type = getenv("OPENBOX_CONFIG_NAMESPACE");
 }
 
 static void parse_args(gint *argc, gchar **argv)
index d71c9eaafd5c039a9d3932f6399ec3d2ed2611fe..23821301274908a349a4796f0c8fec0ebab05b09 100644 (file)
@@ -153,7 +153,7 @@ static gboolean replace_wm()
     return TRUE;
 }
 
-gboolean screen_annex(const gchar *program_name)
+gboolean screen_annex()
 {
     XSetWindowAttributes attrib;
     pid_t pid;
@@ -190,7 +190,6 @@ gboolean screen_annex(const gchar *program_name)
         return FALSE;
     }
 
-
     screen_set_root_cursor();
 
     /* set the OPENBOX_PID hint */
@@ -203,7 +202,7 @@ gboolean screen_annex(const gchar *program_name)
                net_supporting_wm_check, window, screen_support_win);
 
     /* set properties on the supporting window */
-    PROP_SETS(screen_support_win, net_wm_name, program_name);
+    PROP_SETS(screen_support_win, net_wm_name, "Openbox");
     PROP_SET32(screen_support_win, net_supporting_wm_check,
                window, screen_support_win);
 
@@ -506,12 +505,12 @@ void screen_set_desktop(guint num, gboolean dofocus)
            to call xsetinputfocus on the window ourselves. otherwise there is
            no guarantee the window will actually take focus.. */
         if (c->can_focus) {
-            /* do this here so that if you switch desktops to a window with
-               helper windows then the helper windows won't flash */
-            client_bring_helper_windows(c);
             /* reduce flicker by hiliting now rather than waiting for the
                server FocusIn event */
             frame_adjust_focus(c->frame, TRUE);
+            /* do this here so that if you switch desktops to a window with
+               helper windows then the helper windows won't flash */
+            client_bring_helper_windows(c);
         }
     }
 
@@ -943,7 +942,7 @@ void screen_show_desktop(gboolean show, ObClient *show_only)
             ObClient *c = it->data;
             if (c->type == OB_CLIENT_TYPE_DESKTOP &&
                 (c->desktop == screen_desktop || c->desktop == DESKTOP_ALL) &&
-                client_focus(it->data))
+                client_focus(it->data, FALSE))
                 break;
         }
     }
index a694f66349cf4ac16d528f622bfaaad25ff56ea6..bd96ab200992f998d00ca9d099c0befda1974dd4 100644 (file)
@@ -53,7 +53,7 @@ extern DesktopLayout screen_desktop_layout;
 extern gchar **screen_desktop_names;
 
 /*! Take over the screen, set the basic hints on it claming it as ours */
-gboolean screen_annex(const gchar *program_name);
+gboolean screen_annex();
 
 /*! Once the screen is ours, set up its initial state */
 void screen_startup(gboolean reconfig);
index ded4644ebb13d791b3df1da57e58c42312bcf2f6..d93341c8aaecf7477cc31596784d1a61b9211375 100644 (file)
 /*! The possible stacking layers a client window can be a part of */
 typedef enum {
     OB_STACKING_LAYER_INVALID,
-    OB_STACKING_LAYER_DESKTOP,     /*!< 0 - desktop windows */
-    OB_STACKING_LAYER_BELOW,       /*!< 1 - normal windows w/ below */
-    OB_STACKING_LAYER_NORMAL,      /*!< 2 - normal windows */
-    OB_STACKING_LAYER_ABOVE,       /*!< 3 - normal windows w/ above */
-    OB_STACKING_LAYER_FULLSCREEN,  /*!< 4 - fullscreeen windows */
-    OB_STACKING_LAYER_INTERNAL,    /*!< 5 - openbox windows/menus */
+    OB_STACKING_LAYER_DESKTOP,          /*!< 0 - desktop windows */
+    OB_STACKING_LAYER_BELOW,            /*!< 1 - normal windows w/ below */
+    OB_STACKING_LAYER_NORMAL,           /*!< 2 - normal windows */
+    OB_STACKING_LAYER_ABOVE,            /*!< 3 - normal windows w/ above */
+    OB_STACKING_LAYER_FULLSCREEN,       /*!< 4 - fullscreeen windows */
+    OB_STACKING_LAYER_INTERNAL,         /*!< 5 - openbox windows/menus */
     OB_NUM_STACKING_LAYERS
 } ObStackingLayer;