[orca] Add sanity check to Mouse Review to ensure we have the expected version of Gtk



commit d0762fcda8ebc75b238dc653a6a2078f1637c920
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Wed Aug 31 12:33:31 2016 -0400

    Add sanity check to Mouse Review to ensure we have the expected version of Gtk

 src/orca/mouse_review.py |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/src/orca/mouse_review.py b/src/orca/mouse_review.py
index 45b0bdf..bea0249 100644
--- a/src/orca/mouse_review.py
+++ b/src/orca/mouse_review.py
@@ -181,6 +181,15 @@ class MouseReviewer:
             debug.println(debug.LEVEL_INFO, msg, True)
             return
 
+        display = Gdk.Display.get_default()
+        try:
+            seat = Gdk.Display.get_default_seat(display)
+            self._pointer = seat.get_pointer()
+        except AttributeError:
+            msg = "MOUSE REVIEW ERROR: Gtk+ 3.20 is not available"
+            debug.println(debug.LEVEL_INFO, msg, True)
+            return
+
         if not self._active:
             return
 
@@ -194,10 +203,6 @@ class MouseReviewer:
     def activate(self):
         """Activates mouse review."""
 
-        display = Gdk.Display.get_default()
-        seat = Gdk.Display.get_default_seat(display)
-        self._pointer = seat.get_pointer()
-
         _eventManager.registerModuleListeners(self._get_listeners())
         screen = Wnck.Screen.get_default()
         i = screen.connect("window-stacking-changed", self._on_stacking_changed)


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