Bug 725458 - Dispatch touch events notification, even if window isn't focused. r=felipe,smaug

This commit is contained in:
Wes Johnston 2012-02-27 13:23:06 -08:00
parent 69cec67b1d
commit f236dbc153

View File

@ -7667,19 +7667,8 @@ void nsGlobalWindow::MaybeUpdateTouchState()
if(this == focusedWindow) {
UpdateTouchState();
}
}
void nsGlobalWindow::UpdateTouchState()
{
FORWARD_TO_INNER_VOID(UpdateTouchState, ());
nsCOMPtr<nsIWidget> mainWidget = GetMainWidget();
if (!mainWidget)
return;
if (mMayHaveTouchEventListener) {
mainWidget->RegisterTouchWindow();
nsCOMPtr<nsIObserverService> observerService =
do_GetService(NS_OBSERVERSERVICE_CONTRACTID);
@ -7688,6 +7677,20 @@ void nsGlobalWindow::UpdateTouchState()
DOM_TOUCH_LISTENER_ADDED,
nsnull);
}
}
}
void nsGlobalWindow::UpdateTouchState()
{
FORWARD_TO_INNER_VOID(UpdateTouchState, ());
nsCOMPtr<nsIWidget> mainWidget = GetMainWidget();
if (!mainWidget) {
return;
}
if (mMayHaveTouchEventListener) {
mainWidget->RegisterTouchWindow();
} else {
mainWidget->UnregisterTouchWindow();
}