[pyatspi2] Fix meaning of async/asyncInternal



commit da80e61788c3969bb2cbfb6db0a15e263cc4ce83
Author: Mike Gorse <mgorse novell com>
Date:   Sat Apr 10 15:39:31 2010 -0400

    Fix meaning of async/asyncInternal

 pyatspi/appevent.py |    6 +++---
 pyatspi/registry.py |    4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/pyatspi/appevent.py b/pyatspi/appevent.py
index b6141f6..4b295df 100644
--- a/pyatspi/appevent.py
+++ b/pyatspi/appevent.py
@@ -224,10 +224,10 @@ def event_type_to_signal_reciever(bus, factory, event_handler, event_type):
                                source)
                 depth = gobject.main_depth()
                 r = registry.Registry()
-                if (r.asyncInternal() or depth <= 1):
-                        return event_handler(event)
-                else:
+                if (r.asyncInternal() and depth > 1):
                     r.enqueueEvent(event_handler, event)
+                else:
+                        return event_handler(event)
 
         return bus.add_signal_receiver(handler_wrapper, **kwargs)
 
diff --git a/pyatspi/registry.py b/pyatspi/registry.py
index d252581..6884876 100644
--- a/pyatspi/registry.py
+++ b/pyatspi/registry.py
@@ -153,6 +153,7 @@ class Registry(object):
 			name = _bus_object.GetNameOwner (_ATSPI_REGISTRY_NAME)
                         self.desktop = factory (name, _ATSPI_ROOT_PATH, _ATSPI_DESKTOP)
 
+		self.async = False	# not fully supported yet
                 self.has_implementations = True
 
         def _set_default_registry (self):
@@ -173,7 +174,6 @@ class Registry(object):
                 """
                 if not self.has_implementations:
                         self._set_default_registry ()
-		self.async = True	# not fully supported yet
                 try:
                         self.main_loop.run()
                 except KeyboardInterrupt:
@@ -358,7 +358,7 @@ class Registry(object):
                 Tests whether events should currently be delivered
                 asynchronously
                 """
-                return self.async and not(self.frozen)
+                return self.async or self.frozen
 
         def freezeEvents (self):
                 """



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]