зеркало из https://github.com/mozilla/gecko-dev.git
Bug 580165 - Clean up dead code related to missing screen managers in widget. r=jimm
--HG-- extra : rebase_source : e472caf15d50a835ce06ad761f72d130371d442a
This commit is contained in:
Родитель
c49879aa7a
Коммит
ac2ca00f06
|
@ -1834,42 +1834,31 @@ NS_METHOD nsWindow::ConstrainPosition(bool aAllowSlop,
|
|||
RECT screenRect;
|
||||
|
||||
nsCOMPtr<nsIScreenManager> screenmgr = do_GetService(sScreenManagerContractID);
|
||||
if (screenmgr) {
|
||||
nsCOMPtr<nsIScreen> screen;
|
||||
int32_t left, top, width, height;
|
||||
if (!screenmgr) {
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
}
|
||||
nsCOMPtr<nsIScreen> screen;
|
||||
int32_t left, top, width, height;
|
||||
|
||||
screenmgr->ScreenForRect(*aX, *aY, logWidth, logHeight,
|
||||
getter_AddRefs(screen));
|
||||
if (screen) {
|
||||
if (mSizeMode != nsSizeMode_Fullscreen) {
|
||||
// For normalized windows, use the desktop work area.
|
||||
screen->GetAvailRectDisplayPix(&left, &top, &width, &height);
|
||||
} else {
|
||||
// For full screen windows, use the desktop.
|
||||
screen->GetRectDisplayPix(&left, &top, &width, &height);
|
||||
}
|
||||
screenRect.left = left;
|
||||
screenRect.right = left + width;
|
||||
screenRect.top = top;
|
||||
screenRect.bottom = top + height;
|
||||
screenmgr->ScreenForRect(*aX, *aY, logWidth, logHeight,
|
||||
getter_AddRefs(screen));
|
||||
if (mSizeMode != nsSizeMode_Fullscreen) {
|
||||
// For normalized windows, use the desktop work area.
|
||||
nsresult rv = screen->GetAvailRectDisplayPix(&left, &top, &width, &height);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
} else {
|
||||
if (mWnd) {
|
||||
HDC dc = ::GetDC(mWnd);
|
||||
if (dc) {
|
||||
if (::GetDeviceCaps(dc, TECHNOLOGY) == DT_RASDISPLAY) {
|
||||
if (mSizeMode != nsSizeMode_Fullscreen) {
|
||||
::SystemParametersInfo(SPI_GETWORKAREA, 0, &screenRect, 0);
|
||||
} else {
|
||||
screenRect.left = screenRect.top = 0;
|
||||
screenRect.right = GetSystemMetrics(SM_CXFULLSCREEN);
|
||||
screenRect.bottom = GetSystemMetrics(SM_CYFULLSCREEN);
|
||||
}
|
||||
}
|
||||
::ReleaseDC(mWnd, dc);
|
||||
}
|
||||
// For full screen windows, use the desktop.
|
||||
nsresult rv = screen->GetRectDisplayPix(&left, &top, &width, &height);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
screenRect.left = left;
|
||||
screenRect.right = left + width;
|
||||
screenRect.top = top;
|
||||
screenRect.bottom = top + height;
|
||||
|
||||
if (aAllowSlop) {
|
||||
if (*aX < screenRect.left - logWidth + kWindowPositionSlop)
|
||||
|
|
Загрузка…
Ссылка в новой задаче