Search
SailfishOS Open Build Service
>
Projects
>
home:sledge
:
branches:nemo:devel:hw:ti:omap4:common
>
gst-plugins-base
> 0046-xvimagesink-don-t-use-deprecated-XKeycodeToKeysym.patch
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File 0046-xvimagesink-don-t-use-deprecated-XKeycodeToKeysym.patch of Package gst-plugins-base
From 5eac2e936544f7a2d6e4f20a14204fdbebb2abfc Mon Sep 17 00:00:00 2001 From: "Oleksij Rempel (Alexey Fisher)" <bug-track@fisher-privat.net> Date: Mon, 5 Mar 2012 11:09:12 +0100 Subject: [PATCH] xvimagesink: don't use deprecated XKeycodeToKeysym https://bugzilla.gnome.org/show_bug.cgi?id=671299 Signed-off-by: Oleksij Rempel (Alexey Fisher) <bug-track@fisher-privat.net> --- sys/xvimage/xvimagesink.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/sys/xvimage/xvimagesink.c b/sys/xvimage/xvimagesink.c index 21a2ef3..b210358 100644 --- a/sys/xvimage/xvimagesink.c +++ b/sys/xvimage/xvimagesink.c @@ -129,6 +129,9 @@ #include "gst/glib-compat-private.h" +/* for XkbKeycodeToKeysym */ +#include <X11/XKBlib.h> + GST_DEBUG_CATEGORY_STATIC (gst_debug_xvimagesink); #define GST_CAT_DEFAULT gst_debug_xvimagesink GST_DEBUG_CATEGORY_STATIC (GST_CAT_PERFORMANCE); @@ -1243,6 +1246,7 @@ gst_xvimagesink_handle_xevents (GstXvImageSink * xvimagesink) KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask, &e)) { KeySym keysym; + const char *key_str = NULL; /* We lock only for the X function call */ g_mutex_unlock (xvimagesink->x_lock); @@ -1269,24 +1273,20 @@ gst_xvimagesink_handle_xevents (GstXvImageSink * xvimagesink) case KeyRelease: /* Key pressed/released over our window. We send upstream events for interactivity/navigation */ - GST_DEBUG ("xvimagesink key %d pressed over window at %d,%d", - e.xkey.keycode, e.xkey.x, e.xkey.y); g_mutex_lock (xvimagesink->x_lock); - keysym = XKeycodeToKeysym (xvimagesink->xcontext->disp, - e.xkey.keycode, 0); - g_mutex_unlock (xvimagesink->x_lock); + keysym = XkbKeycodeToKeysym (xvimagesink->xcontext->disp, + e.xkey.keycode, 0, 0); if (keysym != NoSymbol) { - char *key_str = NULL; - - g_mutex_lock (xvimagesink->x_lock); key_str = XKeysymToString (keysym); - g_mutex_unlock (xvimagesink->x_lock); - gst_navigation_send_key_event (GST_NAVIGATION (xvimagesink), - e.type == KeyPress ? "key-press" : "key-release", key_str); } else { - gst_navigation_send_key_event (GST_NAVIGATION (xvimagesink), - e.type == KeyPress ? "key-press" : "key-release", "unknown"); + key_str = "unknown"; } + g_mutex_unlock (xvimagesink->x_lock); + GST_DEBUG_OBJECT (xvimagesink, + "key %d pressed over window at %d,%d (%s)", + e.xkey.keycode, e.xkey.x, e.xkey.y, key_str); + gst_navigation_send_key_event (GST_NAVIGATION (xvimagesink), + e.type == KeyPress ? "key-press" : "key-release", key_str); break; default: GST_DEBUG ("xvimagesink unhandled X event (%d)", e.type); -- 1.7.9.5