mirror of
https://github.com/libretro/RetroArch
synced 2025-02-04 21:40:02 +00:00
Create x11_update_window_title
This commit is contained in:
parent
eb31cf4d43
commit
f868cbab31
@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
#include "x11_common.h"
|
#include "x11_common.h"
|
||||||
#include "../../general.h"
|
#include "../../general.h"
|
||||||
|
#include "../video_monitor.h"
|
||||||
|
|
||||||
static Atom XA_NET_WM_STATE;
|
static Atom XA_NET_WM_STATE;
|
||||||
static Atom XA_NET_WM_STATE_FULLSCREEN;
|
static Atom XA_NET_WM_STATE_FULLSCREEN;
|
||||||
@ -521,3 +522,16 @@ bool x11_connect(void)
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void x11_update_window_title(void *data)
|
||||||
|
{
|
||||||
|
char buf[128] = {0};
|
||||||
|
char buf_fps[128] = {0};
|
||||||
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
|
if (video_monitor_get_fps(buf, sizeof(buf),
|
||||||
|
buf_fps, sizeof(buf_fps)))
|
||||||
|
XStoreName(g_x11_dpy, g_x11_win, buf);
|
||||||
|
if (settings->fps_show)
|
||||||
|
rarch_main_msg_queue_push(buf_fps, 1, 1, false);
|
||||||
|
}
|
||||||
|
@ -80,5 +80,7 @@ void x11_install_sighandlers(void);
|
|||||||
|
|
||||||
bool x11_connect(void);
|
bool x11_connect(void);
|
||||||
|
|
||||||
|
void x11_update_window_title(void *data);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -755,7 +755,6 @@ static bool xv_frame(void *data, const void *frame, unsigned width,
|
|||||||
unsigned pitch, const char *msg)
|
unsigned pitch, const char *msg)
|
||||||
{
|
{
|
||||||
XWindowAttributes target;
|
XWindowAttributes target;
|
||||||
char buf[128] = {0};
|
|
||||||
xv_t *xv = (xv_t*)data;
|
xv_t *xv = (xv_t*)data;
|
||||||
|
|
||||||
if (!frame)
|
if (!frame)
|
||||||
@ -780,8 +779,7 @@ static bool xv_frame(void *data, const void *frame, unsigned width,
|
|||||||
true);
|
true);
|
||||||
XSync(g_x11_dpy, False);
|
XSync(g_x11_dpy, False);
|
||||||
|
|
||||||
if (video_monitor_get_fps(buf, sizeof(buf), NULL, 0))
|
x11_update_window_title(NULL);
|
||||||
XStoreName(g_x11_dpy, g_x11_win, buf);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,6 @@
|
|||||||
|
|
||||||
#include "../../driver.h"
|
#include "../../driver.h"
|
||||||
#include "../../runloop.h"
|
#include "../../runloop.h"
|
||||||
#include "../video_monitor.h"
|
|
||||||
|
|
||||||
#include "../common/gl_common.h"
|
#include "../common/gl_common.h"
|
||||||
#include "../common/x11_common.h"
|
#include "../common/x11_common.h"
|
||||||
@ -218,21 +217,6 @@ static void gfx_ctx_glx_set_resize(void *data,
|
|||||||
(void)height;
|
(void)height;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_glx_update_window_title(void *data)
|
|
||||||
{
|
|
||||||
char buf[128] = {0};
|
|
||||||
char buf_fps[128] = {0};
|
|
||||||
driver_t *driver = driver_get_ptr();
|
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
gfx_ctx_glx_data_t *glx = (gfx_ctx_glx_data_t*)driver->video_context_data;
|
|
||||||
|
|
||||||
if (video_monitor_get_fps(buf, sizeof(buf),
|
|
||||||
buf_fps, sizeof(buf_fps)))
|
|
||||||
XStoreName(g_x11_dpy, g_x11_win, buf);
|
|
||||||
if (settings->fps_show)
|
|
||||||
rarch_main_msg_queue_push(buf_fps, 1, 1, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool gfx_ctx_glx_init(void *data)
|
static bool gfx_ctx_glx_init(void *data)
|
||||||
{
|
{
|
||||||
static const int visual_attribs[] = {
|
static const int visual_attribs[] = {
|
||||||
@ -655,7 +639,7 @@ const gfx_ctx_driver_t gfx_ctx_glx = {
|
|||||||
NULL, /* get_video_output_next */
|
NULL, /* get_video_output_next */
|
||||||
x11_get_metrics,
|
x11_get_metrics,
|
||||||
NULL,
|
NULL,
|
||||||
gfx_ctx_glx_update_window_title,
|
x11_update_window_title,
|
||||||
x11_check_window,
|
x11_check_window,
|
||||||
gfx_ctx_glx_set_resize,
|
gfx_ctx_glx_set_resize,
|
||||||
x11_has_focus,
|
x11_has_focus,
|
||||||
|
@ -26,7 +26,6 @@
|
|||||||
|
|
||||||
#include "../../driver.h"
|
#include "../../driver.h"
|
||||||
#include "../../runloop.h"
|
#include "../../runloop.h"
|
||||||
#include "../video_monitor.h"
|
|
||||||
#include "../common/gl_common.h"
|
#include "../common/gl_common.h"
|
||||||
#include "../common/x11_common.h"
|
#include "../common/x11_common.h"
|
||||||
|
|
||||||
@ -133,22 +132,6 @@ static void gfx_ctx_xegl_set_resize(void *data,
|
|||||||
(void)height;
|
(void)height;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_xegl_update_window_title(void *data)
|
|
||||||
{
|
|
||||||
char buf[128] = {0};
|
|
||||||
char buf_fps[128] = {0};
|
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
|
|
||||||
(void)data;
|
|
||||||
|
|
||||||
if (video_monitor_get_fps(buf, sizeof(buf),
|
|
||||||
buf_fps, sizeof(buf_fps)))
|
|
||||||
XStoreName(g_x11_dpy, g_x11_win, buf);
|
|
||||||
if (settings->fps_show)
|
|
||||||
rarch_main_msg_queue_push(buf_fps, 1, 1, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#define XEGL_ATTRIBS_BASE \
|
#define XEGL_ATTRIBS_BASE \
|
||||||
EGL_SURFACE_TYPE, EGL_WINDOW_BIT, \
|
EGL_SURFACE_TYPE, EGL_WINDOW_BIT, \
|
||||||
EGL_RED_SIZE, 1, \
|
EGL_RED_SIZE, 1, \
|
||||||
@ -687,7 +670,7 @@ const gfx_ctx_driver_t gfx_ctx_x_egl =
|
|||||||
NULL, /* get_video_output_next */
|
NULL, /* get_video_output_next */
|
||||||
x11_get_metrics,
|
x11_get_metrics,
|
||||||
NULL,
|
NULL,
|
||||||
gfx_ctx_xegl_update_window_title,
|
x11_update_window_title,
|
||||||
x11_check_window,
|
x11_check_window,
|
||||||
gfx_ctx_xegl_set_resize,
|
gfx_ctx_xegl_set_resize,
|
||||||
gfx_ctx_xegl_has_focus,
|
gfx_ctx_xegl_has_focus,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user