diff --git a/src/declarativeimports/core/tooltip.cpp b/src/declarativeimports/core/tooltip.cpp --- a/src/declarativeimports/core/tooltip.cpp +++ b/src/declarativeimports/core/tooltip.cpp @@ -157,7 +157,7 @@ dlg->setVisualParent(this); dlg->setMainItem(mainItem()); dlg->setInteractive(m_interactive); - dlg->show(); + dlg->setVisible(true); } QString ToolTip::mainText() const diff --git a/src/plasmaquick/dialog.cpp b/src/plasmaquick/dialog.cpp --- a/src/plasmaquick/dialog.cpp +++ b/src/plasmaquick/dialog.cpp @@ -270,10 +270,6 @@ void DialogPrivate::updateVisibility(bool visible) { - if (mainItem) { - mainItem->setVisible(visible); - } - if (visible) { if (visualParent && visualParent->window()) { q->setTransientParent(visualParent->window()); @@ -304,6 +300,12 @@ if (mainItemLayout) { updateLayoutParameters(); } + + //if is a wayland window that was hidden, we need + //to set its position again as there won't be any move event to sync QWindow::position and shellsurface::position + if (shellSurface) { + shellSurface->setPosition(q->position()); + } } } @@ -354,7 +356,7 @@ Q_ASSERT(mainItem); Q_ASSERT(mainItemLayout); - if (!componentComplete || !q->isVisible()) { + if (!componentComplete) { return; } @@ -380,7 +382,7 @@ Q_ASSERT(mainItem); Q_ASSERT(mainItemLayout); - if (!componentComplete || !q->isVisible()) { + if (!componentComplete) { return; } @@ -406,7 +408,7 @@ Q_ASSERT(mainItem); Q_ASSERT(mainItemLayout); - if (!componentComplete || !q->isVisible()) { + if (!componentComplete) { return; } @@ -428,7 +430,7 @@ Q_ASSERT(mainItem); Q_ASSERT(mainItemLayout); - if (!componentComplete || !q->isVisible()) { + if (!componentComplete) { return; } @@ -447,7 +449,7 @@ void DialogPrivate::getSizeHints(QSize &min, QSize &max) const { - if (!componentComplete || !mainItem || !q->isVisible() || !mainItemLayout) { + if (!componentComplete || !mainItem || !mainItemLayout) { return; } Q_ASSERT(mainItem); @@ -481,7 +483,7 @@ void DialogPrivate::updateLayoutParameters() { - if (!componentComplete || !mainItem || !q->isVisible() || !mainItemLayout) { + if (!componentComplete || !mainItem || !mainItemLayout) { return; } @@ -598,7 +600,7 @@ { Q_ASSERT(mainItem); - if (!componentComplete || !q->isVisible()) { + if (!componentComplete) { return; } if (mainItem->width() <= 0 || mainItem->height() <= 0) { @@ -787,7 +789,7 @@ d->mainItem = mainItem; if (mainItem) { - d->mainItem->setVisible(isVisible()); + d->mainItem->setVisible(true); mainItem->setParentItem(contentItem()); connect(mainItem, SIGNAL(widthChanged()), this, SLOT(slotMainItemSizeChanged())); @@ -1037,7 +1039,7 @@ QQuickWindow::resizeEvent(re); //A dialog can be resized even if no mainItem has ever been set - if (!isVisible() || !d->mainItem) { + if (!d->mainItem) { return; } @@ -1048,6 +1050,7 @@ auto margin = d->frameSvgItem->fixedMargins(); d->mainItem->setPosition(QPointF(margin->left(), margin->top())); + d->mainItem->setSize(QSize(re->size().width() - margin->left() - margin->right(), re->size().height() - margin->top() - margin->bottom())); @@ -1164,10 +1167,13 @@ * see https://phabricator.kde.org/T6064 */ #if HAVE_KWAYLAND - if (!d->shellSurface) { + //sometimes non null regions arrive even for non visible windows + //for which surface creation would fail + if (!d->shellSurface && isVisible()) { KWindowSystem::setState(winId(), NET::SkipTaskbar | NET::SkipPager); d->setupWaylandIntegration(); d->updateVisibility(true); + d->updateTheme(); } #endif #if (QT_VERSION > QT_VERSION_CHECK(5, 5, 0)) @@ -1311,14 +1317,6 @@ KWindowSystem::setState(winId(), NET::SkipTaskbar | NET::SkipPager); } d->updateTheme(); - - if (d->mainItem) { - d->syncToMainItemSize(); - } - - if (d->mainItemLayout) { - d->updateLayoutParameters(); - } } bool Dialog::hideOnWindowDeactivate() const