summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2014-08-14 16:38:33 (GMT)
committerdgp <dgp@users.sourceforge.net>2014-08-14 16:38:33 (GMT)
commita0186aabaef33d8ba53ef9d250707fc00995c98c (patch)
treeea55c1e5e05b97de83c1bd78ae6b1a06de5fadaa
parent8b077fa484a644682769bc71be8ebb965478df15 (diff)
parenta5927e8d5f0b12747732ed2d4a6c58ac801314b9 (diff)
downloadtk-a0186aabaef33d8ba53ef9d250707fc00995c98c.zip
tk-a0186aabaef33d8ba53ef9d250707fc00995c98c.tar.gz
tk-a0186aabaef33d8ba53ef9d250707fc00995c98c.tar.bz2
merge 8.5
-rw-r--r--macosx/tkMacOSXMenu.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c
index 380d3a7..e1cdc76 100644
--- a/macosx/tkMacOSXMenu.c
+++ b/macosx/tkMacOSXMenu.c
@@ -757,11 +757,19 @@ TkpPostMenu(
* to be posted. */
int y) /* The global y-coordinate */
{
- NSWindow *win = [NSApp keyWindow];
- if (!win) {
+
+
+ /* Get the object that holds this Tk Window.*/
+ Tk_Window root;
+ root = Tk_MainWindow(interp);
+ if (root == NULL) {
return TCL_ERROR;
}
-
+
+ Drawable d = Tk_WindowId(root);
+ NSView *rootview = TkMacOSXGetRootControl(d);
+ NSWindow *win = [rootview window];
+
inPostMenu = 1;
int oldMode = Tcl_SetServiceMode(TCL_SERVICE_NONE);