Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 focuswriter (1.7.2-2) unstable; urgency=medium
 .
   * Track upstream maintenance branch
   * bump debian policy
Author: Barak A. Pearlmutter <bap@debian.org>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: 2019-08-04

--- focuswriter-1.7.2.orig/src/window.cpp
+++ focuswriter-1.7.2/src/window.cpp
@@ -1497,6 +1497,17 @@ void Window::initMenus()
 	connect(help_menu, SIGNAL(aboutToHide()), m_documents, SLOT(showHeader()));
 #endif
 
+	// Prevent autodetection of macOS menu roles
+	file_menu->menuAction()->setMenuRole(QAction::NoRole);
+	edit_menu->menuAction()->setMenuRole(QAction::NoRole);
+	format_menu->menuAction()->setMenuRole(QAction::NoRole);
+	headings_menu->menuAction()->setMenuRole(QAction::NoRole);
+	tools_menu->menuAction()->setMenuRole(QAction::NoRole);
+	quotes_menu->menuAction()->setMenuRole(QAction::NoRole);
+	settings_menu->menuAction()->setMenuRole(QAction::NoRole);
+	focus_menu->menuAction()->setMenuRole(QAction::NoRole);
+	help_menu->menuAction()->setMenuRole(QAction::NoRole);
+
 	// Enable toolbar management in preferences dialog
 	QHashIterator<QString, QAction*> i(m_actions);
 	while (i.hasNext()) {
@@ -1510,6 +1521,11 @@ void Window::initMenus()
 
 		// Load custom shortcut
 		ActionManager::instance()->addAction(i.key(), i.value());
+
+		// Prevent autodetection of macOS menu roles
+		if (i.value()->menuRole() == QAction::TextHeuristicRole) {
+			i.value()->setMenuRole(QAction::NoRole);
+		}
 	}
 	addActions(m_actions.values());
 }
