From b10ecba532e04850925825840208f9ed8b0f876e Mon Sep 17 00:00:00 2001 From: fluxgen Date: Fri, 17 May 2002 13:27:20 +0000 Subject: fixed transient check in destructor --- src/Window.cc | 43 +++++++++++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/src/Window.cc b/src/Window.cc index d774eed..7499378 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Window.cc,v 1.50 2002/05/07 13:50:34 fluxgen Exp $ +// $Id: Window.cc,v 1.51 2002/05/17 13:27:20 fluxgen Exp $ #include "Window.hh" @@ -82,7 +82,7 @@ tab(0) { lastFocusTime.tv_sec = lastFocusTime.tv_usec = 0; - + #ifdef DEBUG fprintf(stderr, I18n::instance()-> getMessage( @@ -90,6 +90,7 @@ tab(0) "FluxboxWindow::FluxboxWindow(): creating 0x%lx\n"), w); + #endif //DEBUG Fluxbox *fluxbox = Fluxbox::instance(); display = fluxbox->getXDisplay(); @@ -399,8 +400,7 @@ FluxboxWindow::~FluxboxWindow(void) { return; Fluxbox *fluxbox = Fluxbox::instance(); - - + if (moving || resizing) { screen->hideGeometry(); XUngrabPointer(display, CurrentTime); @@ -413,23 +413,38 @@ FluxboxWindow::~FluxboxWindow(void) { } else //it's iconic screen->removeIcon(this); - if (windowmenu) + if (windowmenu) { delete windowmenu; + windowmenu = 0; + } - if (tab!=0) + if (tab!=0) { delete tab; - tab = 0; + tab = 0; + } - if (client.mwm_hint!=0) + if (client.mwm_hint!=0) { XFree(client.mwm_hint); + client.mwm_hint = 0; + } + if (client.blackbox_hint!=0) { + XFree(client.blackbox_hint); + client.blackbox_hint = 0; + } - if (client.blackbox_hint!=0) - XFree(client.blackbox_hint); - - //TODO: Move this to Workspace::removeWindow - if (client.transient_for!=0) - fluxbox->setFocusedWindow(client.transient_for); + if (client.transient_for!=0) { + //guard from having transient_for = this + if (client.transient_for == this) { + #ifdef DEBUG + cerr<<__FILE__<<"("<<__LINE__<<"): WARNING! client.transient_for == this WARNING!"<setFocusedWindow(client.transient_for); + } + if (client.window_group) fluxbox->removeGroupSearch(client.window_group); -- cgit v0.11.2