Repository navigation
fix: use availableGeometry for quake window to avoid dock overlap - #592
Merged
deepin-bot[bot] merged 1 commit intoNov 11, 2026
Merged
Conversation
1. Root cause: QuakeWindow::resizeByCurrentScreen and getQuakeHeight used QScreen::geometry() (full screen rect) instead of availableGeometry() (work area excluding dock), so the quake window covered the dock when dock moved to top/left/right 2. Fix: replace geometry() with availableGeometry() at 4 call sites in resizeByCurrentScreen (width, topLeft, maxHeight) and getQuakeHeight (default height) so the window is positioned within the usable area 3. Impact: when no dock is present availableGeometry() equals geometry(), so behavior is unchanged; when dock is present the quake window no longer overlaps the dock after position switches Log: fix quake window overlapping dock after switching dock position Influence: 1. Test quake window with dock at bottom (regression, behavior unchanged) 2. Test quake window with dock at top/left/right (fix scenario) 3. Test switching dock position while quake window is open 4. Test quake window with no dock present fix: 雷神窗口使用 availableGeometry 避免遮挡任务栏 1. 根因:QuakeWindow::resizeByCurrentScreen 和 getQuakeHeight 使用 QScreen::geometry()(全屏矩形)而非 availableGeometry()(扣除 dock 的可用区域),导致 dock 切换至顶部/左侧/右侧时雷神窗口 覆盖 dock 2. 方案:将 resizeByCurrentScreen 中 width、topLeft、maxHeight 三处 及 getQuakeHeight 默认高度处的 geometry() 替换为 availableGeometry(),使窗口定位在可用区域内 3. 影响:dock 不存在时 availableGeometry() 与 geometry() 返回值相同, 行为不变;dock 存在时雷神窗口不再遮挡 dock Log: 修复切换任务栏位置后雷神窗口遮挡任务栏的问题 Influence: 1. 测试 dock 在底部时雷神窗口(回归,行为不变) 2. 测试 dock 在顶部/左侧/右侧时雷神窗口(修复场景) 3. 测试雷神窗口打开后切换 dock 位置 4. 测试无 dock 环境下雷神窗口 PMS: BUG-378923
pengfeixx
marked this pull request as draft
November 6, 2026 22:25
Reviewer's GuideImplementationUse each screen’s available geometry for the quake window’s position and size so it stays within the usable work area when the dock moves.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
pengfeixx
marked this pull request as ready for review
November 11, 2026 06:07
lzwind
approved these changes
Nov 11, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: lzwind, pengfeixx The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Contributor
Author
|
/merge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Root Cause Analysis
QuakeWindow::resizeByCurrentScreen and getQuakeHeight used QScreen::geometry() (full screen rectangle) instead of availableGeometry() (usable work area excluding dock). When the dock position switched to top/left/right, the availableGeometryChanged signal triggered slotWorkAreaResized → resizeByCurrentScreen(true), but the window was repositioned using the full-screen rect, causing it to overlap the dock. The historical fix 298e3ca (which used availableGeometry) was only on old-master and never merged into master; the master refactor (57b7c43) reintroduced geometry().
Fix
Replace geometry() with availableGeometry() at 4 call sites in src/main/mainwindow.cpp: resizeByCurrentScreen (width L3605, topLeft L3606, maxHeight L3609) and getQuakeHeight (default height L3746). When no dock is present, availableGeometry() equals geometry(), so behavior is unchanged.
Change Safety Assessment
Code Safety
Business Impact Scope
Affected module: Quake Window (雷神窗口) positioning and height calculation. User scenario: after opening the quake window and switching the dock to top/left/right, the window no longer overlaps the dock.
Verification Suggestion
Test quake window with dock at bottom (regression), top/left/right (fix scenario), and after switching dock position while the window is open. Verify no-dock environment is unchanged.
根因分析
QuakeWindow::resizeByCurrentScreen 和 getQuakeHeight 使用 QScreen::geometry()(全屏矩形)而非 availableGeometry()(扣除 dock 的可用区域)。dock 位置切换至顶部/左侧/右侧时,availableGeometryChanged 信号触发 slotWorkAreaResized → resizeByCurrentScreen(true),但窗口按全屏矩形重新定位,导致遮挡 dock。历史修复 298e3ca(使用 availableGeometry)仅在 old-master,未合入 master;master 重构(57b7c437)重新引入了 geometry()。
修复方案
将 src/main/mainwindow.cpp 中 4 处 geometry() 替换为 availableGeometry():resizeByCurrentScreen(宽度 L3605、左上角 L3606、最大高度 L3609)和 getQuakeHeight(默认高度 L3746)。dock 不存在时 availableGeometry() 与 geometry() 返回值相同,行为不变。
改动安全评估
代码安全评估
业务影响范围
受影响模块:雷神窗口定位与高度计算。用户场景:打开雷神窗口后切换 dock 至顶部/左侧/右侧时,窗口不再遮挡 dock。
验证建议
测试 dock 在底部(回归)、顶部/左侧/右侧(修复场景)时的雷神窗口,以及窗口打开后切换 dock 位置。验证无 dock 环境行为不变。
Summary by Sourcery
Use each screen’s available work area for quake window sizing and positioning.
Bug Fixes: