x11/keymap: Silence deprecation warnings around a fallback
We still use XKeycodeToKeysym() in a fallback path in case we're not running on a decent enough system; XKeycodeToKeysym() is deprecated as of version 1.12 of the X server, but since I don't want to copy a bunch of code from GDK or, god forbid, from Xlib, for a fallback path, it's probably more reasonable to just silence the compiler warnings - at least until we can drop all the X compatibility crap, and just use modern, or semi-modern, API.
This commit is contained in:
parent
09a317d23d
commit
5a77f814ab
@ -409,6 +409,29 @@ _clutter_keymap_x11_get_caps_lock_state (ClutterKeymapX11 *keymap)
|
|||||||
return keymap->caps_lock_state;
|
return keymap->caps_lock_state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||||
|
|
||||||
|
/* XXX - yes, I know that XKeycodeToKeysym() has been deprecated; hopefully,
|
||||||
|
* this code will never get run on any decent system that is also able to
|
||||||
|
* run Clutter. I just don't want to copy the implementation inside GDK for
|
||||||
|
* a fallback path.
|
||||||
|
*/
|
||||||
|
static int
|
||||||
|
translate_keysym (ClutterKeymapX11 *keymap,
|
||||||
|
guint hardware_keycode)
|
||||||
|
{
|
||||||
|
ClutterBackendX11 *backend_x11;
|
||||||
|
gint retval;
|
||||||
|
|
||||||
|
backend_x11 = CLUTTER_BACKEND_X11 (keymap->backend);
|
||||||
|
|
||||||
|
retval = XKeycodeToKeysym (backend_x11->xdpy, hardware_keycode, 0);
|
||||||
|
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||||
|
|
||||||
gint
|
gint
|
||||||
_clutter_keymap_x11_translate_key_state (ClutterKeymapX11 *keymap,
|
_clutter_keymap_x11_translate_key_state (ClutterKeymapX11 *keymap,
|
||||||
guint hardware_keycode,
|
guint hardware_keycode,
|
||||||
@ -440,7 +463,7 @@ _clutter_keymap_x11_translate_key_state (ClutterKeymapX11 *keymap,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif /* HAVE_XKB */
|
#endif /* HAVE_XKB */
|
||||||
retval = XKeycodeToKeysym (backend_x11->xdpy, hardware_keycode, 0);
|
retval = translate_keysym (keymap, hardware_keycode);
|
||||||
|
|
||||||
if (mods_p)
|
if (mods_p)
|
||||||
*mods_p = unconsumed_modifiers;
|
*mods_p = unconsumed_modifiers;
|
||||||
|
Loading…
Reference in New Issue
Block a user