Turn g_x11_has_focus into static variable

This commit is contained in:
twinaphex 2015-11-19 12:23:01 +01:00
parent 655520aeec
commit c8130120bc
3 changed files with 9 additions and 8 deletions

View File

@ -33,7 +33,7 @@ static Atom XA_NET_MOVERESIZE_WINDOW;
Colormap g_x11_cmap; Colormap g_x11_cmap;
static Atom g_x11_quit_atom; static Atom g_x11_quit_atom;
static volatile sig_atomic_t g_x11_quit; static volatile sig_atomic_t g_x11_quit;
bool g_x11_has_focus; static bool g_x11_has_focus;
Window g_x11_win; Window g_x11_win;
static XIM g_x11_xim; static XIM g_x11_xim;
static XIC g_x11_xic; static XIC g_x11_xic;
@ -482,6 +482,11 @@ void x11_get_video_size(void *data, unsigned *width, unsigned *height)
} }
} }
bool x11_has_focus_internal(void *data)
{
return g_x11_has_focus;
}
bool x11_has_focus(void *data) bool x11_has_focus(void *data)
{ {
Window win; Window win;

View File

@ -35,7 +35,6 @@
#include "../video_context_driver.h" #include "../video_context_driver.h"
extern bool g_x11_has_focus;
extern Window g_x11_win; extern Window g_x11_win;
extern Display *g_x11_dpy; extern Display *g_x11_dpy;
extern Colormap g_x11_cmap; extern Colormap g_x11_cmap;
@ -72,6 +71,8 @@ void x11_get_video_size(void *data, unsigned *width, unsigned *height);
bool x11_has_focus(void *data); bool x11_has_focus(void *data);
bool x11_has_focus_internal(void *data);
bool x11_alive(void *data); bool x11_alive(void *data);
void x11_install_sighandlers(void); void x11_install_sighandlers(void);

View File

@ -775,11 +775,6 @@ static bool xv_frame(void *data, const void *frame, unsigned width,
return true; return true;
} }
static bool xv_focus(void *data)
{
return g_x11_has_focus;
}
static bool xv_suppress_screensaver(void *data, bool enable) static bool xv_suppress_screensaver(void *data, bool enable)
{ {
driver_t *driver = driver_get_ptr(); driver_t *driver = driver_get_ptr();
@ -870,7 +865,7 @@ video_driver_t video_xvideo = {
xv_frame, xv_frame,
xv_set_nonblock_state, xv_set_nonblock_state,
x11_alive, x11_alive,
xv_focus, x11_has_focus_internal,
xv_suppress_screensaver, xv_suppress_screensaver,
xv_has_windowed, xv_has_windowed,
xv_set_shader, xv_set_shader,