fix(window): handle window movement across monitors with different scaling #3675
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
描述:
本 PR 修复了多显示器环境下,窗口在不同缩放因子显示器间移动时大小异常的问题。
核心改动:
新增
window_manager.rs模块处理窗口管理。引入
MonitorInfo结构体,用于 IPC 通信。移动窗口时,正确计算源显示器与目标显示器的缩放比例:
跨平台支持,增强类型安全性。
在
ipc.rs添加新命令,并在lib.rs注册。使用示例(前端 Tauri IPC 调用):
效果:
确保多显示器环境下,窗口能正确移动和显示,即使显示器缩放设置不同。