diff --git a/reactos/dll/cpl/desk/monslctl.c b/reactos/dll/cpl/desk/monslctl.c index d2f1eefe9d0..defa151fcf9 100644 --- a/reactos/dll/cpl/desk/monslctl.c +++ b/reactos/dll/cpl/desk/monslctl.c @@ -39,6 +39,7 @@ typedef struct _MONITORSELWND PMONSL_MON Monitors; RECT rcExtent; RECT rcMonitors; + RECT rcOldMonitors; POINT ScrollPos; SIZE Margin; SIZE SelectionFrame; @@ -261,6 +262,14 @@ MonSelRepaint(IN PMONITORSELWND infoPtr) InvalidateRect(infoPtr->hSelf, &rc, TRUE); + + if (!EqualRect(&infoPtr->rcMonitors, &infoPtr->rcOldMonitors) && + infoPtr->rcOldMonitors.right != infoPtr->rcOldMonitors.left) + { + MonSelRectToScreen(infoPtr, &infoPtr->rcOldMonitors, &rc); + InvalidateRect(infoPtr->hSelf, &rc, TRUE); + infoPtr->rcOldMonitors = infoPtr->rcMonitors; + } } static VOID @@ -355,6 +364,7 @@ MonSelUpdateMonitorsInfo(IN OUT PMONITORSELWND infoPtr, ScaleRectSizeFit(&rcExtSurface, &rcExtDisplay); + infoPtr->rcOldMonitors = infoPtr->rcMonitors; infoPtr->rcMonitors = rcExtDisplay; /* Now that we know in which area all monitors are located, diff --git a/reactos/dll/cpl/desk/settings.c b/reactos/dll/cpl/desk/settings.c index 4f7b909bbc1..62b12b4f8e8 100644 --- a/reactos/dll/cpl/desk/settings.c +++ b/reactos/dll/cpl/desk/settings.c @@ -26,6 +26,8 @@ UpdateDisplay(IN HWND hwndDlg, PDATA pData, IN BOOL bUpdateThumb) TCHAR Buffer[64]; TCHAR Pixel[64]; DWORD index; + HWND hwndMonSel; + MONSL_MONINFO info; LoadString(hApplet, IDS_PIXEL, Pixel, sizeof(Pixel) / sizeof(TCHAR)); _stprintf(Buffer, Pixel, pData->CurrentDisplayDevice->CurrentSettings->dmPelsWidth, pData->CurrentDisplayDevice->CurrentSettings->dmPelsHeight, Pixel); @@ -43,6 +45,15 @@ UpdateDisplay(IN HWND hwndDlg, PDATA pData, IN BOOL bUpdateThumb) } if (LoadString(hApplet, (2900 + pData->CurrentDisplayDevice->CurrentSettings->dmBitsPerPel), Buffer, sizeof(Buffer) / sizeof(TCHAR))) SendDlgItemMessage(hwndDlg, IDC_SETTINGS_BPP, CB_SELECTSTRING, (WPARAM)-1, (LPARAM)Buffer); + + hwndMonSel = GetDlgItem(hwndDlg, IDC_SETTINGS_MONSEL); + index = (INT)SendMessage(hwndMonSel, MSLM_GETCURSEL, 0, 0); + if (index != (DWORD)-1 && SendMessage(hwndMonSel, MSLM_GETMONITORINFO, index, (LPARAM)&info)) + { + info.Size.cx = pData->CurrentDisplayDevice->CurrentSettings->dmPelsWidth; + info.Size.cy = pData->CurrentDisplayDevice->CurrentSettings->dmPelsHeight; + SendMessage(hwndMonSel, MSLM_SETMONITORINFO, index, (LPARAM)&info); + } } static PSETTINGS_ENTRY @@ -165,8 +176,8 @@ AddDisplayDevice(IN PDATA pData, IN const DISPLAY_DEVICE *DisplayDevice) for (Current = newEntry->Settings; Current != NULL; Current = Current->Flink) { if (Current->Flink != NULL && - ((Current->dmPelsWidth != Current->Flink->dmPelsWidth) && - (Current->dmPelsHeight != Current->Flink->dmPelsHeight))) + ((Current->dmPelsWidth != Current->Flink->dmPelsWidth) || + (Current->dmPelsHeight != Current->Flink->dmPelsHeight))) { ResolutionsCount++; } @@ -182,8 +193,8 @@ AddDisplayDevice(IN PDATA pData, IN const DISPLAY_DEVICE *DisplayDevice) { if (Current->Flink == NULL || (Current->Flink != NULL && - ((Current->dmPelsWidth != Current->Flink->dmPelsWidth) && - (Current->dmPelsHeight != Current->Flink->dmPelsHeight)))) + ((Current->dmPelsWidth != Current->Flink->dmPelsWidth) || + (Current->dmPelsHeight != Current->Flink->dmPelsHeight)))) { newEntry->Resolutions[i].dmPelsWidth = Current->dmPelsWidth; newEntry->Resolutions[i].dmPelsHeight = Current->dmPelsHeight;