From 0cba1e7dffae670d1a4bbaa6fb300d6888f1e7ce Mon Sep 17 00:00:00 2001 From: fluxgen Date: Wed, 27 Feb 2002 22:04:01 +0000 Subject: fixed the focusbug when deleting a window which calls Fluxbox::setFocusedWindow and the calls FluxboxWindow::setFocusFlag on the same window --- src/Window.cc | 13 +++++++------ src/fluxbox.cc | 8 ++++---- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/Window.cc b/src/Window.cc index ee149a2..843687d 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.30 2002/02/26 22:35:58 fluxgen Exp $ +// $Id: Window.cc,v 1.31 2002/02/27 22:04:01 fluxgen Exp $ //use GNU extensions #ifndef _GNU_SOURCE @@ -406,6 +406,7 @@ FluxboxWindow::~FluxboxWindow(void) { if (timer) { if (timer->isTiming()) timer->stop(); delete timer; + timer = 0; } if (windowmenu) @@ -417,18 +418,18 @@ FluxboxWindow::~FluxboxWindow(void) { if (client.icon_title) delete [] client.icon_title; - if (tab) + if (tab!=0) delete tab; tab = 0; - if (client.mwm_hint) + if (client.mwm_hint!=0) XFree(client.mwm_hint); - if (client.blackbox_hint) + if (client.blackbox_hint!=0) XFree(client.blackbox_hint); //TODO: Move this to Workspace::removeWindow - if (client.transient_for) + if (client.transient_for!=0) fluxbox->setFocusedWindow(client.transient_for); if (client.window_group) @@ -2433,7 +2434,7 @@ void FluxboxWindow::setFocusFlag(bool focus) { } if ((screen->isSloppyFocus() || screen->isSemiSloppyFocus()) && - screen->doAutoRaise()) + screen->doAutoRaise() && timer!=0 ) timer->stop(); } diff --git a/src/fluxbox.cc b/src/fluxbox.cc index fbeb860..c2b616c 100644 --- a/src/fluxbox.cc +++ b/src/fluxbox.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: fluxbox.cc,v 1.36 2002/02/26 22:42:23 fluxgen Exp $ +// $Id: fluxbox.cc,v 1.37 2002/02/27 22:04:01 fluxgen Exp $ //Use some GNU extensions #ifndef _GNU_SOURCE @@ -2475,7 +2475,7 @@ void Fluxbox::setFocusedWindow(FluxboxWindow *win) { Toolbar *old_tbar = 0, *tbar = 0; Workspace *old_wkspc = 0, *wkspc = 0; - if (focused_window) { + if (focused_window!=0) { old_win = focused_window; old_screen = old_win->getScreen(); @@ -2499,9 +2499,9 @@ void Fluxbox::setFocusedWindow(FluxboxWindow *win) { } else focused_window = (FluxboxWindow *) 0; - if (tbar) + if (tbar!=0) tbar->redrawWindowLabel(True); - if (screen) + if (screen!=0) screen->updateNetizenWindowFocus(); if (old_tbar && old_tbar != tbar) -- cgit v0.11.2