summaryrefslogtreecommitdiffstats
path: root/generic/tkMenuDraw.c
diff options
context:
space:
mode:
authorhobbs <hobbs>2009-09-14 23:40:42 (GMT)
committerhobbs <hobbs>2009-09-14 23:40:42 (GMT)
commitbb4f9b6a6182f89ab2bd4c1982c994549ffcb962 (patch)
tree9e2f1b56c7f5c7c5faecaef7cbae85075e01588b /generic/tkMenuDraw.c
parentdb92c980025b4202cf1e520ce03d6aa1e0737ade (diff)
downloadtk-bb4f9b6a6182f89ab2bd4c1982c994549ffcb962.zip
tk-bb4f9b6a6182f89ab2bd4c1982c994549ffcb962.tar.gz
tk-bb4f9b6a6182f89ab2bd4c1982c994549ffcb962.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/tkMenuDraw.c')
-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..61d03e4 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.10.2.1 2009/09/14 23:40: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;