diff options
author | ericm <ericm> | 2000-04-18 02:18:32 (GMT) |
---|---|---|
committer | ericm <ericm> | 2000-04-18 02:18:32 (GMT) |
commit | 3b8d97bbddc028359dd7f579f7f4e2fdaf887752 (patch) | |
tree | 1a5b1bcdfcedcc57a982da47be2f49a3aba66103 /win/tkWinDialog.c | |
parent | 642a893448534c32d814fa625c78d6ab695cad1b (diff) | |
download | tk-3b8d97bbddc028359dd7f579f7f4e2fdaf887752.zip tk-3b8d97bbddc028359dd7f579f7f4e2fdaf887752.tar.gz tk-3b8d97bbddc028359dd7f579f7f4e2fdaf887752.tar.bz2 |
* win/tkWinDialog.c: Added checks for visibility of parent window
before creating MessageBox and ChooseColor dialogs; this prevents
the application from locking when the parent is withdrawn and the
message box is created. In these cases, the window will be
created without a parent.
* unix/mkLinks: Added WinViewable.3.
* tests/msgbox.test: Added tests for patch from [Bug: 4997].
* library/msgbox.tcl:
* library/dialog.tcl: Applied patch from [Bug: 4997]; detaches
dialog window from parent if parent is not viewable.
* library/bgerror.tcl: Removed workaround from [Bug: 4370]; this
is superceeded by patches to dialog.tcl.
* generic/tkCmds.c: Changed WinfoObjCmd to use Tk_IsViewable
function to determine visibility of windows instead of inlining
the code.
* generic/tkStubInit.c:
* generic/tkDecls.h:
* generic/tk.decls: Added Tk_IsViewable declaration.
Diffstat (limited to 'win/tkWinDialog.c')
-rw-r--r-- | win/tkWinDialog.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c index d7fc92a..c4a2bd8 100644 --- a/win/tkWinDialog.c +++ b/win/tkWinDialog.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinDialog.c,v 1.8 2000/03/31 09:24:26 hobbs Exp $ + * RCS: @(#) $Id: tkWinDialog.c,v 1.9 2000/04/18 02:18:34 ericm Exp $ * */ @@ -269,8 +269,13 @@ Tk_ChooseColorObjCmd(clientData, interp, objc, objv) } Tk_MakeWindowExist(parent); - chooseColor.hwndOwner = hWnd = Tk_GetHWND(Tk_WindowId(parent)); - + chooseColor.hwndOwner = NULL; + hWnd = NULL; + if (Tk_IsViewable(parent)) { + hWnd = Tk_GetHWND(Tk_WindowId(parent)); + chooseColor.hwndOwner = hWnd; + } + oldMode = Tcl_SetServiceMode(TCL_SERVICE_ALL); winCode = ChooseColor(&chooseColor); (void) Tcl_SetServiceMode(oldMode); @@ -1701,8 +1706,11 @@ Tk_MessageBoxObjCmd(clientData, interp, objc, objv) } Tk_MakeWindowExist(parent); - hWnd = Tk_GetHWND(Tk_WindowId(parent)); - + hWnd = NULL; + if ( Tk_IsViewable(parent) ) { + hWnd = Tk_GetHWND(Tk_WindowId(parent)); + } + flags = 0; if (defaultBtn >= 0) { int defaultBtnIdx; |