mirror of
https://github.com/libretro/RetroArch
synced 2025-01-27 03:35:22 +00:00
Create x11_install_quit_atom
This commit is contained in:
parent
9b44a2496b
commit
655520aeec
@ -31,7 +31,7 @@ static Atom XA_NET_WM_STATE;
|
||||
static Atom XA_NET_WM_STATE_FULLSCREEN;
|
||||
static Atom XA_NET_MOVERESIZE_WINDOW;
|
||||
Colormap g_x11_cmap;
|
||||
Atom g_x11_quit_atom;
|
||||
static Atom g_x11_quit_atom;
|
||||
static volatile sig_atomic_t g_x11_quit;
|
||||
bool g_x11_has_focus;
|
||||
Window g_x11_win;
|
||||
@ -573,3 +573,10 @@ void x11_colormap_destroy(void)
|
||||
XFreeColormap(g_x11_dpy, g_x11_cmap);
|
||||
g_x11_cmap = None;
|
||||
}
|
||||
|
||||
void x11_install_quit_atom(void)
|
||||
{
|
||||
g_x11_quit_atom = XInternAtom(g_x11_dpy, "WM_DELETE_WINDOW", False);
|
||||
if (g_x11_quit_atom)
|
||||
XSetWMProtocols(g_x11_dpy, g_x11_win, &g_x11_quit_atom, 1);
|
||||
}
|
||||
|
@ -35,7 +35,6 @@
|
||||
|
||||
#include "../video_context_driver.h"
|
||||
|
||||
extern Atom g_x11_quit_atom;
|
||||
extern bool g_x11_has_focus;
|
||||
extern Window g_x11_win;
|
||||
extern Display *g_x11_dpy;
|
||||
@ -89,5 +88,7 @@ void x11_window_destroy(bool fullscreen);
|
||||
|
||||
void x11_colormap_destroy(void);
|
||||
|
||||
void x11_install_quit_atom(void);
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -548,10 +548,7 @@ static void *xv_init(const video_info_t *video,
|
||||
XSync(g_x11_dpy, False);
|
||||
memset(xv->image->data, 128, xv->image->data_size);
|
||||
|
||||
g_x11_quit_atom = XInternAtom(g_x11_dpy, "WM_DELETE_WINDOW", False);
|
||||
if (g_x11_quit_atom)
|
||||
XSetWMProtocols(g_x11_dpy, g_x11_win, &g_x11_quit_atom, 1);
|
||||
|
||||
x11_install_quit_atom();
|
||||
x11_install_sighandlers();
|
||||
|
||||
xv_set_nonblock_state(xv, !video->vsync);
|
||||
|
@ -471,9 +471,7 @@ static bool gfx_ctx_glx_set_video_mode(void *data,
|
||||
glXMakeContextCurrent(g_x11_dpy, glx->g_glx_win, glx->g_glx_win, glx->g_ctx);
|
||||
XSync(g_x11_dpy, False);
|
||||
|
||||
g_x11_quit_atom = XInternAtom(g_x11_dpy, "WM_DELETE_WINDOW", False);
|
||||
if (g_x11_quit_atom)
|
||||
XSetWMProtocols(g_x11_dpy, g_x11_win, &g_x11_quit_atom, 1);
|
||||
x11_install_quit_atom();
|
||||
|
||||
glXGetConfig(g_x11_dpy, vi, GLX_DOUBLEBUFFER, &val);
|
||||
glx->g_is_double = val;
|
||||
|
@ -450,9 +450,7 @@ static bool gfx_ctx_xegl_set_video_mode(void *data,
|
||||
|
||||
XIfEvent(g_x11_dpy, &event, egl_wait_notify, NULL);
|
||||
|
||||
g_x11_quit_atom = XInternAtom(g_x11_dpy, "WM_DELETE_WINDOW", False);
|
||||
if (g_x11_quit_atom)
|
||||
XSetWMProtocols(g_x11_dpy, g_x11_win, &g_x11_quit_atom, 1);
|
||||
x11_install_quit_atom();
|
||||
|
||||
gfx_ctx_xegl_swap_interval(data, g_interval);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user