Revert part of last commit
authorMike Gorse <mgorse@novell.com>
Wed, 28 Dec 2011 03:23:41 +0000 (22:23 -0500)
committerMike Gorse <mgorse@novell.com>
Wed, 28 Dec 2011 03:23:41 +0000 (22:23 -0500)
Modifiers and hw_code are still sent as int16 for now, so it was wrong
to remove the code to parse them as int16, at least for the time being.

registryd/de-marshaller.c

index 4e0f2a5..8b2b00f 100644 (file)
@@ -87,10 +87,17 @@ dbus_bool_t spi_dbus_marshal_deviceEvent(DBusMessage *message, const Accessibili
 dbus_bool_t spi_dbus_demarshal_deviceEvent(DBusMessage *message, Accessibility_DeviceEvent *e)
 {
   DBusMessageIter iter;
+  dbus_uint16_t hw_code;
+  dbus_uint16_t modifiers;
 
   dbus_message_iter_init(message, &iter);
   if (spi_dbus_message_iter_get_struct(&iter, DBUS_TYPE_UINT32, &e->type, DBUS_TYPE_INT32, &e->id, DBUS_TYPE_INT32, &e->hw_code, DBUS_TYPE_INT32, &e->modifiers, DBUS_TYPE_INT32, &e->timestamp, DBUS_TYPE_STRING, &e->event_string, DBUS_TYPE_BOOLEAN, &e->is_text, DBUS_TYPE_INVALID))
     return TRUE;
+  /* TODO: Perhaps remove the below code for 2.1 */
+  if (!spi_dbus_message_iter_get_struct(&iter, DBUS_TYPE_UINT32, &e->type, DBUS_TYPE_INT32, &e->id, DBUS_TYPE_INT16, &hw_code, DBUS_TYPE_INT16, &modifiers, DBUS_TYPE_INT32, &e->timestamp, DBUS_TYPE_STRING, &e->event_string, DBUS_TYPE_BOOLEAN, &e->is_text, DBUS_TYPE_INVALID))
+    return FALSE;
+  e->hw_code = hw_code;
+  e->modifiers = modifiers;
   return TRUE;
 }