From d23557d38e893c6e31621efc53b0f2aae41872e2 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 19 Nov 2015 11:13:59 +0100 Subject: [PATCH] Start restricting scope of g_x11_has_focus --- gfx/common/x11_common.c | 2 ++ gfx/drivers/xvideo.c | 1 - gfx/drivers_context/glx_ctx.c | 1 - gfx/drivers_context/xegl_ctx.c | 1 - 4 files changed, 2 insertions(+), 3 deletions(-) diff --git a/gfx/common/x11_common.c b/gfx/common/x11_common.c index 97ed6cdaec..cc5f52c38c 100644 --- a/gfx/common/x11_common.c +++ b/gfx/common/x11_common.c @@ -304,6 +304,8 @@ unsigned x11_get_xinerama_monitor(Display *dpy, int x, int y, bool x11_create_input_context(Display *dpy, Window win, XIM *xim, XIC *xic) { + g_x11_has_focus = true; + *xim = XOpenIM(dpy, NULL, NULL, NULL); if (!*xim) diff --git a/gfx/drivers/xvideo.c b/gfx/drivers/xvideo.c index daac3ad80d..a0e918f303 100644 --- a/gfx/drivers/xvideo.c +++ b/gfx/drivers/xvideo.c @@ -557,7 +557,6 @@ static void *xv_init(const video_info_t *video, x11_install_sighandlers(); xv_set_nonblock_state(xv, !video->vsync); - g_x11_has_focus = true; driver->display_type = RARCH_DISPLAY_X11; driver->video_display = (uintptr_t)g_x11_dpy; diff --git a/gfx/drivers_context/glx_ctx.c b/gfx/drivers_context/glx_ctx.c index cccea2700b..e4c615409a 100644 --- a/gfx/drivers_context/glx_ctx.c +++ b/gfx/drivers_context/glx_ctx.c @@ -535,7 +535,6 @@ static bool gfx_ctx_glx_set_video_mode(void *data, XSetErrorHandler(old_handler); XFree(vi); - g_x11_has_focus = true; if (!x11_create_input_context(g_x11_dpy, g_x11_win, &glx->g_xim, &g_x11_xic)) goto error; diff --git a/gfx/drivers_context/xegl_ctx.c b/gfx/drivers_context/xegl_ctx.c index 5231a467d7..c541bc69a0 100644 --- a/gfx/drivers_context/xegl_ctx.c +++ b/gfx/drivers_context/xegl_ctx.c @@ -485,7 +485,6 @@ static bool gfx_ctx_xegl_set_video_mode(void *data, XSetErrorHandler(old_handler); XFree(vi); - g_x11_has_focus = true; g_inited = true; if (!x11_create_input_context(g_x11_dpy, g_x11_win, &g_xim, &g_x11_xic))