aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2021-11-10 14:04:05 +0800
committerPo Lu2021-11-10 14:04:05 +0800
commite9b954f0fdc91eaad32d853e82ad8cb4c53c69d2 (patch)
tree424eb046da6c0b2e2e75651226d2c613f6da640e /src
parentff9cf991c1608cd2578a66cba41e654a2b5d9144 (diff)
downloademacs-e9b954f0fdc91eaad32d853e82ad8cb4c53c69d2.tar.gz
emacs-e9b954f0fdc91eaad32d853e82ad8cb4c53c69d2.zip
Revert "Support opening the toolkit menu bar on NS"
This reverts commit ff9cf991c1608cd2578a66cba41e654a2b5d9144.
Diffstat (limited to 'src')
-rw-r--r--src/nsmenu.m55
-rw-r--r--src/nsterm.m1
2 files changed, 0 insertions, 56 deletions
diff --git a/src/nsmenu.m b/src/nsmenu.m
index b93d3a79bdc..29201e69079 100644
--- a/src/nsmenu.m
+++ b/src/nsmenu.m
@@ -439,44 +439,6 @@ set_frame_menubar (struct frame *f, bool deep_p)
439 ns_update_menubar (f, deep_p); 439 ns_update_menubar (f, deep_p);
440} 440}
441 441
442void
443ns_activate_menubar (struct frame *frame)
444{
445 if (frame != SELECTED_FRAME ()
446 || !FRAME_EXTERNAL_MENU_BAR (frame))
447 return;
448
449 block_input ();
450 NSApplication *app = [NSApplication sharedApplication];
451 NSMenu *menu = [app mainMenu];
452 for (NSMenuItem *item in [menu itemArray])
453 {
454 if ([item hasSubmenu])
455 {
456#ifdef NS_IMPL_GNUSTEP
457 [[item submenu] display];
458#else
459 NSWindow *window = [FRAME_NS_VIEW (frame) window];
460 NSScreen *screen = [window screen];
461
462 NSRect screen_frame = [screen frame];
463 [app postEvent: [NSEvent mouseEventWithType: NSLeftMouseDown
464 location: NSMakePoint (NSMinX (screen_frame),
465 NSMinY (screen_frame) + 10)
466 modifierFlags: 0
467 timestamp: 0
468 windowNumber: [window windowNumber]
469 context: [NSGraphicsContext currentContext]
470 eventNumber: 0
471 clickCount: 1
472 pressure: 1.0f]
473 atStart: YES];
474#endif
475 break;
476 }
477 }
478 unblock_input ();
479}
480 442
481/* ========================================================================== 443/* ==========================================================================
482 444
@@ -1954,22 +1916,6 @@ DEFUN ("menu-or-popup-active-p", Fmenu_or_popup_active_p, Smenu_or_popup_active_
1954 return popup_activated () ? Qt : Qnil; 1916 return popup_activated () ? Qt : Qnil;
1955} 1917}
1956 1918
1957DEFUN ("ns-menu-bar-open", Fns_menu_bar_open, Sns_menu_bar_open, 0, 1, "i",
1958 doc: /* Start key navigation of the menu bar in FRAME.
1959This initially opens the first menu bar item and you can then navigate with the
1960arrow keys, select a menu entry with the return key or cancel with the
1961escape key. If FRAME has no menu bar this function does nothing.
1962
1963If FRAME is nil or not given, use the selected frame. */)
1964 (Lisp_Object frame)
1965{
1966 struct frame *f = decode_window_system_frame (frame);
1967
1968 ns_activate_menubar (f);
1969
1970 return Qnil;
1971}
1972
1973/* ========================================================================== 1919/* ==========================================================================
1974 1920
1975 Lisp interface declaration 1921 Lisp interface declaration
@@ -1981,7 +1927,6 @@ syms_of_nsmenu (void)
1981{ 1927{
1982 defsubr (&Sns_reset_menu); 1928 defsubr (&Sns_reset_menu);
1983 defsubr (&Smenu_or_popup_active_p); 1929 defsubr (&Smenu_or_popup_active_p);
1984 defsubr (&Sns_menu_bar_open);
1985 1930
1986 DEFSYM (Qdebug_on_next_call, "debug-on-next-call"); 1931 DEFSYM (Qdebug_on_next_call, "debug-on-next-call");
1987} 1932}
diff --git a/src/nsterm.m b/src/nsterm.m
index 4e84e130b89..ed0e7a2aae8 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -5067,7 +5067,6 @@ ns_create_terminal (struct ns_display_info *dpyinfo)
5067 terminal->delete_frame_hook = ns_destroy_window; 5067 terminal->delete_frame_hook = ns_destroy_window;
5068 terminal->delete_terminal_hook = ns_delete_terminal; 5068 terminal->delete_terminal_hook = ns_delete_terminal;
5069 terminal->change_tab_bar_height_hook = ns_change_tab_bar_height; 5069 terminal->change_tab_bar_height_hook = ns_change_tab_bar_height;
5070 terminal->activate_menubar_hook = ns_activate_menubar;
5071 /* Other hooks are NULL by default. */ 5070 /* Other hooks are NULL by default. */
5072 5071
5073 return terminal; 5072 return terminal;