Merge pull request #6989 from Dwedit/win32_message_loop_threaded_video_fix

Move win32 message loop, now compatible with threaded video
This commit is contained in:
Twinaphex 2018-07-14 06:12:07 +02:00 committed by GitHub
commit a68a22081c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 7 deletions

View File

@ -56,6 +56,7 @@
#include "../../input/input_keymaps.h" #include "../../input/input_keymaps.h"
#include "../video_thread_wrapper.h" #include "../video_thread_wrapper.h"
#include "../video_display_server.h" #include "../video_display_server.h"
#include "../../gfx/video_driver.h"
#include <shellapi.h> #include <shellapi.h>
#ifdef HAVE_MENU #ifdef HAVE_MENU
@ -1045,12 +1046,14 @@ void win32_check_window(bool *quit, bool *resize,
unsigned *width, unsigned *height) unsigned *width, unsigned *height)
{ {
#if !defined(_XBOX) #if !defined(_XBOX)
if (video_driver_is_threaded())
{
const ui_application_t *application = const ui_application_t *application =
ui_companion_driver_get_application_ptr(); ui_companion_driver_get_application_ptr();
if (application) if (application)
application->process_events(); application->process_events();
}
*quit = g_win32_quit; *quit = g_win32_quit;
#endif
if (g_win32_resized) if (g_win32_resized)
{ {
@ -1059,6 +1062,7 @@ void win32_check_window(bool *quit, bool *resize,
*height = g_win32_resize_height; *height = g_win32_resize_height;
g_win32_resized = false; g_win32_resized = false;
} }
#endif
} }
bool win32_suppress_screensaver(void *data, bool enable) bool win32_suppress_screensaver(void *data, bool enable)
@ -1189,7 +1193,7 @@ void win32_set_window(unsigned *width, unsigned *height,
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
const ui_window_t *window = ui_companion_driver_get_window_ptr(); const ui_window_t *window = ui_companion_driver_get_window_ptr();
if (!fullscreen && settings->bools.ui_menubar_enable) if (!fullscreen && settings->bools.ui_menubar_enable && !video_driver_is_threaded())
{ {
RECT rc_temp; RECT rc_temp;
rc_temp.left = 0; rc_temp.left = 0;

View File

@ -2535,6 +2535,14 @@ static enum runloop_state runloop_check_state(
} }
} }
if (!video_driver_is_threaded())
{
const ui_application_t *application =
ui_companion_driver_get_application_ptr();
if (application)
application->process_events();
}
video_driver_get_status(&frame_count, &is_alive, &is_focused); video_driver_get_status(&frame_count, &is_alive, &is_focused);
#ifdef HAVE_MENU #ifdef HAVE_MENU