Skip to content

fix: 修复 Windows 平台窗口被任务栏遮挡的问题#930

Merged
ayangweb merged 1 commit into
masterfrom
fix-window-order
Apr 18, 2026
Merged

fix: 修复 Windows 平台窗口被任务栏遮挡的问题#930
ayangweb merged 1 commit into
masterfrom
fix-window-order

Conversation

@ayangweb

Copy link
Copy Markdown
Owner

fixed #430

@ayangweb ayangweb changed the title fix: 修复 Windows 平台窗口被任务栏盖住的问题 fix: 修复 Windows 平台窗口被任务栏遮挡的问题 Apr 18, 2026
@ayangweb ayangweb requested a review from Copilot April 18, 2026 03:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to fix the “always-on-top” behavior on Windows (Issue #430), where the app window can be covered by the Windows 11 taskbar / fullscreen apps, by introducing a Windows-specific always-on-top implementation and some UI-side handling around context menus.

Changes:

  • Add Windows-specific set_always_on_top implementation using Win32 SetWindowPos and restructure window commands into per-OS modules (macOS/Windows/Linux).
  • Update main window context-menu handling to temporarily disable always-on-top on Windows while the menu is displayed.
  • Add a Windows-only Rust dependency (windows crate) to support the Win32 calls.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/pages/main/index.vue Temporarily toggles always-on-top around context menu popup on Windows.
src-tauri/src/plugins/window/src/commands/windows.rs Implements Windows always-on-top via Win32 SetWindowPos and a background loop.
src-tauri/src/plugins/window/src/commands/mod.rs Refactors command dispatch to OS-specific modules (windows/linux/macos).
src-tauri/src/plugins/window/src/commands/macos.rs Inlines previously shared window behaviors and keeps macOS panel logic for main window.
src-tauri/src/plugins/window/src/commands/linux.rs Adds Linux implementation equivalent to the prior shared/common behavior.
src-tauri/src/plugins/window/src/commands/common.rs Removes the prior non-macOS shared implementation.
src-tauri/src/plugins/window/Cargo.toml Adds Windows-only windows crate dependency.
Cargo.lock Updates lockfile to include windows 0.58.0 alongside existing windows 0.61.x.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src-tauri/src/plugins/window/src/commands/windows.rs
Comment thread src-tauri/src/plugins/window/Cargo.toml Outdated
Comment thread src/pages/main/index.vue
Comment thread src/pages/main/index.vue
Comment thread src-tauri/src/plugins/window/src/commands/windows.rs Outdated
Comment thread src-tauri/src/plugins/window/src/commands/windows.rs
Comment thread src-tauri/src/plugins/window/src/commands/windows.rs

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

该 PR 旨在修复 Windows 11 上开启“窗口置顶”后仍会被全屏应用/任务栏遮挡的问题(关联 #430),并对 custom-window Tauri 插件的按平台实现进行拆分与增强。

Changes:

  • Windows:通过 Win32 SetWindowPos(HWND_TOPMOST, ...) 强制维持窗口 TopMost,以避免被任务栏/全屏窗口覆盖。
  • 前端:在 Windows 上弹出右键菜单前临时取消置顶,避免菜单被置顶窗口遮挡,菜单关闭后再恢复置顶。
  • 插件结构:将非 macOS 的 common 实现拆分为 windows/linux 平台文件,并新增 Windows 专用依赖。

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/pages/main/index.vue Windows 下右键菜单弹出前临时取消置顶,弹出后恢复置顶
src-tauri/src/plugins/window/src/commands/windows.rs Windows 置顶实现改为 Win32 SetWindowPos + 轮询维持 TopMost
src-tauri/src/plugins/window/src/commands/mod.rs commands 模块改为按 OS 拆分并简化窗口显示逻辑
src-tauri/src/plugins/window/src/commands/macos.rs macOS 命令实现内聚(移除 shared/common 依赖),保留主窗口 panel 行为
src-tauri/src/plugins/window/src/commands/linux.rs 新增 Linux 命令实现(承接原 common 行为)
src-tauri/src/plugins/window/src/commands/common.rs 删除原非 macOS 的 common 实现
src-tauri/src/plugins/window/Cargo.toml Windows 平台新增 windows crate 依赖
Cargo.lock 锁文件更新,引入 windows 0.62.2 及其依赖,同时保留 windows 0.61.3

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/pages/main/index.vue
Comment thread src-tauri/src/plugins/window/src/commands/windows.rs
Comment thread src-tauri/src/plugins/window/src/commands/windows.rs
Comment thread src-tauri/src/plugins/window/Cargo.toml Outdated
Comment thread src/pages/main/index.vue
@ayangweb ayangweb merged commit 6b46e10 into master Apr 18, 2026
@ayangweb ayangweb deleted the fix-window-order branch April 18, 2026 04:36
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.

当前版本窗口置顶功能无法正常使用

2 participants