Author: hbelusca
Date: Mon Jan 11 20:52:44 2016
New Revision: 70577
URL:
http://svn.reactos.org/svn/reactos?rev=70577&view=rev
Log:
[DESK.CPL]
Resolution selection improvement patch by Mark Jansen:
- Fix a bug that allowed only a subset of resolutions to be visible.
- Update the preview on the fly when dragging the resolution slider.
- Fix a bug that prevented the monitor preview from properly invalidating the preview,
leaving the old preview partially visible.
Needs to be included in 0.4 branch.
CORE-10786
Modified:
trunk/reactos/dll/cpl/desk/monslctl.c
trunk/reactos/dll/cpl/desk/settings.c
Modified: trunk/reactos/dll/cpl/desk/monslctl.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/monslctl.c?re…
==============================================================================
--- trunk/reactos/dll/cpl/desk/monslctl.c [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/desk/monslctl.c [iso-8859-1] Mon Jan 11 20:52:44 2016
@@ -39,6 +39,7 @@
PMONSL_MON Monitors;
RECT rcExtent;
RECT rcMonitors;
+ RECT rcOldMonitors;
POINT ScrollPos;
SIZE Margin;
SIZE SelectionFrame;
@@ -261,6 +262,14 @@
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 @@
ScaleRectSizeFit(&rcExtSurface,
&rcExtDisplay);
+ infoPtr->rcOldMonitors = infoPtr->rcMonitors;
infoPtr->rcMonitors = rcExtDisplay;
/* Now that we know in which area all monitors are located,
Modified: trunk/reactos/dll/cpl/desk/settings.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/settings.c?re…
==============================================================================
--- trunk/reactos/dll/cpl/desk/settings.c [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/desk/settings.c [iso-8859-1] Mon Jan 11 20:52:44 2016
@@ -26,6 +26,8 @@
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 @@
}
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 @@
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 @@
{
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;