From 61f5e131b9461403af23fe6625039b3f8b4a0e7e Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Sat, 19 Jan 2019 00:27:20 +1100 Subject: [PATCH] added workaround for #334 --- main.cpp | 2 +- mainwindow.cpp | 14 ++++++++++---- mainwindow.h | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/main.cpp b/main.cpp index f2806308e..4d3ddd33f 100644 --- a/main.cpp +++ b/main.cpp @@ -65,7 +65,7 @@ int main(int argc, char *argv[]) { if (launch_fullscreen) { w.showFullScreen(); } else { - w.showMaximized(); + w.show(); } return a.exec(); diff --git a/mainwindow.cpp b/mainwindow.cpp index 165e69f57..da5ffa0b4 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -229,7 +229,7 @@ MainWindow::MainWindow(QWidget *parent, const QString &an) : setup_layout(false); - init_audio(); + init_audio(); } MainWindow::~MainWindow() { @@ -1028,13 +1028,19 @@ void MainWindow::paintEvent(QPaintEvent *event) { QTimer::singleShot(10, this, SLOT(load_with_launch())); enable_launch_with_project = false; } + if (!demoNoticeShown) { #ifndef QT_DEBUG - if (!demoNoticeShown) { DemoNotice* d = new DemoNotice(this); d->open(); - demoNoticeShown = true; - } #endif + if (windowState() != Qt::WindowFullScreen) { + // workaround for setting to maximized - on some systems, setting + // to maximized doesn't work until after the paintEvent + setWindowState(Qt::WindowMaximized); + } + + demoNoticeShown = true; + } } void MainWindow::clear_undo_stack() { diff --git a/mainwindow.h b/mainwindow.h index d51928626..295834a15 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -41,7 +41,7 @@ public slots: protected: void closeEvent(QCloseEvent *); - void paintEvent(QPaintEvent *event); + void paintEvent(QPaintEvent *event); private slots: void clear_undo_stack();