summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2011-08-03 16:50:18 (GMT)
committerdgp <dgp@users.sourceforge.net>2011-08-03 16:50:18 (GMT)
commit0726563f613388aad5a365791aa72dfea1781644 (patch)
treed9dce89e0f4f5a2feb6ad5363da273e14f35be01
parent97cb297a80a8dfc25d50fbf7ca3415fbfb9a4ce0 (diff)
downloadtk-0726563f613388aad5a365791aa72dfea1781644.zip
tk-0726563f613388aad5a365791aa72dfea1781644.tar.gz
tk-0726563f613388aad5a365791aa72dfea1781644.tar.bz2
Bug 2891541 Merge of 8.5.8 fix from Pat Thoyts.
Permit normal behaviour on Windows for a grabbed toplevel when it is the main window.
-rw-r--r--ChangeLog6
-rw-r--r--changes2
-rw-r--r--win/tkWinWm.c9
3 files changed, 16 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index f28c324..5a186cf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-08-03 Don Porter <dgp@users.sourceforge.net>
+
+ * win/tkWinWm.c: [Bug 2891541] Merge of 8.5.8 fix from Pat Thoyts.
+ Permit normal behaviour on Windows for a grabbed toplevel when it
+ is the main window.
+
2011-08-03 Jan Nijtmans <nijtmans@users.sf.net>
* win/tkWinDialog.c: [Bug 3314770] regression - Windows file
diff --git a/changes b/changes
index 4bd9858..c299052 100644
--- a/changes
+++ b/changes
@@ -6935,4 +6935,6 @@ and -to (porter)
2011-06-17 (bug fix)[3062331] crash in unset traces (macdonald,porter)
+2011-08-03 (bug fix)[2891541] fix grab behaviour for main window (thoyts)
+
--- Released 8.6b2, August 5, 2011 --- See ChangeLog for details ---
diff --git a/win/tkWinWm.c b/win/tkWinWm.c
index 859aa52..53f8ee6 100644
--- a/win/tkWinWm.c
+++ b/win/tkWinWm.c
@@ -7939,6 +7939,10 @@ WmProc(
case WM_SYSCOMMAND:
/*
* If there is a grab in effect then ignore the minimize command
+ * unless the grab is on the main window (.). This is to permit
+ * applications that leave a grab on . to work normally.
+ * All other toplevels are deemed non-minimizable when a grab is
+ * present.
* If there is a grab in effect and this window is outside the
* grab tree then ignore all system commands. [Bug 1847002]
*/
@@ -7946,8 +7950,11 @@ WmProc(
if (winPtr) {
int cmd = wParam & 0xfff0;
int grab = TkGrabState(winPtr);
- if (grab != TK_GRAB_NONE && SC_MINIMIZE == cmd)
+ if ((SC_MINIMIZE == cmd)
+ && (grab == TK_GRAB_IN_TREE || grab == TK_GRAB_ANCESTOR)
+ && (winPtr != winPtr->mainPtr->winPtr)) {
goto done;
+ }
if (grab == TK_GRAB_EXCLUDED
&& !(SC_MOVE == cmd || SC_SIZE == cmd)) {
goto done;