summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkevin_walzer <kevin_walzer@noemail.net>2014-08-14 02:41:52 (GMT)
committerkevin_walzer <kevin_walzer@noemail.net>2014-08-14 02:41:52 (GMT)
commitaf2f45aca7dcb74472f33d1b62d899fab47105be (patch)
tree425dc3b379345df948cc759bd20295b8c09e0b23
parent5109505c93fc7e21495b1332e19c7d6ed6a23bee (diff)
downloadtk-af2f45aca7dcb74472f33d1b62d899fab47105be.zip
tk-af2f45aca7dcb74472f33d1b62d899fab47105be.tar.gz
tk-af2f45aca7dcb74472f33d1b62d899fab47105be.tar.bz2
Allow Tk to post popup menus when Tk app is not frontmost
FossilOrigin-Name: 51268e7b4f90ec4c14d114927d32626d37621997
-rw-r--r--macosx/tkMacOSXMenu.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c
index 313a5cf..a8e9f2f 100644
--- a/macosx/tkMacOSXMenu.c
+++ b/macosx/tkMacOSXMenu.c
@@ -757,10 +757,18 @@ 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;