optimize: 优化快捷键显示/隐藏窗口功能:当窗口打开着但未获取焦点时,快捷键可获取窗口焦点,而不是隐藏窗口。
parent
56afeebf05
commit
e94056941a
|
@ -285,8 +285,13 @@ function initApp () {
|
||||||
globalShortcut.unregisterAll()
|
globalShortcut.unregisterAll()
|
||||||
if (DevSidecar.api.config.get().app.showHideShortcut) {
|
if (DevSidecar.api.config.get().app.showHideShortcut) {
|
||||||
globalShortcut.register(DevSidecar.api.config.get().app.showHideShortcut, () => {
|
globalShortcut.register(DevSidecar.api.config.get().app.showHideShortcut, () => {
|
||||||
if (winIsHidden) {
|
if (winIsHidden || !win.isFocused()) {
|
||||||
showWin()
|
if (!win.isFocused()) {
|
||||||
|
win.focus()
|
||||||
|
}
|
||||||
|
if (winIsHidden) {
|
||||||
|
showWin()
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// linux,快捷键不关闭窗口
|
// linux,快捷键不关闭窗口
|
||||||
if (!isLinux()) {
|
if (!isLinux()) {
|
||||||
|
|
Loading…
Reference in New Issue