Author: fireball
Date: Wed Jan 19 17:17:58 2011
New Revision: 50439
URL:
http://svn.reactos.org/svn/reactos?rev=50439&view=rev
Log:
- Globally save monitor working area per monitor, fix incorrectly storing it in the
kernelmode. Patch by Drazic.
- Required two lines modification of Wine's user32, not a big problem for later
syncing.
See issue #5523 for more details.
Modified:
branches/arwinss/reactos/dll/win32/user32/sysparams.c
branches/arwinss/reactos/include/reactos/wine/rosuser.h
branches/arwinss/reactos/subsystems/win32/win32k/main/monitor.c
branches/arwinss/reactos/subsystems/win32/win32k/w32ksvc.db
Modified: branches/arwinss/reactos/dll/win32/user32/sysparams.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/user3…
==============================================================================
--- branches/arwinss/reactos/dll/win32/user32/sysparams.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/user32/sysparams.c [iso-8859-1] Wed Jan 19 17:17:58
2011
@@ -39,6 +39,7 @@
#include "controls.h"
#include "user_private.h"
+#include "rosuser.h"
#include "wine/unicode.h"
#include "wine/debug.h"
@@ -1731,6 +1732,7 @@
spi_idx = SPI_SETWORKAREA_IDX;
CopyRect( &work_area, pvParam );
+ RosUserSetMonitorInfo( NULL, &work_area );
spi_loaded[spi_idx] = TRUE;
break;
}
Modified: branches/arwinss/reactos/include/reactos/wine/rosuser.h
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/include/reactos…
==============================================================================
--- branches/arwinss/reactos/include/reactos/wine/rosuser.h [iso-8859-1] (original)
+++ branches/arwinss/reactos/include/reactos/wine/rosuser.h [iso-8859-1] Wed Jan 19
17:17:58 2011
@@ -168,6 +168,10 @@
APIENTRY
RosUserGetAsyncKeyboardState(BYTE key_state_table[]);
+VOID
+APIENTRY
+RosUserSetMonitorInfo(HMONITOR hMonitor, LPCRECT rcWorkArea);
+
BOOL NTAPI
RosUserRegisterShellHookWindow(HWND hWnd);
Modified: branches/arwinss/reactos/subsystems/win32/win32k/main/monitor.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
==============================================================================
--- branches/arwinss/reactos/subsystems/win32/win32k/main/monitor.c [iso-8859-1]
(original)
+++ branches/arwinss/reactos/subsystems/win32/win32k/main/monitor.c [iso-8859-1] Wed Jan
19 17:17:58 2011
@@ -150,6 +150,15 @@
}
Monitor->GdiDevice = pGdiDevice;
+
+ /* Set monitor rects */
+ Monitor->rcMonitor.left = 0; /* FIXME: get origin */
+ Monitor->rcMonitor.top = 0; /* FIXME: get origin */
+ 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 (gMonitorList == NULL)
{
DPRINT("Primary monitor is beeing attached\n");
@@ -279,10 +288,10 @@
for (Monitor = gMonitorList; Monitor != NULL; Monitor = Monitor->Next)
{
safeHMonitorList[i] = Monitor->Handle;
- safeRectList[i].left = 0; /* FIXME: get origin */
- safeRectList[i].top = 0; /* FIXME: get origin */
- safeRectList[i].right = safeRectList->left +
Monitor->GdiDevice->gdiinfo.ulHorzRes;
- safeRectList[i].bottom = safeRectList->top +
Monitor->GdiDevice->gdiinfo.ulVertRes;
+ safeRectList[i].left = Monitor->rcMonitor.left;
+ safeRectList[i].top = Monitor->rcMonitor.top;
+ safeRectList[i].right = Monitor->rcMonitor.right;
+ safeRectList[i].bottom = Monitor->rcMonitor.bottom;
i++;
}
@@ -407,11 +416,9 @@
}
/* fill monitor info */
- MonitorInfo.rcMonitor.left = 0; /* FIXME: get origin */
- MonitorInfo.rcMonitor.top = 0; /* FIXME: get origin */
- MonitorInfo.rcMonitor.right = MonitorInfo.rcMonitor.left +
Monitor->GdiDevice->gdiinfo.ulHorzRes;
- MonitorInfo.rcMonitor.bottom = MonitorInfo.rcMonitor.top +
Monitor->GdiDevice->gdiinfo.ulVertRes;
- MonitorInfo.rcWork = MonitorInfo.rcMonitor; /* FIXME: use DEVMODE panning to calculate
work area? */
+ MonitorInfo.rcMonitor = Monitor->rcMonitor;
+ MonitorInfo.rcWork = Monitor->rcWork; /* FIXME: use DEVMODE panning to calculate
work area? */
+
MonitorInfo.dwFlags = 0;
if (Monitor->IsPrimary)
@@ -452,6 +459,43 @@
DPRINT("GetMonitorInfo: success\n");
return TRUE;
-
-
-}
+}
+
+VOID
+APIENTRY
+RosUserSetMonitorInfo(
+ IN HMONITOR hMonitor,
+ LPCRECT rcWorkArea)
+{
+ PMONITOR Monitor;
+
+ DPRINT("Enter RosUserSetMonitorInfo\n");
+
+ /* get monitor object */
+ if (hMonitor)
+ {
+ if (!(Monitor = UserGetMonitorObject(hMonitor)))
+ {
+ DPRINT1("Couldnt find monitor 0x%lx\n", hMonitor);
+ return;
+ }
+ }
+ else
+ {
+ /* Use a primary one if it exists */
+ if (!gMonitorList) return;
+ Monitor = gMonitorList;
+ }
+
+ /* Update monitor info */
+ _SEH2_TRY
+ {
+ Monitor->rcWork = *rcWorkArea;
+ }
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+ {
+ /* Ignore the exception */
+ }
+ _SEH2_END;
+}
+
Modified: branches/arwinss/reactos/subsystems/win32/win32k/w32ksvc.db
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/subsystems/win3…
==============================================================================
--- branches/arwinss/reactos/subsystems/win32/win32k/w32ksvc.db [iso-8859-1] (original)
+++ branches/arwinss/reactos/subsystems/win32/win32k/w32ksvc.db [iso-8859-1] Wed Jan 19
17:17:58 2011
@@ -81,6 +81,7 @@
RosUserToUnicodeEx 7
RosUserMapVirtualKeyEx 4
RosUserGetAsyncKeyState 1
+RosUserSetMonitorInfo 2
RosUserRegisterShellHookWindow 1
RosUserDeRegisterShellHookWindow 1
RosUserBuildShellHookHwndList 2