From eec8fcddae44e16a8c7a1d295a68fcc55223ab45 Mon Sep 17 00:00:00 2001 From: patthoyts Date: Tue, 3 Nov 2009 23:49:10 +0000 Subject: [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. --- ChangeLog | 5 +++++ changes | 4 +++- win/tkWinWm.c | 11 +++++++++-- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index b06d269..e442025 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-11-03 Pat Thoyts + + * win/tkWinWm.c: [Bug 2891541] Permit normal behaviour on + Windows for a grabbed toplevel when it is the main window. + 2009-11-03 Don Porter *** 8.5.8 TAGGED FOR RELEASE *** diff --git a/changes b/changes index a0eb85b..1dfa8a5 100644 --- a/changes +++ b/changes @@ -2,7 +2,7 @@ This file summarizes all changes made to Tk since version 1.0 was released on March 13, 1991. Changes that aren't backward compatible are marked specially. -RCS: @(#) $Id: changes,v 1.130.2.14 2009/11/03 20:15:24 dgp Exp $ +RCS: @(#) $Id: changes,v 1.130.2.15 2009/11/03 23:49:11 patthoyts Exp $ 3/16/91 (bug fix) Modified tkWindow.c to remove Tk's Tcl commands from the interpreter when the main window is deleted (otherwise there will @@ -6670,4 +6670,6 @@ in screen distances, reducing precision loss (ferrieux) 2009-10-29 (bug fix)[1825353] Russian Windows tiny fonts problem (thoyts) +2009-11-03 (bug fix)[2891541] fix grab behaviour for main window (thoyts) + --- Released 8.5.8, November xx, 2009 --- See ChangeLog for details --- 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; -- cgit v0.12