Skip to content

Commit

Permalink
sync: from linuxdeepin/dtkdeclarative
Browse files Browse the repository at this point in the history
Synchronize source files from linuxdeepin/dtkdeclarative.

Source-pull-request: linuxdeepin/dtkdeclarative#271
  • Loading branch information
deepin-ci-robot committed Jan 6, 2024
1 parent 5b1b075 commit 1a30953
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/dquickwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,12 @@ void DQuickWindowAttachedPrivate::_q_updateClipPath()
q->setClipPathByWM(clipPath->path());
}

void DQuickWindowAttachedPrivate::_q_ensurePlatformHandle()
{
if (explicitEnable && DWindowManagerHelper::instance()->hasNoTitlebar())
ensurePlatformHandle();
}

DQuickWindowAttached::DQuickWindowAttached(QWindow *window)
: QObject(window)
, DObject(*new DQuickWindowAttachedPrivate(window, this))
Expand Down Expand Up @@ -490,13 +496,8 @@ void DQuickWindowAttached::setEnabled(bool e)
}

if (!d->ensurePlatformHandle()) {
QObject::connect(DWindowManagerHelper::instance(), &DWindowManagerHelper::hasNoTitlebarChanged, this,
[this] () {
D_D(DQuickWindowAttached);
if (d->explicitEnable && DWindowManagerHelper::instance()->hasNoTitlebar())
d->ensurePlatformHandle();

}, Qt::UniqueConnection);
QObject::connect(DWindowManagerHelper::instance(), SIGNAL(hasNoTitlebarChanged()), this, SLOT(_q_ensurePlatformHandle())
, Qt::UniqueConnection);
}
}

Expand Down
1 change: 1 addition & 0 deletions src/dquickwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ public Q_SLOTS:
D_PRIVATE_SLOT(void _q_onWindowMotifHintsChanged(quint32))
D_PRIVATE_SLOT(void _q_updateBlurAreaForWindow())
D_PRIVATE_SLOT(void _q_updateClipPath())
D_PRIVATE_SLOT(void _q_ensurePlatformHandle())

friend class DQuickBehindWindowBlur;
friend class DQuickBehindWindowBlurPrivate;
Expand Down
1 change: 1 addition & 0 deletions src/private/dquickwindow_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class DQuickWindowAttachedPrivate : public DTK_CORE_NAMESPACE::DObjectPrivate
void updateBlurAreaFor(DQuickBehindWindowBlur *blur);
void _q_updateBlurAreaForWindow();
void _q_updateClipPath();
void _q_ensurePlatformHandle();

QWindow *window = nullptr;
DPlatformHandle *handle = nullptr;
Expand Down

0 comments on commit 1a30953

Please sign in to comment.