[gnome-applets/wip/muktupavels/werror: 3/3] accessx-status: avoid deprecated XKeycodeToKeysym
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-applets/wip/muktupavels/werror: 3/3] accessx-status: avoid deprecated XKeycodeToKeysym
- Date: Sat, 4 Apr 2020 15:11:59 +0000 (UTC)
commit c754a58ee755d7ee3d7d9c70b4b5573aaec2137d
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Sat Apr 4 18:06:40 2020 +0300
accessx-status: avoid deprecated XKeycodeToKeysym
gnome-applets/accessx-status/accessx-status-applet.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/gnome-applets/accessx-status/accessx-status-applet.c
b/gnome-applets/accessx-status/accessx-status-applet.c
index 1d853cc7a..272b12316 100644
--- a/gnome-applets/accessx-status/accessx-status-applet.c
+++ b/gnome-applets/accessx-status/accessx-status-applet.c
@@ -499,10 +499,18 @@ accessx_status_applet_slowkeys_image (AccessxStatusApplet *sapplet,
window = gtk_widget_get_window (GTK_WIDGET (sapplet));
if (event && window) {
- KeySym keysym = XKeycodeToKeysym (
- GDK_WINDOW_XDISPLAY (window),
- event->keycode,
- 0);
+ int keysyms_return;
+ KeySym *keysyms;
+ KeySym keysym;
+
+ keysyms = XGetKeyboardMapping (GDK_WINDOW_XDISPLAY (window),
+ event->keycode,
+ 1,
+ &keysyms_return);
+
+ keysym = keysyms[0];
+ XFree (keysyms);
+
glyphstring = XKeysymToString (keysym);
if ((!g_utf8_validate (glyphstring, -1, NULL)) ||
(g_utf8_strlen (glyphstring, -1) > 1))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]