From 156392fee547dc07363b425f5226cfa0f28f6105 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Engdeg=C3=A5rd?= Date: Mon, 9 Oct 2023 17:18:17 +0200 Subject: [PATCH] Don't allow Services entries in pop-up menus on macOS (bug#66420) * src/nsmenu.m ([EmacsMenu runMenuAt:forFrame:keymaps:]): Prevent the system from adding context menu plug-ins (Services entries or sub-menu) to all our pop-up menus. --- src/nsmenu.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/nsmenu.m b/src/nsmenu.m index 4a86864176d..fb356c6b861 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m @@ -768,6 +768,10 @@ - (Lisp_Object)runMenuAt: (NSPoint)p forFrame: (struct frame *)f pressure: 0]; context_menu_value = -1; +#ifdef NS_IMPL_COCOA + /* Don't let the system add a Services menu here. */ + self.allowsContextMenuPlugIns = NO; +#endif [NSMenu popUpContextMenu: self withEvent: event forView: view]; retVal = context_menu_value; context_menu_value = 0;