Repository navigation
Conversation
Wayland toplevels cannot be positioned by the client, so QWidget::move() is a no-op and the quake window is auto-placed in the middle of the screen. Use the treeland_dde_shell_unstable_v2 protocol to submit a fixed position hint before the surface is mapped, and resubmit it whenever Qt recreates the wl_surface (on every hide/show cycle). Wayland 顶层窗口无法由客户端指定位置,move() 在 Wayland 下无效,导致雷神 窗口被自动放置到屏幕中间。改用 treeland_dde_shell_unstable_v2 协议在窗口 映射前提交固定位置提示,并在 wl_surface 每次重建(隐藏/再次显示)时重新提交。 Log: 修复雷神窗口在 Treeland 下显示在屏幕中间且闪烁的问题 PMS: BUG-344337 Influence: 仅影响 Treeland 下的雷神窗口显示位置;X11 与其他 Wayland 合成器 行为不变,编译时缺少 libwayland-dev/wayland-scanner 时该特性自动关闭。
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: JWWTSL 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 |
Reviewer's GuideThe PR introduces an optional Treeland-specific Wayland positioner that uses the private dde-shell protocol to pin the quake window to the top-left of the cursor’s output, reapplying the initial-placement hint across native-surface recreation while preserving existing behavior on unsupported platforms and X11. Sequence diagram for Treeland quake window positioningsequenceDiagram
participant User
participant QuakeWindow
participant TreelandWindowPositioner
participant WaylandSurface
participant Treeland
User->>QuakeWindow: showEvent
QuakeWindow->>TreelandWindowPositioner: screenForPosition
QuakeWindow->>TreelandWindowPositioner: setTargetScreen
QuakeWindow->>TreelandWindowPositioner: applyPosition
TreelandWindowPositioner->>Treeland: ensureManager
TreelandWindowPositioner->>WaylandSurface: createShellSurface
TreelandWindowPositioner->>Treeland: set_role(normal)
TreelandWindowPositioner->>Treeland: set_position_hint(output, 0, 0)
Treeland-->>WaylandSurface: map at output top-left
Sequence diagram for reapplying placement after surface recreationsequenceDiagram
participant QuakeWindow
participant TreelandWindowPositioner
participant WaylandSurface
participant Treeland
QuakeWindow->>WaylandSurface: hide/show recreates surface
WaylandSurface-->>TreelandWindowPositioner: surfaceCreated
TreelandWindowPositioner->>Treeland: createShellSurface
TreelandWindowPositioner->>Treeland: set_position_hint(output, 0, 0)
Treeland-->>WaylandSurface: map at output top-left
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
🔍 详细分析1. 语法逻辑 ✅评价: 语法正确,逻辑清晰 ✅ 通过 潜在问题: 建议: ['在 ensureManager() 中,若 wl_display_get_registry 失败,应先释放已创建的 m_eventQueue 再返回,或调整 m_managerQueried 的赋值时机使其仅在全部成功后置 true'] 2. 代码质量 ✅评价: 代码结构清晰,注释完整 ✅ 通过 潜在问题: 建议: ['更新测试文件版权头中的年份为 2025'] 3. 代码性能 ✅评价: 性能良好,资源使用合理 ✅ 通过 潜在问题: 建议: [] 4. 代码安全 🔒评价: 存在0个安全漏洞 ✅ 通过
安全漏洞详情: 建议: [] 💡 改进建议代码示例// 修复 ensureManager() 中的 error path 资源泄漏
void TreelandWindowPositioner::ensureManager()
{
if (m_managerQueried)
return;
auto *platformNative = QGuiApplication::platformNativeInterface();
if (!platformNative)
return;
m_display = static_cast<wl_display *>(
platformNative->nativeResourceForWindow("display", windowOf(m_window)));
if (!m_display)
return;
m_eventQueue = wl_display_create_queue(m_display);
if (!m_eventQueue)
return;
m_registry = wl_display_get_registry(m_display);
if (!m_registry) {
// 释放已创建的 event queue,避免泄漏
wl_event_queue_destroy(m_eventQueue);
m_eventQueue = nullptr;
return;
}
m_managerQueried = true;
wl_proxy_set_queue(reinterpret_cast<wl_proxy *>(m_registry), m_eventQueue);
static const wl_registry_listener listener = {
&TreelandWindowPositioner::onRegistryGlobal,
nullptr,
};
wl_registry_add_listener(m_registry, &listener, this);
wl_display_roundtrip_queue(m_display, m_eventQueue);
}本报告由 AI 代码审查工具自动生成 |
|
TAG Bot New tag: 6.5.41 |
|
TAG Bot New tag: 6.5.42 |
Summary
Wayland toplevels cannot be positioned by the client, so
QWidget::move()is a no-op and the quake window gets auto-placed in the middle of the screen instead of the top (BUG-344337).This change pins the quake window to the top-left of the cursor screen via the Treeland private protocol
treeland_dde_shell_unstable_v2:TreelandWindowPositionerwhich submitsset_position_hint(output, 0, 0)before the surface is mapped.wl_surface(on every hide/show cycle).libwayland-dev/wayland-scanner.Test plan
UT_TreelandWindowPositioner_Test(7 cases).Related
Summary by Sourcery
Pin the quake window to the top of its cursor-selected screen on Treeland while preserving existing behavior on unsupported platforms.
New Features:
Bug Fixes:
Enhancements:
Build:
Tests: