mirror of
https://github.com/zadam/trilium.git
synced 2025-11-09 16:08:58 +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(
|
||||
translatedShortcut,
|
||||
cls.wrap(() => {
|
||||
if (!mainWindow) {
|
||||
const targetWindow = getLastFocusedWindow() || mainWindow;
|
||||
if (!targetWindow) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 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