Bug 927172 - Can't touch scroll when second monitor is attached r=jimm

--HG--
extra : rebase_source : 9d583bda2e6def27f5f99c74481635dd79621179
This commit is contained in:
Rodrigo Silveira 2013-10-29 21:29:07 -07:00
Родитель afb0b98b12
Коммит 336c93949d
2 изменённых файлов: 19 добавлений и 12 удалений

Просмотреть файл

@ -258,6 +258,7 @@ FrameworkView::UpdateWidgetSizeAndPosition()
NS_ASSERTION(mWindow, "SetWindow must be called before UpdateWidgetSizeAndPosition!");
NS_ASSERTION(mWidget, "SetWidget must be called before UpdateWidgetSizeAndPosition!");
UpdateBounds();
mWidget->Move(0, 0);
mWidget->Resize(0, 0, mWindowBounds.width, mWindowBounds.height, true);
mWidget->SizeModeChanged();
@ -284,21 +285,30 @@ void FrameworkView::SetDpi(float aDpi)
LogFunction();
mDPI = aDpi;
// Often a DPI change implies a window size change.
NS_ASSERTION(mWindow, "SetWindow must be called before SetDpi!");
Rect logicalBounds;
mWindow->get_Bounds(&logicalBounds);
// convert to physical (device) pixels
mWindowBounds = MetroUtils::LogToPhys(logicalBounds);
// notify the widget that dpi has changed
if (mWidget) {
mWidget->ChangedDPI();
UpdateBounds();
}
}
}
void
FrameworkView::UpdateBounds()
{
if (!mWidget)
return;
RECT winRect;
GetClientRect(mWidget->GetICoreWindowHWND(), &winRect);
mWindowBounds = nsIntRect(winRect.left,
winRect.top,
winRect.right - winRect.left,
winRect.bottom - winRect.top);
}
void
FrameworkView::SetWidget(MetroWidget* aWidget)
{
@ -307,6 +317,7 @@ FrameworkView::SetWidget(MetroWidget* aWidget)
LogFunction();
mWidget = aWidget;
mWidget->FindMetroWindow();
UpdateBounds();
}
////////////////////////////////////////////////////
@ -394,11 +405,6 @@ FrameworkView::OnWindowSizeChanged(ICoreWindow* aSender, IWindowSizeChangedEvent
return S_OK;
}
NS_ASSERTION(mWindow, "SetWindow must be called before OnWindowSizeChanged!");
Rect logicalBounds;
mWindow->get_Bounds(&logicalBounds);
mWindowBounds = MetroUtils::LogToPhys(logicalBounds);
UpdateWidgetSizeAndPosition();
return S_OK;
}

Просмотреть файл

@ -150,6 +150,7 @@ protected:
void UpdateLogicalDPI();
void FireViewStateObservers();
void ProcessLaunchArguments();
void UpdateBounds();
// Printing and preview
void CreatePrintControl(IPrintDocumentPackageTarget* aDocPackageTarget,