summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorhobbs <hobbs>2009-09-14 23:40:42 (GMT)
committerhobbs <hobbs>2009-09-14 23:40:42 (GMT)
commit7ddd685d9afb4397ba47bb464c385ef27f3d31ed (patch)
tree9e2f1b56c7f5c7c5faecaef7cbae85075e01588b /generic
parent59d18bcefa5280de1152a05d08d250cb582fab62 (diff)
downloadtk-7ddd685d9afb4397ba47bb464c385ef27f3d31ed.zip
tk-7ddd685d9afb4397ba47bb464c385ef27f3d31ed.tar.gz
tk-7ddd685d9afb4397ba47bb464c385ef27f3d31ed.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..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;