diff --git a/win32ss/user/ntuser/display.c b/win32ss/user/ntuser/display.c index 2850f41..4414be6 100644 --- a/win32ss/user/ntuser/display.c +++ b/win32ss/user/ntuser/display.c @@ -697,7 +697,6 @@ UserChangeDisplaySettings( HKEY hkey; NTSTATUS Status; PPDEVOBJ ppdev; - WORD OrigBC; //PDESKTOP pdesk; /* If no DEVMODE is given, use registry settings */ @@ -716,9 +715,6 @@ UserChangeDisplaySettings( else dm = *pdm; - /* Save original bit count */ - OrigBC = gpsi->BitCount; - /* Check params */ if ((dm.dmFields & (DM_PELSWIDTH | DM_PELSHEIGHT)) != (DM_PELSWIDTH | DM_PELSHEIGHT)) { @@ -779,12 +775,18 @@ 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? */ if (!(flags & CDS_NORESET)) { ULONG ulResult; PVOID pvOldCursor; - TEXTMETRICW tmw; /* Remove mouse pointer */ pvOldCursor = UserSetCursor(NULL, TRUE); @@ -811,24 +813,11 @@ UserChangeDisplaySettings( /* Update the system metrics */ InitMetrics(); + //IntvGetDeviceCaps(&PrimarySurface, &GdiHandleTable->DevCaps); + /* Set new size of the monitor */ 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 */ UserClipCursor(NULL); @@ -836,21 +825,13 @@ UserChangeDisplaySettings( //IntHideDesktop(pdesk); /* Send WM_DISPLAYCHANGE to all toplevel windows */ - UserSendNotifyMessage( HWND_BROADCAST, - WM_DISPLAYCHANGE, - gpsi->BitCount, - MAKELONG(gpsi->aiSysMet[SM_CXSCREEN], gpsi->aiSysMet[SM_CYSCREEN]) ); - - ERR("BitCount New %d Orig %d ChkNew %d\n",gpsi->BitCount,OrigBC,ppdev->gdiinfo.cBitsPixel); - - /* 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_IntSendMessageTimeout(HWND_BROADCAST, + WM_DISPLAYCHANGE, + (WPARAM)ppdev->gdiinfo.cBitsPixel, + (LPARAM)(ppdev->gdiinfo.ulHorzRes + (ppdev->gdiinfo.ulVertRes << 16)), + SMTO_NORMAL, + 100, + &ulResult); //co_IntShowDesktop(pdesk, ppdev->gdiinfo.ulHorzRes, ppdev->gdiinfo.ulVertRes); diff --git a/win32ss/user/ntuser/monitor.c b/win32ss/user/ntuser/monitor.c index 33650c3..2566581 100644 --- a/win32ss/user/ntuser/monitor.c +++ b/win32ss/user/ntuser/monitor.c @@ -266,11 +266,6 @@ UserUpdateMonitorSize(IN HDEV hDev) if (pMonitor->hrgnMonitor) IntGdiSetRegionOwner(pMonitor->hrgnMonitor, GDI_OBJ_HMGR_PUBLIC); - // - // Should be Virtual accumulation of all the available monitors. - // - gpsi->rcScreenReal = pMonitor->rcMonitor; - return STATUS_SUCCESS; }