summaryrefslogtreecommitdiff
path: root/src/Window.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Window.cc')
-rw-r--r--src/Window.cc30
1 files changed, 14 insertions, 16 deletions
diff --git a/src/Window.cc b/src/Window.cc
index 6d9a344..5a93385 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.270 2004/03/08 12:20:31 rathnor Exp $ 25// $Id: Window.cc,v 1.271 2004/03/21 09:00:25 rathnor Exp $
26 26
27#include "Window.hh" 27#include "Window.hh"
28 28
@@ -784,15 +784,11 @@ bool FluxboxWindow::removeClient(WinClient &client) {
784 784
785 // if it is our active client, deal with it... 785 // if it is our active client, deal with it...
786 if (m_client == &client) { 786 if (m_client == &client) {
787 // set next client to be focused 787 WinClient *next_client = screen().getLastFocusedWindow(*this, m_client);
788 // if the client we're about to remove is the last client then set prev client 788 if (next_client != 0)
789 if (&client == m_clientlist.back()) 789 setCurrentClient(*next_client, false);
790 prevClient();
791 else
792 nextClient();
793 } 790 }
794 791
795 client.m_win = 0;
796 m_clientlist.remove(&client); 792 m_clientlist.remove(&client);
797 793
798 if (m_client == &client) { 794 if (m_client == &client) {
@@ -815,12 +811,12 @@ bool FluxboxWindow::removeClient(WinClient &client) {
815 } 811 }
816 812
817 m_labelbuttons.erase(&client); 813 m_labelbuttons.erase(&client);
818
819 frame().reconfigure(); 814 frame().reconfigure();
815 updateClientLeftWindow();
820 816
821#ifdef DEBUG 817#ifdef DEBUG
822 cerr<<__FILE__<<"("<<__FUNCTION__<<")["<<this<<"] numClients = "<<numClients()<<endl; 818 cerr<<__FILE__<<"("<<__FUNCTION__<<")["<<this<<"] numClients = "<<numClients()<<endl;
823#endif // DEBUG 819#endif // DEBUG
824 820
825 return true; 821 return true;
826} 822}
@@ -905,6 +901,9 @@ void FluxboxWindow::moveClientRight() {
905 901
906/// Update LEFT window atom on all clients. 902/// Update LEFT window atom on all clients.
907void FluxboxWindow::updateClientLeftWindow() { 903void FluxboxWindow::updateClientLeftWindow() {
904 if (clientList().empty())
905 return;
906
908 // It should just update the affected clients but that 907 // It should just update the affected clients but that
909 // would require more complex code and we're assuming 908 // would require more complex code and we're assuming
910 // the user dont have alot of windows grouped so this 909 // the user dont have alot of windows grouped so this
@@ -929,8 +928,11 @@ bool FluxboxWindow::setCurrentClient(WinClient &client, bool setinput) {
929 928
930 m_client = &client; 929 m_client = &client;
931 m_client->raise(); 930 m_client->raise();
931
932 // frame focused doesn't necessarily mean input focused
933 frame().setLabelButtonFocus(*m_labelbuttons[m_client]);
934
932 if (setinput && setInputFocus()) { 935 if (setinput && setInputFocus()) {
933 frame().setLabelButtonFocus(*m_labelbuttons[m_client]);
934 return true; 936 return true;
935 } 937 }
936 938
@@ -1242,7 +1244,6 @@ bool FluxboxWindow::setInputFocus() {
1242 } else { 1244 } else {
1243 ret = m_client->sendFocus(); 1245 ret = m_client->sendFocus();
1244 } 1246 }
1245
1246 1247
1247 return ret; 1248 return ret;
1248} 1249}
@@ -1296,10 +1297,7 @@ void FluxboxWindow::iconify() {
1296 } 1297 }
1297 } 1298 }
1298 1299
1299 WinClient *focused_client = Fluxbox::instance()->getFocusedWindow(); 1300 // focus revert is done elsewhere (based on signal)
1300 if (focused_client && focused_client->fbwindow() == this)
1301 Fluxbox::instance()->revertFocus(screen());
1302
1303} 1301}
1304 1302
1305void FluxboxWindow::deiconify(bool reassoc, bool do_raise) { 1303void FluxboxWindow::deiconify(bool reassoc, bool do_raise) {