diff --git a/Core/Core.cpp b/Core/Core.cpp index ecc13619c0..44b7f0c679 100644 --- a/Core/Core.cpp +++ b/Core/Core.cpp @@ -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 } diff --git a/Core/Core.h b/Core/Core.h index 2b10254d64..ba12a0a8c2 100644 --- a/Core/Core.h +++ b/Core/Core.h @@ -21,6 +21,7 @@ #include "Core/CoreParameter.h" // called from emu thread +void UpdateRunLoop(); void Core_Run(); void Core_Stop(); void Core_ErrorPause(); diff --git a/Qt/mainwindow.h b/Qt/mainwindow.h index bceb661a74..0bcd62e34b 100644 --- a/Qt/mainwindow.h +++ b/Qt/mainwindow.h @@ -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: diff --git a/native b/native index e651601025..50d4319832 160000 --- a/native +++ b/native @@ -1 +1 @@ -Subproject commit e65160102599ddbce3410ec17f39364b93e22424 +Subproject commit 50d4319832447774c8eabb823e82c0898377419b