Index: src/orca/scripts/gdmlogin.py
===================================================================
--- src/orca/scripts/gdmlogin.py	(revision 2121)
+++ src/orca/scripts/gdmlogin.py	(working copy)
@@ -56,7 +56,7 @@
 
         # Now we find the focused object and set the locus of focus to it.
         #
-        obj = util.findFocusedObject(self.app)
+        obj = self.findFocusedObject(self.app)
         if obj:
             orca.setLocusOfFocus(event, obj)
         else:
Index: src/orca/scripts/gnome-terminal.py
===================================================================
--- src/orca/scripts/gnome-terminal.py	(revision 2121)
+++ src/orca/scripts/gnome-terminal.py	(working copy)
@@ -67,7 +67,7 @@
     #
     #    # Now we find the focused object and set the locus of focus to it.
     #    #
-    #    obj = util.findFocusedObject(self.app)
+    #    obj = self.findFocusedObject(self.app)
     #    if obj:
     #        orca.setLocusOfFocus(event, obj)
     #    else:
Index: src/orca/scripts/StarOffice.py
===================================================================
--- src/orca/scripts/StarOffice.py	(revision 2122)
+++ src/orca/scripts/StarOffice.py	(working copy)
@@ -883,7 +883,7 @@
 
         debug.println(self.debugLevel, "StarOffice.setDynamicColumnHeaders.")
 
-        clickCount = util.getClickCount(self.lastDynamicEvent, inputEvent)
+        clickCount = self.getClickCount(self.lastDynamicEvent, inputEvent)
         table = getTable(orca_state.locusOfFocus)
         if table:
             row = self.getTableRow(orca_state.locusOfFocus)
@@ -946,7 +946,7 @@
 
         debug.println(self.debugLevel, "StarOffice.setDynamicRowHeaders.")
 
-        clickCount = util.getClickCount(self.lastDynamicEvent, inputEvent)
+        clickCount = self.getClickCount(self.lastDynamicEvent, inputEvent)
         table = getTable(orca_state.locusOfFocus)
         if table:
             column = self.getTableColumn(orca_state.locusOfFocus)
Index: src/orca/util.py
===================================================================
--- src/orca/util.py	(revision 2122)
+++ src/orca/util.py	(working copy)
@@ -197,57 +197,3 @@
         return obj.child(obj.childCount - 1)
     else:
         return obj
-
-def findFocusedObject(root):
-    """Returns the accessible that has focus under or including the
-    given root.
-
-    TODO: This will currently traverse all children, whether they are
-    visible or not and/or whether they are children of parents that
-    manage their descendants.  At some point, this method should be
-    optimized to take such things into account.
-
-    Arguments:
-    - root: the root object where to start searching
-
-    Returns the object with the FOCUSED state or None if no object with
-    the FOCUSED state can be found.
-    """
-
-    if root.state.count(atspi.Accessibility.STATE_FOCUSED):
-        return root
-
-    for i in range(0, root.childCount):
-        try:
-            candidate = findFocusedObject(root.child(i))
-            if candidate:
-                return candidate
-        except:
-            pass
-
-    return None
-
-def getClickCount(lastInputEvent, inputEvent):
-    """Return the count of the number of clicks a user has made to one of the
-    keys on the keyboard.
-
-    Arguments:
-    - lastInputEvent: the last input event.
-    - inputEvent: the current input event.
-    """
-
-    if not isinstance(lastInputEvent, input_event.KeyboardEvent) or \
-       not isinstance(inputEvent, input_event.KeyboardEvent):
-        orca_state.clickCount = 0
-        return orca_state.clickCount
-
-    if (lastInputEvent.hw_code != inputEvent.hw_code) or \
-       (lastInputEvent.modifiers != inputEvent.modifiers):
-        orca_state.clickCount = 1
-        return orca_state.clickCount
-
-    if (inputEvent.time - lastInputEvent.time) < settings.doubleClickTimeout:
-        orca_state.clickCount += 1
-    else:
-        orca_state.clickCount = 0
-    return orca_state.clickCount+1
Index: src/orca/default.py
===================================================================
--- src/orca/default.py	(revision 2122)
+++ src/orca/default.py	(working copy)
@@ -1487,7 +1487,7 @@
             orcaKey = (inputEvent.event_string == "/")
 
         doubleClick = \
-           (util.getClickCount(self.lastWhereAmIEvent, inputEvent) == 2)
+           (self.getClickCount(self.lastWhereAmIEvent, inputEvent) == 2)
         self.lastWhereAmIEvent = inputEvent
 
         context = self.speechGenerator.getSpeechContext(obj)
