mirror of
https://github.com/libretro/RetroArch
synced 2025-03-18 13:20:57 +00:00
(Win32) Do optimization for Windows where we only update the title
when the previous title differs from the current title (X11) Have to roll back the previous title optimization/less calls to XChangeProperty, because the title is lost upon toggling between fullscreen/windowed and is no longer set
This commit is contained in:
parent
938d7c1fc4
commit
e6fd2c9cdb
@ -2339,22 +2339,17 @@ bool win32_set_video_mode(void *data,
|
||||
void win32_update_title(void)
|
||||
{
|
||||
const ui_window_t *window = ui_companion_driver_get_window_ptr();
|
||||
static unsigned update_title_wait = 0;
|
||||
|
||||
if (update_title_wait)
|
||||
{
|
||||
update_title_wait--;
|
||||
return;
|
||||
}
|
||||
|
||||
if (window)
|
||||
{
|
||||
static char prev_title[128];
|
||||
char title[128];
|
||||
title[0] = '\0';
|
||||
video_driver_get_window_title(title, sizeof(title));
|
||||
update_title_wait = g_win32_refresh_rate;
|
||||
if (title[0])
|
||||
if (title[0] && !string_is_equal(title, prev_title))
|
||||
{
|
||||
window->set_title(&main_window, title);
|
||||
strlcpy(prev_title, title, sizeof(prev_title));
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -766,16 +766,12 @@ bool x11_connect(void)
|
||||
void x11_update_title(void *data)
|
||||
{
|
||||
size_t len;
|
||||
static char prev_title[128];
|
||||
char title[128];
|
||||
title[0] = '\0';
|
||||
len = video_driver_get_window_title(title, sizeof(title));
|
||||
if (title[0] && !string_is_equal(title, prev_title))
|
||||
{
|
||||
if (title[0])
|
||||
XChangeProperty(g_x11_dpy, g_x11_win, XA_WM_NAME, XA_STRING,
|
||||
8, PropModeReplace, (const unsigned char*)title, len);
|
||||
strlcpy(prev_title, title, sizeof(prev_title));
|
||||
}
|
||||
}
|
||||
|
||||
bool x11_input_ctx_new(bool true_full)
|
||||
|
Loading…
x
Reference in New Issue
Block a user