Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 233347 Details for
Bug 290649
x11-wm/fluxbox-1.1.1-r1 - strict mouse focus broken even when focusLastWindow is set to false.
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Attempt #2 of the strictmousefocus patch
strictmousefocus-1.1.1.patch (text/plain), 5.88 KB, created by
Jim Ramsay (lack) (RETIRED)
on 2010-05-28 23:39:44 UTC
(
hide
)
Description:
Attempt #2 of the strictmousefocus patch
Filename:
MIME Type:
Creator:
Jim Ramsay (lack) (RETIRED)
Created:
2010-05-28 23:39:44 UTC
Size:
5.88 KB
patch
obsolete
>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/ClientMenu.cc b/src/ClientMenu.cc >index 0da3773..e3ef7f5 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" >@@ -53,8 +54,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 701373b..7302b5a 100644 >--- a/src/FocusControl.cc >+++ b/src/FocusControl.cc >@@ -401,21 +401,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) >@@ -489,6 +498,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; >@@ -594,6 +604,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"); > } >@@ -606,6 +618,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..c265253 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,14 +91,20 @@ 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; } > > /// 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); >diff --git a/src/Screen.cc b/src/Screen.cc >index 1581571..b423c96 100644 >--- a/src/Screen.cc >+++ b/src/Screen.cc >@@ -1554,8 +1554,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());
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 290649
:
233323
|
233329
|
233331
| 233347