]> git.saurik.com Git - wxWidgets.git/commitdiff
Use XkbKeycodeToKeysym() instead of deprecated XKeycodeToKeysym().
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 7 May 2012 13:12:23 +0000 (13:12 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 7 May 2012 13:12:23 +0000 (13:12 +0000)
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
build/bakefiles/make_dist.mk
src/gtk/window.cpp

index c871fc789ff09bc6fb6fb7bc15939cfa4ca72867..6f406b55870646af01711983c7edae6f8f3fceef 100644 (file)
@@ -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
index 0b1520582e064beb2ca98440982fe58b5cf440d0..f820a7acc86c14e8f4a6e72b0ffedb5184c039a6 100644 (file)
@@ -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
index ea7570bf2ff0a64a629b3ed39b2282b6c2d2521a..b878d59e32bd20cdff5e8abd399a12e6f255a6f8 100644 (file)
@@ -42,6 +42,7 @@ using namespace wxGTKImpl;
 
 #ifdef GDK_WINDOWING_X11
 #include <gdk/gdkx.h>
+#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