mirror of
https://github.com/reactos/reactos.git
synced 2025-07-30 09:52:14 +00:00
[NtUser]
- Broadcast the appropriate messages to notify a change in display parameters and color. This should fix rollback issues from setting display modes. See CORE-12571 and CORE-13212. svn path=/trunk/; revision=75407
This commit is contained in:
parent
27783c2956
commit
09ab5ea7ed
2 changed files with 40 additions and 16 deletions
|
@ -697,6 +697,7 @@ UserChangeDisplaySettings(
|
||||||
HKEY hkey;
|
HKEY hkey;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
PPDEVOBJ ppdev;
|
PPDEVOBJ ppdev;
|
||||||
|
WORD OrigBC;
|
||||||
//PDESKTOP pdesk;
|
//PDESKTOP pdesk;
|
||||||
|
|
||||||
/* If no DEVMODE is given, use registry settings */
|
/* If no DEVMODE is given, use registry settings */
|
||||||
|
@ -715,6 +716,9 @@ UserChangeDisplaySettings(
|
||||||
else
|
else
|
||||||
dm = *pdm;
|
dm = *pdm;
|
||||||
|
|
||||||
|
/* Save original bit count */
|
||||||
|
OrigBC = gpsi->BitCount;
|
||||||
|
|
||||||
/* Check params */
|
/* Check params */
|
||||||
if ((dm.dmFields & (DM_PELSWIDTH | DM_PELSHEIGHT)) != (DM_PELSWIDTH | DM_PELSHEIGHT))
|
if ((dm.dmFields & (DM_PELSWIDTH | DM_PELSHEIGHT)) != (DM_PELSWIDTH | DM_PELSHEIGHT))
|
||||||
{
|
{
|
||||||
|
@ -775,18 +779,12 @@ UserChangeDisplaySettings(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check if DEVMODE matches the current mode */
|
|
||||||
if (pdm == ppdev->pdmwDev && !(flags & CDS_RESET))
|
|
||||||
{
|
|
||||||
ERR("DEVMODE matches, nothing to do\n");
|
|
||||||
goto leave;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Shall we apply the settings? */
|
/* Shall we apply the settings? */
|
||||||
if (!(flags & CDS_NORESET))
|
if (!(flags & CDS_NORESET))
|
||||||
{
|
{
|
||||||
ULONG ulResult;
|
ULONG ulResult;
|
||||||
PVOID pvOldCursor;
|
PVOID pvOldCursor;
|
||||||
|
TEXTMETRICW tmw;
|
||||||
|
|
||||||
/* Remove mouse pointer */
|
/* Remove mouse pointer */
|
||||||
pvOldCursor = UserSetCursor(NULL, TRUE);
|
pvOldCursor = UserSetCursor(NULL, TRUE);
|
||||||
|
@ -813,11 +811,24 @@ UserChangeDisplaySettings(
|
||||||
/* Update the system metrics */
|
/* Update the system metrics */
|
||||||
InitMetrics();
|
InitMetrics();
|
||||||
|
|
||||||
//IntvGetDeviceCaps(&PrimarySurface, &GdiHandleTable->DevCaps);
|
|
||||||
|
|
||||||
/* Set new size of the monitor */
|
/* Set new size of the monitor */
|
||||||
UserUpdateMonitorSize((HDEV)ppdev);
|
UserUpdateMonitorSize((HDEV)ppdev);
|
||||||
|
|
||||||
|
/* Update the SERVERINFO */
|
||||||
|
gpsi->dmLogPixels = ppdev->gdiinfo.ulLogPixelsY;
|
||||||
|
gpsi->Planes = ppdev->gdiinfo.cPlanes;
|
||||||
|
gpsi->BitsPixel = ppdev->gdiinfo.cBitsPixel;
|
||||||
|
gpsi->BitCount = gpsi->Planes * gpsi->BitsPixel;
|
||||||
|
if (ppdev->gdiinfo.flRaster & RC_PALETTE)
|
||||||
|
{
|
||||||
|
gpsi->PUSIFlags |= PUSIF_PALETTEDISPLAY;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
gpsi->PUSIFlags &= ~PUSIF_PALETTEDISPLAY;
|
||||||
|
// Font is realized and this dc was previously set to internal DC_ATTR.
|
||||||
|
gpsi->cxSysFontChar = IntGetCharDimensions(hSystemBM, &tmw, (DWORD*)&gpsi->cySysFontChar);
|
||||||
|
gpsi->tmSysFont = tmw;
|
||||||
|
|
||||||
/* Remove all cursor clipping */
|
/* Remove all cursor clipping */
|
||||||
UserClipCursor(NULL);
|
UserClipCursor(NULL);
|
||||||
|
|
||||||
|
@ -825,13 +836,21 @@ UserChangeDisplaySettings(
|
||||||
//IntHideDesktop(pdesk);
|
//IntHideDesktop(pdesk);
|
||||||
|
|
||||||
/* Send WM_DISPLAYCHANGE to all toplevel windows */
|
/* Send WM_DISPLAYCHANGE to all toplevel windows */
|
||||||
co_IntSendMessageTimeout(HWND_BROADCAST,
|
UserSendNotifyMessage( HWND_BROADCAST,
|
||||||
WM_DISPLAYCHANGE,
|
WM_DISPLAYCHANGE,
|
||||||
(WPARAM)ppdev->gdiinfo.cBitsPixel,
|
gpsi->BitCount,
|
||||||
(LPARAM)(ppdev->gdiinfo.ulHorzRes + (ppdev->gdiinfo.ulVertRes << 16)),
|
MAKELONG(gpsi->aiSysMet[SM_CXSCREEN], gpsi->aiSysMet[SM_CYSCREEN]) );
|
||||||
SMTO_NORMAL,
|
|
||||||
100,
|
ERR("BitCount New %d Orig %d ChkNew %d\n",gpsi->BitCount,OrigBC,ppdev->gdiinfo.cBitsPixel);
|
||||||
&ulResult);
|
|
||||||
|
/* Not full screen and different bit count, send messages */
|
||||||
|
if (!(flags & CDS_FULLSCREEN) &&
|
||||||
|
gpsi->BitCount != OrigBC )
|
||||||
|
{
|
||||||
|
ERR("Detect settings changed.\n");
|
||||||
|
UserSendNotifyMessage( HWND_BROADCAST, WM_SETTINGCHANGE, 0, 0 );
|
||||||
|
UserSendNotifyMessage( HWND_BROADCAST, WM_SYSCOLORCHANGE, 0, 0 );
|
||||||
|
}
|
||||||
|
|
||||||
//co_IntShowDesktop(pdesk, ppdev->gdiinfo.ulHorzRes, ppdev->gdiinfo.ulVertRes);
|
//co_IntShowDesktop(pdesk, ppdev->gdiinfo.ulHorzRes, ppdev->gdiinfo.ulVertRes);
|
||||||
|
|
||||||
|
|
|
@ -266,6 +266,11 @@ UserUpdateMonitorSize(IN HDEV hDev)
|
||||||
if (pMonitor->hrgnMonitor)
|
if (pMonitor->hrgnMonitor)
|
||||||
IntGdiSetRegionOwner(pMonitor->hrgnMonitor, GDI_OBJ_HMGR_PUBLIC);
|
IntGdiSetRegionOwner(pMonitor->hrgnMonitor, GDI_OBJ_HMGR_PUBLIC);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Should be Virtual accumulation of all the available monitors.
|
||||||
|
//
|
||||||
|
gpsi->rcScreenReal = pMonitor->rcMonitor;
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue