improved windows functionality

This commit is contained in:
itsmattkc
2019-10-16 22:32:51 +11:00
parent c2ae2e5d9e
commit 578345693b
2 changed files with 14 additions and 0 deletions
+6
View File
@@ -25,4 +25,10 @@ void DebugHandler(QtMsgType type, const QMessageLogContext &context, const QStri
}
fprintf(stderr, "[%s] %s (%s:%u)\n", msg_type, localMsg.constData(), context.function, context.line);
#ifdef Q_OS_WINDOWS
// Windows still seems to buffer stderr and we want to see debug messages immediately, so here we make sure each line
// is flushed
fflush(stderr);
#endif
}
+8
View File
@@ -20,7 +20,9 @@
#include "mainwindow.h"
#include <QApplication>
#include <QDebug>
#include <QDesktopWidget>
// Panel objects
#include "panel/panelmanager.h"
@@ -38,6 +40,12 @@
olive::MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent)
{
#ifdef Q_OS_WINDOWS
// Qt on Windows has a bug that "de-maximizes" the window when widgets are added, resizing the window beforehand
// works around that issue and we just set it to whatever size is available
resize(qApp->desktop()->availableGeometry(this).size());
#endif
// Create empty central widget - we don't actually want a central widget but some of Qt's docking/undocking fails
// without it
QWidget* centralWidget = new QWidget(this);