mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-03-01 10:35:54 +00:00
Use UpdateRunLoop to handle input and detect minimized window for all platforms.
This commit is contained in:
parent
3cdf53732b
commit
8a7573004d
@ -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
|
||||
}
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "Core/CoreParameter.h"
|
||||
|
||||
// called from emu thread
|
||||
void UpdateRunLoop();
|
||||
void Core_Run();
|
||||
void Core_Stop();
|
||||
void Core_ErrorPause();
|
||||
|
@ -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
2
native
@ -1 +1 @@
|
||||
Subproject commit e65160102599ddbce3410ec17f39364b93e22424
|
||||
Subproject commit 50d4319832447774c8eabb823e82c0898377419b
|
Loading…
x
Reference in New Issue
Block a user