--- subsystems/win32/win32k/ntuser/monitor.c.old 2010-11-05 19:37:28.546875000 +0100 +++ subsystems/win32/win32k/ntuser/monitor.c 2010-11-05 19:45:30.125000000 +0100 @@ -246,6 +246,51 @@ return STATUS_SUCCESS; } +/* IntResetMonitorSize + * + * Reset size of the monitor using atached device + * + * Arguments + * + * PMONITOR + * pGdiDevice Pointer to the PDEVOBJ, which size has changed + * + * Return value + * Returns a NTSTATUS + */ +NTSTATUS +IntResetMonitorSize(IN PDEVOBJ *pGdiDevice) +{ + PMONITOR Monitor; + + for (Monitor = gMonitorList; Monitor != NULL; Monitor = Monitor->Next) + { + if (Monitor->GdiDevice == pGdiDevice) + break; + } + + if (Monitor == NULL) + { + /* no monitor for given device found */ + return STATUS_INVALID_PARAMETER; + } + + Monitor->rcMonitor.left = 0; + Monitor->rcMonitor.top = 0; + Monitor->rcMonitor.right = Monitor->rcMonitor.left + Monitor->GdiDevice->gdiinfo.ulHorzRes; + Monitor->rcMonitor.bottom = Monitor->rcMonitor.top + Monitor->GdiDevice->gdiinfo.ulVertRes; + Monitor->rcWork = Monitor->rcMonitor; + + if (Monitor->hrgnMonitor) + REGION_FreeRgnByHandle(Monitor->hrgnMonitor); + + Monitor->hrgnMonitor = IntSysCreateRectRgnIndirect( &Monitor->rcMonitor ); + + IntGdiSetRegionOwner(Monitor->hrgnMonitor, GDI_OBJ_HMGR_PUBLIC); + + return STATUS_SUCCESS; +} + /* IntGetPrimaryMonitor * * Returns a PMONITOR for the primary monitor Index: subsystems/win32/win32k/ntuser/display.c =================================================================== --- subsystems/win32/win32k/ntuser/display.c.old 2010-11-05 19:38:01.609375000 +0100 +++ subsystems\win32\win32k\ntuser\display.c 2010-11-05 19:47:13.468750000 +0100 @@ -764,6 +764,9 @@ //IntvGetDeviceCaps(&PrimarySurface, &GdiHandleTable->DevCaps); + /* Set new size of the monitor */ + IntResetMonitorSize(ppdev); + /* Remove all cursor clipping */ UserClipCursor(NULL); Index: subsystems/win32/win32k/include/monitor.h =================================================================== --- subsystems/win32/win32k/include/monitor.h.old 2010-11-05 19:38:12.906250000 +0100 +++ subsystems/win32/win32k/include/monitor.h 2010-11-05 18:46:53.375000000 +0100 @@ -40,6 +40,7 @@ NTSTATUS IntAttachMonitor(PDEVOBJ *pGdiDevice, ULONG DisplayNumber); NTSTATUS IntDetachMonitor(PDEVOBJ *pGdiDevice); +NTSTATUS IntResetMonitorSize(IN PDEVOBJ *pGdiDevice); PMONITOR FASTCALL UserGetMonitorObject(IN HMONITOR); PMONITOR FASTCALL IntGetPrimaryMonitor(VOID);