Vanessa 2023-08-30 21:54:38 +08:00
parent 54aae5431b
commit c1478c2bc1
2 changed files with 5 additions and 3 deletions

View File

@ -811,7 +811,7 @@ app.whenReady().then(() => {
}); });
}); });
} else { } else {
globalShortcut.register(data.hotkey, () => { globalShortcut.register(shortcut, () => {
BrowserWindow.getAllWindows().forEach(itemB => { BrowserWindow.getAllWindows().forEach(itemB => {
itemB.webContents.send("siyuan-hotkey", { itemB.webContents.send("siyuan-hotkey", {
hotkey: item hotkey: item

View File

@ -116,7 +116,6 @@ export const onGetConfig = (isStart: boolean, app: App) => {
id: getCurrentWindow().id, id: getCurrentWindow().id,
port: location.port port: location.port
}); });
sendGlobalShortcut(app);
webFrame.setZoomFactor(window.siyuan.storage[Constants.LOCAL_ZOOM]); webFrame.setZoomFactor(window.siyuan.storage[Constants.LOCAL_ZOOM]);
/// #endif /// #endif
if (!window.siyuan.config.uiLayout || (window.siyuan.config.uiLayout && !window.siyuan.config.uiLayout.left)) { if (!window.siyuan.config.uiLayout || (window.siyuan.config.uiLayout && !window.siyuan.config.uiLayout.left)) {
@ -127,6 +126,9 @@ export const onGetConfig = (isStart: boolean, app: App) => {
window.siyuan.emojis = response.data as IEmoji[]; window.siyuan.emojis = response.data as IEmoji[];
try { try {
JSONToLayout(app, isStart); JSONToLayout(app, isStart);
/// #if !BROWSER
sendGlobalShortcut(app);
/// #endif
openChangelog(); openChangelog();
} catch (e) { } catch (e) {
resetLayout(); resetLayout();
@ -309,7 +311,7 @@ export const initWindow = (app: App) => {
let matchCommand = false; let matchCommand = false;
app.plugins.find(item => { app.plugins.find(item => {
item.commands.find(command => { item.commands.find(command => {
if (command.globalCallback && data === command.customHotkey) { if (command.globalCallback && data.hotkey === command.customHotkey) {
matchCommand = true; matchCommand = true;
command.globalCallback(); command.globalCallback();
return true; return true;