Skip to content

Commit

Permalink
fix: wake up app on window when minimized #58 (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
orangelckc committed Mar 22, 2023
1 parent 254f301 commit 3c1ba49
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/stores/settings.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { register, unregisterAll } from '@tauri-apps/api/globalShortcut'
import { appWindow } from '@tauri-apps/api/window'
import { hide, show } from '@tauri-apps/api/app'
import { enable, disable } from 'tauri-plugin-autostart-api'
import { THEME, DEFAULT_SHORTCUT_KEY } from '@/constants'

Expand Down Expand Up @@ -53,9 +54,13 @@ export const useSettingsStore = defineStore(
if (!isRememberPosition.value) {
appWindow.center()
}

appWindow.unminimize()
show() // macos 显示程序专用
appWindow.show()
appWindow.setFocus()
} else {
hide() // macos 隐藏程序专用
appWindow.hide()
}
})
Expand Down

0 comments on commit 3c1ba49

Please sign in to comment.