aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrathnor <rathnor>2003-05-08 15:06:59 (GMT)
committerrathnor <rathnor>2003-05-08 15:06:59 (GMT)
commit768613f3e0603b9b498619a9e289ab3329c32503 (patch)
treeed878b8e8f732f835a5b57fdbec7538807e07845
parentd926e4d968609389b4a7c890c60762e12ce457f1 (diff)
downloadfluxbox_pavel-768613f3e0603b9b498619a9e289ab3329c32503.zip
fluxbox_pavel-768613f3e0603b9b498619a9e289ab3329c32503.tar.bz2
fix sloppy focus for embedded tabs
-rw-r--r--ChangeLog2
-rw-r--r--src/Window.cc35
2 files changed, 29 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 115e6bf..42278b6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
1(Format: Year/Month/Day) 1(Format: Year/Month/Day)
2Changes for 0.9.2: 2Changes for 0.9.2:
3*03/05/08: 3*03/05/08:
4 * Fixed sloppy focus for embedded tabs (Simon)
5 Window.cc
4 * Fixed Slit ordering bug (Henrik) 6 * Fixed Slit ordering bug (Henrik)
5 Screen.cc 7 Screen.cc
6 * Fixed better command help/option 8 * Fixed better command help/option
diff --git a/src/Window.cc b/src/Window.cc
index fb07764..c3cbfa5 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Window.cc,v 1.163 2003/05/08 02:20:52 rathnor Exp $ 25// $Id: Window.cc,v 1.164 2003/05/08 15:06:59 rathnor Exp $
26 26
27#include "Window.hh" 27#include "Window.hh"
28 28
@@ -344,7 +344,7 @@ void FluxboxWindow::init() {
344 FbTk::EventManager &evm = *FbTk::EventManager::instance(); 344 FbTk::EventManager &evm = *FbTk::EventManager::instance();
345 // we need motion notify so we mask it 345 // we need motion notify so we mask it
346 btn->window().setEventMask(ExposureMask | ButtonPressMask | ButtonReleaseMask | 346 btn->window().setEventMask(ExposureMask | ButtonPressMask | ButtonReleaseMask |
347 ButtonMotionMask); 347 ButtonMotionMask | EnterWindowMask);
348 348
349 FbTk::RefCount<FbTk::Command> set_client_cmd(new SetClientCmd(*m_client)); 349 FbTk::RefCount<FbTk::Command> set_client_cmd(new SetClientCmd(*m_client));
350 btn->setOnClick(set_client_cmd); 350 btn->setOnClick(set_client_cmd);
@@ -552,7 +552,7 @@ void FluxboxWindow::attachClient(WinClient &client) {
552 btn->show(); 552 btn->show();
553 // we need motion notify so we mask it 553 // we need motion notify so we mask it
554 btn->window().setEventMask(ExposureMask | ButtonPressMask | 554 btn->window().setEventMask(ExposureMask | ButtonPressMask |
555 ButtonReleaseMask | ButtonMotionMask); 555 ButtonReleaseMask | ButtonMotionMask | EnterWindowMask);
556 556
557 557
558 FbTk::RefCount<FbTk::Command> 558 FbTk::RefCount<FbTk::Command>
@@ -2515,10 +2515,27 @@ void FluxboxWindow::enterNotifyEvent(XCrossingEvent &ev) {
2515 !isVisible()) { 2515 !isVisible()) {
2516 return; 2516 return;
2517 } 2517 }
2518
2519 WinClient *client = 0;
2520 // don't waste our time scanning if we aren't real sloppy focus
2521 if (screen.isSloppyFocus()) {
2522 // determine if we're in a label button (tab)
2523 Client2ButtonMap::iterator it = m_labelbuttons.begin();
2524 Client2ButtonMap::iterator it_end = m_labelbuttons.end();
2525 for (; it != it_end; ++it) {
2526 if ((*it).second->window() == ev.window) {
2527 client = (*it).first;
2528 break;
2529 }
2530 }
2531 }
2518 if (ev.window == frame().window() || 2532 if (ev.window == frame().window() ||
2519 ev.window == m_client->window()) { 2533 ev.window == m_client->window() ||
2520 if ((screen.isSloppyFocus() || screen.isSemiSloppyFocus()) 2534 client) {
2521 && !isFocused()) { 2535 if ((screen.isSloppyFocus() || screen.isSemiSloppyFocus())
2536 && !isFocused() ||
2537 // or, we are focused, but it isn't the one we want
2538 client && screen.isSloppyFocus() && (m_client != client)) {
2522 2539
2523 // check that there aren't any subsequent leave notify events in the 2540 // check that there aren't any subsequent leave notify events in the
2524 // X event queue 2541 // X event queue
@@ -2527,8 +2544,10 @@ void FluxboxWindow::enterNotifyEvent(XCrossingEvent &ev) {
2527 sa.w = ev.window; 2544 sa.w = ev.window;
2528 sa.enter = sa.leave = False; 2545 sa.enter = sa.leave = False;
2529 XCheckIfEvent(display, &dummy, queueScanner, (char *) &sa); 2546 XCheckIfEvent(display, &dummy, queueScanner, (char *) &sa);
2530 2547
2531 if ((!sa.leave || sa.inferior) && setInputFocus()) 2548 // if client is set, use setCurrent client, otherwise just setInputFocus
2549 if ((!sa.leave || sa.inferior) &&
2550 ((client && setCurrentClient(*client, true)) || setInputFocus()))
2532 installColormap(True); 2551 installColormap(True);
2533 } 2552 }
2534 } 2553 }