Send key events to listeners assumed to be hung, but don't block
authorMike Gorse <mgorse@novell.com>
Fri, 24 Feb 2012 22:22:50 +0000 (16:22 -0600)
committerMike Gorse <mgorse@novell.com>
Fri, 24 Feb 2012 22:22:50 +0000 (16:22 -0600)
Orca would sometimes fail to notice that its modifier key was released
since it was presumed to be hung and would not be sent the event. So,
rather than ignore event listeners assumed to be hung, we'll send them
the notifications for the keys that they're listening to but not wait
for a reply, instead assuming that they are not consumed.

registryd/deviceeventcontroller.c

index 8637b2c..93ee40d 100644 (file)
@@ -1224,19 +1224,27 @@ Accessibility_DeviceEventListener_NotifyEvent(SpiDEController *controller,
   DBusError error;
   dbus_bool_t consumed = FALSE;
   GSList *l;
+  gboolean hung = FALSE;
 
   for (l = hung_processes; l; l = l->next)
   {
     if (!strcmp (l->data, listener->bus_name))
     {
-      dbus_message_unref (message);
-      return FALSE;
+      dbus_message_set_no_reply (message, TRUE);
+      hung = TRUE;
+      break;
     }
   }
 
   dbus_error_init(&error);
   if (spi_dbus_marshal_deviceEvent(message, key_event))
   {
+    if (hung)
+    {
+      dbus_connection_send (controller->bus, message, NULL);
+      dbus_message_unref (message);
+      return FALSE;
+    }
     DBusMessage *reply = send_and_allow_reentry (controller->bus, message, 1000, &error);
     if (reply)
     {