mirror of
https://github.com/libretro/RetroArch
synced 2025-02-28 12:40:23 +00:00
(Qt) Only call log_msg when the Qt companion UI window is active
This commit is contained in:
parent
1b86ea43c3
commit
0946604627
37
retroarch.c
37
retroarch.c
@ -897,22 +897,23 @@ static const location_driver_t *location_drivers[] = {
|
||||
};
|
||||
|
||||
static ui_companion_driver_t ui_companion_null = {
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
"null",
|
||||
NULL, /* init */
|
||||
NULL, /* deinit */
|
||||
NULL, /* toggle */
|
||||
NULL, /* event_command */
|
||||
NULL, /* notify_content_loaded */
|
||||
NULL, /* notify_list_loaded */
|
||||
NULL, /* notify_refresh */
|
||||
NULL, /* msg_queue_push */
|
||||
NULL, /* render_messagebox */
|
||||
NULL, /* get_main_window */
|
||||
NULL, /* log_msg */
|
||||
NULL, /* is_active */
|
||||
NULL, /* browser_window */
|
||||
NULL, /* msg_window */
|
||||
NULL, /* window */
|
||||
NULL, /* application */
|
||||
"null", /* ident */
|
||||
};
|
||||
|
||||
|
||||
@ -20436,9 +20437,11 @@ void ui_companion_driver_log_msg(const char *msg)
|
||||
settings_t *settings = p_rarch->configuration_settings;
|
||||
bool qt_is_inited = p_rarch->qt_is_inited;
|
||||
bool desktop_menu_enable = settings->bools.desktop_menu_enable;
|
||||
bool window_is_active = p_rarch->ui_companion_qt_data && qt_is_inited
|
||||
&& ui_companion_qt.is_active(p_rarch->ui_companion_qt_data);
|
||||
|
||||
if (desktop_menu_enable)
|
||||
if (p_rarch->ui_companion_qt_data && qt_is_inited)
|
||||
if (window_is_active)
|
||||
ui_companion_qt.log_msg(p_rarch->ui_companion_qt_data, msg);
|
||||
#endif
|
||||
}
|
||||
|
@ -721,6 +721,7 @@ ui_companion_driver_t ui_companion_cocoa = {
|
||||
NULL, /* render_messagebox */
|
||||
ui_companion_cocoa_get_main_window,
|
||||
NULL, /* log_msg */
|
||||
NULL, /* is_active */
|
||||
&ui_browser_window_cocoa,
|
||||
&ui_msg_window_cocoa,
|
||||
&ui_window_cocoa,
|
||||
|
@ -660,6 +660,7 @@ ui_companion_driver_t ui_companion_cocoatouch = {
|
||||
ui_companion_cocoatouch_render_messagebox,
|
||||
NULL, /* get_main_window */
|
||||
NULL, /* log_msg */
|
||||
NULL, /* is_active */
|
||||
NULL, /* ui_browser_window_null */
|
||||
NULL, /* ui_msg_window_null */
|
||||
NULL, /* ui_window_null */
|
||||
|
@ -722,6 +722,14 @@ static void ui_companion_qt_log_msg(void *data, const char *msg)
|
||||
win_handle->qtWindow->appendLogMessage(msg);
|
||||
}
|
||||
|
||||
static bool ui_companion_qt_is_active(void *data)
|
||||
{
|
||||
ui_companion_qt_t *handle = (ui_companion_qt_t*)data;
|
||||
ui_window_qt_t *win_handle = (ui_window_qt_t*)handle->window;
|
||||
|
||||
return win_handle->qtWindow->isVisible();
|
||||
}
|
||||
|
||||
void ui_companion_qt_msg_queue_push(void *data,
|
||||
const char *msg, unsigned priority, unsigned duration, bool flush)
|
||||
{
|
||||
@ -749,6 +757,7 @@ ui_companion_driver_t ui_companion_qt = {
|
||||
NULL,
|
||||
NULL,
|
||||
ui_companion_qt_log_msg,
|
||||
ui_companion_qt_is_active,
|
||||
&ui_browser_window_qt,
|
||||
&ui_msg_window_qt,
|
||||
&ui_window_qt,
|
||||
|
@ -124,7 +124,8 @@ ui_companion_driver_t ui_companion_win32 = {
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL, /* log_msg */
|
||||
NULL, /* is_active */
|
||||
&ui_browser_window_win32,
|
||||
&ui_msg_window_win32,
|
||||
&ui_window_win32,
|
||||
|
@ -136,6 +136,7 @@ typedef struct ui_companion_driver
|
||||
void (*render_messagebox)(const char *msg);
|
||||
void *(*get_main_window)(void *data);
|
||||
void (*log_msg)(void *data, const char *msg);
|
||||
bool (*is_active)(void *data);
|
||||
ui_browser_window_t *browser_window;
|
||||
ui_msg_window_t *msg_window;
|
||||
ui_window_t *window;
|
||||
|
Loading…
x
Reference in New Issue
Block a user