Author: gadamopoulos
Date: Wed May 19 13:50:21 2010
New Revision: 47275
URL:
http://svn.reactos.org/svn/reactos?rev=47275&view=rev
Log:
[win32k]
-Store the monitor work area in the monitor and not in the desktop
Modified:
trunk/reactos/subsystems/win32/win32k/include/desktop.h
trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c
trunk/reactos/subsystems/win32/win32k/ntuser/monitor.c
trunk/reactos/subsystems/win32/win32k/ntuser/sysparams.c
trunk/reactos/subsystems/win32/win32k/ntuser/window.c
trunk/reactos/subsystems/win32/win32k/ntuser/winpos.c
Modified: trunk/reactos/subsystems/win32/win32k/include/desktop.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/desktop.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/include/desktop.h [iso-8859-1] Wed May 19
13:50:21 2010
@@ -24,8 +24,6 @@
DWORD dwMouseHoverTime;
/* ReactOS */
- /* Rectangle of the work area */
- RECTL WorkArea;
/* Pointer to the active queue. */
PVOID ActiveMessageQueue;
/* Handle of the desktop window. */
@@ -69,9 +67,6 @@
VOID APIENTRY
IntDesktopObjectDelete(PWIN32_DELETEMETHOD_PARAMETERS Parameters);
-VOID FASTCALL
-IntGetDesktopWorkArea(PDESKTOP Desktop, RECTL *Rect);
-
LRESULT CALLBACK
IntDesktopWindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c [iso-8859-1] Wed May 19
13:50:21 2010
@@ -419,35 +419,6 @@
return Status;
}
-VOID FASTCALL
-IntGetDesktopWorkArea(PDESKTOP Desktop, RECTL *Rect)
-{
- RECTL *Ret;
-
- ASSERT(Desktop);
-
- Ret = &Desktop->WorkArea;
- if((Ret->right == -1) && ScreenDeviceContext)
- {
- PDC dc;
- SURFACE *psurf;
- dc = DC_LockDc(ScreenDeviceContext);
- /* FIXME - Handle dc == NULL!!!! */
- psurf = dc->dclevel.pSurface;
- if (psurf)
- {
- Ret->right = psurf->SurfObj.sizlBitmap.cx;
- Ret->bottom = psurf->SurfObj.sizlBitmap.cy;
- }
- DC_UnlockDc(dc);
- }
-
- if(Rect)
- {
- *Rect = *Ret;
- }
-}
-
PDESKTOP FASTCALL
IntGetActiveDesktop(VOID)
{
@@ -1051,13 +1022,6 @@
RtlCopyMemory(DesktopObject->pDeskInfo->szDesktopName,
lpszDesktopName->Buffer,
lpszDesktopName->Length);
-
- // init desktop area
- DesktopObject->WorkArea.left = 0;
- DesktopObject->WorkArea.top = 0;
- DesktopObject->WorkArea.right = -1;
- DesktopObject->WorkArea.bottom = -1;
- IntGetDesktopWorkArea(DesktopObject, NULL);
/* Initialize some local (to win32k) desktop state. */
InitializeListHead(&DesktopObject->PtiList);
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 May 19
13:50:21 2010
@@ -344,10 +344,7 @@
RECTL MonitorRect, IntersectionRect;
ExEnterCriticalRegionAndAcquireFastMutexUnsafe(&Monitor->Lock);
- MonitorRect.left = 0; /* FIXME: get origin */
- MonitorRect.top = 0; /* FIXME: get origin */
- MonitorRect.right = MonitorRect.left +
Monitor->GdiDevice->gdiinfo.ulHorzRes;
- MonitorRect.bottom = MonitorRect.top +
Monitor->GdiDevice->gdiinfo.ulVertRes;
+ MonitorRect = Monitor->rcMonitor;
ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(&Monitor->Lock);
DPRINT("MonitorRect: left = %d, top = %d, right = %d, bottom = %d\n",
@@ -677,11 +674,8 @@
}
/* 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;
MonitorInfo.dwFlags = 0;
if (Monitor->IsPrimary)
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/sysparams.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/sysparams.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/sysparams.c [iso-8859-1] Wed May 19
13:50:21 2010
@@ -895,26 +895,24 @@
}
return (UINT_PTR)KEY_METRIC;
- case SPI_GETWORKAREA: // FIXME: the workarea should be part of the MONITOR
+ case SPI_GETWORKAREA:
{
- PTHREADINFO pti = PsGetCurrentThreadWin32Thread();
- PDESKTOP pdesktop = pti->rpdesk;
- RECTL rclWorkarea;
-
- if(!pdesktop)
- return 0;
-
- IntGetDesktopWorkArea(pdesktop, &rclWorkarea);
- return SpiGet(pvParam, &rclWorkarea, sizeof(RECTL), fl);
+ PMONITOR pmonitor = IntGetPrimaryMonitor();
+
+ if(!pmonitor)
+ return 0;
+
+ return SpiGet(pvParam, &pmonitor->rcWork, sizeof(RECTL), fl);
}
- case SPI_SETWORKAREA: // FIXME: the workarea should be part of the MONITOR
+ case SPI_SETWORKAREA:
{
- PTHREADINFO pti = PsGetCurrentThreadWin32Thread();
- PDESKTOP pdesktop = pti->rpdesk;
+ /*FIXME: we should set the work area of the monitor
+ that contains the specified rectangle*/
+ PMONITOR pmonitor = IntGetPrimaryMonitor();
RECT rcWorkArea;
- if(!pdesktop)
+ if(!pmonitor)
return 0;
if (!SpiSet(&rcWorkArea, pvParam, sizeof(RECTL), fl))
@@ -929,7 +927,7 @@
rcWorkArea.bottom <= rcWorkArea.top)
return 0;
- pdesktop->WorkArea = rcWorkArea;
+ pmonitor->rcWork = rcWorkArea;
if (fl & SPIF_UPDATEINIFILE)
{
// FIXME: what to do?
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/window.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] Wed May 19 13:50:21
2010
@@ -2112,7 +2112,7 @@
PRTL_USER_PROCESS_PARAMETERS ProcessParams;
BOOL CalculatedDefPosSize = FALSE;
- IntGetDesktopWorkArea(Window->pti->rpdesk, &WorkArea);
+ UserSystemParametersInfo(SPI_GETWORKAREA, 0, &WorkArea, 0);
rc = WorkArea;
ProcessParams = PsGetCurrentProcess()->Peb->ProcessParameters;
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/winpos.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/winpos.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/winpos.c [iso-8859-1] Wed May 19 13:50:21
2010
@@ -258,19 +258,17 @@
if (!Wnd->InternalPosInitialized)
{
RECTL WorkArea;
- PTHREADINFO pti = PsGetCurrentThreadWin32Thread();
- PDESKTOP Desktop = pti->rpdesk; /* Or rather get it from the window? */
Parent = Window->spwndParent;
if(Parent)
{
if(IntIsDesktopWindow(Parent))
- IntGetDesktopWorkArea(Desktop, &WorkArea);
+ UserSystemParametersInfo(SPI_GETWORKAREA, 0, &WorkArea, 0);
else
WorkArea = Parent->Wnd->rcClient;
}
else
- IntGetDesktopWorkArea(Desktop, &WorkArea);
+ UserSystemParametersInfo(SPI_GETWORKAREA, 0, &WorkArea, 0);
Wnd->InternalPos.NormalRect = Window->Wnd->rcWindow;
IntGetWindowBorderMeasures(Window, &XInc, &YInc);