@@ -3000,7 +3000,7 @@
     def reviewCurrentLine(self, inputEvent):
         """Presents the current flat review line via braille and speech."""
 
-        clickCount = util.getClickCount(self.lastReviewCurrentEvent,
+        clickCount = self.getClickCount(self.lastReviewCurrentEvent,
                                            inputEvent)
         self._reviewCurrentLine(inputEvent, clickCount)
         self.lastReviewCurrentEvent = inputEvent
@@ -3120,7 +3120,7 @@
         will cause the word to be phonetically spelt.
         """
 
-        clickCount = util.getClickCount(self.lastReviewCurrentEvent,
+        clickCount = self.getClickCount(self.lastReviewCurrentEvent,
                                            inputEvent)
         self._reviewCurrentItem(inputEvent, targetCursorCell, clickCount)
         self.lastReviewCurrentEvent = inputEvent
@@ -3232,7 +3232,7 @@
         """Presents the current flat review character via braille and speech.
         """
 
-        clickCount = util.getClickCount(self.lastReviewCurrentEvent,
+        clickCount = self.getClickCount(self.lastReviewCurrentEvent,
                                            inputEvent)
         self._reviewCurrentCharacter(inputEvent, clickCount)
         self.lastReviewCurrentEvent = inputEvent
@@ -3720,6 +3720,60 @@
 
         return displayedText
 
+    def findFocusedObject(self, root):
+        """Returns the accessible that has focus under or including the
+        given root.
+
+        TODO: This will currently traverse all children, whether they are
+        visible or not and/or whether they are children of parents that
+        manage their descendants.  At some point, this method should be
+        optimized to take such things into account.
+
+        Arguments:
+        - root: the root object where to start searching
+
+        Returns the object with the FOCUSED state or None if no object with
+        the FOCUSED state can be found.
+        """
+
+        if root.state.count(atspi.Accessibility.STATE_FOCUSED):
+            return root
+
+        for i in range(0, root.childCount):
+            try:
+                candidate = self.findFocusedObject(root.child(i))
+                if candidate:
+                    return candidate
+            except:
+                pass
+
+        return None
+
+    def getClickCount(self, lastInputEvent, inputEvent):
+        """Return the count of the number of clicks a user has made to one
+        of the keys on the keyboard.
+
+        Arguments:
+        - lastInputEvent: the last input event.
+        - inputEvent: the current input event.
+        """
+
+        if not isinstance(lastInputEvent, input_event.KeyboardEvent) or \
+           not isinstance(inputEvent, input_event.KeyboardEvent):
+            orca_state.clickCount = 0
+            return orca_state.clickCount
+
+        if (lastInputEvent.hw_code != inputEvent.hw_code) or \
+           (lastInputEvent.modifiers != inputEvent.modifiers):
+            orca_state.clickCount = 1
+            return orca_state.clickCount
+
+        if (inputEvent.time - lastInputEvent.time) < settings.doubleClickTimeout:
+            orca_state.clickCount += 1
+        else:
+            orca_state.clickCount = 0
+        return orca_state.clickCount+1
+
     def isDesiredFocusedItem(self, obj, rolesList):
         """Called to determine if the given object and it's hierarchy of
            parent objects, each have the desired roles.
Index: src/orca/orca.py
===================================================================
--- src/orca/orca.py	(revision 2121)
+++ src/orca/orca.py	(working copy)
@@ -720,7 +720,8 @@
             if (not consumed) and settings.learnModeEnabled:
                 if keyboardEvent.type \
                     == atspi.Accessibility.KEY_PRESSED_EVENT:
-                    clickCount = util.getClickCount(orca_state.lastInputEvent,
+                    clickCount = orca_state.activeScript.getClickCount(\
+                                                orca_state.lastInputEvent,
                                                 keyboardEvent)
                     if clickCount == 2:
                         util.phoneticSpellCurrentItem(keyboardEvent.event_string)
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 2122)
+++ ChangeLog	(working copy)
@@ -162,6 +162,18 @@
           def isDesiredFocusedItem(obj, rolesList):
           def speakMisspeltWord(allTokens, badWord):
 
+        * src/orca/scripts/gdmlogin.py:
+          src/orca/scripts/gnome-terminal.py:
+          src/orca/scripts/StarOffice.py:
+          src/orca/util.py:
+          src/orca/default.py:
+          src/orca/orca.py:
+          Another partial fix for bug #395548.
+
+          Moved:
+          def findFocusedObject(root):
+          def getClickCount(lastInputEvent, inputEvent):
+
 2007-03-05  Rich Burridge <rich.burridge@sun.com>
 
         * src/orca/debug.py:
