summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nsmenu.m30
1 files changed, 26 insertions, 4 deletions
diff --git a/src/nsmenu.m b/src/nsmenu.m
index cad0ff6fe17..5df391bcbe1 100644
--- a/src/nsmenu.m
+++ b/src/nsmenu.m
@@ -759,6 +759,32 @@ prettify_key (const char *key)
}
#ifdef NS_IMPL_GNUSTEP
+/* The code below doesn't work on Mac OS X, because it runs a nested
+ Carbon-related event loop to track menu bar movement.
+
+ But it works fine aside from that, so it will work on GNUstep if
+ they start to call `willHighlightItem'. */
+- (void) menu: (NSMenu *) menu willHighlightItem: (NSMenuItem *) item
+{
+ NSInteger idx = [item tag];
+ struct frame *f = SELECTED_FRAME ();
+ Lisp_Object vec = f->menu_bar_vector;
+ Lisp_Object help, frame;
+
+ if (idx >= ASIZE (vec))
+ return;
+
+ XSETFRAME (frame, f);
+ help = AREF (vec, idx + MENU_ITEMS_ITEM_HELP);
+
+ if (STRINGP (help) || NILP (help))
+ kbd_buffer_store_help_event (frame, help);
+
+ raise (SIGIO);
+}
+#endif
+
+#ifdef NS_IMPL_GNUSTEP
- (void) close
{
/* Close all the submenus. This has the unfortunate side-effect of
@@ -809,10 +835,6 @@ prettify_key (const char *key)
{
return NSZeroRect;
}
-
-- (void)menu:(NSMenu *)menu willHighlightItem:(NSMenuItem *)item
-{
-}
#endif
@end /* EmacsMenu */