Fix resizable window toggle on Windows
Also include a hex code on process crashes in the VM manager.
This commit is contained in:
@@ -1655,11 +1655,12 @@ MainWindow::focusOutEvent(QFocusEvent *event)
|
|||||||
void
|
void
|
||||||
MainWindow::on_actionResizable_window_triggered(bool checked)
|
MainWindow::on_actionResizable_window_triggered(bool checked)
|
||||||
{
|
{
|
||||||
|
hide();
|
||||||
if (checked) {
|
if (checked) {
|
||||||
vid_resize = 1;
|
vid_resize = 1;
|
||||||
setWindowFlag(Qt::WindowMaximizeButtonHint, true);
|
|
||||||
setWindowFlag(Qt::MSWindowsFixedSizeDialogHint, false);
|
|
||||||
setFixedSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX);
|
setFixedSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX);
|
||||||
|
setWindowFlag(Qt::MSWindowsFixedSizeDialogHint, false);
|
||||||
|
setWindowFlag(Qt::WindowMaximizeButtonHint, true);
|
||||||
for (int i = 1; i < MONITORS_NUM; i++) {
|
for (int i = 1; i < MONITORS_NUM; i++) {
|
||||||
if (monitors[i].target_buffer) {
|
if (monitors[i].target_buffer) {
|
||||||
renderers[i]->setWindowFlag(Qt::WindowMaximizeButtonHint, true);
|
renderers[i]->setWindowFlag(Qt::WindowMaximizeButtonHint, true);
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
#include <QPixmap>
|
#include <QPixmap>
|
||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
#include <QStyleOption>
|
#include <QStyleOption>
|
||||||
|
#include <QMainWindow>
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include <86box/86box.h>
|
#include <86box/86box.h>
|
||||||
@@ -61,7 +62,14 @@ StyleOverride::polish(QWidget *widget)
|
|||||||
widget->setFixedSize(QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX));
|
widget->setFixedSize(QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX));
|
||||||
widget->layout()->setSizeConstraint(QLayout::SetFixedSize);
|
widget->layout()->setSizeConstraint(QLayout::SetFixedSize);
|
||||||
}
|
}
|
||||||
widget->setWindowFlag(Qt::MSWindowsFixedSizeDialogHint, true);
|
if (!qobject_cast<QMainWindow *>(widget)) {
|
||||||
|
widget->setWindowFlag(Qt::MSWindowsFixedSizeDialogHint, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (qobject_cast<QMainWindow *>(widget)) {
|
||||||
|
widget->setWindowFlag(Qt::MSWindowsFixedSizeDialogHint, vid_resize != 1);
|
||||||
|
widget->setWindowFlag(Qt::WindowMaximizeButtonHint, vid_resize == 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
widget->setWindowFlag(Qt::WindowContextHelpButtonHint, false);
|
widget->setWindowFlag(Qt::WindowContextHelpButtonHint, false);
|
||||||
#ifdef Q_OS_WINDOWS
|
#ifdef Q_OS_WINDOWS
|
||||||
|
|||||||
@@ -10,6 +10,8 @@
|
|||||||
|
|
||||||
class StyleOverride : public QProxyStyle {
|
class StyleOverride : public QProxyStyle {
|
||||||
public:
|
public:
|
||||||
|
using QProxyStyle::QProxyStyle;
|
||||||
|
|
||||||
int styleHint(
|
int styleHint(
|
||||||
StyleHint hint,
|
StyleHint hint,
|
||||||
const QStyleOption *option = nullptr,
|
const QStyleOption *option = nullptr,
|
||||||
|
|||||||
@@ -491,7 +491,7 @@ VMManagerSystem::launchSettings() {
|
|||||||
if (exitCode != 0 || exitStatus != QProcess::NormalExit) {
|
if (exitCode != 0 || exitStatus != QProcess::NormalExit) {
|
||||||
qInfo().nospace().noquote() << "Abnormal program termination while launching settings: exit code " << exitCode << ", exit status " << exitStatus;
|
qInfo().nospace().noquote() << "Abnormal program termination while launching settings: exit code " << exitCode << ", exit status " << exitStatus;
|
||||||
QMessageBox::critical(this, tr("Virtual machine crash"),
|
QMessageBox::critical(this, tr("Virtual machine crash"),
|
||||||
tr("The virtual machine \"%1\"'s process has unexpectedly terminated with exit code %2.").arg(displayName, QString::number(exitCode)));
|
tr("The virtual machine \"%1\"'s process has unexpectedly terminated with exit code %2.").arg(displayName, QString::number(exitCode) + QString(" (0x%1)").arg(QString::number(exitCode, 16))));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user