diff --git a/gfx/common/x11_common.c b/gfx/common/x11_common.c index 828e2a8b69..1f85307f09 100644 --- a/gfx/common/x11_common.c +++ b/gfx/common/x11_common.c @@ -383,7 +383,31 @@ static void x11_init_keyboard_lut(void) x11_keysym_rlut_size = 0; } -bool x11_create_input_context(Display *dpy, Window win, XIM *xim, XIC *xic) +static void x11_destroy_input_context(XIM *xim, XIC *xic) +{ + if (*xic) + { + XDestroyIC(*xic); + *xic = NULL; + } + + if (*xim) + { + XCloseIM(*xim); + *xim = NULL; + } + + memset(x11_keysym_lut, 0, sizeof(x11_keysym_lut)); + if (x11_keysym_rlut) + { + free(x11_keysym_rlut); + x11_keysym_rlut = NULL; + } + x11_keysym_rlut_size = 0; +} + + +static bool x11_create_input_context(Display *dpy, Window win, XIM *xim, XIC *xic) { x11_destroy_input_context(xim, xic); x11_init_keyboard_lut(); @@ -410,29 +434,6 @@ bool x11_create_input_context(Display *dpy, Window win, XIM *xim, XIC *xic) return true; } -void x11_destroy_input_context(XIM *xim, XIC *xic) -{ - if (*xic) - { - XDestroyIC(*xic); - *xic = NULL; - } - - if (*xim) - { - XCloseIM(*xim); - *xim = NULL; - } - - memset(x11_keysym_lut, 0, sizeof(x11_keysym_lut)); - if (x11_keysym_rlut) - { - free(x11_keysym_rlut); - x11_keysym_rlut = NULL; - } - x11_keysym_rlut_size = 0; -} - bool x11_get_metrics(void *data, enum display_metric_types type, float *value) { diff --git a/gfx/common/x11_common.h b/gfx/common/x11_common.h index b391b530f6..d2bfee5107 100644 --- a/gfx/common/x11_common.h +++ b/gfx/common/x11_common.h @@ -40,9 +40,6 @@ void x11_move_window(Display *dpy, Window win, /* Set icon, class, default stuff. */ void x11_set_window_attr(Display *dpy, Window win); -bool x11_create_input_context(Display *dpy, Window win, XIM *xim, XIC *xic); -void x11_destroy_input_context(XIM *xim, XIC *xic); - bool x11_get_metrics(void *data, enum display_metric_types type, float *value);