Use UpdateRunLoop to handle input and detect minimized window for all platforms.

This commit is contained in:
Sacha 2014-06-30 00:17:34 +10:00
parent 3cdf53732b
commit 8a7573004d
4 changed files with 15 additions and 7 deletions

View File

@ -134,7 +134,9 @@ void UpdateScreenScale(int width, int height) {
NativeResized();
}
static inline void UpdateRunLoop() {
void UpdateRunLoop() {
if (windowHidden)
return;
NativeUpdate(input_state);
{
@ -149,12 +151,10 @@ static inline void UpdateRunLoop() {
void Core_RunLoop() {
while ((GetUIState() != UISTATE_INGAME || !PSP_IsInited()) && GetUIState() != UISTATE_EXIT) {
#if defined(USING_WIN_UI)
time_update();
#if defined(USING_WIN_UI)
double startTime = time_now_d();
if (!windowHidden) {
UpdateRunLoop();
}
UpdateRunLoop();
// Simple throttling to not burn the GPU in the menu.
time_update();
@ -166,7 +166,6 @@ void Core_RunLoop() {
GL_SwapBuffers();
}
#else
time_update();
UpdateRunLoop();
#endif
}

View File

@ -21,6 +21,7 @@
#include "Core/CoreParameter.h"
// called from emu thread
void UpdateRunLoop();
void Core_Run();
void Core_Stop();
void Core_ErrorPause();

View File

@ -39,6 +39,14 @@ public:
void updateMenus();
protected:
void changeEvent(QEvent *e)
{
QMainWindow::changeEvent(e);
// Does not work on Linux for Qt5.2 or Qt5.3 (Qt bug)
if(e->type() == QEvent::WindowStateChange)
Core_NotifyWindowHidden(isMinimized());
}
void closeEvent(QCloseEvent *) { exitAct(); }
signals:

2
native

@ -1 +1 @@
Subproject commit e65160102599ddbce3410ec17f39364b93e22424
Subproject commit 50d4319832447774c8eabb823e82c0898377419b