summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorhobbs <hobbs>2009-09-14 23:41:42 (GMT)
committerhobbs <hobbs>2009-09-14 23:41:42 (GMT)
commit33e2ffcd22e3a6489550d76769c30cdaf2855466 (patch)
treea26610d599ac66de2d6917237b5b0a6c55dfcc84 /generic
parentd5445b6e40de90dcbe3b80b515fbf3d1bfdace33 (diff)
downloadtk-33e2ffcd22e3a6489550d76769c30cdaf2855466.zip
tk-33e2ffcd22e3a6489550d76769c30cdaf2855466.tar.gz
tk-33e2ffcd22e3a6489550d76769c30cdaf2855466.tar.bz2
* generic/tkMenuDraw.c (TkPostSubmenu): Fix reposting of submenu in
* win/tkWinMenu.c (TkWinHandleMenuEvent): torn off Windows menu. [Bug 873613] (DrawMenuEntryArrow): Draw Win menu arrow after being torn off. [Bug 873608]
Diffstat (limited to 'generic')
-rw-r--r--generic/tkMenuDraw.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/generic/tkMenuDraw.c b/generic/tkMenuDraw.c
index 0956b3d..a86c067 100644
--- a/generic/tkMenuDraw.c
+++ b/generic/tkMenuDraw.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: tkMenuDraw.c,v 1.10 2007/12/13 15:24:16 dgp Exp $
+ * RCS: @(#) $Id: tkMenuDraw.c,v 1.11 2009/09/14 23:41:42 hobbs Exp $
*/
#include "tkInt.h"
@@ -984,11 +984,15 @@ TkPostSubmenu(
* attempt to match Motif behavior).
*
* The menu has to redrawn so that the entry can change relief.
+ *
+ * Set postedCascade early to ensure tear-off submenus work on
+ * Windows. [Bug 873613]
*/
Tk_GetRootCoords(menuPtr->tkwin, &x, &y);
AdjustMenuCoords(menuPtr, mePtr, &x, &y);
+ menuPtr->postedCascade = mePtr;
subary[0] = mePtr->namePtr;
subary[1] = Tcl_NewStringObj("post", -1);
subary[2] = Tcl_NewIntObj(x);
@@ -1001,9 +1005,9 @@ TkPostSubmenu(
Tcl_DecrRefCount(subary[2]);
Tcl_DecrRefCount(subary[3]);
if (result != TCL_OK) {
+ menuPtr->postedCascade = NULL;
return result;
}
- menuPtr->postedCascade = mePtr;
TkEventuallyRedrawMenu(menuPtr, mePtr);
}
return TCL_OK;