summaryrefslogtreecommitdiffstats
path: root/win/tkWinMenu.c
diff options
context:
space:
mode:
authorhobbs <hobbs>2006-09-21 00:13:36 (GMT)
committerhobbs <hobbs>2006-09-21 00:13:36 (GMT)
commitec91bdeba76de4de9dd91666882eb91e3eb9f438 (patch)
tree70c616da3f4f0b9e2d4682c87200b700f4966d6b /win/tkWinMenu.c
parentf3e94efd8116ee14a10a72bd9de9095056145a83 (diff)
downloadtk-ec91bdeba76de4de9dd91666882eb91e3eb9f438.zip
tk-ec91bdeba76de4de9dd91666882eb91e3eb9f438.tar.gz
tk-ec91bdeba76de4de9dd91666882eb91e3eb9f438.tar.bz2
* win/tkWinMenu.c (TkpPostMenu): disable menu animation in menus
with images to avoid clipping bug. [Bug 1329198]
Diffstat (limited to 'win/tkWinMenu.c')
-rw-r--r--win/tkWinMenu.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/win/tkWinMenu.c b/win/tkWinMenu.c
index 5b037dd..432e8db 100644
--- a/win/tkWinMenu.c
+++ b/win/tkWinMenu.c
@@ -10,7 +10,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.48 2006/05/25 23:50:31 hobbs Exp $
+ * RCS: @(#) $Id: tkWinMenu.c,v 1.49 2006/09/21 00:13:36 hobbs Exp $
*/
#define OEMRESOURCE
@@ -35,6 +35,10 @@
#define ALIGN_BITMAP_TOP 0x00000004
#define ALIGN_BITMAP_BOTTOM 0x00000008
+#ifndef TPM_NOANIMATION
+#define TPM_NOANIMATION 0x4000L
+#endif
+
/*
* Platform-specific menu flags:
*
@@ -721,11 +725,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));
@@ -788,6 +793,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);