summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2021-08-10 15:16:12 +0200
committerSimon Rettberg2021-08-10 15:16:12 +0200
commitafbef5ddb4fcb5a01e4d645bae5779d5325ffb4d (patch)
tree14a2f59b0de0fab3ad4644997c74efb63d44125e
parentThis is a bit too new.... Keep deprecated variant (diff)
downloadslxgreeter-afbef5ddb4fcb5a01e4d645bae5779d5325ffb4d.tar.gz
slxgreeter-afbef5ddb4fcb5a01e4d645bae5779d5325ffb4d.tar.xz
slxgreeter-afbef5ddb4fcb5a01e4d645bae5779d5325ffb4d.zip
Don't re-layout mainwindow if nothing changed
-rw-r--r--src/loginform.cpp1
-rw-r--r--src/mainwindow.cpp5
-rw-r--r--src/mainwindow.h1
3 files changed, 7 insertions, 0 deletions
diff --git a/src/loginform.cpp b/src/loginform.cpp
index eecf34b..39cdf64 100644
--- a/src/loginform.cpp
+++ b/src/loginform.cpp
@@ -484,5 +484,6 @@ void LoginForm::setBrowserSize()
this->resize(*f);
this->setFixedSize(*f);
this->setGeometry(pw, ph, f->width(), f->height());
+ emit resized();
});
}
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 95d74de..b331da5 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -110,6 +110,11 @@ void MainWindow::reLayout()
m_LoginForm->move(offsetX, offsetY);
m_LoginForm->show();
newsX = m_LoginForm->geometry().right() + 5;
+
+ QRect layout(offsetX, offsetY, m_ScreenRect.width(), m_ScreenRect.height());
+ if (layout == m_lastRelayout)
+ return;
+ m_lastRelayout = layout;
}
// Banner
diff --git a/src/mainwindow.h b/src/mainwindow.h
index 3ea0e4a..53fd150 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -78,6 +78,7 @@ private:
QSvgWidget *m_Banner;
QList<QWidget*> m_DecoItems;
QTextEdit *m_News;
+ QRect m_lastRelayout;
};
#endif // MAINWINDOW_H