Commit 29d31c15 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧 Committed by Aleix Pol Gonzalez
Browse files

Do not compute sizes within dialogs when they're not visible

It makes our system do stuff unnecessarily, it often warns that the
dialog is not even the right size and it will be called anyway when the
dialog is displayed, so just do it when it's necessary.
parent 1ec7b42c
Pipeline #153287 passed with stage
in 1 minute and 29 seconds
......@@ -579,7 +579,7 @@ void DialogPrivate::syncToMainItemSize()
{
Q_ASSERT(mainItem);
if (!componentComplete) {
if (!componentComplete || q->visibility() == QWindow::Hidden) {
return;
}
if (mainItem->width() <= 0 || mainItem->height() <= 0) {
......@@ -1150,7 +1150,7 @@ void Dialog::resizeEvent(QResizeEvent *re)
}
// A dialog can be resized even if no mainItem has ever been set
if (!d->mainItem) {
if (!d->mainItem || !isExposed()) {
return;
}
......@@ -1237,7 +1237,11 @@ bool Dialog::event(QEvent *event)
{
if (event->type() == QEvent::Expose) {
if (!KWindowSystem::isPlatformWayland() || !isExposed()) {
return QQuickWindow::event(event);
auto ret = QQuickWindow::event(event);
if (d->mainItem) {
d->syncToMainItemSize();
}
return ret;
}
/*
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment