at-spi r985 - in trunk: . registryd
- From: liyuan svn gnome org
- To: svn-commits-list gnome org
- Subject: at-spi r985 - in trunk: . registryd
- Date: Mon, 25 Feb 2008 02:49:56 +0000 (GMT)
Author: liyuan
Date: Mon Feb 25 02:49:56 2008
New Revision: 985
URL: http://svn.gnome.org/viewvc/at-spi?rev=985&view=rev
Log:
2008-02-25 Li Yuan <li yuan sun com>
* registryd/deviceeventcontroller.c: (global_filter_fn),
(dec_lock_modifiers), (dec_unlock_modifiers),
(impl_generate_keyboard_event): patch from Franz Netykafka runbox no
Bug #508147. Lock/Unlock modifier keys when xkb extension is
missing.
Modified:
trunk/ChangeLog
trunk/registryd/deviceeventcontroller.c
Modified: trunk/registryd/deviceeventcontroller.c
==============================================================================
--- trunk/registryd/deviceeventcontroller.c (original)
+++ trunk/registryd/deviceeventcontroller.c Mon Feb 25 02:49:56 2008
@@ -82,6 +82,7 @@
static unsigned int _numlock_physical_mask = Mod2Mask; /* a guess, will be reset */
static GQuark spi_dec_private_quark = 0;
+static XModifierKeymap* xmkeymap = NULL;
static int (*x_default_error_handler) (Display *display, XErrorEvent *error_event);
@@ -1119,6 +1120,9 @@
priv = (DEControllerPrivateData *)
g_object_get_qdata (G_OBJECT (controller), spi_dec_private_quark);
+ if (xevent->type == MappingNotify)
+ xmkeymap = NULL;
+
if (xevent->type == KeyPress || xevent->type == KeyRelease)
{
if (controller->xevie_display == NULL)
@@ -2130,15 +2134,37 @@
static gboolean
dec_lock_modifiers (SpiDEController *controller, unsigned modifiers)
{
- return XkbLockModifiers (spi_get_display (), XkbUseCoreKbd,
- modifiers, modifiers);
+ DEControllerPrivateData *priv = (DEControllerPrivateData *)
+ g_object_get_qdata (G_OBJECT (controller), spi_dec_private_quark);
+
+ if (priv->have_xkb) {
+ return XkbLockModifiers (spi_get_display (), XkbUseCoreKbd,
+ modifiers, modifiers);
+ } else {
+ int mod_index;
+ for (mod_index=0;mod_index<8;mod_index++)
+ if (modifiers & (1<<mod_index))
+ dec_synth_keycode_press(controller, xmkeymap->modifiermap[mod_index]);
+ return TRUE;
+ }
}
static gboolean
dec_unlock_modifiers (SpiDEController *controller, unsigned modifiers)
{
- return XkbLockModifiers (spi_get_display (), XkbUseCoreKbd,
- modifiers, 0);
+ DEControllerPrivateData *priv = (DEControllerPrivateData *)
+ g_object_get_qdata (G_OBJECT (controller), spi_dec_private_quark);
+
+ if (priv->have_xkb) {
+ return XkbLockModifiers (spi_get_display (), XkbUseCoreKbd,
+ modifiers, 0);
+ } else {
+ int mod_index;
+ for (mod_index=0;mod_index<8;mod_index++)
+ if (modifiers & (1<<mod_index))
+ dec_synth_keycode_release(controller, xmkeymap->modifiermap[mod_index]);
+ return TRUE;
+ }
}
static KeySym
@@ -2268,6 +2294,13 @@
gdk_error_trap_push ();
+ DEControllerPrivateData *priv = (DEControllerPrivateData *)
+ g_object_get_qdata (G_OBJECT (controller), spi_dec_private_quark);
+
+ if (!priv->have_xkb && xmkeymap==NULL) {
+ xmkeymap = XGetModifierMapping(spi_get_display ());
+ }
+
switch (synth_type)
{
case Accessibility_KEY_PRESS:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]