mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-05 05:52:37 +00:00
vaapisink: fix GstNavigation "key-press" / "key-release" events.
Fix arguments to XkbKeycodeToKeysym() for converting an X11 keycode to a KeySym. In particular, there is no such Window argument. Also make sure to check for, and use, the correct <X11/XKBlib.h> header where that new function is defined. Otherwise, default to the older XKeycodeToKeysym() function.
This commit is contained in:
parent
039244bf77
commit
48e5bcbe7b
2 changed files with 25 additions and 2 deletions
10
configure.ac
10
configure.ac
|
@ -559,6 +559,16 @@ if test "$enable_x11" = "yes"; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
dnl Check for XKB library
|
||||||
|
HAVE_XKBLIB=0
|
||||||
|
if test $USE_X11 -eq 1; then
|
||||||
|
AC_CHECK_HEADERS([X11/XKBlib.h], [HAVE_XKBLIB=1], [:])
|
||||||
|
fi
|
||||||
|
if test $HAVE_XKBLIB -eq 1; then
|
||||||
|
AC_DEFINE_UNQUOTED([HAVE_XKBLIB], 1,
|
||||||
|
[Defined to 1 if the XKB extension exists.])
|
||||||
|
fi
|
||||||
|
|
||||||
dnl Check for XRandR
|
dnl Check for XRandR
|
||||||
HAVE_XRANDR=0
|
HAVE_XRANDR=0
|
||||||
if test $USE_X11 -eq 1; then
|
if test $USE_X11 -eq 1; then
|
||||||
|
|
|
@ -218,6 +218,20 @@ gst_vaapisink_backend_drm (void)
|
||||||
#include <gst/vaapi/gstvaapidisplay_x11.h>
|
#include <gst/vaapi/gstvaapidisplay_x11.h>
|
||||||
#include <gst/vaapi/gstvaapiwindow_x11.h>
|
#include <gst/vaapi/gstvaapiwindow_x11.h>
|
||||||
|
|
||||||
|
#if HAVE_XKBLIB
|
||||||
|
# include <X11/XKBlib.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static inline KeySym
|
||||||
|
x11_keycode_to_keysym (Display * dpy, unsigned int kc)
|
||||||
|
{
|
||||||
|
#if HAVE_XKBLIB
|
||||||
|
return XkbKeycodeToKeysym (dpy, kc, 0, 0);
|
||||||
|
#else
|
||||||
|
return XKeycodeToKeysym (dpy, kc, 0);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/* Checks whether a ConfigureNotify event is in the queue */
|
/* Checks whether a ConfigureNotify event is in the queue */
|
||||||
typedef struct _ConfigureNotifyEventPendingArgs ConfigureNotifyEventPendingArgs;
|
typedef struct _ConfigureNotifyEventPendingArgs ConfigureNotifyEventPendingArgs;
|
||||||
struct _ConfigureNotifyEventPendingArgs
|
struct _ConfigureNotifyEventPendingArgs
|
||||||
|
@ -387,8 +401,7 @@ gst_vaapisink_x11_handle_events (GstVaapiSink * sink)
|
||||||
case KeyPress:
|
case KeyPress:
|
||||||
case KeyRelease:
|
case KeyRelease:
|
||||||
gst_vaapi_display_lock (display);
|
gst_vaapi_display_lock (display);
|
||||||
keysym = XkbKeycodeToKeysym (x11_dpy, x11_win,
|
keysym = x11_keycode_to_keysym (x11_dpy, e.xkey.keycode);
|
||||||
e.xkey.keycode, 0, 0);
|
|
||||||
if (keysym != NoSymbol) {
|
if (keysym != NoSymbol) {
|
||||||
key_str = XKeysymToString (keysym);
|
key_str = XKeysymToString (keysym);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue