From c78239a10d49fe3b7f7c1c6b405bc2ac271dbf49 Mon Sep 17 00:00:00 2001 From: Themaister Date: Sat, 23 Feb 2013 15:20:47 +0100 Subject: [PATCH] Avoid async error handling breaking XSetInputFocus. --- gfx/context/glx_ctx.c | 1 + gfx/context/xegl_ctx.c | 1 + 2 files changed, 2 insertions(+) diff --git a/gfx/context/glx_ctx.c b/gfx/context/glx_ctx.c index b7118792dd..b0141c1dd6 100644 --- a/gfx/context/glx_ctx.c +++ b/gfx/context/glx_ctx.c @@ -378,6 +378,7 @@ static bool gfx_ctx_set_video_mode( // This can blow up on some drivers. It's not fatal, so override errors for this call. int (*old_handler)(Display*, XErrorEvent*) = XSetErrorHandler(nul_handler); XSetInputFocus(g_dpy, g_win, RevertToNone, CurrentTime); + XSync(g_dpy, False); XSetErrorHandler(old_handler); XFree(vi); diff --git a/gfx/context/xegl_ctx.c b/gfx/context/xegl_ctx.c index 8f4653cfa0..07184dde0e 100644 --- a/gfx/context/xegl_ctx.c +++ b/gfx/context/xegl_ctx.c @@ -410,6 +410,7 @@ static bool gfx_ctx_set_video_mode( // This can blow up on some drivers. It's not fatal, so override errors for this call. int (*old_handler)(Display*, XErrorEvent*) = XSetErrorHandler(nul_handler); XSetInputFocus(g_dpy, g_win, RevertToNone, CurrentTime); + XSync(g_dpy, False); XSetErrorHandler(old_handler); XFree(vi);