summaryrefslogtreecommitdiffstats
path: root/library/choosedir.tcl
diff options
context:
space:
mode:
Diffstat (limited to 'library/choosedir.tcl')
-rw-r--r--library/choosedir.tcl14
1 files changed, 12 insertions, 2 deletions
diff --git a/library/choosedir.tcl b/library/choosedir.tcl
index f17dc7b..e224d60 100644
--- a/library/choosedir.tcl
+++ b/library/choosedir.tcl
@@ -5,7 +5,7 @@
# Copyright (c) 1998-2000 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: choosedir.tcl,v 1.12 2002/04/29 13:17:44 bagnonm Exp $
+# RCS: @(#) $Id: choosedir.tcl,v 1.13 2002/06/12 23:08:12 mdejong Exp $
# Make sure the tk::dialog namespace, in which all dialogs should live, exists
namespace eval ::tk::dialog {}
@@ -51,7 +51,17 @@ proc ::tk::dialog::file::chooseDir:: {args} {
set data(okBtn) $w.f2.ok
set data(cancelBtn) $w.f3.cancel
}
- wm transient $w $data(-parent)
+
+ # Dialog boxes should be transient with respect to their parent,
+ # so that they will always stay on top of their parent window. However,
+ # some window managers will create the window as withdrawn if the parent
+ # window is withdrawn or iconified. Combined with the grab we put on the
+ # window, this can hang the entire application. Therefore we only make
+ # the dialog transient if the parent is viewable.
+
+ if {[winfo viewable [winfo toplevel $data(-parent)]] } {
+ wm transient $w $data(-parent)
+ }
trace variable data(selectPath) w [list ::tk::dialog::file::SetPath $w]
$data(dirMenuBtn) configure \