aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2002-05-17 13:27:20 (GMT)
committerfluxgen <fluxgen>2002-05-17 13:27:20 (GMT)
commitb10ecba532e04850925825840208f9ed8b0f876e (patch)
tree7aaeef415b2815fde73dcf1eae6e99a00c340263
parente1f76359f50e3c3c4e9a0c5ef8e126b180f99caa (diff)
downloadfluxbox_pavel-b10ecba532e04850925825840208f9ed8b0f876e.zip
fluxbox_pavel-b10ecba532e04850925825840208f9ed8b0f876e.tar.bz2
fixed transient check in destructor
-rw-r--r--src/Window.cc43
1 files 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 @@
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.50 2002/05/07 13:50:34 fluxgen Exp $ 25// $Id: Window.cc,v 1.51 2002/05/17 13:27:20 fluxgen Exp $
26 26
27#include "Window.hh" 27#include "Window.hh"
28 28
@@ -82,7 +82,7 @@ tab(0)
82{ 82{
83 83
84 lastFocusTime.tv_sec = lastFocusTime.tv_usec = 0; 84 lastFocusTime.tv_sec = lastFocusTime.tv_usec = 0;
85 85 #ifdef DEBUG
86 fprintf(stderr, 86 fprintf(stderr,
87 I18n::instance()-> 87 I18n::instance()->
88 getMessage( 88 getMessage(
@@ -90,6 +90,7 @@ tab(0)
90 "FluxboxWindow::FluxboxWindow(): creating 0x%lx\n"), 90 "FluxboxWindow::FluxboxWindow(): creating 0x%lx\n"),
91 w); 91 w);
92 92
93 #endif //DEBUG
93 94
94 Fluxbox *fluxbox = Fluxbox::instance(); 95 Fluxbox *fluxbox = Fluxbox::instance();
95 display = fluxbox->getXDisplay(); 96 display = fluxbox->getXDisplay();
@@ -399,8 +400,7 @@ FluxboxWindow::~FluxboxWindow(void) {
399 return; 400 return;
400 401
401 Fluxbox *fluxbox = Fluxbox::instance(); 402 Fluxbox *fluxbox = Fluxbox::instance();
402 403
403
404 if (moving || resizing) { 404 if (moving || resizing) {
405 screen->hideGeometry(); 405 screen->hideGeometry();
406 XUngrabPointer(display, CurrentTime); 406 XUngrabPointer(display, CurrentTime);
@@ -413,23 +413,38 @@ FluxboxWindow::~FluxboxWindow(void) {
413 } else //it's iconic 413 } else //it's iconic
414 screen->removeIcon(this); 414 screen->removeIcon(this);
415 415
416 if (windowmenu) 416 if (windowmenu) {
417 delete windowmenu; 417 delete windowmenu;
418 windowmenu = 0;
419 }
418 420
419 if (tab!=0) 421 if (tab!=0) {
420 delete tab; 422 delete tab;
421 tab = 0; 423 tab = 0;
424 }
422 425
423 if (client.mwm_hint!=0) 426 if (client.mwm_hint!=0) {
424 XFree(client.mwm_hint); 427 XFree(client.mwm_hint);
428 client.mwm_hint = 0;
429 }
430 if (client.blackbox_hint!=0) {
431 XFree(client.blackbox_hint);
432 client.blackbox_hint = 0;
433 }
425 434
426 if (client.blackbox_hint!=0)
427 XFree(client.blackbox_hint);
428
429 //TODO: Move this to Workspace::removeWindow
430 if (client.transient_for!=0)
431 fluxbox->setFocusedWindow(client.transient_for);
432 435
436 if (client.transient_for!=0) {
437 //guard from having transient_for = this
438 if (client.transient_for == this) {
439 #ifdef DEBUG
440 cerr<<__FILE__<<"("<<__LINE__<<"): WARNING! client.transient_for == this WARNING!"<<endl;
441 #endif //DEBUG
442 client.transient_for = 0;
443 }
444
445 fluxbox->setFocusedWindow(client.transient_for);
446 }
447
433 if (client.window_group) 448 if (client.window_group)
434 fluxbox->removeGroupSearch(client.window_group); 449 fluxbox->removeGroupSearch(client.window_group);
435 450