mirror of https://github.com/snes9xgit/snes9x.git
Minimized fix.
This commit is contained in:
parent
8a4732c9f2
commit
177a802186
|
@ -6,6 +6,7 @@
|
|||
#include <QtEvents>
|
||||
#include <QGuiApplication>
|
||||
#include <QStackedWidget>
|
||||
#include <qnamespace.h>
|
||||
#include <qpa/qplatformnativeinterface.h>
|
||||
|
||||
#include "EmuMainWindow.hpp"
|
||||
|
@ -470,6 +471,22 @@ bool EmuMainWindow::event(QEvent *event)
|
|||
app->pause();
|
||||
}
|
||||
break;
|
||||
case QEvent::WindowStateChange:
|
||||
{
|
||||
auto scevent = (QWindowStateChangeEvent *)event;
|
||||
if (!(scevent->oldState() & Qt::WindowMinimized) && windowState() & Qt::WindowMinimized)
|
||||
{
|
||||
minimized_pause = true;
|
||||
app->pause();
|
||||
}
|
||||
else if (minimized_pause && !(windowState() & Qt::WindowMinimized))
|
||||
{
|
||||
minimized_pause = false;
|
||||
app->unpause();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case QEvent::MouseMove:
|
||||
if (!cursor_visible)
|
||||
{
|
||||
|
|
|
@ -46,6 +46,7 @@ class EmuMainWindow : public QMainWindow
|
|||
|
||||
bool manual_pause = false;
|
||||
bool focus_pause = false;
|
||||
bool minimized_pause = false;
|
||||
bool using_stacked_widget = false;
|
||||
QMenu *load_state_menu;
|
||||
QMenu *save_state_menu;
|
||||
|
|
Loading…
Reference in New Issue