fix SessionManager maximized windows
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include <QApplication>
|
||||
#include <QFileInfo>
|
||||
#include <QMetaMethod>
|
||||
#include <QTimer>
|
||||
#if QT_VERSION < 0x050000
|
||||
# include <QDesktopWidget>
|
||||
#else
|
||||
@@ -131,8 +132,9 @@ void restoreWindowState(QWidget * w, QPIConfig & sr, QString name) {
|
||||
int wstate = sr.getValue(name + " window state").toInt();
|
||||
w->setWindowState(Qt::WindowNoState);
|
||||
w->restoreGeometry(sr.getValue(name + " geometry 0").toByteArray());
|
||||
if (wstate == Qt::WindowMaximized)
|
||||
w->setWindowState((Qt::WindowState)wstate);
|
||||
if (wstate == Qt::WindowMaximized) {
|
||||
QTimer::singleShot(0, w, [w,wstate](){w->setWindowState((Qt::WindowState)wstate);});
|
||||
}
|
||||
bool wnd_ok = false;
|
||||
QRect srect;
|
||||
#if QT_VERSION < 0x050000
|
||||
@@ -149,6 +151,7 @@ void restoreWindowState(QWidget * w, QPIConfig & sr, QString name) {
|
||||
}
|
||||
}
|
||||
srect = QApplication::primaryScreen()->geometry();
|
||||
qDebug() << w << wnd_ok << wstate << w->geometry();
|
||||
#endif
|
||||
if (!wnd_ok) {
|
||||
w->setWindowState(Qt::WindowNoState);
|
||||
|
||||
Reference in New Issue
Block a user