aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrathnor <rathnor>2003-04-27 14:36:05 (GMT)
committerrathnor <rathnor>2003-04-27 14:36:05 (GMT)
commit63ac5deee691f7b528399c0f03e100e983a8cb55 (patch)
tree84a36fabdc129ecb5a92f3b0ecd91978514646d8 /src
parentecf483e0c64d4123e16298464260af5ab6ed3c55 (diff)
downloadfluxbox_pavel-63ac5deee691f7b528399c0f03e100e983a8cb55.zip
fluxbox_pavel-63ac5deee691f7b528399c0f03e100e983a8cb55.tar.bz2
fix nextFocus problem with tabbed windows
Diffstat (limited to 'src')
-rw-r--r--src/Screen.cc33
-rw-r--r--src/Screen.hh3
-rw-r--r--src/Window.cc48
-rw-r--r--src/Window.hh4
4 files changed, 53 insertions, 35 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index 8e5e830..8712fa3 100644
--- a/src/Screen.cc
+++ b/src/Screen.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: Screen.cc,v 1.138 2003/04/26 18:27:01 fluxgen Exp $ 25// $Id: Screen.cc,v 1.139 2003/04/27 14:36:03 rathnor Exp $
26 26
27 27
28#include "Screen.hh" 28#include "Screen.hh"
@@ -500,6 +500,7 @@ BScreen::BScreen(ResourceManager &rm,
500 m_currentworkspace_sig(*this), // current workspace signal 500 m_currentworkspace_sig(*this), // current workspace signal
501 m_layermanager(num_layers), 501 m_layermanager(num_layers),
502 cycling_focus(false), 502 cycling_focus(false),
503 cycling_last(0),
503 m_windowtheme(new FbWinFrameTheme(scrn)), 504 m_windowtheme(new FbWinFrameTheme(scrn)),
504 m_menutheme(new FbTk::MenuTheme(scrn)), 505 m_menutheme(new FbTk::MenuTheme(scrn)),
505 resource(rm, screenname, altscreenname), 506 resource(rm, screenname, altscreenname),
@@ -1474,6 +1475,7 @@ void BScreen::nextFocus(int opts) {
1474 if (!cycling_focus) { 1475 if (!cycling_focus) {
1475 cycling_focus = True; 1476 cycling_focus = True;
1476 cycling_window = focused_list.begin(); 1477 cycling_window = focused_list.begin();
1478 cycling_last = 0;
1477 } else { 1479 } else {
1478 // already cycling, so restack to put windows back in their proper order 1480 // already cycling, so restack to put windows back in their proper order
1479 m_layermanager.restack(); 1481 m_layermanager.restack();
@@ -1498,7 +1500,18 @@ void BScreen::nextFocus(int opts) {
1498 (fbwin->isStuck() 1500 (fbwin->isStuck()
1499 || fbwin->getWorkspaceNumber() == getCurrentWorkspaceID())) { 1501 || fbwin->getWorkspaceNumber() == getCurrentWorkspaceID())) {
1500 // either on this workspace, or stuck 1502 // either on this workspace, or stuck
1501 if (! (doSkipWindow(fbwin, opts) || !fbwin->setInputFocus()) ) { 1503
1504 // keep track of the originally selected window in a set
1505 WinClient &last_client = fbwin->winClient();
1506
1507 if (! (doSkipWindow(fbwin, opts) || !fbwin->setCurrentClient(**it)) ) {
1508 // moved onto a new fbwin
1509 if (!cycling_last || cycling_last->fbwindow() != fbwin) {
1510 if (cycling_last)
1511 // set back to orig current Client in that fbwin
1512 cycling_last->fbwindow()->setCurrentClient(*cycling_last, false);
1513 cycling_last = &last_client;
1514 }
1502 fbwin->tempRaise(); 1515 fbwin->tempRaise();
1503 break; 1516 break;
1504 } 1517 }
@@ -1552,6 +1565,7 @@ void BScreen::prevFocus(int opts) {
1552 if (!cycling_focus) { 1565 if (!cycling_focus) {
1553 cycling_focus = True; 1566 cycling_focus = True;
1554 cycling_window = focused_list.end(); 1567 cycling_window = focused_list.end();
1568 cycling_last = 0;
1555 } else { 1569 } else {
1556 // already cycling, so restack to put windows back in their proper order 1570 // already cycling, so restack to put windows back in their proper order
1557 m_layermanager.restack(); 1571 m_layermanager.restack();
@@ -1577,7 +1591,19 @@ void BScreen::prevFocus(int opts) {
1577 (fbwin->isStuck() 1591 (fbwin->isStuck()
1578 || fbwin->getWorkspaceNumber() == getCurrentWorkspaceID())) { 1592 || fbwin->getWorkspaceNumber() == getCurrentWorkspaceID())) {
1579 // either on this workspace, or stuck 1593 // either on this workspace, or stuck
1580 if (! (doSkipWindow(fbwin, opts) || !fbwin->setInputFocus()) ) { 1594
1595 // keep track of the originally selected window in a set
1596 WinClient &last_client = fbwin->winClient();
1597
1598
1599 if (! (doSkipWindow(fbwin, opts) || !fbwin->setCurrentClient(**it)) ) {
1600 // moved onto a new fbwin
1601 if (!cycling_last || cycling_last->fbwindow() != fbwin) {
1602 if (cycling_last)
1603 // set back to orig current Client in that fbwin
1604 cycling_last->fbwindow()->setCurrentClient(*cycling_last, false);
1605 cycling_last = &last_client;
1606 }
1581 fbwin->tempRaise(); 1607 fbwin->tempRaise();
1582 break; 1608 break;
1583 } 1609 }
@@ -2389,6 +2415,7 @@ bool BScreen::doSkipWindow(const FluxboxWindow *w, int opts) {
2389void BScreen::notifyReleasedKeys(XKeyEvent &ke) { 2415void BScreen::notifyReleasedKeys(XKeyEvent &ke) {
2390 if (cycling_focus) { 2416 if (cycling_focus) {
2391 cycling_focus = false; 2417 cycling_focus = false;
2418 cycling_last = 0;
2392 // put currently focused window to top 2419 // put currently focused window to top
2393 WinClient *client = *cycling_window; 2420 WinClient *client = *cycling_window;
2394 focused_list.erase(cycling_window); 2421 focused_list.erase(cycling_window);
diff --git a/src/Screen.hh b/src/Screen.hh
index e048b27..39c32fb 100644
--- a/src/Screen.hh
+++ b/src/Screen.hh
@@ -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: Screen.hh,v 1.87 2003/04/26 14:47:40 fluxgen Exp $ 25// $Id: Screen.hh,v 1.88 2003/04/27 14:36:04 rathnor Exp $
26 26
27#ifndef SCREEN_HH 27#ifndef SCREEN_HH
28#define SCREEN_HH 28#define SCREEN_HH
@@ -357,6 +357,7 @@ private:
357 // Screen global so it works for sticky windows too. 357 // Screen global so it works for sticky windows too.
358 FocusedWindows focused_list; 358 FocusedWindows focused_list;
359 FocusedWindows::iterator cycling_window; 359 FocusedWindows::iterator cycling_window;
360 WinClient *cycling_last;
360 361
361 std::auto_ptr<Slit> m_slit; 362 std::auto_ptr<Slit> m_slit;
362 363
diff --git a/src/Window.cc b/src/Window.cc
index 5c40cc0..01f99f4 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.152 2003/04/27 12:31:43 fluxgen Exp $ 25// $Id: Window.cc,v 1.153 2003/04/27 14:36:04 rathnor Exp $
26 26
27#include "Window.hh" 27#include "Window.hh"
28 28
@@ -702,16 +702,15 @@ void FluxboxWindow::prevClient() {
702 setInputFocus(); 702 setInputFocus();
703} 703}
704 704
705void FluxboxWindow::setCurrentClient(WinClient &client) { 705bool FluxboxWindow::setCurrentClient(WinClient &client, bool setinput) {
706 // make sure it's in our list 706 // make sure it's in our list
707 if (client.m_win != this) 707 if (client.m_win != this)
708 return; 708 return false;
709 709
710 m_client = &client; 710 m_client = &client;
711 m_client->raise(); 711 m_client->raise();
712 Fluxbox::instance()->setFocusedWindow(this);
713 m_frame.setLabelButtonFocus(*m_labelbuttons[m_client]); 712 m_frame.setLabelButtonFocus(*m_labelbuttons[m_client]);
714 setInputFocus(); 713 return setinput && setInputFocus();
715} 714}
716 715
717bool FluxboxWindow::isGroupable() const { 716bool FluxboxWindow::isGroupable() const {
@@ -2321,21 +2320,15 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent &me) {
2321 doSnapping(dx, dy); 2320 doSnapping(dx, dy);
2322 2321
2323 if (! screen.doOpaqueMove()) { 2322 if (! screen.doOpaqueMove()) {
2324 XDrawRectangle(display, screen.getRootWindow(), 2323 XDrawRectangle(display, screen.getRootWindow(), screen.rootTheme().opGC(),
2325 screen.rootTheme().opGC(),
2326 last_move_x, last_move_y, 2324 last_move_x, last_move_y,
2327 m_frame.width() + 2325 m_frame.width() + 2*frame().window().borderWidth()-1,
2328 2*frame().window().borderWidth() - 1, 2326 m_frame.height() + 2*frame().window().borderWidth()-1);
2329 m_frame.height() +
2330 2*frame().window().borderWidth() - 1);
2331 2327
2332 XDrawRectangle(display, screen.getRootWindow(), 2328 XDrawRectangle(display, screen.getRootWindow(), screen.rootTheme().opGC(),
2333 screen.rootTheme().opGC(),
2334 dx, dy, 2329 dx, dy,
2335 m_frame.width() + 2330 m_frame.width() + 2*frame().window().borderWidth()-1,
2336 2*frame().window().borderWidth()-1, 2331 m_frame.height() + 2*frame().window().borderWidth()-1);
2337 m_frame.height() +
2338 2*frame().window().borderWidth()-1);
2339 last_move_x = dx; 2332 last_move_x = dx;
2340 last_move_y = dy; 2333 last_move_y = dy;
2341 } else { 2334 } else {
@@ -2356,8 +2349,7 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent &me) {
2356 startResizing(me.window, me.x, me.y, left); 2349 startResizing(me.window, me.x, me.y, left);
2357 } else if (resizing) { 2350 } else if (resizing) {
2358 // draw over old rect 2351 // draw over old rect
2359 XDrawRectangle(display, screen.getRootWindow(), 2352 XDrawRectangle(display, screen.getRootWindow(), screen.rootTheme().opGC(),
2360 screen.rootTheme().opGC(),
2361 last_resize_x, last_resize_y, 2353 last_resize_x, last_resize_y,
2362 last_resize_w - 1 + 2 * m_frame.window().borderWidth(), 2354 last_resize_w - 1 + 2 * m_frame.window().borderWidth(),
2363 last_resize_h - 1 + 2 * m_frame.window().borderWidth()); 2355 last_resize_h - 1 + 2 * m_frame.window().borderWidth());
@@ -2385,8 +2377,7 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent &me) {
2385 } 2377 }
2386 2378
2387 // draw resize rectangle 2379 // draw resize rectangle
2388 XDrawRectangle(display, screen.getRootWindow(), 2380 XDrawRectangle(display, screen.getRootWindow(), screen.rootTheme().opGC(),
2389 screen.rootTheme().opGC(),
2390 last_resize_x, last_resize_y, 2381 last_resize_x, last_resize_y,
2391 last_resize_w - 1 + 2 * m_frame.window().borderWidth(), 2382 last_resize_w - 1 + 2 * m_frame.window().borderWidth(),
2392 last_resize_h - 1 + 2 * m_frame.window().borderWidth()); 2383 last_resize_h - 1 + 2 * m_frame.window().borderWidth());
@@ -2477,6 +2468,7 @@ void FluxboxWindow::enterNotifyEvent(XCrossingEvent &ev) {
2477 ev.window == m_client->window()) { 2468 ev.window == m_client->window()) {
2478 if ((screen.isSloppyFocus() || screen.isSemiSloppyFocus()) 2469 if ((screen.isSloppyFocus() || screen.isSemiSloppyFocus())
2479 && !isFocused()) { 2470 && !isFocused()) {
2471
2480 2472
2481 // check that there aren't any subsequent leave notify events in the 2473 // check that there aren't any subsequent leave notify events in the
2482 // X event queue 2474 // X event queue
@@ -2488,6 +2480,7 @@ void FluxboxWindow::enterNotifyEvent(XCrossingEvent &ev) {
2488 2480
2489 if ((!sa.leave || sa.inferior) && setInputFocus()) 2481 if ((!sa.leave || sa.inferior) && setInputFocus())
2490 installColormap(True); 2482 installColormap(True);
2483
2491 2484
2492 } 2485 }
2493 } 2486 }
@@ -2653,18 +2646,15 @@ void FluxboxWindow::stopMoving() {
2653 2646
2654 2647
2655 if (! screen.doOpaqueMove()) { 2648 if (! screen.doOpaqueMove()) {
2656 XDrawRectangle(FbTk::App::instance()->display(), 2649 XDrawRectangle(FbTk::App::instance()->display(), screen.getRootWindow(), screen.rootTheme().opGC(),
2657 screen.getRootWindow(), screen.rootTheme().opGC(),
2658 last_move_x, last_move_y, 2650 last_move_x, last_move_y,
2659 frame().width() + 2*frame().window().borderWidth() - 1, 2651 frame().width() + 2*frame().window().borderWidth()-1,
2660 frame().height() + 2*frame().window().borderWidth() - 1); 2652 frame().height() + 2*frame().window().borderWidth()-1);
2661
2662 moveResize(last_move_x, last_move_y, m_frame.width(), m_frame.height()); 2653 moveResize(last_move_x, last_move_y, m_frame.width(), m_frame.height());
2663
2664 if (workspace_number != getScreen().getCurrentWorkspaceID()) { 2654 if (workspace_number != getScreen().getCurrentWorkspaceID()) {
2665 deiconify(true, false); 2655 screen.reassociateWindow(this, getScreen().getCurrentWorkspaceID(), true);
2656 m_frame.show();
2666 } 2657 }
2667
2668 fluxbox->ungrab(); 2658 fluxbox->ungrab();
2669 } else 2659 } else
2670 moveResize(m_frame.x(), m_frame.y(), m_frame.width(), m_frame.height()); 2660 moveResize(m_frame.x(), m_frame.y(), m_frame.width(), m_frame.height());
diff --git a/src/Window.hh b/src/Window.hh
index 0f8053f..cbeb6ac 100644
--- a/src/Window.hh
+++ b/src/Window.hh
@@ -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.hh,v 1.63 2003/04/26 14:05:47 rathnor Exp $ 25// $Id: Window.hh,v 1.64 2003/04/27 14:36:05 rathnor Exp $
26 26
27#ifndef WINDOW_HH 27#ifndef WINDOW_HH
28#define WINDOW_HH 28#define WINDOW_HH
@@ -124,7 +124,7 @@ public:
124 /// remove client from client list 124 /// remove client from client list
125 bool removeClient(WinClient &client); 125 bool removeClient(WinClient &client);
126 /// set new current client and raise it 126 /// set new current client and raise it
127 void setCurrentClient(WinClient &client); 127 bool setCurrentClient(WinClient &client, bool setinput = true);
128 WinClient *findClient(Window win); 128 WinClient *findClient(Window win);
129 void nextClient(); 129 void nextClient();
130 void prevClient(); 130 void prevClient();