From e857ab762c9d064bdfd436fcd5d36afab8f6ebd8 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 18 May 2018 11:30:05 +0100 Subject: [PATCH 1/2] Fix right click menu in electron Fixes https://github.com/vector-im/riot-web/issues/6762 --- electron_app/src/webcontents-handler.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/electron_app/src/webcontents-handler.js b/electron_app/src/webcontents-handler.js index 37416ebe..8e079718 100644 --- a/electron_app/src/webcontents-handler.js +++ b/electron_app/src/webcontents-handler.js @@ -61,7 +61,7 @@ function onLinkContextMenu(ev, params) { clipboard.writeText(url); }, })); - popupMenu.popup(); + popupMenu.popup({}); ev.preventDefault(); } @@ -88,7 +88,7 @@ function onSelectedContextMenu(ev, params) { const items = _CutCopyPasteSelectContextMenus(params); const popupMenu = Menu.buildFromTemplate(items); - popupMenu.popup(); + popupMenu.popup({}); ev.preventDefault(); } @@ -101,7 +101,7 @@ function onEditableContextMenu(ev, params) { const popupMenu = Menu.buildFromTemplate(items); - popupMenu.popup(); + popupMenu.popup({}); ev.preventDefault(); } From 6722eedf7a3b83478a3fc0c58716c8c6b8a678f8 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 18 May 2018 11:42:40 +0100 Subject: [PATCH 2/2] Comment why we're passing empty objects in --- electron_app/src/webcontents-handler.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/electron_app/src/webcontents-handler.js b/electron_app/src/webcontents-handler.js index 8e079718..cd6833fd 100644 --- a/electron_app/src/webcontents-handler.js +++ b/electron_app/src/webcontents-handler.js @@ -61,6 +61,7 @@ function onLinkContextMenu(ev, params) { clipboard.writeText(url); }, })); + // popup() requires an options object even for no options popupMenu.popup({}); ev.preventDefault(); } @@ -88,6 +89,7 @@ function onSelectedContextMenu(ev, params) { const items = _CutCopyPasteSelectContextMenus(params); const popupMenu = Menu.buildFromTemplate(items); + // popup() requires an options object even for no options popupMenu.popup({}); ev.preventDefault(); } @@ -101,6 +103,7 @@ function onEditableContextMenu(ev, params) { const popupMenu = Menu.buildFromTemplate(items); + // popup() requires an options object even for no options popupMenu.popup({}); ev.preventDefault(); }