Author: tkreuzer
Date: Wed Jan 12 14:02:54 2011
New Revision: 50370
URL:
http://svn.reactos.org/svn/reactos?rev=50370&view=rev
Log:
[WIN32K]
Reset monitor size after mode switch. patch by rafalh <rafalh1992 at o2 dor pl>
See issue #5727 for more details.
Modified:
trunk/reactos/subsystems/win32/win32k/include/monitor.h
trunk/reactos/subsystems/win32/win32k/ntuser/display.c
trunk/reactos/subsystems/win32/win32k/ntuser/monitor.c
Modified: trunk/reactos/subsystems/win32/win32k/include/monitor.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/monitor.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/include/monitor.h [iso-8859-1] Wed Jan 12
14:02:54 2011
@@ -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);
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/display.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/display.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/display.c [iso-8859-1] Wed Jan 12
14:02:54 2011
@@ -765,6 +765,9 @@
//IntvGetDeviceCaps(&PrimarySurface, &GdiHandleTable->DevCaps);
+ /* Set new size of the monitor */
+ IntResetMonitorSize(ppdev);
+
/* Remove all cursor clipping */
UserClipCursor(NULL);
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/monitor.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/monitor.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/monitor.c [iso-8859-1] Wed Jan 12
14:02:54 2011
@@ -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