fix: quick ask not show (#2315)
* fix: quick ask not show * fix: window resize does not work on windows 11
This commit is contained in:
parent
c8ea16e661
commit
bbfc686c33
@ -68,11 +68,7 @@ app
|
||||
} else {
|
||||
app.on('second-instance', (_event, _commandLine, _workingDirectory) => {
|
||||
// Someone tried to run a second instance, we should focus our window.
|
||||
if (windowManager.mainWindow) {
|
||||
if (windowManager.mainWindow.isMinimized())
|
||||
windowManager.mainWindow.restore()
|
||||
windowManager.mainWindow.focus()
|
||||
}
|
||||
windowManager.showMainWindow()
|
||||
})
|
||||
}
|
||||
app.on('activate', () => {
|
||||
@ -107,7 +103,12 @@ function createMainWindow() {
|
||||
|
||||
function registerGlobalShortcuts() {
|
||||
const ret = registerShortcut(quickAskHotKey, (selectedText: string) => {
|
||||
windowManager.showMainWindow()
|
||||
if (!windowManager.isQuickAskWindowVisible()) {
|
||||
windowManager.showQuickAskWindow()
|
||||
windowManager.sendQuickAskSelectedText(selectedText)
|
||||
} else {
|
||||
windowManager.hideQuickAskWindow()
|
||||
}
|
||||
})
|
||||
|
||||
if (!ret) {
|
||||
|
||||
@ -101,6 +101,7 @@ class WindowManager {
|
||||
expandQuickAskWindow(heightOffset: number): void {
|
||||
const width = quickAskWindowConfig.width!
|
||||
const height = quickAskWindowConfig.height! + heightOffset
|
||||
this._quickAskWindow?.setMinimumSize(width, height)
|
||||
this._quickAskWindow?.setSize(width, height, true)
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user