mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-10 02:02:29 +08:00
Fixed focusing on old windows when opening new windows from tray
This commit is contained in:
parent
f5a4acc097
commit
87c70cb46e
@ -106,6 +106,12 @@ function updateTrayMenu() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function openNewWindow() {
|
||||||
|
if (lastFocusedWindow){
|
||||||
|
lastFocusedWindow.webContents.send("globalShortcut", "openNewWindow");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function triggerKeyboardAction(actionName: KeyboardActionNames) {
|
function triggerKeyboardAction(actionName: KeyboardActionNames) {
|
||||||
if (lastFocusedWindow){
|
if (lastFocusedWindow){
|
||||||
lastFocusedWindow.webContents.send("globalShortcut", actionName);
|
lastFocusedWindow.webContents.send("globalShortcut", actionName);
|
||||||
@ -214,7 +220,7 @@ function updateTrayMenu() {
|
|||||||
label: t("tray.open_new_window"),
|
label: t("tray.open_new_window"),
|
||||||
type: "normal",
|
type: "normal",
|
||||||
icon: getIconPath("new-window"),
|
icon: getIconPath("new-window"),
|
||||||
click: () => triggerKeyboardAction("openNewWindow")
|
click: () => openNewWindow()
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: t("tray.new-note"),
|
label: t("tray.new-note"),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user