Skip to content

Commit 85f478b

Browse files
committed
fix: force noTitlebar sync apply, restore queued connection for scheduleApply
noTitlebar requires immediate sync apply because the treeland protocol currently lacks configure event support. Restore Qt::QueuedConnection to prevent staleness from stack variable scenarios. Log: noTitlebar强制同步提交,scheduleApply恢复异步调度 Influence: noTitlebar属性直接同步更新到wayland;其他属性恢复异步合并调度
1 parent 3928e82 commit 85f478b

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

src/plugins/platform/treeland/dtreelandplatformwindowinterface.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,12 @@ PersonalizationWindowContext *DTreeLandPlatformWindowHelper::windowContext() con
306306

307307
void DTreeLandPlatformWindowHelper::setEnabledNoTitlebar(bool enable)
308308
{
309-
updateFeature(m_noTitlebar, enable, NoTitlebar);
309+
if (m_noTitlebar == enable)
310+
return;
311+
m_noTitlebar = enable;
312+
m_initialized |= NoTitlebar;
313+
m_dirty |= NoTitlebar;
314+
applyPending();
310315
}
311316

312317
void DTreeLandPlatformWindowHelper::setWindowRadius(int windowRadius)
@@ -354,7 +359,7 @@ void DTreeLandPlatformWindowHelper::scheduleApply()
354359
if (m_applyScheduled)
355360
return;
356361
m_applyScheduled = true;
357-
QMetaObject::invokeMethod(this, &DTreeLandPlatformWindowHelper::applyPending);
362+
QMetaObject::invokeMethod(this, &DTreeLandPlatformWindowHelper::applyPending, Qt::QueuedConnection);
358363
}
359364

360365
void DTreeLandPlatformWindowHelper::applyPending()

src/plugins/platform/treeland/dtreelandplatformwindowinterface.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ private slots:
6363

6464
template<typename T>
6565
void updateFeature(T &member, const T &value, Feature flag) {
66+
if (member == value)
67+
return;
6668
member = value;
6769
m_initialized |= flag;
6870
m_dirty |= flag;

0 commit comments

Comments
 (0)