mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 07:42:04 +00:00
Bug 352093. Part 4: IME code should use GetRootWidget so it works with documents that don't have their own widgets. r=masayuki
This commit is contained in:
parent
469425a1ed
commit
f14e143e57
@ -222,7 +222,7 @@ nsIMEStateManager::GetWidget(nsPresContext* aPresContext)
|
||||
if (!vm)
|
||||
return nsnull;
|
||||
nsCOMPtr<nsIWidget> widget = nsnull;
|
||||
nsresult rv = vm->GetWidget(getter_AddRefs(widget));
|
||||
nsresult rv = vm->GetRootWidget(getter_AddRefs(widget));
|
||||
NS_ENSURE_SUCCESS(rv, nsnull);
|
||||
return widget;
|
||||
}
|
||||
@ -497,7 +497,7 @@ nsIMEStateManager::OnTextStateFocus(nsPresContext* aPresContext,
|
||||
NS_ENSURE_TRUE(vm, NS_ERROR_NOT_AVAILABLE);
|
||||
|
||||
nsCOMPtr<nsIWidget> widget;
|
||||
nsresult rv = vm->GetWidget(getter_AddRefs(widget));
|
||||
nsresult rv = vm->GetRootWidget(getter_AddRefs(widget));
|
||||
NS_ENSURE_SUCCESS(rv, NS_ERROR_NOT_AVAILABLE);
|
||||
|
||||
rv = widget->OnIMEFocusChange(PR_TRUE);
|
||||
|
@ -5973,6 +5973,7 @@ PresShell::HandleEvent(nsIView *aView,
|
||||
// key and IME events must be targeted at the presshell for the focused frame
|
||||
if (!sDontRetargetEvents &&
|
||||
(NS_IS_KEY_EVENT(aEvent) || NS_IS_IME_EVENT(aEvent) ||
|
||||
NS_IS_QUERY_CONTENT_EVENT(aEvent) || NS_IS_SELECTION_EVENT(aEvent) ||
|
||||
NS_IS_CONTEXT_MENU_KEY(aEvent))) {
|
||||
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
|
||||
if (!fm)
|
||||
|
@ -2669,7 +2669,7 @@ TestApp::TestNotification(void)
|
||||
if (NS_SUCCEEDED(nsr) && presShell) {
|
||||
nsCOMPtr<nsIViewManager> viewManager = presShell->GetViewManager();
|
||||
if (viewManager) {
|
||||
nsr = viewManager->GetWidget(getter_AddRefs(widget));
|
||||
nsr = viewManager->GetRootWidget(getter_AddRefs(widget));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2736,7 +2736,7 @@ TestApp::TestContentEvents(void)
|
||||
if (NS_SUCCEEDED(nsr) && presShell) {
|
||||
nsCOMPtr<nsIViewManager> viewManager = presShell->GetViewManager();
|
||||
if (viewManager) {
|
||||
nsr = viewManager->GetWidget(getter_AddRefs(widget));
|
||||
nsr = viewManager->GetRootWidget(getter_AddRefs(widget));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user