From a196647192167746512156e78808c1507cb208f2 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Tue, 15 May 2007 15:20:56 +0000 Subject: [PATCH] merge r6533-6557 from trunk --- Makefile.am | 82 ++- data/autostart.sh | 31 + data/gnome-wm-properties/openbox.desktop | 2 +- data/rc-gnome.xml | 546 ------------------ data/rc-kde.xml | 546 ------------------ data/xsession/openbox-gnome-session.in | 1 - ...gnome.desktop => openbox-gnome.desktop.in} | 2 +- data/xsession/openbox-kde-session.in | 1 - ...box-kde.desktop => openbox-kde.desktop.in} | 2 +- data/xsession/openbox-session.in | 16 + .../{openbox.desktop => openbox.desktop.in} | 4 +- doc/openbox-gnome-session.1 | 4 +- doc/openbox-gnome-session.1.sgml | 5 +- doc/openbox-kde-session.1 | 4 +- doc/openbox-kde-session.1.sgml | 5 +- doc/openbox-session.1.sgml | 90 +++ doc/openbox.1.in | 92 --- doc/openbox.1.sgml | 43 +- openbox/action.c | 50 +- openbox/action.h | 2 +- openbox/client.c | 97 ++-- openbox/client.h | 19 +- openbox/event.c | 35 +- openbox/focus.c | 164 ++---- openbox/keyboard.c | 8 + openbox/moveresize.c | 22 +- openbox/openbox.c | 11 +- openbox/screen.c | 13 +- openbox/screen.h | 2 +- openbox/stacking.h | 12 +- 30 files changed, 398 insertions(+), 1513 deletions(-) create mode 100644 data/autostart.sh delete mode 100644 data/rc-gnome.xml delete mode 100644 data/rc-kde.xml rename data/xsession/{openbox-gnome.desktop => openbox-gnome.desktop.in} (83%) rename data/xsession/{openbox-kde.desktop => openbox-kde.desktop.in} (83%) create mode 100644 data/xsession/openbox-session.in rename data/xsession/{openbox.desktop => openbox.desktop.in} (70%) create mode 100644 doc/openbox-session.1.sgml delete mode 100644 doc/openbox.1.in diff --git a/Makefile.am b/Makefile.am index 8b9f2fb5..75b206dc 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 index 00000000..962cae07 --- /dev/null +++ b/data/autostart.sh @@ -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 diff --git a/data/gnome-wm-properties/openbox.desktop b/data/gnome-wm-properties/openbox.desktop index 96418613..eee0dd60 100644 --- a/data/gnome-wm-properties/openbox.desktop +++ b/data/gnome-wm-properties/openbox.desktop @@ -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 index 20b20c51..00000000 --- a/data/rc-gnome.xml +++ /dev/null @@ -1,546 +0,0 @@ - - - - - - - - 10 - 20 - - - - yes - yes - no - 200 - no - - - - Smart - - - - - Clearlooks - NLIMC - yes - - yes - yes - - sans - 8 - - bold - - normal - - - - sans - 8 - - bold - - normal - - - - sans - 9 - - normal - - normal - - - - sans - 9 - - normal - - normal - - - - sans - 9 - - bold - - normal - - - - - - - 4 - 1 - - desktop one - desktop two - desktop three - desktop four - - - - - yes - Nonpixel - - Center - - - - - TopLeft - - 0 - 0 - no - Above - - Vertical - - no - 300 - - 300 - - Middle - - - - - C-g - - - - no - - - no - - - no - - - no - - - no - - - no - - - no - - - no - - - 1 - - - 1 - - - 1 - - - 1 - - - - - - - - - - - - - - - - client-menu - - - - - - - - - - - - yesyes - - - - - - - - true - Konqueror - - kfmclient openProfile filemanagement - - - - - - 3 - - 200 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - client-menu - - - - - - - - - top - - - - - - - - - bottom - - - - - - - - - - - client-menu - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - client-menu - - - - client-menu - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - menu.xml - 200 - no - 100 - yes - - - - - - - - - - yes - - no - - - - center - - 200 - - 1 - - - - yes - - - 1 - - - normal - - - no - - no - - - no - - - yes - - true - - - - --> - - diff --git a/data/rc-kde.xml b/data/rc-kde.xml deleted file mode 100644 index 20b20c51..00000000 --- a/data/rc-kde.xml +++ /dev/null @@ -1,546 +0,0 @@ - - - - - - - - 10 - 20 - - - - yes - yes - no - 200 - no - - - - Smart - - - - - Clearlooks - NLIMC - yes - - yes - yes - - sans - 8 - - bold - - normal - - - - sans - 8 - - bold - - normal - - - - sans - 9 - - normal - - normal - - - - sans - 9 - - normal - - normal - - - - sans - 9 - - bold - - normal - - - - - - - 4 - 1 - - desktop one - desktop two - desktop three - desktop four - - - - - yes - Nonpixel - - Center - - - - - TopLeft - - 0 - 0 - no - Above - - Vertical - - no - 300 - - 300 - - Middle - - - - - C-g - - - - no - - - no - - - no - - - no - - - no - - - no - - - no - - - no - - - 1 - - - 1 - - - 1 - - - 1 - - - - - - - - - - - - - - - - client-menu - - - - - - - - - - - - yesyes - - - - - - - - true - Konqueror - - kfmclient openProfile filemanagement - - - - - - 3 - - 200 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - client-menu - - - - - - - - - top - - - - - - - - - bottom - - - - - - - - - - - client-menu - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - client-menu - - - - client-menu - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - menu.xml - 200 - no - 100 - yes - - - - - - - - - - yes - - no - - - - center - - 200 - - 1 - - - - yes - - - 1 - - - normal - - - no - - no - - - no - - - yes - - true - - - - --> - - diff --git a/data/xsession/openbox-gnome-session.in b/data/xsession/openbox-gnome-session.in index b5223552..c2bc9399 100644 --- a/data/xsession/openbox-gnome-session.in +++ b/data/xsession/openbox-gnome-session.in @@ -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 "$@" diff --git a/data/xsession/openbox-gnome.desktop b/data/xsession/openbox-gnome.desktop.in similarity index 83% rename from data/xsession/openbox-gnome.desktop rename to data/xsession/openbox-gnome.desktop.in index da15d1f5..19ae82e0 100644 --- a/data/xsession/openbox-gnome.desktop +++ b/data/xsession/openbox-gnome.desktop.in @@ -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 diff --git a/data/xsession/openbox-kde-session.in b/data/xsession/openbox-kde-session.in index a125e4cd..0fe00940 100644 --- a/data/xsession/openbox-kde-session.in +++ b/data/xsession/openbox-kde-session.in @@ -2,5 +2,4 @@ # Run KDE with Openbox as its window manager export KDEWM="@bindir@/openbox" -export OPENBOX_CONFIG_NAMESPACE="kde" exec startkde "$@" diff --git a/data/xsession/openbox-kde.desktop b/data/xsession/openbox-kde.desktop.in similarity index 83% rename from data/xsession/openbox-kde.desktop rename to data/xsession/openbox-kde.desktop.in index 1244d8d9..ddfc72d7 100644 --- a/data/xsession/openbox-kde.desktop +++ b/data/xsession/openbox-kde.desktop.in @@ -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 index 00000000..c466f17d --- /dev/null +++ b/data/xsession/openbox-session.in @@ -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 "$@" diff --git a/data/xsession/openbox.desktop b/data/xsession/openbox.desktop.in similarity index 70% rename from data/xsession/openbox.desktop rename to data/xsession/openbox.desktop.in index 77de117a..f8cb9f36 100644 --- a/data/xsession/openbox.desktop +++ b/data/xsession/openbox.desktop.in @@ -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 diff --git a/doc/openbox-gnome-session.1 b/doc/openbox-gnome-session.1 index 843801ff..d6a5a644 100644 --- a/doc/openbox-gnome-session.1 +++ b/doc/openbox-gnome-session.1 @@ -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 diff --git a/doc/openbox-gnome-session.1.sgml b/doc/openbox-gnome-session.1.sgml index 702fab70..01236aff 100644 --- a/doc/openbox-gnome-session.1.sgml +++ b/doc/openbox-gnome-session.1.sgml @@ -38,14 +38,11 @@ manpage.1: manpage.sgml &dhpackage; runs a GNOME session with Openbox as the window manager. - - When running inside GNOME like this, Openbox will use the - rc-gnome.xml configuration file. SEE ALSO - openbox(1), openbox-kde-session (1). + openbox(1), openbox-kde-session (1), openbox-session(1). The program's full documentation is available on the website: diff --git a/doc/openbox-kde-session.1 b/doc/openbox-kde-session.1 index 1c87fb8c..7e18944b 100644 --- a/doc/openbox-kde-session.1 +++ b/doc/openbox-kde-session.1 @@ -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 diff --git a/doc/openbox-kde-session.1.sgml b/doc/openbox-kde-session.1.sgml index d481ff02..aeb114a4 100644 --- a/doc/openbox-kde-session.1.sgml +++ b/doc/openbox-kde-session.1.sgml @@ -38,14 +38,11 @@ manpage.1: manpage.sgml &dhpackage; runs a KDE session with Openbox as the window manager. - - When running inside KDE like this, Openbox will use the - rc-kde.xml configuration file. SEE ALSO - openbox(1), openbox-gnome-session (1). + openbox(1), openbox-gnome-session (1), openbox-session (1). 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 index 00000000..e32c48e1 --- /dev/null +++ b/doc/openbox-session.1.sgml @@ -0,0 +1,90 @@ + 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. + + --> + + 1"> + OPENBOX"> + +]> + + + + &dhucpackage; + + &dhsection; + + + &dhpackage; + + Runs an Openbox session without any session manager. + + + + DESCRIPTION + + &dhpackage; 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. + + On log in, &dhpackage; 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: + + +
+ xsetroot -solid grey & + gnome-settings-daemon &
+ + 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. + +
+ + SEE ALSO + + openbox(1), openbox-kde-session (1), openbox-gnome-session (1). + + + The program's full documentation is available on the website: + http://openbox.org/ + + Please report bugs to: http://bugzilla.icculus.org/ + + +
+ + + + diff --git a/doc/openbox.1.in b/doc/openbox.1.in deleted file mode 100644 index 7962235e..00000000 --- a/doc/openbox.1.in +++ /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 diff --git a/doc/openbox.1.sgml b/doc/openbox.1.sgml index b1736554..70766ba4 100644 --- a/doc/openbox.1.sgml +++ b/doc/openbox.1.sgml @@ -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.
- 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 Default session type. The ~/.xsession file - should start any applications you want to run at startup, and then run - &dhpackage; at the end, such as: + The third option at log in, which is Openbox + without a session manager, uses the openbox-session + command to start Openbox. On log in, &dhpackage; 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: + -
+
xsetroot -solid grey & - gnome-settings-daemon & - exec &dhpackage;
+ gnome-settings-daemon &
+ + 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. + + The default @configdir@/openbox/autostart.sh runs a number of things + with Openbox. Lastly, if you use startx to launch your X - session, you should set up a ~/.xinitrc file, exactly the same as the - above ~/.xsession file. + session, you can set up a ~/.xinitrc file to run + openbox-session and follow the same directions as + above regarding the autostart.sh file.
You can use the obconf tool to configure Openbox easily with a graphical interface, however more in-depth configuration @@ -84,18 +95,10 @@ manpage.1: manpage.sgml obconf older than version 2.0 may not work at all for you. - The default configuration files are installed in + 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. - - There are 3 default configuration files, rc.xml, - rc-gnome.xml, and rc-kde.xml. The - rc-gnome.xml is used when you run - openbox-gnome-session and the rc-kde.xml is used when - you run openbox-kde-session. The configuration - files should be named the same in ~/.config/openbox/. -
OPTIONS diff --git a/openbox/action.c b/openbox/action.c index aa9465b8..50191859 100644 --- a/openbox/action.c +++ b/openbox/action.c @@ -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) diff --git a/openbox/action.h b/openbox/action.h index 7c48f37b..38452e44 100644 --- a/openbox/action.h +++ b/openbox/action.h @@ -115,7 +115,7 @@ struct SendToDesktopDirection { }; struct Desktop { - struct InteractiveAction inter; + struct AnyAction inter; guint desk; }; diff --git a/openbox/client.c b/openbox/client.c index c1df4786..fa4aae95 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -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) diff --git a/openbox/client.h b/openbox/client.h index c4815d4c..9019c62d 100644 --- a/openbox/client.h +++ b/openbox/client.h @@ -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. diff --git a/openbox/event.c b/openbox/event.c index a2571f0e..1fa5e11f 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -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; diff --git a/openbox/focus.c b/openbox/focus.c index 88ef0104..60e6ea99 100644 --- a/openbox/focus.c +++ b/openbox/focus.c @@ -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); - } - } -} diff --git a/openbox/keyboard.c b/openbox/keyboard.c index b834046b..ab9d05b0 100644 --- a/openbox/keyboard.c +++ b/openbox/keyboard.c @@ -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); diff --git a/openbox/moveresize.c b/openbox/moveresize.c index b5fe6cb0..837f3e92 100644 --- a/openbox/moveresize.c +++ b/openbox/moveresize.c @@ -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(); diff --git a/openbox/openbox.c b/openbox/openbox.c index 303f809b..419d2b55 100644 --- a/openbox/openbox.c +++ b/openbox/openbox.c @@ -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) diff --git a/openbox/screen.c b/openbox/screen.c index d71c9eaa..23821301 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -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; } } diff --git a/openbox/screen.h b/openbox/screen.h index a694f663..bd96ab20 100644 --- a/openbox/screen.h +++ b/openbox/screen.h @@ -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); diff --git a/openbox/stacking.h b/openbox/stacking.h index ded4644e..d93341c8 100644 --- a/openbox/stacking.h +++ b/openbox/stacking.h @@ -28,12 +28,12 @@ /*! 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; -- 2.39.2