This commit is contained in:
parent
6b59e9d7f2
commit
72240c7f38
1 changed files with 16 additions and 2 deletions
|
@ -43,7 +43,7 @@ const windowStatePath = path.join(confDir, "windowState.json");
|
|||
let bootWindow;
|
||||
let latestActiveWindow;
|
||||
let firstOpen = false;
|
||||
let workspaces = []; // workspaceDir, id, browserWindow, tray
|
||||
let workspaces = []; // workspaceDir, id, browserWindow, tray, hideShortcut
|
||||
let kernelPort = 6806;
|
||||
let resetWindowStateOnRestart = false;
|
||||
|
||||
|
@ -1098,6 +1098,12 @@ app.whenReady().then(() => {
|
|||
if (!data.hotkeys || data.hotkeys.length === 0) {
|
||||
return;
|
||||
}
|
||||
workspaces.find(workspaceItem => {
|
||||
if (event.sender.id === workspaceItem.browserWindow.webContents.id) {
|
||||
workspaceItem.hotkeys = data.hotkeys;
|
||||
return true;
|
||||
}
|
||||
});
|
||||
data.hotkeys.forEach((item, index) => {
|
||||
const shortcut = hotKey2Electron(item);
|
||||
if (!shortcut) {
|
||||
|
@ -1111,11 +1117,19 @@ app.whenReady().then(() => {
|
|||
let currentWorkspace;
|
||||
const currentWebContentsId = (latestActiveWindow && !latestActiveWindow.isDestroyed()) ? latestActiveWindow.webContents.id : undefined;
|
||||
workspaces.find(workspaceItem => {
|
||||
if ((currentWebContentsId || event.sender.id) === workspaceItem.browserWindow.webContents.id) {
|
||||
if (currentWebContentsId === workspaceItem.browserWindow.webContents.id && workspaceItem.hotkeys[0] === item) {
|
||||
currentWorkspace = workspaceItem;
|
||||
return true;
|
||||
}
|
||||
});
|
||||
if (!currentWorkspace) {
|
||||
workspaces.find(workspaceItem => {
|
||||
if (workspaceItem.hotkeys[0] === item && event.sender.id === workspaceItem.browserWindow.webContents.id) {
|
||||
currentWorkspace = workspaceItem;
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
if (!currentWorkspace) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue