diff options
author | hobbs <hobbs> | 2006-09-21 00:13:54 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2006-09-21 00:13:54 (GMT) |
commit | 3a9cc6cc0b5ed16fa24da7f86943ceed2ca680c1 (patch) | |
tree | 4c2e5aeb99fa3aed9e30b6167177e43a9415e812 | |
parent | 300dcf1ffe80755d76b0a3ed40f15e8951b93fee (diff) | |
download | tk-3a9cc6cc0b5ed16fa24da7f86943ceed2ca680c1.zip tk-3a9cc6cc0b5ed16fa24da7f86943ceed2ca680c1.tar.gz tk-3a9cc6cc0b5ed16fa24da7f86943ceed2ca680c1.tar.bz2 |
* win/tkWinMenu.c (TkpPostMenu): disable menu animation in menus
with images to avoid clipping bug. [Bug 1329198]
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | win/tkWinMenu.c | 25 |
2 files changed, 26 insertions, 4 deletions
@@ -1,3 +1,8 @@ +2006-09-20 Jeff Hobbs <jeffh@ActiveState.com> + + * win/tkWinMenu.c (TkpPostMenu): disable menu animation in menus + with images to avoid clipping bug. [Bug 1329198] + 2006-09-11 Daniel Steffen <das@users.sourceforge.net> * macosx/tkMacOSXWm.c (TkMacOSXMakeRealWindowExist): revert part of diff --git a/win/tkWinMenu.c b/win/tkWinMenu.c index 4e02e41..d94f463 100644 --- a/win/tkWinMenu.c +++ b/win/tkWinMenu.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: tkWinMenu.c,v 1.21.2.5 2006/04/05 19:47:39 hobbs Exp $ + * RCS: @(#) $Id: tkWinMenu.c,v 1.21.2.6 2006/09/21 00:13:54 hobbs Exp $ */ #define OEMRESOURCE @@ -33,6 +33,10 @@ #define ALIGN_BITMAP_TOP 0x00000004 #define ALIGN_BITMAP_BOTTOM 0x00000008 +#ifndef TPM_NOANIMATION +#define TPM_NOANIMATION 0x4000L +#endif + /* * Platform-specific menu flags: * @@ -735,11 +739,12 @@ TkpPostMenu(interp, menuPtr, x, y) int y; { HMENU winMenuHdl = (HMENU) menuPtr->platformData; - int result, flags; + int i, result, flags; RECT noGoawayRect; POINT point; Tk_Window parentWindow = Tk_Parent(menuPtr->tkwin); int oldServiceMode = Tcl_GetServiceMode(); + TkMenuEntry *mePtr; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); @@ -760,7 +765,7 @@ TkpPostMenu(interp, menuPtr, x, y) * The post commands could have deleted the menu, which means * we are dead and should go away. */ - + if (menuPtr->tkwin == NULL) { tsdPtr->inPostMenu--; return TCL_OK; @@ -781,7 +786,7 @@ TkpPostMenu(interp, menuPtr, x, y) } Tcl_SetServiceMode(TCL_SERVICE_NONE); - + /* * Make an assumption here. If the right button is down, * then we want to track it. Otherwise, track the left mouse button. @@ -802,6 +807,18 @@ TkpPostMenu(interp, menuPtr, x, y) } } + /* + * Disable menu animation if an image is present, as clipping isn't + * handled correctly with temp DCs. [Bug 1329198] + */ + for (i = 0; i < menuPtr->numEntries; i++) { + mePtr = menuPtr->entries[i]; + if (mePtr->image != NULL) { + flags |= TPM_NOANIMATION; + break; + } + } + TrackPopupMenu(winMenuHdl, flags, x, y, 0, tsdPtr->menuHWND, &noGoawayRect); Tcl_SetServiceMode(oldServiceMode); |