mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-16 13:17:46 +00:00
fix: 全局快捷键相关bug
This commit is contained in:
parent
bb87b7f20d
commit
14f47f8cfc
4 changed files with 5 additions and 2 deletions
|
|
@ -311,7 +311,7 @@ class Background {
|
||||||
this.window.setTouchBar(createTouchBar(this.window));
|
this.window.setTouchBar(createTouchBar(this.window));
|
||||||
|
|
||||||
// register global shortcuts
|
// register global shortcuts
|
||||||
if (this.store.get('settings.enableGlobalShortcut')) {
|
if (this.store.get('settings.enableGlobalShortcut') !== false) {
|
||||||
registerGlobalShortcut(this.window, this.store);
|
registerGlobalShortcut(this.window, this.store);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,7 @@ export function initIpcMain(win, store) {
|
||||||
if (options.enableGlobalShortcut) {
|
if (options.enableGlobalShortcut) {
|
||||||
registerGlobalShortcut(win, store);
|
registerGlobalShortcut(win, store);
|
||||||
} else {
|
} else {
|
||||||
|
log('unregister global shortcut');
|
||||||
globalShortcut.unregisterAll();
|
globalShortcut.unregisterAll();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -120,6 +121,7 @@ export function initIpcMain(win, store) {
|
||||||
});
|
});
|
||||||
|
|
||||||
ipcMain.on('switchGlobalShortcutStatusTemporary', (e, status) => {
|
ipcMain.on('switchGlobalShortcutStatusTemporary', (e, status) => {
|
||||||
|
log('switchGlobalShortcutStatusTemporary');
|
||||||
if (status === 'disable') {
|
if (status === 'disable') {
|
||||||
globalShortcut.unregisterAll();
|
globalShortcut.unregisterAll();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ let localStorage = {
|
||||||
lyricsBackground: true,
|
lyricsBackground: true,
|
||||||
closeAppOption: 'ask',
|
closeAppOption: 'ask',
|
||||||
enableDiscordRichPresence: false,
|
enableDiscordRichPresence: false,
|
||||||
enableGlobalShortcut: false,
|
enableGlobalShortcut: true,
|
||||||
showLibraryDefault: false,
|
showLibraryDefault: false,
|
||||||
enabledPlaylistCategories,
|
enabledPlaylistCategories,
|
||||||
proxyConfig: {
|
proxyConfig: {
|
||||||
|
|
|
||||||
|
|
@ -978,6 +978,7 @@ export default {
|
||||||
this.recordedShortcut = [];
|
this.recordedShortcut = [];
|
||||||
},
|
},
|
||||||
exitRecordShortcut() {
|
exitRecordShortcut() {
|
||||||
|
if (this.shortcutInput.recording === false) return;
|
||||||
this.shortcutInput = { id: '', type: '', recording: false };
|
this.shortcutInput = { id: '', type: '', recording: false };
|
||||||
this.recordedShortcut = [];
|
this.recordedShortcut = [];
|
||||||
ipcRenderer.send('switchGlobalShortcutStatusTemporary', 'enable');
|
ipcRenderer.send('switchGlobalShortcutStatusTemporary', 'enable');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue