Fix focus-follows-mouse (Bug #290649)
authorJim Ramsay <lack@gentoo.org>
Sat, 29 May 2010 15:01:29 +0000 (15:01 +0000)
committerJim Ramsay <lack@gentoo.org>
Sat, 29 May 2010 15:01:29 +0000 (15:01 +0000)
Package-Manager: portage-2.1.8.3/cvs/Linux i686

x11-wm/fluxbox/ChangeLog
x11-wm/fluxbox/Manifest
x11-wm/fluxbox/files/mousefocus-1.1.1-r2.patch [new file with mode: 0644]
x11-wm/fluxbox/files/strictmousefocus-1.1.1.patch [new file with mode: 0644]
x11-wm/fluxbox/fluxbox-1.1.1-r2.ebuild [new file with mode: 0644]
x11-wm/fluxbox/metadata.xml

index cc782a0613261835ad63db70f446502c9b216643..47814435cf61f2ac3a3048ae339f1ad1cfb46c0a 100644 (file)
@@ -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.
index 9e776bc30037565f5633dc9f1b3581bd5942896d..1f250a3eb7a28ab83d647d98eaa9e1bb48641965 100644 (file)
@@ -7,7 +7,9 @@ AUX fluxbox.desktop 202 RMD160 255bb2cdae75e1fc204d4b60f39c8aba66770e7a SHA1 d57
 AUX fluxbox.xsession 2004 RMD160 9a5f192628d6d888734f24b9ff4f6f1b7e8f178b SHA1 ec59f4611868866b8bc6d7fc9762bbc9bca640c3 SHA256 dbff4840a2c32c8ab837e4f34cb002f810dccca107f5e04a28c22d33db2a59bd
 AUX gentoo_style_location-1.1.x.patch 711 RMD160 d6d358759ba664bcfcf098f47d37f206387de007 SHA1 1ac6b515ab6004757cd5217cb74c892feb5ea5ee SHA256 84aba82bc9ab3a9dcdeb3857eb7ee0236a8ec96ae77e29cd0455813bac473915
 AUX macrocmd-crash-1.1.1.patch 2251 RMD160 716f3da654365730a964d693dac789a17258e164 SHA1 aa55faaaa3637b02b221c64c7a195ad1fbe434c6 SHA256 4d99d38a56aae213d03aafbf6041d8eadd7197f2212fc94deefaab803dd877a5
+AUX mousefocus-1.1.1-r2.patch 5552 RMD160 a1893631fa5167026936715ed4f21b7b977f4a45 SHA1 ab3274917c75dac46387ef15e86a1bd1a3ecdcdc SHA256 989730762581e9fdbca1c5997811f9f8ebb8d1e0b95884c6d7efee0345b2781f
 AUX mousefocus-1.1.1.patch 8127 RMD160 7cd8b23c7db46256f45f931fcd44b3c18d627e3d SHA1 e83c7994439b8a7f6c10ccaac6509df2fa223a90 SHA256 a9fb2c249f13abde8a96912db9bade7252d9b312fc0ae11acee0b266773fa8b1
+AUX strictmousefocus-1.1.1.patch 8989 RMD160 adcd297418bfaffec12edd6fbf49cd502dc9cf1f SHA1 5ba0603fb03f559b945f62918190a056db564c72 SHA256 4bbcf304c161246acb7d515dc3b185ceab655daedabd2d594925dbb3d90fc11e
 AUX styles-menu-commonbox 127 RMD160 e5668235e10ffa8fa73683d23d4483c85bf4296e SHA1 59c6aed23a105536de1b1264f94ee75008d74557 SHA256 44a56b182b0da9bf26ac41ff7e5ea8da3ddb7c5cbca0f554e3c74f15c72a3d98
 AUX styles-menu-fluxbox 117 RMD160 a2f3ced8acd6bd9057aea30b6ca374cff7d3db3e SHA1 99692536559b07878054852e17171d4ef5f79a76 SHA256 f5829a442d8653941e2741ab73f49e9d9c95fc8129531e4197730c0bbb2f2989
 AUX styles-menu-user 93 RMD160 2a6831b45ce1d655586b699d16c0547de201d187 SHA1 84a02411e552875877c169a08b49dc452176c474 SHA256 5f708a443c602485d958cb21cf55d9680e86aa3369215552c35ed9f46429e946
@@ -18,6 +20,7 @@ EBUILD fluxbox-1.0.0-r2.ebuild 3250 RMD160 2886be9d84068d3c2689a06a18f895a63e533
 EBUILD fluxbox-1.0.0.ebuild 3114 RMD160 1d5322cad44277827affc4dce9a29cc6de0a9d50 SHA1 b4c8e79b0345039427e5c91b094d2ca7524e822b SHA256 b678d8273bf09bc4d9ac19f311cd7bd202bc6c0cba94f489c6535e6bb02d5918
 EBUILD fluxbox-1.1.0.1.ebuild 3150 RMD160 90f2c25eed0e9cd727008b766962b576a3949141 SHA1 fe1237e45d4d4e93036b9807086983baa31cedc5 SHA256 f803103487153c08fb6f79ec01e1747886baf54d76cad51f5aa2a52007242437
 EBUILD fluxbox-1.1.1-r1.ebuild 3352 RMD160 669656e72a0f816494601d9ff3b71a9435315a8d SHA1 eaf77d56d6fa69ed7b9633476615b082cf317c73 SHA256 da0c379998762f49b482fcad6c245fc3d9df1571f6e1201ba7fe21ee8d7b5142
+EBUILD fluxbox-1.1.1-r2.ebuild 3632 RMD160 aea5784bbe1310ab027df82b421d252738982c3d SHA1 722be4540f77f7dc141741d1fcdc451efeeb54bb SHA256 dd44da802ede69cb6694077878309f6b93910a671c4e2d58fe52c3dae5a96d73
 EBUILD fluxbox-9999.ebuild 3095 RMD160 4756748e96ef6f0a704571f36ff5ccd2b47b0b72 SHA1 fa25b86b5ec9c0955419587249792e774aca2a8e SHA256 a97680f8fac32564017816a9740a6772a2a9040c14524a92bdd46866b0399392
-MISC ChangeLog 50224 RMD160 3fb821e881ccd576f15293045d8fbbba71c999a0 SHA1 cdf2fd101c88972e4c66ad0105a59be6dbd953f1 SHA256 06a22fd00a9ffefccd4d7f042a18de85e09b498f3460610b97ad2a2f475de2fe
-MISC metadata.xml 890 RMD160 c07e8a6d876e730c1608809d2b6294cf1511bbb3 SHA1 dd886d7bba0ff28bcda9f82d356bd1b1d0d183e8 SHA256 47616493ac1ab0f7858e5f7b55b61b3e17ec0cb992ce2a5f3858a47250a3926f
+MISC ChangeLog 50452 RMD160 c6455807d100f684edf23237c8a5e836727351f2 SHA1 09c34636d8d83a2b07a1792eae56d210422cd232 SHA256 c821d4628e9d0687a45fbae885cd7e306aa7bb01b5975860498eb2830a9f7b85
+MISC metadata.xml 1023 RMD160 0000d4186c712fd878a8bbb47ac5363ae5fa1ce9 SHA1 2b461f96e1220092bc3ca3a609bde70cebdcf04c SHA256 e797cbae3aa30ae91842d2969514b8437b19075226942821cf7557683738de00
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 (file)
index 0000000..b492eee
--- /dev/null
@@ -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 (file)
index 0000000..ff150fb
--- /dev/null
@@ -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 (file)
index 0000000..ec1eda4
--- /dev/null
@@ -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
+}
index 836fd8327ce59d2dde1f6fa0f5f025de356f39d0..d2e41fe8cf6d91b9b542f84e2d7eb56aaffa29fe 100644 (file)
@@ -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>