Reset monitor size after mode switch. patch by rafalh <rafalh1992 at o2 dor pl>

See issue #5727 for more details.

svn path=/trunk/; revision=50370
This commit is contained in:
Timo Kreuzer
2011-01-12 14:02:54 +00:00
parent 2aa0f3b839
commit ab4a29a81b
3 changed files with 49 additions and 0 deletions
@@ -40,6 +40,7 @@ NTSTATUS CleanupMonitorImpl();
NTSTATUS IntAttachMonitor(PDEVOBJ *pGdiDevice, ULONG DisplayNumber);
NTSTATUS IntDetachMonitor(PDEVOBJ *pGdiDevice);
NTSTATUS IntResetMonitorSize(IN PDEVOBJ *pGdiDevice);
PMONITOR FASTCALL UserGetMonitorObject(IN HMONITOR);
PMONITOR FASTCALL IntGetPrimaryMonitor(VOID);
@@ -765,6 +765,9 @@ UserChangeDisplaySettings(
//IntvGetDeviceCaps(&PrimarySurface, &GdiHandleTable->DevCaps);
/* Set new size of the monitor */
IntResetMonitorSize(ppdev);
/* Remove all cursor clipping */
UserClipCursor(NULL);
@@ -246,6 +246,51 @@ IntDetachMonitor(IN PDEVOBJ *pGdiDevice)
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