1
0
mirror of https://github.com/laurent22/joplin.git synced 2026-02-04 07:53:44 +02:00

Compare commits

...

1 Commits

Author SHA1 Message Date
Laurent Cozic
7d0cd1ab3e update 2026-02-03 00:45:08 +00:00
2 changed files with 8 additions and 2 deletions

View File

@@ -156,7 +156,10 @@ const useContextMenu = (props: ContextMenuProps) => {
// Prepend the event listener so that it gets called before
// the listener that shows the default menu.
const targetWindow = bridge().activeWindow();
// Use mainWindow() instead of activeWindow() because activeWindow() can return
// the DevTools window when it's focused, causing the listener to be registered
// on the wrong webContents.
const targetWindow = bridge().mainWindow();
targetWindow.webContents.prependListener('context-menu', onContextMenu);
return () => {

View File

@@ -34,7 +34,10 @@ export default function(editor: Editor, plugins: PluginStates, dispatch: Dispatc
if (!editor) return () => {};
const contextMenuItems = menuItems(dispatch);
const targetWindow = bridge().activeWindow();
// Use mainWindow() instead of activeWindow() because activeWindow() can return
// the DevTools window when it's focused, causing the listener to be registered
// on the wrong webContents.
const targetWindow = bridge().mainWindow();
const makeMainMenuItems = (element: Element) => {
let itemType: ContextMenuItemType = ContextMenuItemType.None;