fix(window): 支持拖拽文件时保持窗口#506
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a GlobalInputManager to centralize global input event handling and resolve focus issues related to double-tap shortcuts and drag-and-drop operations. Key changes include refactoring DoubleTapManager to use the new manager and implementing logic in WindowManager to delay window hiding during external drag events. A review comment identified a logical redundancy in the mouse-up event handler where visibility resolution was being triggered twice; it is recommended to refactor this into a single conditional branch to improve clarity and avoid duplicate execution.
| this.hideAfterDeferredMouseUpIfNeeded() | ||
| this.resolveMouseUpVisibility() |
There was a problem hiding this comment.
这里存在逻辑冗余。hideAfterDeferredMouseUpIfNeeded 内部已经包含了对 resolveMouseUpVisibility 的调用。当 pendingBlurHideOnMouseUp 为 true 时,会导致 resolveMouseUpVisibility 被连续执行两次。建议根据 pendingBlurHideOnMouseUp 的状态进行分支处理,以提高代码清晰度并避免重复逻辑执行。
if (this.pendingBlurHideOnMouseUp) {
this.hideAfterDeferredMouseUpIfNeeded()
} else {
this.resolveMouseUpVisibility()
}
变更内容
动机
视频
2026-05-18-19-45-38.mp4
相关 issue
备注
目前仅在 Windows 平台上经过测试,Mac/Linux 平台表现暂不明确。