X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=registryd%2Fdeviceeventcontroller.c;h=686f2cd55d590d63e4e2cb3343266f9dfa7d7d4b;hb=d17bd107e0b8774c280aa8bf7682ec850ed9c439;hp=d3b8e89814bf518a2a5c126e1dcf2f32042bfa99;hpb=942b1b3f28aa95bc8579967b878dc9516b10ea80;p=platform%2Fupstream%2Fat-spi2-core.git diff --git a/registryd/deviceeventcontroller.c b/registryd/deviceeventcontroller.c index d3b8e89..686f2cd 100644 --- a/registryd/deviceeventcontroller.c +++ b/registryd/deviceeventcontroller.c @@ -23,7 +23,7 @@ /* deviceeventcontroller.c: implement the DeviceEventController interface */ -#include +#include "config.h" #undef SPI_XKB_DEBUG #undef SPI_DEBUG @@ -39,11 +39,14 @@ #include #include "paths.h" -#include "keymasks.h" #include "de-types.h" #include "de-marshaller.h" +#include "keymasks.h" + +#ifdef HAVE_X11 #include "display.h" #include "event-source.h" +#endif #include "deviceeventcontroller.h" #include "reentrant-list.h" @@ -64,10 +67,13 @@ struct _SpiPoint { gint y; }; typedef struct _SpiPoint SpiPoint; + static unsigned int mouse_mask_state = 0; static unsigned int key_modifier_mask = - Mod1Mask | Mod2Mask | Mod3Mask | Mod4Mask | Mod5Mask | ShiftMask | LockMask | ControlMask | SPI_KEYMASK_NUMLOCK; -static unsigned int _numlock_physical_mask = Mod2Mask; /* a guess, will be reset */ + SPI_KEYMASK_MOD1 | SPI_KEYMASK_MOD2 | SPI_KEYMASK_MOD3 | SPI_KEYMASK_MOD4 | + SPI_KEYMASK_MOD5 | SPI_KEYMASK_SHIFT | SPI_KEYMASK_SHIFTLOCK | + SPI_KEYMASK_CONTROL | SPI_KEYMASK_NUMLOCK; +static unsigned int _numlock_physical_mask = SPI_KEYMASK_MOD2; /* a guess, will be reset */ static gboolean have_mouse_listener = FALSE; static gboolean have_mouse_event_listener = FALSE; @@ -632,7 +638,7 @@ handle_keygrab (SpiDEController *controller, grab_mask.mod_mask = key_listener->mask; if (g_slist_length (key_listener->keys) == 0) /* special case means AnyKey/AllKeys */ { - grab_mask.key_val = AnyKey; + grab_mask.key_val = 0L; /* AnyKey */ #ifdef SPI_DEBUG fprintf (stderr, "AnyKey grab!"); #endif @@ -921,6 +927,7 @@ send_and_allow_reentry (DBusConnection *bus, DBusMessage *message, int timeout, { const char *dest = dbus_message_get_destination (message); GSList *l; + dbus_bool_t result; gchar *bus_name_dup; dbus_message_ref (message); dbus_pending_call_set_notify (pending, reset_hung_process, message, @@ -930,9 +937,9 @@ send_and_allow_reentry (DBusConnection *bus, DBusMessage *message, int timeout, "Ping"); if (!message) return NULL; - dbus_connection_send_with_reply (bus, message, &pending, -1); + result = dbus_connection_send_with_reply (bus, message, &pending, -1); dbus_message_unref (message); - if (!pending) + if (!result || !pending) return NULL; bus_name_dup = g_strdup (dest); dbus_pending_call_set_notify (pending, reset_hung_process_from_ping, @@ -1359,6 +1366,7 @@ impl_register_keystroke_listener (DBusConnection *bus, Accessibility_KeyDefinition *kd = (Accessibility_KeyDefinition *)g_malloc(sizeof(Accessibility_KeyDefinition)); if (!spi_dbus_message_iter_get_struct(&iter_array, DBUS_TYPE_INT32, &kd->keycode, DBUS_TYPE_INT32, &kd->keysym, DBUS_TYPE_STRING, &keystring, DBUS_TYPE_INVALID)) { + g_free (kd); break; } kd->keystring = g_strdup (keystring); @@ -1569,6 +1577,7 @@ impl_deregister_keystroke_listener (DBusConnection *bus, if (!spi_dbus_message_iter_get_struct(&iter_array, DBUS_TYPE_INT32, &kd->keycode, DBUS_TYPE_INT32, &kd->keysym, DBUS_TYPE_STRING, &keystring, DBUS_TYPE_INVALID)) { + g_free(kd); break; } kd->keystring = g_strdup (keystring); @@ -1749,13 +1758,19 @@ impl_generate_keyboard_event (DBusConnection *bus, DBusMessage *message, void *u * in our arg list; it can contain either * a keycode or a keysym. */ - spi_dec_synth_keysym (controller, (KeySym) keycode); + spi_dec_synth_keysym (controller, keycode); break; case Accessibility_KEY_STRING: if (!spi_dec_plat_synth_keystring (controller, synth_type, keycode, keystring)) fprintf (stderr, "Keystring synthesis failure, string=%s\n", keystring); break; + case Accessibility_KEY_LOCKMODIFIERS: + spi_dec_plat_lock_modifiers (controller, keycode); + break; + case Accessibility_KEY_UNLOCKMODIFIERS: + spi_dec_plat_unlock_modifiers (controller, keycode); + break; } reply = dbus_message_new_method_return (message); return reply;