diff options
author | rathnor <rathnor> | 2004-03-08 12:20:31 (GMT) |
---|---|---|
committer | rathnor <rathnor> | 2004-03-08 12:20:31 (GMT) |
commit | bc8a31d40552a3886df695557277b2fc013799bb (patch) | |
tree | 8e01b56ebb1ca63aebf21b664610577e3907ab0d /src/Window.cc | |
parent | 206a7ca10d0747acaab1f00975ff519badf61600 (diff) | |
download | fluxbox-bc8a31d40552a3886df695557277b2fc013799bb.zip fluxbox-bc8a31d40552a3886df695557277b2fc013799bb.tar.bz2 |
fix passing of focus when grouping
Diffstat (limited to 'src/Window.cc')
-rw-r--r-- | src/Window.cc | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/Window.cc b/src/Window.cc index 7638306..6d9a344 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.269 2004/03/03 12:29:31 rathnor Exp $ | 25 | // $Id: Window.cc,v 1.270 2004/03/08 12:20:31 rathnor Exp $ |
26 | 26 | ||
27 | #include "Window.hh" | 27 | #include "Window.hh" |
28 | 28 | ||
@@ -601,6 +601,8 @@ void FluxboxWindow::attachClient(WinClient &client) { | |||
601 | // reparent client win to this frame | 601 | // reparent client win to this frame |
602 | frame().setClientWindow(client); | 602 | frame().setClientWindow(client); |
603 | FbTk::EventManager &evm = *FbTk::EventManager::instance(); | 603 | FbTk::EventManager &evm = *FbTk::EventManager::instance(); |
604 | WinClient *was_focused = 0; | ||
605 | WinClient *focused_win = Fluxbox::instance()->getFocusedWindow(); | ||
604 | 606 | ||
605 | // get the current window on the end of our client list | 607 | // get the current window on the end of our client list |
606 | Window leftwin = None; | 608 | Window leftwin = None; |
@@ -621,6 +623,9 @@ void FluxboxWindow::attachClient(WinClient &client) { | |||
621 | 623 | ||
622 | // reparent window to this | 624 | // reparent window to this |
623 | frame().setClientWindow(**client_it); | 625 | frame().setClientWindow(**client_it); |
626 | if ((*client_it) == focused_win) | ||
627 | was_focused = focused_win; | ||
628 | |||
624 | moveResizeClient(**client_it, | 629 | moveResizeClient(**client_it, |
625 | frame().clientArea().x(), | 630 | frame().clientArea().x(), |
626 | frame().clientArea().y(), | 631 | frame().clientArea().y(), |
@@ -678,6 +683,8 @@ void FluxboxWindow::attachClient(WinClient &client) { | |||
678 | btn->setOnClick(set_client_cmd); | 683 | btn->setOnClick(set_client_cmd); |
679 | evm.add(*this, btn->window()); // we take care of button events for this | 684 | evm.add(*this, btn->window()); // we take care of button events for this |
680 | 685 | ||
686 | if (&client == focused_win) | ||
687 | was_focused = focused_win; | ||
681 | client.m_win = this; | 688 | client.m_win = this; |
682 | 689 | ||
683 | client.saveBlackboxAttribs(m_blackbox_attrib); | 690 | client.saveBlackboxAttribs(m_blackbox_attrib); |
@@ -691,6 +698,12 @@ void FluxboxWindow::attachClient(WinClient &client) { | |||
691 | m_workspacesig.notify(); | 698 | m_workspacesig.notify(); |
692 | m_layersig.notify(); | 699 | m_layersig.notify(); |
693 | 700 | ||
701 | if (was_focused != 0) { | ||
702 | // already has focus, we're just assuming the state of the old window | ||
703 | setCurrentClient(*was_focused, false); | ||
704 | frame().setFocus(true); | ||
705 | } | ||
706 | |||
694 | frame().reconfigure(); | 707 | frame().reconfigure(); |
695 | 708 | ||
696 | // keep the current window on top | 709 | // keep the current window on top |