This commit is contained in:
allonli 2025-12-18 20:40:23 +08:00 committed by GitHub
commit 4b713ff75e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 24 additions and 7 deletions

View File

@ -47,6 +47,7 @@ export enum IpcChannel {
App_MacRequestProcessTrust = 'app:mac-request-process-trust',
App_QuoteToMain = 'app:quote-to-main',
App_ShowMainWindow = 'app:show-main-window',
App_SetDisableHardwareAcceleration = 'app:set-disable-hardware-acceleration',
Notification_Send = 'notification:send',

View File

@ -909,6 +909,7 @@ export function registerIpc(mainWindow: BrowserWindow, app: Electron.App) {
SelectionService.registerIpcHandler()
ipcMain.handle(IpcChannel.App_QuoteToMain, (_, text: string) => windowService.quoteToMainWindow(text))
ipcMain.handle(IpcChannel.App_ShowMainWindow, () => windowService.showMainWindow())
ipcMain.handle(IpcChannel.App_SetDisableHardwareAcceleration, (_, isDisable: boolean) => {
configManager.setDisableHardwareAcceleration(isDisable)

View File

@ -375,15 +375,15 @@ export class WindowService {
mainWindow.hide()
//for mac users, should hide dock icon if close to tray
if (isMac && isTrayOnClose) {
app.dock?.hide()
const quickAssistantEnabled = configManager.getEnableQuickAssistant()
if (!quickAssistantEnabled) {
app.dock?.hide()
mainWindow.once('show', () => {
//restore the window can hide by cmd+h when the window is shown again
// https://github.com/electron/electron/pull/47970
app.dock?.show()
})
mainWindow.once('show', () => {
app.dock?.show()
})
}
}
})

View File

@ -487,6 +487,7 @@ const api = {
}) => ipcRenderer.invoke(IpcChannel.AgentToolPermission_Response, payload)
},
quoteToMainWindow: (text: string) => ipcRenderer.invoke(IpcChannel.App_QuoteToMain, text),
openMainWindow: () => ipcRenderer.invoke(IpcChannel.App_ShowMainWindow),
setDisableHardwareAcceleration: (isDisable: boolean) =>
ipcRenderer.invoke(IpcChannel.App_SetDisableHardwareAcceleration, isDisable),
trace: {

View File

@ -64,6 +64,16 @@ const Footer: FC<FooterProps> = ({
: t('miniwindow.footer.esc_back')
})}
</Tag>
<Tag
bordered={false}
style={{ cursor: 'pointer' }}
className="nodrag"
onClick={() => {
window.api.openMainWindow()
window.api.miniWindow.hide()
}}>
</Tag>
{route === 'home' && !canUseBackspace && (
<Tag
bordered={false}

View File

@ -183,6 +183,10 @@ const WindowFooter: FC<FooterProps> = ({
</>
)}
</OpButton>
<OpButton onClick={() => window.api?.openMainWindow?.()} $isWindowFocus={isWindowFocus}>
<CircleX size={14} className="btn-icon" />
</OpButton>
{onRegenerate && (
<OpButton onClick={handleRegenerate} $isWindowFocus={isWindowFocus} data-hovered={isRegenerateHovered}>
<RefreshIcon size={14} className="btn-icon" />