diff options
Diffstat (limited to 'src/Window.cc')
-rw-r--r-- | src/Window.cc | 43 |
1 files changed, 6 insertions, 37 deletions
diff --git a/src/Window.cc b/src/Window.cc index 53ec88d..f8b4457 100644 --- a/src/Window.cc +++ b/src/Window.cc | |||
@@ -748,44 +748,15 @@ bool FluxboxWindow::detachClient(WinClient &client) { | |||
748 | if (client.fbwindow() != this || numClients() <= 1) | 748 | if (client.fbwindow() != this || numClients() <= 1) |
749 | return false; | 749 | return false; |
750 | 750 | ||
751 | // I'm not sure how to do this bit better | ||
752 | // we need to find the window we've got, and update the | ||
753 | // window to its right to have a left window set to the | ||
754 | // window which is to the left of the current. | ||
755 | // Think in terms of: | ||
756 | // window1 <- my_window <- window2 | ||
757 | // we need to take out my_window, so update window2 leftwin to be window1 | ||
758 | |||
759 | Window leftwin = None; | 751 | Window leftwin = None; |
760 | ClientList::iterator client_it_end = clientList().end(); | 752 | ClientList::iterator client_it, client_it_after; |
761 | ClientList::iterator client_it = clientList().begin(); | 753 | client_it = client_it_after = |
762 | ClientList::iterator client_it_before = client_it_end; | 754 | find(clientList().begin(), clientList().end(), &client); |
763 | ClientList::iterator client_it_after = clientList().begin(); | ||
764 | if (!clientList().empty()) { | ||
765 | ++client_it_after; | ||
766 | if (clientList().front() == &client) { | ||
767 | leftwin = None; | ||
768 | } else { | ||
769 | ++client_it; | ||
770 | client_it_before = clientList().begin(); | ||
771 | ++client_it_after; | ||
772 | |||
773 | while (client_it != client_it_end) { | ||
774 | if (*client_it == &client) { | ||
775 | break; | ||
776 | } | ||
777 | ++client_it_before; | ||
778 | ++client_it; | ||
779 | ++client_it_after; | ||
780 | } | ||
781 | } | ||
782 | } | ||
783 | 755 | ||
784 | // update the leftwin of the window to the right | 756 | if (client_it != clientList().begin()) |
785 | if (client_it_before != client_it_end) | 757 | leftwin = (*(--client_it))->window(); |
786 | leftwin = (*client_it_before)->window(); | ||
787 | 758 | ||
788 | if (client_it_after != client_it_end) | 759 | if (++client_it_after != clientList().end()) |
789 | (*client_it_after)->setGroupLeftWindow(leftwin); | 760 | (*client_it_after)->setGroupLeftWindow(leftwin); |
790 | 761 | ||
791 | removeClient(client); | 762 | removeClient(client); |
@@ -2558,8 +2529,6 @@ void FluxboxWindow::mapNotifyEvent(XMapEvent &ne) { | |||
2558 | /** | 2529 | /** |
2559 | Unmaps frame window and client window if | 2530 | Unmaps frame window and client window if |
2560 | event.window == m_client->window | 2531 | event.window == m_client->window |
2561 | Returns true if *this should die | ||
2562 | else false | ||
2563 | */ | 2532 | */ |
2564 | void FluxboxWindow::unmapNotifyEvent(XUnmapEvent &ue) { | 2533 | void FluxboxWindow::unmapNotifyEvent(XUnmapEvent &ue) { |
2565 | WinClient *client = findClient(ue.window); | 2534 | WinClient *client = findClient(ue.window); |