summaryrefslogtreecommitdiff
path: root/x11-wm
diff options
context:
space:
mode:
authorJim Ramsay <lack@gentoo.org>2010-05-29 15:01:29 +0000
committerJim Ramsay <lack@gentoo.org>2010-05-29 15:01:29 +0000
commitd8b541bdce07897e595cf04f57efae93ec93cba7 (patch)
tree4b35212bdbd4cd3942634f8071ee1d0393e1a913 /x11-wm
parentdev-python/numeric has been deleted. (diff)
downloadgentoo-2-d8b541bdce07897e595cf04f57efae93ec93cba7.tar.gz
gentoo-2-d8b541bdce07897e595cf04f57efae93ec93cba7.tar.bz2
gentoo-2-d8b541bdce07897e595cf04f57efae93ec93cba7.zip
Fix focus-follows-mouse (Bug #290649)
(Portage version: 2.1.8.3/cvs/Linux i686)
Diffstat (limited to 'x11-wm')
-rw-r--r--x11-wm/fluxbox/ChangeLog11
-rw-r--r--x11-wm/fluxbox/files/mousefocus-1.1.1-r2.patch159
-rw-r--r--x11-wm/fluxbox/files/strictmousefocus-1.1.1.patch236
-rw-r--r--x11-wm/fluxbox/fluxbox-1.1.1-r2.ebuild120
-rw-r--r--x11-wm/fluxbox/metadata.xml2
5 files changed, 526 insertions, 2 deletions
diff --git a/x11-wm/fluxbox/ChangeLog b/x11-wm/fluxbox/ChangeLog
index cc782a061326..47814435cf61 100644
--- a/x11-wm/fluxbox/ChangeLog
+++ b/x11-wm/fluxbox/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for x11-wm/fluxbox
-# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/x11-wm/fluxbox/ChangeLog,v 1.274 2009/11/14 16:09:34 scarabeus Exp $
+# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/x11-wm/fluxbox/ChangeLog,v 1.275 2010/05/29 15:01:29 lack Exp $
+
+*fluxbox-1.1.1-r2 (29 May 2010)
+
+ 29 May 2010; Jim Ramsay <lack@gentoo.org> +fluxbox-1.1.1-r2.ebuild,
+ +files/mousefocus-1.1.1-r2.patch, +files/strictmousefocus-1.1.1.patch,
+ metadata.xml:
+ Fix focus-follows-mouse (Bug #290649)
14 Nov 2009; Tomáš Chvátal <scarabeus@gentoo.org> fluxbox-9999.ebuild:
QA: drop Keywords from live ebuild, make ebuild properly eapi2.
diff --git a/x11-wm/fluxbox/files/mousefocus-1.1.1-r2.patch b/x11-wm/fluxbox/files/mousefocus-1.1.1-r2.patch
new file mode 100644
index 000000000000..b492eee11659
--- /dev/null
+++ b/x11-wm/fluxbox/files/mousefocus-1.1.1-r2.patch
@@ -0,0 +1,159 @@
+From 998d9ea7942e3bcb07b52e06d08ef69bbe552944 Mon Sep 17 00:00:00 2001
+From: Jim Ramsay <i.am@jimramsay.com>
+Date: Fri, 30 Jan 2009 10:41:27 -0500
+Subject: [PATCH 1/2] Added facility to selectively ignore EnterNotify events
+
+This will be used to avoid some situations where an EnterNotify event should not
+focus the window beneath the mouse cursor. For example, when a menu (or any
+window for that matter) is unmapped, focus should not pass to whatever window is
+beneath the current location of the mouse cursor, but to the previous window in
+the focus list.
+
+This was first noticed when using the ClientMenu feature with
+focus-follows-mouse on -> The focus would always end up on the window beneath
+the mouse pointer, not the window selected in the menu.
+---
+ src/FocusControl.cc | 25 ++++++++++++++++++++++++-
+ src/FocusControl.hh | 10 ++++++++++
+ src/Window.cc | 8 ++++++--
+ 3 files changed, 40 insertions(+), 3 deletions(-)
+
+diff --git a/src/FocusControl.cc b/src/FocusControl.cc
+index cead827..e0a3662 100644
+--- a/src/FocusControl.cc
++++ b/src/FocusControl.cc
+@@ -81,7 +81,8 @@ FocusControl::FocusControl(BScreen &screen):
+ m_focused_win_list(screen), m_creation_order_win_list(screen),
+ m_cycling_list(0),
+ m_was_iconic(false),
+- m_cycling_last(0) {
++ m_cycling_last(0),
++ m_ignore_mouse_x(-1), m_ignore_mouse_y(-1) {
+
+ m_cycling_window = m_focused_list.clientList().end();
+
+@@ -402,6 +403,28 @@ void FocusControl::dirFocus(FluxboxWindow &win, FocusDir dir) {
+
+ }
+
++void FocusControl::ignoreAtPointer()
++{
++ int ignore_i;
++ unsigned int ignore_ui;
++ Window ignore_w;
++
++ XQueryPointer(m_screen.rootWindow().display(),
++ m_screen.rootWindow().window(), &ignore_w, &ignore_w,
++ &m_ignore_mouse_x, &m_ignore_mouse_y,
++ &ignore_i, &ignore_i, &ignore_ui);
++}
++
++void FocusControl::ignoreAt(int x, int y)
++{
++ m_ignore_mouse_x = x; m_ignore_mouse_y = y;
++}
++
++bool FocusControl::isIgnored(int x, int y)
++{
++ return x == m_ignore_mouse_x && y == m_ignore_mouse_y;
++}
++
+ void FocusControl::removeClient(WinClient &client) {
+ if (client.screen().isShuttingdown())
+ return;
+diff --git a/src/FocusControl.hh b/src/FocusControl.hh
+index 4de4310..91681ab 100644
+--- a/src/FocusControl.hh
++++ b/src/FocusControl.hh
+@@ -93,6 +93,15 @@ public:
+ bool isMouseFocus() const { return focusModel() == MOUSEFOCUS; }
+ /// @return true if tab focus mode is mouse tab focus
+ bool isMouseTabFocus() const { return tabFocusModel() == MOUSETABFOCUS; }
++
++ /// Set the "ignore" pointer location to the current pointer location
++ void ignoreAtPointer();
++ /// Set the "ignore" pointer location to the given coordinates
++ void ignoreAt(int x, int y);
++ /// @return true if events at the given X/Y coordinate should be ignored
++ /// (ie, they were previously cached via one of the ignoreAt calls)
++ bool isIgnored(int x, int y);
++
+ /// @return true if cycling is in progress
+ bool isCycling() const { return m_cycling_list != 0; }
+ /// Appends a client to the front of the focus list
+@@ -157,6 +166,7 @@ private:
+ const FocusableList *m_cycling_list;
+ Focusable *m_was_iconic;
+ WinClient *m_cycling_last;
++ int m_ignore_mouse_x, m_ignore_mouse_y;
+
+ static WinClient *s_focused_window;
+ static FluxboxWindow *s_focused_fbwindow;
+diff --git a/src/Window.cc b/src/Window.cc
+index 5d50fcf..fe32d29 100644
+--- a/src/Window.cc
++++ b/src/Window.cc
+@@ -2676,13 +2676,17 @@ void FluxboxWindow::enterNotifyEvent(XCrossingEvent &ev) {
+ sa.enter = sa.leave = False;
+ XCheckIfEvent(display, &dummy, queueScanner, (char *) &sa);
+
+- if ((!sa.leave || sa.inferior) && !screen().focusControl().isCycling() ) {
++ if ((!sa.leave || sa.inferior) &&
++ !screen().focusControl().isCycling() &&
++ !screen().focusControl().isIgnored(ev.x_root, ev.y_root) ) {
+ focus();
+ }
+ }
+ }
+
+- if (screen().focusControl().isMouseTabFocus() && client && client != m_client) {
++ if (screen().focusControl().isMouseTabFocus() &&
++ client && client != m_client &&
++ !screen().focusControl().isIgnored(ev.x_root, ev.y_root) ) {
+ setCurrentClient(*client, isFocused());
+ }
+
+--
+1.7.1
+
+
+From e16a6d1fa71825b5390d9139b771f470aeb03d79 Mon Sep 17 00:00:00 2001
+From: Jim Ramsay <i.am@jimramsay.com>
+Date: Sat, 29 May 2010 09:30:48 -0400
+Subject: [PATCH 2/2] Ignore EnterNotify when the ClientMenu closes
+
+This is so that the resulting exposition of a window belowe the ClientMenu will
+not steal focus from the window just focused by the ClientMenu.
+---
+ src/ClientMenu.cc | 7 ++++++-
+ 1 files changed, 6 insertions(+), 1 deletions(-)
+
+diff --git a/src/ClientMenu.cc b/src/ClientMenu.cc
+index f5af305..c49791c 100644
+--- a/src/ClientMenu.cc
++++ b/src/ClientMenu.cc
+@@ -25,6 +25,7 @@
+ #include "Screen.hh"
+ #include "Window.hh"
+ #include "WindowCmd.hh"
++#include "FocusControl.hh"
+ #include <X11/keysym.h>
+
+ #include "FbTk/MenuItem.hh"
+@@ -52,8 +53,12 @@ public:
+
+ m_client.focus();
+ fbwin->raise();
+- if ((mods & ControlMask) == 0)
++ if ((mods & ControlMask) == 0) {
++ // Ignore any focus changes due to this menu closing
++ // (even in StrictMouseFocus mode)
++ m_client.screen().focusControl().ignoreAtPointer();
+ parent->hide();
++ }
+ }
+
+ const std::string &label() const { return m_client.title(); }
+--
+1.7.1
+
diff --git a/x11-wm/fluxbox/files/strictmousefocus-1.1.1.patch b/x11-wm/fluxbox/files/strictmousefocus-1.1.1.patch
new file mode 100644
index 000000000000..ff150fbe4ac9
--- /dev/null
+++ b/x11-wm/fluxbox/files/strictmousefocus-1.1.1.patch
@@ -0,0 +1,236 @@
+From a830cf18ce0830451208157ecd0997521e171522 Mon Sep 17 00:00:00 2001
+From: Jim Ramsay <jim.ramsay@motorola.com>
+Date: Fri, 28 May 2010 13:22:13 -0400
+Subject: [PATCH 1/2] Add new focus model: StrictMouseFocus
+
+This is not actually implemented yet, but from now on, "MouseFocus" means:
+ Focus follows mouse only when you are moving the mouse, any EnterNotify events
+ caused by non-mouse operations (window closing, keycommands, changing
+ desktops) will *not* shift focus
+
+And once fully-implemented, "StrictMouseFocus" will mean:
+ Focus follows mouse on every EnterNotify event (except when the "ClientMenu"
+ closes or during alt+tab window cycling)
+---
+ doc/fluxbox.1.in | 7 +++++--
+ nls/fluxbox-nls.hh | 1 +
+ src/FocusControl.cc | 5 +++++
+ src/FocusControl.hh | 7 ++++---
+ src/Screen.cc | 7 ++++++-
+ 5 files changed, 21 insertions(+), 6 deletions(-)
+
+diff --git a/doc/fluxbox.1.in b/doc/fluxbox.1.in
+index 11f70d9..86802b9 100644
+--- a/doc/fluxbox.1.in
++++ b/doc/fluxbox.1.in
+@@ -910,10 +910,13 @@ session\.screen0\.followModel: <model>
+ be focused\. `Ignore\' does nothing, and `Follow\' uses the setting in
+ session\.screen0\.userFollowModel\. Default: Ignore
+
+-session\.screen0\.focusModel: ClickToFocus|MouseFocus
++session\.screen0\.focusModel: ClickToFocus|MouseFocus|StrictMouseFocus
+ This controls how windows gain focus via the mouse\. With `ClickToFocus\',
+ the user must click on the window\. With `MouseFocus\', windows gain focus
+- whenever the mouse moves over them\. Default: ClickToFocus
++ whenever the mouse moves over them, but only when the mouse is moving.
++ With `StrictMouseFocus\', windows gain focus whenever the mouse enters any
++ exposed area, even if this is due to layer changes, window movement,
++ changing desktops, closing windows, etc\. Default: ClickToFocus
+
+ session\.screen0\.autoRaise: <boolean>
+ When True, this setting automatically raises any window that gains focus\.
+diff --git a/nls/fluxbox-nls.hh b/nls/fluxbox-nls.hh
+index a304995..178c2f2 100644
+--- a/nls/fluxbox-nls.hh
++++ b/nls/fluxbox-nls.hh
+@@ -84,6 +84,7 @@ enum {
+ ConfigmenuMaxIgnoreInc = 27,
+ ConfigmenuMaxDisableMove = 28,
+ ConfigmenuMaxDisableResize = 29,
++ ConfigmenuStrictMouseFocus = 30,
+
+ EwmhSet = 5,
+ EwmhOutOfMemoryClientList = 1,
+diff --git a/src/FocusControl.cc b/src/FocusControl.cc
+index e0a3662..66a2ed8 100644
+--- a/src/FocusControl.cc
++++ b/src/FocusControl.cc
+@@ -491,6 +491,7 @@ void FocusControl::revertFocus(BScreen &screen) {
+ else {
+ switch (screen.focusControl().focusModel()) {
+ case FocusControl::MOUSEFOCUS:
++ case FocusControl::STRICTMOUSEFOCUS:
+ XSetInputFocus(screen.rootWindow().display(),
+ PointerRoot, None, CurrentTime);
+ break;
+@@ -596,6 +597,8 @@ std::string FbTk::Resource<FocusControl::FocusModel>::getString() const {
+ switch (m_value) {
+ case FocusControl::MOUSEFOCUS:
+ return string("MouseFocus");
++ case FocusControl::STRICTMOUSEFOCUS:
++ return string("StrictMouseFocus");
+ case FocusControl::CLICKFOCUS:
+ return string("ClickFocus");
+ }
+@@ -608,6 +611,8 @@ void FbTk::Resource<FocusControl::FocusModel>::
+ setFromString(char const *strval) {
+ if (strcasecmp(strval, "MouseFocus") == 0)
+ m_value = FocusControl::MOUSEFOCUS;
++ else if (strcasecmp(strval, "StrictMouseFocus") == 0)
++ m_value = FocusControl::STRICTMOUSEFOCUS;
+ else if (strcasecmp(strval, "ClickToFocus") == 0)
+ m_value = FocusControl::CLICKFOCUS;
+ else
+diff --git a/src/FocusControl.hh b/src/FocusControl.hh
+index 91681ab..72eec11 100644
+--- a/src/FocusControl.hh
++++ b/src/FocusControl.hh
+@@ -42,8 +42,9 @@ public:
+ typedef std::list<Focusable *> Focusables;
+ /// main focus model
+ enum FocusModel {
+- MOUSEFOCUS = 0, ///< focus follows mouse
+- CLICKFOCUS ///< focus on click
++ MOUSEFOCUS = 0, ///< focus follows mouse, but only when the mouse is moving
++ CLICKFOCUS, ///< focus on click
++ STRICTMOUSEFOCUS ///< focus always follows mouse, even when stationary
+ };
+ /// focus model for tabs
+ enum TabFocusModel {
+@@ -90,7 +91,7 @@ public:
+ */
+ void dirFocus(FluxboxWindow &win, FocusDir dir);
+ /// @return true if focus mode is mouse focus
+- bool isMouseFocus() const { return focusModel() == MOUSEFOCUS; }
++ bool isMouseFocus() const { return focusModel() != CLICKFOCUS; }
+ /// @return true if tab focus mode is mouse tab focus
+ bool isMouseTabFocus() const { return tabFocusModel() == MOUSETABFOCUS; }
+
+diff --git a/src/Screen.cc b/src/Screen.cc
+index 649ea2b..0271868 100644
+--- a/src/Screen.cc
++++ b/src/Screen.cc
+@@ -1615,8 +1615,13 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) {
+ "Click To Focus", "Click to focus",
+ FocusControl::CLICKFOCUS);
+ _FOCUSITEM(Configmenu, MouseFocus,
+- "Mouse Focus", "Mouse Focus",
++ "Mouse Focus (Keyboard Friendly)",
++ "Mouse Focus (Keyboard Friendly)",
+ FocusControl::MOUSEFOCUS);
++ _FOCUSITEM(Configmenu, StrictMouseFocus,
++ "Mouse Focus (Strict)",
++ "Mouse Focus (Strict)",
++ FocusControl::STRICTMOUSEFOCUS);
+ #undef _FOCUSITEM
+
+ focus_menu->insert(new FbTk::MenuSeparator());
+--
+1.7.1
+
+
+From 9db301c26e27e4d139dff424f8eab2f8def30cb5 Mon Sep 17 00:00:00 2001
+From: Jim Ramsay <jim.ramsay@motorola.com>
+Date: Fri, 28 May 2010 15:50:15 -0400
+Subject: [PATCH 2/2] Implement StrictMouseFocus
+
+As noted in the previous commit, StrictMouseFocus now works as advertised:
+ Focus follows mouse on every EnterNotify event (except when the "ClientMenu"
+ closes or during alt+tab window cycling)
+---
+ src/ClientMenu.cc | 7 ++++++-
+ src/FocusControl.cc | 19 ++++++++++++++-----
+ src/FocusControl.hh | 10 ++++++++--
+ 3 files changed, 28 insertions(+), 8 deletions(-)
+
+diff --git a/src/ClientMenu.cc b/src/ClientMenu.cc
+index f5af305..46306d9 100644
+--- a/src/ClientMenu.cc
++++ b/src/ClientMenu.cc
+@@ -25,6 +25,7 @@
+ #include "Screen.hh"
+ #include "Window.hh"
+ #include "WindowCmd.hh"
++#include "FocusControl.hh"
+ #include <X11/keysym.h>
+
+ #include "FbTk/MenuItem.hh"
+@@ -52,8 +53,12 @@ public:
+
+ m_client.focus();
+ fbwin->raise();
+- if ((mods & ControlMask) == 0)
++ if ((mods & ControlMask) == 0) {
++ // Ignore any focus changes due to this menu closing
++ // (even in StrictMouseFocus mode)
++ m_client.screen().focusControl().ignoreAtPointer(true);
+ parent->hide();
++ }
+ }
+
+ const std::string &label() const { return m_client.title(); }
+diff --git a/src/FocusControl.cc b/src/FocusControl.cc
+index 66a2ed8..44cd81b 100644
+--- a/src/FocusControl.cc
++++ b/src/FocusControl.cc
+@@ -403,21 +403,30 @@ void FocusControl::dirFocus(FluxboxWindow &win, FocusDir dir) {
+
+ }
+
+-void FocusControl::ignoreAtPointer()
++void FocusControl::ignoreAtPointer(bool force)
+ {
+- int ignore_i;
++ int ignore_i, ignore_x, ignore_y;
+ unsigned int ignore_ui;
+ Window ignore_w;
+
+ XQueryPointer(m_screen.rootWindow().display(),
+ m_screen.rootWindow().window(), &ignore_w, &ignore_w,
+- &m_ignore_mouse_x, &m_ignore_mouse_y,
++ &ignore_x, &ignore_y,
+ &ignore_i, &ignore_i, &ignore_ui);
++
++ this->ignoreAt(ignore_x, ignore_y, force);
++}
++
++void FocusControl::ignoreAt(int x, int y, bool force)
++{
++ if (force || this->focusModel() == MOUSEFOCUS) {
++ m_ignore_mouse_x = x; m_ignore_mouse_y = y;
++ }
+ }
+
+-void FocusControl::ignoreAt(int x, int y)
++void FocusControl::ignoreCancel()
+ {
+- m_ignore_mouse_x = x; m_ignore_mouse_y = y;
++ m_ignore_mouse_x = m_ignore_mouse_y = -1;
+ }
+
+ bool FocusControl::isIgnored(int x, int y)
+diff --git a/src/FocusControl.hh b/src/FocusControl.hh
+index 72eec11..c265253 100644
+--- a/src/FocusControl.hh
++++ b/src/FocusControl.hh
+@@ -96,9 +96,15 @@ public:
+ bool isMouseTabFocus() const { return tabFocusModel() == MOUSETABFOCUS; }
+
+ /// Set the "ignore" pointer location to the current pointer location
+- void ignoreAtPointer();
++ /// @param force If true, ignore even in StrictMouseFocus mode
++ void ignoreAtPointer(bool force = false);
+ /// Set the "ignore" pointer location to the given coordinates
+- void ignoreAt(int x, int y);
++ /// @param x Current X position of the pointer
++ /// @param y Current Y position of the pointer
++ /// @param force If true, ignore even in StrictMouseFocus mode
++ void ignoreAt(int x, int y, bool force = false);
++ /// unset the "ignore" pointer location
++ void ignoreCancel();
+ /// @return true if events at the given X/Y coordinate should be ignored
+ /// (ie, they were previously cached via one of the ignoreAt calls)
+ bool isIgnored(int x, int y);
+--
+1.7.1
+
diff --git a/x11-wm/fluxbox/fluxbox-1.1.1-r2.ebuild b/x11-wm/fluxbox/fluxbox-1.1.1-r2.ebuild
new file mode 100644
index 000000000000..ec1eda4a369f
--- /dev/null
+++ b/x11-wm/fluxbox/fluxbox-1.1.1-r2.ebuild
@@ -0,0 +1,120 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/x11-wm/fluxbox/fluxbox-1.1.1-r2.ebuild,v 1.1 2010/05/29 15:01:29 lack Exp $
+
+EAPI="2"
+inherit eutils
+
+IUSE="nls xinerama truetype gnome +imlib +slit +toolbar vim-syntax -newmousefocus"
+
+DESCRIPTION="Fluxbox is an X11 window manager featuring tabs and an iconbar"
+
+SRC_URI="mirror://sourceforge/fluxbox/${P}.tar.bz2"
+HOMEPAGE="http://www.fluxbox.org"
+
+# Please note that USE="gnome" simply adds support for some gnome protocols, and
+# does not depend on external libraries. However, it does make the binary a
+# fair bit bigger, so we don't want to turn it on unless the user actually wants
+# it.
+
+RDEPEND="x11-libs/libXpm
+ x11-libs/libXrandr
+ xinerama? ( x11-libs/libXinerama )
+ x11-apps/xmessage
+ x11-libs/libXft
+ truetype? ( media-libs/freetype )
+ imlib? ( >=media-libs/imlib2-1.2.0[X] )
+ vim-syntax? ( app-vim/fluxbox-syntax )
+ !!<x11-themes/fluxbox-styles-fluxmod-20040809-r1
+ !!<=x11-misc/fluxconf-0.9.9
+ !!<=x11-misc/fbdesk-1.2.1"
+DEPEND="nls? ( sys-devel/gettext )
+ x11-proto/xextproto
+ xinerama? ( x11-proto/xineramaproto )
+ ${RDEPEND}"
+PROVIDE="virtual/blackbox"
+
+SLOT="0"
+LICENSE="MIT"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd"
+
+src_prepare() {
+ # We need to be able to include directories rather than just plain
+ # files in menu [include] items. This patch will allow us to do clever
+ # things with style ebuilds.
+ epatch "${FILESDIR}/gentoo_style_location-1.1.x.patch"
+
+ # Patch to handle a broken key file gracefully, #263379
+ epatch "${FILESDIR}/macrocmd-crash-1.1.1.patch"
+
+ # Patch to quiet fbsetbg on upgrade
+ epatch "${FILESDIR}/fbsetbg-quiet-1.1.1.patch"
+
+ # Patch to fix window focus bug when you have "focus-follows-mouse"
+ if use newmousefocus; then
+ # These change 'MouseFocus' behaviour to what will be in fluxbox-1.1.2
+ # and add the new 'StrictMouseFocus' mode.
+ epatch "${FILESDIR}/mousefocus-1.1.1.patch"
+ epatch "${FILESDIR}/strictmousefocus-1.1.1.patch"
+ else
+ epatch "${FILESDIR}/mousefocus-1.1.1-r2.patch"
+ fi
+
+ # Add in the Gentoo -r number to fluxbox -version output.
+ if [[ "${PR}" == "r0" ]] ; then
+ suffix="gentoo"
+ else
+ suffix="gentoo-${PR}"
+ fi
+ sed -i \
+ -e "s~\(__fluxbox_version .@VERSION@\)~\1-${suffix}~" \
+ version.h.in || die "version sed failed"
+}
+
+src_configure() {
+ econf \
+ $(use_enable nls) \
+ $(use_enable xinerama) \
+ $(use_enable truetype xft) \
+ $(use_enable gnome) \
+ $(use_enable imlib imlib2) \
+ $(use_enable slit ) \
+ $(use_enable toolbar ) \
+ --sysconfdir=/etc/X11/${PN} \
+ --with-style=/usr/share/fluxbox/styles/Emerge \
+ ${myconf}
+}
+
+src_compile() {
+ default
+
+ ebegin "Creating a menu file (may take a while)"
+ mkdir -p "${T}/home/.fluxbox" || die "mkdir home failed"
+ MENUFILENAME="${S}/data/menu" MENUTITLE="Fluxbox ${PV}" \
+ CHECKINIT="no. go away." HOME="${T}/home" \
+ "${S}/util/fluxbox-generate_menu" -is -ds \
+ || die "menu generation failed"
+ eend $?
+}
+
+src_install() {
+ dodir /usr/share/fluxbox
+ emake DESTDIR="${D}" STRIP="" install || die "install failed"
+ dodoc README* AUTHORS TODO* ChangeLog NEWS
+
+ dodir /usr/share/xsessions
+ insinto /usr/share/xsessions
+ doins "${FILESDIR}/${PN}.desktop"
+
+ exeinto /etc/X11/Sessions
+ newexe "${FILESDIR}/${PN}.xsession" fluxbox
+
+ dodir /usr/share/fluxbox/menu.d
+
+ # Styles menu framework
+ dodir /usr/share/fluxbox/menu.d/styles
+ insinto /usr/share/fluxbox/menu.d/styles
+ doins "${FILESDIR}/styles-menu-fluxbox" || die
+ doins "${FILESDIR}/styles-menu-commonbox" || die
+ doins "${FILESDIR}/styles-menu-user" || die
+}
diff --git a/x11-wm/fluxbox/metadata.xml b/x11-wm/fluxbox/metadata.xml
index 836fd8327ce5..d2e41fe8cf6d 100644
--- a/x11-wm/fluxbox/metadata.xml
+++ b/x11-wm/fluxbox/metadata.xml
@@ -18,5 +18,7 @@
<flag name='disabletoolbar'>Disables the fluxbox toolbar</flag>
<flag name='slit'>Enables the fluxbox slit (or dock)</flag>
<flag name='toolbar'>Enables the fluxbox toolbar</flag>
+ <flag name='newmousefocus'>Patches the focus model to the upcoming 1.1.2
+ model, which adds a new 'StrictMouseFocus' mode</flag>
</use>
</pkgmetadata>