mirror of
https://github.com/zadam/trilium.git
synced 2025-11-10 00:19:04 +01:00
send global shortcut to current window, not the first one
This commit is contained in:
parent
71d7403690
commit
44b34d1ea0
@ -337,14 +337,15 @@ async function registerGlobalShortcuts() {
|
|||||||
const result = globalShortcut.register(
|
const result = globalShortcut.register(
|
||||||
translatedShortcut,
|
translatedShortcut,
|
||||||
cls.wrap(() => {
|
cls.wrap(() => {
|
||||||
if (!mainWindow) {
|
const targetWindow = getLastFocusedWindow() || mainWindow;
|
||||||
|
if (!targetWindow) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// window may be hidden / not in focus
|
// window may be hidden / not in focus
|
||||||
mainWindow.focus();
|
targetWindow.focus();
|
||||||
|
|
||||||
mainWindow.webContents.send("globalShortcut", action.actionName);
|
targetWindow.webContents.send("globalShortcut", action.actionName);
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user