diff options
author | markt <markt> | 2006-07-06 04:10:34 (GMT) |
---|---|---|
committer | markt <markt> | 2006-07-06 04:10:34 (GMT) |
commit | 84ca1f2e2f82b66b417b8e25295e37cb07985f3d (patch) | |
tree | 846093f50a65a5a1af8fd1563e66e4d4560f1d44 | |
parent | b407e121badd48b0fd3fdfe2e47a5ac3bfa7f047 (diff) | |
download | fluxbox_paul-84ca1f2e2f82b66b417b8e25295e37cb07985f3d.zip fluxbox_paul-84ca1f2e2f82b66b417b8e25295e37cb07985f3d.tar.bz2 |
re-fixing the focus after fixing the crash bug
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | src/FocusControl.cc | 14 | ||||
-rw-r--r-- | src/Screen.cc | 10 | ||||
-rw-r--r-- | src/Window.cc | 10 |
4 files changed, 14 insertions, 23 deletions
@@ -1,5 +1,8 @@ | |||
1 | (Format: Year/Month/Day) | 1 | (Format: Year/Month/Day) |
2 | Changes for 1.0rc3: | 2 | Changes for 1.0rc3: |
3 | *06/07/06: | ||
4 | * Still trying to get the focus right: bug #1517750 (Mark) | ||
5 | FocusControl.cc Window.cc Screen.cc | ||
3 | *06/07/05: | 6 | *06/07/05: |
4 | * Fix crash on startup on some platforms (Simon) | 7 | * Fix crash on startup on some platforms (Simon) |
5 | FbTk/FbString.cc | 8 | FbTk/FbString.cc |
diff --git a/src/FocusControl.cc b/src/FocusControl.cc index f0d1387..339541c 100644 --- a/src/FocusControl.cc +++ b/src/FocusControl.cc | |||
@@ -458,18 +458,8 @@ void FocusControl::setFocusedWindow(WinClient *client) { | |||
458 | #endif // DEBUG | 458 | #endif // DEBUG |
459 | 459 | ||
460 | // Update the old focused client to non focus | 460 | // Update the old focused client to non focus |
461 | // check if s_focused_window is valid | 461 | if (s_focused_fbwindow) |
462 | if (s_focused_window != 0 && | 462 | s_focused_fbwindow->setFocusFlag(false); |
463 | Fluxbox::instance()->validateClient(s_focused_window)) { | ||
464 | |||
465 | if (!client && s_focused_fbwindow) | ||
466 | s_focused_fbwindow->setFocusFlag(false); | ||
467 | |||
468 | } else { | ||
469 | s_focused_window = 0; | ||
470 | s_focused_fbwindow = 0; | ||
471 | } | ||
472 | |||
473 | 463 | ||
474 | if (client && client->fbwindow() && !client->fbwindow()->isIconic()) { | 464 | if (client && client->fbwindow() && !client->fbwindow()->isIconic()) { |
475 | // screen should be ok | 465 | // screen should be ok |
diff --git a/src/Screen.cc b/src/Screen.cc index 47599bc..df15250 100644 --- a/src/Screen.cc +++ b/src/Screen.cc | |||
@@ -1365,11 +1365,10 @@ FluxboxWindow *BScreen::createWindow(Window client) { | |||
1365 | 1365 | ||
1366 | // always put on end of focused list, if it gets focused it'll get pushed up | 1366 | // always put on end of focused list, if it gets focused it'll get pushed up |
1367 | // there is only the one win client at this stage | 1367 | // there is only the one win client at this stage |
1368 | focusControl().addFocusBack(*winclient); | ||
1368 | if (focusControl().focusNew()) | 1369 | if (focusControl().focusNew()) |
1369 | focusControl().addFocusFront(*winclient); | 1370 | FocusControl::setFocusedWindow(winclient); |
1370 | else | 1371 | |
1371 | focusControl().addFocusBack(*winclient); | ||
1372 | |||
1373 | // we also need to check if another window expects this window to the left | 1372 | // we also need to check if another window expects this window to the left |
1374 | // and if so, then join it. | 1373 | // and if so, then join it. |
1375 | FluxboxWindow *otherwin = 0; | 1374 | FluxboxWindow *otherwin = 0; |
@@ -1407,6 +1406,9 @@ FluxboxWindow *BScreen::createWindow(WinClient &client) { | |||
1407 | return 0; | 1406 | return 0; |
1408 | } | 1407 | } |
1409 | 1408 | ||
1409 | if (focusControl().focusNew() || FocusControl::focusedWindow() == &client) | ||
1410 | FocusControl::setFocusedWindow(&client); | ||
1411 | |||
1410 | m_clientlist_sig.notify(); | 1412 | m_clientlist_sig.notify(); |
1411 | 1413 | ||
1412 | return win; | 1414 | return win; |
diff --git a/src/Window.cc b/src/Window.cc index 80b7ef6..03bde16 100644 --- a/src/Window.cc +++ b/src/Window.cc | |||
@@ -703,11 +703,9 @@ void FluxboxWindow::attachClient(WinClient &client, int x, int y) { | |||
703 | m_workspacesig.notify(); | 703 | m_workspacesig.notify(); |
704 | m_layersig.notify(); | 704 | m_layersig.notify(); |
705 | 705 | ||
706 | if (was_focused != 0) { | 706 | if (was_focused != 0) |
707 | // already has focus, we're just assuming the state of the old window | 707 | // already has focus, we're just assuming the state of the old window |
708 | setCurrentClient(*was_focused, false); | 708 | FocusControl::setFocusedWindow(&client); |
709 | frame().setFocus(true); | ||
710 | } | ||
711 | 709 | ||
712 | frame().reconfigure(); | 710 | frame().reconfigure(); |
713 | 711 | ||
@@ -776,10 +774,8 @@ void FluxboxWindow::detachCurrentClient() { | |||
776 | return; | 774 | return; |
777 | WinClient &client = *m_client; | 775 | WinClient &client = *m_client; |
778 | detachClient(*m_client); | 776 | detachClient(*m_client); |
779 | if (client.fbwindow() != 0) { | 777 | if (client.fbwindow() != 0) |
780 | client.fbwindow()->show(); | 778 | client.fbwindow()->show(); |
781 | FocusControl::setFocusedWindow(&client); | ||
782 | } | ||
783 | } | 779 | } |
784 | 780 | ||
785 | /// removes client from client list, does not create new fluxboxwindow for it | 781 | /// removes client from client list, does not create new fluxboxwindow for it |