Skip to content

feat: 新增窗口呼出位置策略设置(记住上次位置/鼠标屏居中/主屏居中/上次活动屏居中)#558

Open
Cateds wants to merge 2 commits into
ZToolsCenter:mainfrom
Cateds:main
Open

feat: 新增窗口呼出位置策略设置(记住上次位置/鼠标屏居中/主屏居中/上次活动屏居中)#558
Cateds wants to merge 2 commits into
ZToolsCenter:mainfrom
Cateds:main

Conversation

@Cateds

@Cateds Cateds commented Jun 22, 2026

Copy link
Copy Markdown

在设置页"通用-行为"分组新增"窗口呼出位置"下拉选项,支持四种定位策略:

策略 行为
记住上次位置(默认) 恢复该显示器上次拖动后的位置,无记忆时居中
鼠标屏居中 每次呼出在鼠标所在显示器居中
主屏居中 每次呼出在主显示器居中
上次活动屏居中 每次呼出在呼出前活动窗口所在显示器居中(无记录时 fallback 到鼠标屏)

主要目的是模仿 wox 的默认行为,同时位置 ztools 的默认行为一致性

通用-行为 下新建了一个下拉框作为配置

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new setting, windowPositionStrategy, allowing users to configure the positioning strategy of the main window when it is summoned (options include remembering the last position, centering on the cursor screen, centering on the primary screen, or centering on the last active window's screen). The changes span across the settings UI, IPC channels, and the window manager. The review feedback highlights a potential issue in multi-monitor environments (especially on Windows) when using the lastActive strategy, where maximized windows can have negative coordinate offsets that might cause screen.getDisplayNearestPoint to misidentify the active display. It is recommended to use Number.isFinite for safer type checks and to calculate the window's center point for more accurate display detection.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/main/managers/windowManager.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant