summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorashok <ashok@noemail.net>2014-12-03 16:33:49 (GMT)
committerashok <ashok@noemail.net>2014-12-03 16:33:49 (GMT)
commit0b0d72aa8b636588d06a311e4d2aa1b45e78fa59 (patch)
tree7d039ec15045c8571b702275696a1bb75298e2c1 /win
parent39fe73ff9b10094c06228252d1650732e6963e26 (diff)
downloadtk-0b0d72aa8b636588d06a311e4d2aa1b45e78fa59.zip
tk-0b0d72aa8b636588d06a311e4d2aa1b45e78fa59.tar.gz
tk-0b0d72aa8b636588d06a311e4d2aa1b45e78fa59.tar.bz2
Fix for 4a0451f529. Needed a Tcl_ResetResult after recursive event
loop otherwise clicking Cancel would return a non-empty result in case a script was run in the background as part of the event loop. Also updated test suite which did not actually check that a Cancel resulted in an empty event string. FossilOrigin-Name: 4b723acb3e15fcac2d2cffccbc0126d06156e1f1
Diffstat (limited to 'win')
-rw-r--r--win/tkWinDialog.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c
index adb5e9e..c137111 100644
--- a/win/tkWinDialog.c
+++ b/win/tkWinDialog.c
@@ -1407,6 +1407,21 @@ static int GetFileNameVista(Tcl_Interp *interp, OFNOpts *optsPtr,
hr = fdlgIf->lpVtbl->Show(fdlgIf, hWnd);
Tcl_SetServiceMode(oldMode);
+ /*
+ * Ensure that hWnd is enabled, because it can happen that we have updated
+ * the wrapper of the parent, which causes us to leave this child disabled
+ * (Windows loses sync).
+ */
+
+ if (hWnd)
+ EnableWindow(hWnd, 1);
+
+ /*
+ * Clear interp result since it might have been set during the modal loop.
+ * http://core.tcl.tk/tk/tktview/4a0451f5291b3c9168cc560747dae9264e1d2ef6
+ */
+ Tcl_ResetResult(interp);
+
if (SUCCEEDED(hr)) {
if ((oper == OFN_FILE_OPEN) && optsPtr->multi) {
IShellItemArray *multiIf;