summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrathnor <rathnor>2003-05-07 16:44:51 (GMT)
committerrathnor <rathnor>2003-05-07 16:44:51 (GMT)
commite7a5539b29e23bb0b686b4a06bf1e8cc3133c95c (patch)
tree12308c82ccf7f490c1c954c10a00482412bb6a55
parentd63bf127ad6391f3e8408ddfd0ba79c4841a1ecf (diff)
downloadfluxbox_lack-e7a5539b29e23bb0b686b4a06bf1e8cc3133c95c.zip
fluxbox_lack-e7a5539b29e23bb0b686b4a06bf1e8cc3133c95c.tar.bz2
fix crash from removeClient if window wasn't the active client
-rw-r--r--ChangeLog2
-rw-r--r--src/Window.cc22
2 files changed, 17 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 238d529..c35cd7a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
1(Format: Year/Month/Day) 1(Format: Year/Month/Day)
2Changes for 0.9.2: 2Changes for 0.9.2:
3*03/05/07: 3*03/05/07:
4 * Fix crash when detaching client that isn't active (Simon)
5 Window.cc
4 * Fixed transient grouping issues (transients now WinClients) (Simon) 6 * Fixed transient grouping issues (transients now WinClients) (Simon)
5 WinClient.hh/cc Window.hh/cc Workspace.cc Screen.cc 7 WinClient.hh/cc Window.hh/cc Workspace.cc Screen.cc
6 * Fixed screen problem with redrawing menus (Henrik) 8 * Fixed screen problem with redrawing menus (Henrik)
diff --git a/src/Window.cc b/src/Window.cc
index dfcc7a9..967f943 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.160 2003/05/07 16:21:26 rathnor Exp $ 25// $Id: Window.cc,v 1.161 2003/05/07 16:44:51 rathnor Exp $
26 26
27#include "Window.hh" 27#include "Window.hh"
28 28
@@ -631,18 +631,26 @@ bool FluxboxWindow::removeClient(WinClient &client) {
631 cerr<<__FILE__<<"("<<__FUNCTION__<<")["<<this<<"]"<<endl; 631 cerr<<__FILE__<<"("<<__FUNCTION__<<")["<<this<<"]"<<endl;
632#endif // DEBUG 632#endif // DEBUG
633 633
634 // if it is our active client, deal with it...
635 if (m_client == &client) {
634 // set next client to be focused 636 // set next client to be focused
635 // if the client we're about to remove is the last client then set prev client 637 // if the client we're about to remove is the last client then set prev client
636 if (&client == m_clientlist.back()) 638 if (&client == m_clientlist.back())
637 prevClient(); 639 prevClient();
638 else 640 else
639 nextClient(); 641 nextClient();
642 }
640 643
641 client.m_win = 0; 644 client.m_win = 0;
642 m_clientlist.remove(&client); 645 m_clientlist.remove(&client);
643 646
644 if (m_client == &client && m_clientlist.empty()) 647 if (m_client == &client) {
645 m_client = 0; 648 if (m_clientlist.empty())
649 m_client = 0;
650 else
651 // this really shouldn't happen
652 m_client = m_clientlist.back();
653 }
646 654
647 FbTk::EventManager &evm = *FbTk::EventManager::instance(); 655 FbTk::EventManager &evm = *FbTk::EventManager::instance();
648 evm.remove(client.window()); 656 evm.remove(client.window());