Bug 583341 - "Lose" focus if MeeGoTouch VKB is closed by the user. r=romaxa a=npodb
This commit is contained in:
@@ -106,6 +106,12 @@
|
||||
|
||||
#include "nsIDOMSimpleGestureEvent.h" //Gesture support
|
||||
|
||||
#if MOZ_PLATFORM_MAEMO > 5
|
||||
#include "nsIDOMWindow.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIFocusManager.h"
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_X11
|
||||
#include "keysym2ucs.h"
|
||||
#endif //MOZ_X11
|
||||
@@ -1284,6 +1290,22 @@ nsWindow::OnFocusOutEvent(QEvent *aEvent)
|
||||
if (!mWidget)
|
||||
return nsEventStatus_eIgnore;
|
||||
|
||||
#ifdef MOZ_PLATFORM_MAEMO > 5
|
||||
if (((QFocusEvent*)aEvent)->reason() == Qt::OtherFocusReason
|
||||
&& mWidget->isVKBOpen()) {
|
||||
// We assume that the VKB was open in this case, because of the focus
|
||||
// reason and clear the focus in the active window.
|
||||
nsCOMPtr<nsIFocusManager> fm = do_GetService("@mozilla.org/focus-manager;1");
|
||||
if (fm) {
|
||||
nsCOMPtr<nsIDOMWindow> domWindow;
|
||||
fm->GetActiveWindow(getter_AddRefs(domWindow));
|
||||
fm->ClearFocus(domWindow);
|
||||
}
|
||||
|
||||
return nsEventStatus_eIgnore;
|
||||
}
|
||||
#endif
|
||||
|
||||
DispatchDeactivateEventOnTopLevelWindow();
|
||||
|
||||
LOGFOCUS(("Done with container focus out [%p]\n", (void *)this));
|
||||
|
||||
Reference in New Issue
Block a user