(Win32) Reimplement PeekMessage implementation - this should be at the

start of the while loop
This commit is contained in:
twinaphex 2019-07-11 03:49:33 +02:00
parent 0a4bc116df
commit e02ff9c40c
3 changed files with 11 additions and 10 deletions

View File

@ -146,8 +146,12 @@ int rarch_main(int argc, char *argv[], void *data)
#if !defined(HAVE_MAIN)
do
{
int ret;
unsigned sleep_ms = 0;
int ret = runloop_iterate(&sleep_ms);
#if defined(_WIN32) && !defined(_XBOX) && !defined(__WINRT__)
ui_companion_win32.application->process_events();
#endif
ret = runloop_iterate(&sleep_ms);
if (ret == 1 && sleep_ms > 0)
retro_sleep(sleep_ms);
@ -170,6 +174,9 @@ int rarch_main(int argc, char *argv[], void *data)
int ret;
unsigned sleep_ms = 0;
#if defined(_WIN32) && !defined(_XBOX) && !defined(__WINRT__)
ui_companion_win32.application->process_events();
#endif
if (ui_application->process_events)
ui_application->process_events();

View File

@ -1132,14 +1132,7 @@ void win32_check_window(bool *quit, bool *resize,
unsigned *width, unsigned *height)
{
#if !defined(_XBOX)
if (video_driver_is_threaded())
{
const ui_application_t *application =
ui_companion_driver_get_application_ptr();
if (application)
application->process_events();
}
*quit = g_win32_quit;
*quit = g_win32_quit;
if (g_win32_resized)
{

View File

@ -36,7 +36,8 @@ static bool ui_application_win32_pending_events(void)
static void ui_application_win32_process_events(void)
{
while (ui_application_win32_pending_events())
MSG msg;
while (PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE))
{
MSG msg;