From: Oleksij Rempel (Alexey Fisher) Date: Mon, 5 Mar 2012 10:09:12 +0000 (+0100) Subject: xvimagesink: don't use deprecated XKeycodeToKeysym X-Git-Tag: 1.19.3~511^2~6555^2~64 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dc7c6cf4592010b531ebad51020bf505e0435bdb;p=platform%2Fupstream%2Fgstreamer.git xvimagesink: don't use deprecated XKeycodeToKeysym https://bugzilla.gnome.org/show_bug.cgi?id=671299 Signed-off-by: Oleksij Rempel (Alexey Fisher) --- diff --git a/sys/xvimage/xvimagesink.c b/sys/xvimage/xvimagesink.c index f20c877..ccfdaae 100644 --- a/sys/xvimage/xvimagesink.c +++ b/sys/xvimage/xvimagesink.c @@ -133,6 +133,9 @@ #include "gst/glib-compat-private.h" +/* for XkbKeycodeToKeysym */ +#include + GST_DEBUG_CATEGORY_STATIC (gst_debug_xvimagesink); #define GST_CAT_DEFAULT gst_debug_xvimagesink GST_DEBUG_CATEGORY_STATIC (GST_CAT_PERFORMANCE); @@ -1236,6 +1239,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); @@ -1262,24 +1266,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);