fix: prevent pending state failure in window platform interface#396
Conversation
There was a problem hiding this comment.
Sorry @18202781743, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
dcb7198 to
3928e82
Compare
|
目前协议导致无法使用applyPending,noTitlebar需要客户端强制提交,等之后协议添加configure后,再启用, |
Remove Qt::QueuedConnection and value comparison to ensure pending operations always execute synchronously. QueuedConnection fails when stack variables go out of scope before execution. Removing the early return prevents state inconsistency when initial values match desired values. Treeland protocol currently lacks configure support, so all features must apply immediately. Log: 修复窗口平台接口中 pending 状态失败问题
85f478b to
6862e66
Compare
deepin pr auto review★ 总体评分:75分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 diff --git a/src/plugins/platform/treeland/dtreelandplatformwindowinterface.cpp b/src/plugins/platform/treeland/dtreelandplatformwindowinterface.cpp
index 758aedc6..ca45ef54 100644
--- a/src/plugins/platform/treeland/dtreelandplatformwindowinterface.cpp
+++ b/src/plugins/platform/treeland/dtreelandplatformwindowinterface.cpp
@@ -354,7 +354,7 @@ void DTreeLandPlatformWindowHelper::scheduleApply()
if (m_applyScheduled)
return;
m_applyScheduled = true;
- QMetaObject::invokeMethod(this, &DTreeLandPlatformWindowHelper::applyPending);
+ QMetaObject::invokeMethod(this, &DTreeLandPlatformWindowHelper::applyPending, Qt::QueuedConnection);
}
void DTreeLandPlatformWindowHelper::applyPending()
diff --git a/src/plugins/platform/treeland/dtreelandplatformwindowinterface.h b/src/plugins/platform/treeland/dtreelandplatformwindowinterface.h
index 552e8fc7..57d7dd18 100644
--- a/src/plugins/platform/treeland/dtreelandplatformwindowinterface.h
+++ b/src/plugins/platform/treeland/dtreelandplatformwindowinterface.h
@@ -63,8 +63,6 @@ private slots:
template<typename T>
void updateFeature(T &member, const T &value, Feature flag) {
+ if (member == value)
+ return;
member = value;
m_initialized |= flag;
m_dirty |= flag; |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, BLumia 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 |
Remove Qt::QueuedConnection and early return to ensure pending operations always execute. The previous approach using stack variable comparisons was unreliable, causing pending state to fail intermittently. By directly invoking applyPending without queued connection and removing the unnecessary early return check, we guarantee consistent pending state application for window feature updates.
改动文件: