Hopefully fixed Thunderbird address completion and a few other areas.

This commit is contained in:
Storm Dragon
2026-01-05 19:28:09 -05:00
parent 2bd2dffccc
commit 21cfec55ee
2 changed files with 21 additions and 1 deletions

View File

@@ -31,6 +31,7 @@ __date__ = "$Date$"
__copyright__ = "Copyright (c) 2014 Igalia, S.L."
__license__ = "LGPL"
import cthulhu.debug as debug
import cthulhu.cthulhu_state as cthulhu_state
import cthulhu.spellcheck as spellcheck
from cthulhu.ax_object import AXObject
@@ -59,7 +60,10 @@ class SpellCheck(spellcheck.SpellCheck):
return False
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
def isNonSpellCheckChild(x):

View File

@@ -39,6 +39,7 @@ from cthulhu import debug
from cthulhu import cthulhu
from cthulhu import cthulhu_state
from cthulhu.ax_object import AXObject
from cthulhu.ax_utilities import AXUtilities
from cthulhu.scripts import default
from cthulhu.scripts import web
from .script_utilities import Utilities
@@ -241,6 +242,13 @@ class Script(web.Script):
debug.printMessage(debug.LEVEL_INFO, msg, True)
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"
debug.printMessage(debug.LEVEL_INFO, msg, True)
default.Script.onFocusedChanged(self, event)
@@ -301,6 +309,14 @@ class Script(web.Script):
if super().onShowingChanged(event):
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"
debug.printMessage(debug.LEVEL_INFO, msg, True)
default.Script.onShowingChanged(self, event)