summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorpatthoyts <patthoyts@users.sourceforge.net>2009-11-03 23:49:10 (GMT)
committerpatthoyts <patthoyts@users.sourceforge.net>2009-11-03 23:49:10 (GMT)
commiteec8fcddae44e16a8c7a1d295a68fcc55223ab45 (patch)
treec889179d28464c9ed345a3cbc3ffc0b2b4e6cf41 /win
parent88cab73bda545db2653e191c79322e318568afdd (diff)
downloadtk-eec8fcddae44e16a8c7a1d295a68fcc55223ab45.zip
tk-eec8fcddae44e16a8c7a1d295a68fcc55223ab45.tar.gz
tk-eec8fcddae44e16a8c7a1d295a68fcc55223ab45.tar.bz2
[Bug 2891541] fix minimization of main window when it is grabbed.
This fixes a fault in some applications that fail to release a grab set on the main toplevel which were prevented from minimizing on windows following the changes for bug 1847002.
Diffstat (limited to 'win')
-rw-r--r--win/tkWinWm.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/win/tkWinWm.c b/win/tkWinWm.c
index 2af53eb..4266663 100644
--- a/win/tkWinWm.c
+++ b/win/tkWinWm.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWinWm.c,v 1.124.2.6 2009/06/02 09:41:42 patthoyts Exp $
+ * RCS: @(#) $Id: tkWinWm.c,v 1.124.2.7 2009/11/03 23:49:11 patthoyts Exp $
*/
#include "tkWinInt.h"
@@ -8031,6 +8031,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]
*/
@@ -8038,8 +8042,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;