From a54ea9ad88ad2598d5ffae07d0c60122da4c658d Mon Sep 17 00:00:00 2001 From: Brad Parker Date: Thu, 19 Jan 2017 18:08:39 +0000 Subject: [PATCH] show titlebar again for remaining drivers --- gfx/drivers/sdl2_gfx.c | 14 +++++--------- gfx/drivers/xvideo.c | 14 ++++---------- gfx/drivers_context/cocoa_gl_ctx.m | 2 +- gfx/drivers_context/d3d_ctx.cpp | 2 +- gfx/drivers_context/gdi_ctx.cpp | 14 +++++--------- gfx/drivers_context/sdl_gl_ctx.c | 13 +++++-------- gfx/drivers_context/wayland_ctx.c | 2 +- gfx/drivers_context/wgl_ctx.cpp | 2 +- 8 files changed, 23 insertions(+), 40 deletions(-) diff --git a/gfx/drivers/sdl2_gfx.c b/gfx/drivers/sdl2_gfx.c index d4cc2c439f..313b7bb044 100644 --- a/gfx/drivers/sdl2_gfx.c +++ b/gfx/drivers/sdl2_gfx.c @@ -502,6 +502,7 @@ static bool sdl2_gfx_frame(void *data, const void *frame, unsigned width, unsigned pitch, const char *msg, video_frame_info_t *video_info) { sdl2_video_t *vid = (sdl2_video_t*)data; + char title[128]; if (vid->should_resize) sdl_refresh_viewport(vid); @@ -534,17 +535,12 @@ static bool sdl2_gfx_frame(void *data, const void *frame, unsigned width, SDL_RenderPresent(vid->renderer); - if (video_info->monitor_fps_enable) - { - char title[128]; + title[0] = '\0'; - title[0] = '\0'; + video_driver_get_window_title(title, sizeof(title)); - video_driver_get_window_title(title, sizeof(title)); - - if (title[0]) - SDL_SetWindowTitle(vid->window, title); - } + if (title[0]) + SDL_SetWindowTitle(vid->window, title); return true; } diff --git a/gfx/drivers/xvideo.c b/gfx/drivers/xvideo.c index 734de98dc5..a70f8f8771 100644 --- a/gfx/drivers/xvideo.c +++ b/gfx/drivers/xvideo.c @@ -423,6 +423,7 @@ static void *xv_init(const video_info_t *video, XWindowAttributes target; video_frame_info_t video_info; char buf[128] = {0}; + char title[128] = {0}; XSetWindowAttributes attributes = {0}; XVisualInfo visualtemplate = {0}; unsigned width = 0; @@ -539,17 +540,10 @@ static void *xv_init(const video_info_t *video, video_driver_build_info(&video_info); - if (video_info.monitor_fps_enable) - { - char title[128]; + video_driver_get_window_title(title, sizeof(title)); - title[0] = '\0'; - - video_driver_get_window_title(title, sizeof(title)); - - if (title[0]) - XStoreName(g_x11_dpy, g_x11_win, title); - } + if (title[0]) + XStoreName(g_x11_dpy, g_x11_win, title); x11_set_window_attr(g_x11_dpy, g_x11_win); diff --git a/gfx/drivers_context/cocoa_gl_ctx.m b/gfx/drivers_context/cocoa_gl_ctx.m index e3a49f8ab3..5a26887b66 100644 --- a/gfx/drivers_context/cocoa_gl_ctx.m +++ b/gfx/drivers_context/cocoa_gl_ctx.m @@ -424,7 +424,7 @@ static void cocoagl_gfx_ctx_update_title(void *data, video_frame_info_t *video_i view.data = (CocoaView*)nsview_get_ptr(); - if (window && video_info->monitor_fps_enable) + if (window) { char title[128]; diff --git a/gfx/drivers_context/d3d_ctx.cpp b/gfx/drivers_context/d3d_ctx.cpp index 98f65be158..473fcddafa 100644 --- a/gfx/drivers_context/d3d_ctx.cpp +++ b/gfx/drivers_context/d3d_ctx.cpp @@ -101,7 +101,7 @@ static void gfx_ctx_d3d_update_title(void *data, video_frame_info_t *video_info) #else const ui_window_t *window = ui_companion_driver_get_window_ptr(); - if (window && video_info->monitor_fps_enable) + if (window) { char title[128]; diff --git a/gfx/drivers_context/gdi_ctx.cpp b/gfx/drivers_context/gdi_ctx.cpp index dea9050840..1bf674b2d6 100644 --- a/gfx/drivers_context/gdi_ctx.cpp +++ b/gfx/drivers_context/gdi_ctx.cpp @@ -89,18 +89,14 @@ static bool gfx_ctx_gdi_set_resize(void *data, static void gfx_ctx_gdi_update_window_title(void *data, video_frame_info_t *video_info) { const ui_window_t *window = ui_companion_driver_get_window_ptr(); + char title[128]; - if (window && video_info->monitor_fps_enable) - { - char title[128]; + title[0] = '\0'; - title[0] = '\0'; + video_driver_get_window_title(title, sizeof(title)); - video_driver_get_window_title(title, sizeof(title)); - - if (title[0]) - window->set_title(&main_window, title); - } + if (window && title[0]) + window->set_title(&main_window, title); } static void gfx_ctx_gdi_get_video_size(void *data, diff --git a/gfx/drivers_context/sdl_gl_ctx.c b/gfx/drivers_context/sdl_gl_ctx.c index 8b1847e44c..57191042fd 100644 --- a/gfx/drivers_context/sdl_gl_ctx.c +++ b/gfx/drivers_context/sdl_gl_ctx.c @@ -274,18 +274,15 @@ static void sdl_ctx_update_title(void *data, video_frame_info_t *video_info) video_driver_get_window_title(title, sizeof(title)); - if (video_info->monitor_fps_enable) - { #ifdef HAVE_SDL2 - gfx_ctx_sdl_data_t *sdl = (gfx_ctx_sdl_data_t*)data; + gfx_ctx_sdl_data_t *sdl = (gfx_ctx_sdl_data_t*)data; - if (sdl && title[0]) - SDL_SetWindowTitle(sdl->g_win, title); + if (sdl && title[0]) + SDL_SetWindowTitle(sdl->g_win, title); #else - if (title[0]) - SDL_WM_SetCaption(title, NULL); + if (title[0]) + SDL_WM_SetCaption(title, NULL); #endif - } } static void sdl_ctx_check_window(void *data, bool *quit, bool *resize,unsigned *width, diff --git a/gfx/drivers_context/wayland_ctx.c b/gfx/drivers_context/wayland_ctx.c index 70100b88a3..35c79da765 100644 --- a/gfx/drivers_context/wayland_ctx.c +++ b/gfx/drivers_context/wayland_ctx.c @@ -725,7 +725,7 @@ static void gfx_ctx_wl_update_title(void *data, video_frame_info_t *video_info) video_driver_get_window_title(title, sizeof(title)); - if (wl && title[0] && video_info->monitor_fps_enable) + if (wl && title[0]) wl_shell_surface_set_title(wl->shell_surf, title); } diff --git a/gfx/drivers_context/wgl_ctx.cpp b/gfx/drivers_context/wgl_ctx.cpp index 18b83ba5c0..d6320c2224 100644 --- a/gfx/drivers_context/wgl_ctx.cpp +++ b/gfx/drivers_context/wgl_ctx.cpp @@ -389,7 +389,7 @@ static void gfx_ctx_wgl_update_title(void *data, video_frame_info_t *video_info) { const ui_window_t *window = ui_companion_driver_get_window_ptr(); - if (window && video_info->monitor_fps_enable) + if (window) { char title[128];