From 25cc08c07b7f378ea032e936022e457ae527010a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 7 May 2012 13:12:23 +0000 Subject: [PATCH] Use XkbKeycodeToKeysym() instead of deprecated XKeycodeToKeysym(). XKeycodeToKeysym() is deprecated in new X11 headers because it doesn't work correctly with all symbols (https://bugs.freedesktop.org/show_bug.cgi?id=5349). Use XkbKeycodeToKeysym() instead, this should help with some keys and also avoids deprecation warnings during compilation. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71373 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- Makefile.in | 2 ++ build/bakefiles/make_dist.mk | 2 ++ src/gtk/window.cpp | 5 +++++ 3 files changed, 9 insertions(+) diff --git a/Makefile.in b/Makefile.in index c871fc789f..6f406b5587 100644 --- a/Makefile.in +++ b/Makefile.in @@ -37200,6 +37200,8 @@ GTK_DIST: UNIV_DIST $(CP_P) $(GTK1DIR)/*.c $(DISTDIR)/src/gtk1 $(CP_P) $(GTK1DIR)/*.xbm $(DISTDIR)/src/gtk1 $(CP_P) $(GTK1DIR)/*.mms $(DISTDIR)/src/gtk1 + mkdir $(DISTDIR)/include/wx/x11/private + $(CP_P) $(INCDIR)/wx/x11/private/*.h $(DISTDIR)/include/wx/x11/private mkdir $(DISTDIR)/include/wx/gtk/gnome mkdir $(DISTDIR)/src/gtk/gnome diff --git a/build/bakefiles/make_dist.mk b/build/bakefiles/make_dist.mk index 0b1520582e..f820a7acc8 100644 --- a/build/bakefiles/make_dist.mk +++ b/build/bakefiles/make_dist.mk @@ -350,6 +350,8 @@ GTK_DIST: UNIV_DIST $(CP_P) $(GTK1DIR)/*.c $(DISTDIR)/src/gtk1 $(CP_P) $(GTK1DIR)/*.xbm $(DISTDIR)/src/gtk1 $(CP_P) $(GTK1DIR)/*.mms $(DISTDIR)/src/gtk1 + mkdir $(DISTDIR)/include/wx/x11/private + $(CP_P) $(INCDIR)/wx/x11/private/*.h $(DISTDIR)/include/wx/x11/private mkdir $(DISTDIR)/include/wx/gtk/gnome mkdir $(DISTDIR)/src/gtk/gnome diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index ea7570bf2f..b878d59e32 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -42,6 +42,7 @@ using namespace wxGTKImpl; #ifdef GDK_WINDOWING_X11 #include +#include "wx/x11/private/wrapxkb.h" #else typedef guint KeySym; #endif @@ -745,7 +746,11 @@ wxTranslateGTKKeyEventToWx(wxKeyEvent& event, wxLogTrace(TRACE_KEYS, wxT("\t-> keycode %d"), keycode); +#ifdef HAVE_X11_XKBLIB_H + KeySym keysymNormalized = XkbKeycodeToKeysym(dpy, keycode, 0, 0); +#else KeySym keysymNormalized = XKeycodeToKeysym(dpy, keycode, 0); +#endif // use the normalized, i.e. lower register, keysym if we've // got one -- 2.45.2