From e06013dff27b79e915a083567f787260b69d5f16 Mon Sep 17 00:00:00 2001 From: mdejong Date: Wed, 12 Jun 2002 23:08:11 +0000 Subject: * library/choosedir.tcl (tk::dialog::file::chooseDir): * library/clrpick.tcl (tk::dialog::color): * library/dialog.tcl (tk_dialog): * library/msgbox.tcl (tk::MessageBox): * library/tkfbox.tcl (tk::dialog::file): * library/xmfbox.tcl (tk::MotifFDialog_Create): Only make the dialog window a transient if the master is visible. This check already appeared in some of the dialogs. This patch just copies the check into those that were lacking. --- ChangeLog | 14 ++++++++++++++ library/choosedir.tcl | 14 ++++++++++++-- library/clrpick.tcl | 13 +++++++++++-- library/dialog.tcl | 4 ++-- library/msgbox.tcl | 4 ++-- library/tkfbox.tcl | 14 ++++++++++++-- library/xmfbox.tcl | 13 +++++++++++-- 7 files changed, 64 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0d92bfe..fdd352e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,19 @@ 2002-06-12 Mo DeJong + * library/choosedir.tcl (tk::dialog::file::chooseDir): + * library/clrpick.tcl (tk::dialog::color): + * library/dialog.tcl (tk_dialog): + * library/msgbox.tcl (tk::MessageBox): + * library/tkfbox.tcl (tk::dialog::file): + * library/xmfbox.tcl (tk::MotifFDialog_Create): + Only make the dialog window a transient if + the master is visible. This check already + appeared in some of the dialogs. This patch + just copies the check into those that were + lacking. + +2002-06-12 Mo DeJong + * changes: Add note about new transient behavior. * tests/unixWm.test: Check that the WM_TRANSIENT_FOR property for a transient window is being cleared 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 \ diff --git a/library/clrpick.tcl b/library/clrpick.tcl index bf2bca3..6a39220 100644 --- a/library/clrpick.tcl +++ b/library/clrpick.tcl @@ -3,7 +3,7 @@ # Color selection dialog for platforms that do not support a # standard color selection dialog. # -# RCS: @(#) $Id: clrpick.tcl,v 1.16 2002/06/10 00:15:42 a_kovalenko Exp $ +# RCS: @(#) $Id: clrpick.tcl,v 1.17 2002/06/12 23:08:12 mdejong Exp $ # # Copyright (c) 1996 Sun Microsystems, Inc. # @@ -77,7 +77,16 @@ proc ::tk::dialog::color:: {args} { BuildDialog $w } - 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) + } # 5. Withdraw the window, then update all the geometry information # so we know how big it wants to be, then center the window in the diff --git a/library/dialog.tcl b/library/dialog.tcl index db47e83..8afcdfb 100644 --- a/library/dialog.tcl +++ b/library/dialog.tcl @@ -3,7 +3,7 @@ # This file defines the procedure tk_dialog, which creates a dialog # box containing a bitmap, a message, and one or more buttons. # -# RCS: @(#) $Id: dialog.tcl,v 1.12 2001/08/22 01:25:33 hobbs Exp $ +# RCS: @(#) $Id: dialog.tcl,v 1.13 2002/06/12 23:08:12 mdejong Exp $ # # Copyright (c) 1992-1993 The Regents of the University of California. # Copyright (c) 1994-1997 Sun Microsystems, Inc. @@ -61,7 +61,7 @@ proc ::tk_dialog {w title text bitmap default args} { # window, this can hang the entire application. Therefore we only make # the dialog transient if the parent is viewable. # - if { [winfo viewable [winfo toplevel [winfo parent $w]]] } { + if {[winfo viewable [winfo toplevel [winfo parent $w]]] } { wm transient $w [winfo toplevel [winfo parent $w]] } diff --git a/library/msgbox.tcl b/library/msgbox.tcl index c102a62..bd62167 100644 --- a/library/msgbox.tcl +++ b/library/msgbox.tcl @@ -3,7 +3,7 @@ # Implements messageboxes for platforms that do not have native # messagebox support. # -# RCS: @(#) $Id: msgbox.tcl,v 1.18 2002/06/10 00:15:42 a_kovalenko Exp $ +# RCS: @(#) $Id: msgbox.tcl,v 1.19 2002/06/12 23:08:12 mdejong Exp $ # # Copyright (c) 1994-1997 Sun Microsystems, Inc. # @@ -252,7 +252,7 @@ proc ::tk::MessageBox {args} { # "grab"bed windows. So only make the message box transient if the parent # is viewable. # - if { [winfo viewable [winfo toplevel $data(-parent)]] } { + if {[winfo viewable [winfo toplevel $data(-parent)]] } { wm transient $w $data(-parent) } diff --git a/library/tkfbox.tcl b/library/tkfbox.tcl index 1a923fb..6d7ce2f 100644 --- a/library/tkfbox.tcl +++ b/library/tkfbox.tcl @@ -11,7 +11,7 @@ # files by clicking on the file icons or by entering a filename # in the "Filename:" entry. # -# RCS: @(#) $Id: tkfbox.tcl,v 1.34 2002/06/10 00:15:42 a_kovalenko Exp $ +# RCS: @(#) $Id: tkfbox.tcl,v 1.35 2002/06/12 23:08:12 mdejong Exp $ # # Copyright (c) 1994-1998 Sun Microsystems, Inc. # @@ -814,7 +814,17 @@ proc ::tk::dialog::file:: {type args} { set data(cancelBtn) $w.f3.cancel ::tk::dialog::file::SetSelectMode $w $data(-multiple) } - 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) + } # Add traces on the selectPath variable # diff --git a/library/xmfbox.tcl b/library/xmfbox.tcl index 4fec52c..53df5dc 100644 --- a/library/xmfbox.tcl +++ b/library/xmfbox.tcl @@ -4,7 +4,7 @@ # Unix platform. This implementation is used only if the # "::tk_strictMotif" flag is set. # -# RCS: @(#) $Id: xmfbox.tcl,v 1.20 2002/06/10 00:15:42 a_kovalenko Exp $ +# RCS: @(#) $Id: xmfbox.tcl,v 1.21 2002/06/12 23:08:12 mdejong Exp $ # # Copyright (c) 1996 Sun Microsystems, Inc. # Copyright (c) 1998-2000 Scriptics Corporation @@ -107,7 +107,16 @@ proc ::tk::MotifFDialog_Create {dataName type argList} { } MotifFDialog_SetListMode $w - 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) + } MotifFDialog_FileTypes $w MotifFDialog_Update $w -- cgit v0.12