зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1767558 Make `IMContextWrapper::EnsureToCacheContentSelection` try to query with owner widget if there is no last focused widget r=m_kato
It tries to query selection with last focused widget. However, if no widget has gotten focused yet, it causes the warning. I think that in such case, it should try it with owner widget which is typically managed by same `PresShell` in these days. Differential Revision: https://phabricator.services.mozilla.com/D145396
This commit is contained in:
Родитель
5e6b541ce8
Коммит
ab4c034d48
|
@ -3250,7 +3250,9 @@ bool IMContextWrapper::EnsureToCacheContentSelection(
|
|||
return true;
|
||||
}
|
||||
|
||||
if (NS_WARN_IF(!mLastFocusedWindow)) {
|
||||
RefPtr<nsWindow> dispatcherWindow =
|
||||
mLastFocusedWindow ? mLastFocusedWindow : mOwnerWindow;
|
||||
if (NS_WARN_IF(!dispatcherWindow)) {
|
||||
MOZ_LOG(gIMELog, LogLevel::Error,
|
||||
("0x%p EnsureToCacheContentSelection(), FAILED, due to "
|
||||
"no focused window",
|
||||
|
@ -3260,9 +3262,9 @@ bool IMContextWrapper::EnsureToCacheContentSelection(
|
|||
|
||||
nsEventStatus status;
|
||||
WidgetQueryContentEvent querySelectedTextEvent(true, eQuerySelectedText,
|
||||
mLastFocusedWindow);
|
||||
dispatcherWindow);
|
||||
InitEvent(querySelectedTextEvent);
|
||||
mLastFocusedWindow->DispatchEvent(&querySelectedTextEvent, status);
|
||||
dispatcherWindow->DispatchEvent(&querySelectedTextEvent, status);
|
||||
if (NS_WARN_IF(querySelectedTextEvent.Failed())) {
|
||||
MOZ_LOG(gIMELog, LogLevel::Error,
|
||||
("0x%p EnsureToCacheContentSelection(), FAILED, due to "
|
||||
|
|
Загрузка…
Ссылка в новой задаче