Hopefully fixed Thunderbird address completion and a few other areas.
This commit is contained in:
@@ -31,6 +31,7 @@ __date__ = "$Date$"
|
|||||||
__copyright__ = "Copyright (c) 2014 Igalia, S.L."
|
__copyright__ = "Copyright (c) 2014 Igalia, S.L."
|
||||||
__license__ = "LGPL"
|
__license__ = "LGPL"
|
||||||
|
|
||||||
|
import cthulhu.debug as debug
|
||||||
import cthulhu.cthulhu_state as cthulhu_state
|
import cthulhu.cthulhu_state as cthulhu_state
|
||||||
import cthulhu.spellcheck as spellcheck
|
import cthulhu.spellcheck as spellcheck
|
||||||
from cthulhu.ax_object import AXObject
|
from cthulhu.ax_object import AXObject
|
||||||
@@ -59,7 +60,10 @@ class SpellCheck(spellcheck.SpellCheck):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
def _isCandidateWindow(self, window):
|
def _isCandidateWindow(self, window):
|
||||||
if not AXUtilities.is_dialog(window):
|
# Check for dialog or modal window (Thunderbird may use either)
|
||||||
|
if not (AXUtilities.is_dialog(window) or AXUtilities.is_modal(window)):
|
||||||
|
tokens = ["THUNDERBIRD SPELL CHECK:", window, "is not a dialog or modal window"]
|
||||||
|
debug.printTokens(debug.LEVEL_INFO, tokens, True)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def isNonSpellCheckChild(x):
|
def isNonSpellCheckChild(x):
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ from cthulhu import debug
|
|||||||
from cthulhu import cthulhu
|
from cthulhu import cthulhu
|
||||||
from cthulhu import cthulhu_state
|
from cthulhu import cthulhu_state
|
||||||
from cthulhu.ax_object import AXObject
|
from cthulhu.ax_object import AXObject
|
||||||
|
from cthulhu.ax_utilities import AXUtilities
|
||||||
from cthulhu.scripts import default
|
from cthulhu.scripts import default
|
||||||
from cthulhu.scripts import web
|
from cthulhu.scripts import web
|
||||||
from .script_utilities import Utilities
|
from .script_utilities import Utilities
|
||||||
@@ -241,6 +242,13 @@ class Script(web.Script):
|
|||||||
debug.printMessage(debug.LEVEL_INFO, msg, True)
|
debug.printMessage(debug.LEVEL_INFO, msg, True)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# We're sometimes getting a spurious focus claim from the Firefox/Thunderbird
|
||||||
|
# window after opening a file from file manager.
|
||||||
|
if AXObject.get_role(event.source) == Atspi.Role.FRAME:
|
||||||
|
msg = "GECKO: Ignoring event believed to be noise."
|
||||||
|
debug.printMessage(debug.LEVEL_INFO, msg, True)
|
||||||
|
return
|
||||||
|
|
||||||
msg = "GECKO: Passing along event to default script"
|
msg = "GECKO: Passing along event to default script"
|
||||||
debug.printMessage(debug.LEVEL_INFO, msg, True)
|
debug.printMessage(debug.LEVEL_INFO, msg, True)
|
||||||
default.Script.onFocusedChanged(self, event)
|
default.Script.onFocusedChanged(self, event)
|
||||||
@@ -301,6 +309,14 @@ class Script(web.Script):
|
|||||||
if super().onShowingChanged(event):
|
if super().onShowingChanged(event):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# Set focus to newly shown menus outside of document content
|
||||||
|
if event.detail1 and AXUtilities.is_menu(event.source) \
|
||||||
|
and not self.utilities.inDocumentContent(event.source):
|
||||||
|
msg = "GECKO: Setting locus of focus to newly shown menu."
|
||||||
|
debug.printMessage(debug.LEVEL_INFO, msg, True)
|
||||||
|
cthulhu.setLocusOfFocus(event, event.source)
|
||||||
|
return
|
||||||
|
|
||||||
msg = "GECKO: Passing along event to default script"
|
msg = "GECKO: Passing along event to default script"
|
||||||
debug.printMessage(debug.LEVEL_INFO, msg, True)
|
debug.printMessage(debug.LEVEL_INFO, msg, True)
|
||||||
default.Script.onShowingChanged(self, event)
|
default.Script.onShowingChanged(self, event)
|
||||||
|
|||||||
Reference in New Issue
Block a user