Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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