зеркало из https://github.com/mozilla/pjs.git
Bug 583341 - "Lose" focus if MeeGoTouch VKB is closed by the user. r=romaxa a=npodb
--HG-- extra : rebase_source : 2aed309de5a47f3c0572cfae2c595b8e46e9ac35
This commit is contained in:
Родитель
d1af3c0112
Коммит
6d57316a23
|
@ -3137,15 +3137,18 @@ XRE_main(int argc, char* argv[], const nsXREAppData* aAppData)
|
||||||
QScopedPointer<QApplication> app(new QApplication(gArgc, gArgv));
|
QScopedPointer<QApplication> app(new QApplication(gArgc, gArgv));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// try to get the MInputContext if possible to support the MeeGo VKB
|
#if MOZ_PLATFORM_MAEMO > 5
|
||||||
QInputContext *inputContext = app->inputContext();
|
if (XRE_GetProcessType() == GeckoProcessType_Default) {
|
||||||
if (inputContext && inputContext->identifierName() != "MInputContext") {
|
// try to get the MInputContext if possible to support the MeeGo VKB
|
||||||
QInputContext* context = QInputContextFactory::create("MInputContext",
|
QInputContext* inputContext = app->inputContext();
|
||||||
app.data());
|
if (inputContext && inputContext->identifierName() != "MInputContext") {
|
||||||
if (context)
|
QInputContext* context = QInputContextFactory::create("MInputContext",
|
||||||
app->setInputContext(context);
|
app.data());
|
||||||
|
if (context)
|
||||||
|
app->setInputContext(context);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
QStringList nonQtArguments = app->arguments();
|
QStringList nonQtArguments = app->arguments();
|
||||||
gQtOnlyArgc = 1;
|
gQtOnlyArgc = 1;
|
||||||
gQtOnlyArgv = (char**) malloc(sizeof(char*)
|
gQtOnlyArgv = (char**) malloc(sizeof(char*)
|
||||||
|
|
|
@ -106,6 +106,12 @@
|
||||||
|
|
||||||
#include "nsIDOMSimpleGestureEvent.h" //Gesture support
|
#include "nsIDOMSimpleGestureEvent.h" //Gesture support
|
||||||
|
|
||||||
|
#if MOZ_PLATFORM_MAEMO > 5
|
||||||
|
#include "nsIDOMWindow.h"
|
||||||
|
#include "nsIDOMElement.h"
|
||||||
|
#include "nsIFocusManager.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef MOZ_X11
|
#ifdef MOZ_X11
|
||||||
#include "keysym2ucs.h"
|
#include "keysym2ucs.h"
|
||||||
#endif //MOZ_X11
|
#endif //MOZ_X11
|
||||||
|
@ -1284,6 +1290,22 @@ nsWindow::OnFocusOutEvent(QEvent *aEvent)
|
||||||
if (!mWidget)
|
if (!mWidget)
|
||||||
return nsEventStatus_eIgnore;
|
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();
|
DispatchDeactivateEventOnTopLevelWindow();
|
||||||
|
|
||||||
LOGFOCUS(("Done with container focus out [%p]\n", (void *)this));
|
LOGFOCUS(("Done with container focus out [%p]\n", (void *)this));
|
||||||
|
|
Загрузка…
Ссылка в новой задаче