mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 17:25:55 +00:00
[win32k]
-Store the monitor work area in the monitor and not in the desktop svn path=/trunk/; revision=47275
This commit is contained in:
parent
0a81d8d27b
commit
1cb77963b2
6 changed files with 16 additions and 67 deletions
|
@ -24,8 +24,6 @@ typedef struct _DESKTOP
|
|||
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 @@ IntDesktopObjectParse(IN PVOID ParseObject,
|
|||
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);
|
||||
|
||||
|
|
|
@ -419,35 +419,6 @@ IntValidateDesktopHandle(
|
|||
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)
|
||||
{
|
||||
|
@ -1052,13 +1023,6 @@ NtUserCreateDesktop(
|
|||
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);
|
||||
DesktopObject->ActiveMessageQueue = NULL;
|
||||
|
|
|
@ -344,10 +344,7 @@ IntGetMonitorsFromRect(OPTIONAL IN LPCRECTL pRect,
|
|||
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 @@ NtUserGetMonitorInfo(
|
|||
}
|
||||
|
||||
/* 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)
|
||||
|
|
|
@ -895,26 +895,24 @@ SpiGetSet(UINT uiAction, UINT uiParam, PVOID pvParam, FLONG fl)
|
|||
}
|
||||
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;
|
||||
PMONITOR pmonitor = IntGetPrimaryMonitor();
|
||||
|
||||
if(!pdesktop)
|
||||
if(!pmonitor)
|
||||
return 0;
|
||||
|
||||
IntGetDesktopWorkArea(pdesktop, &rclWorkarea);
|
||||
return SpiGet(pvParam, &rclWorkarea, sizeof(RECTL), fl);
|
||||
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 @@ SpiGetSet(UINT uiAction, UINT uiParam, PVOID pvParam, FLONG fl)
|
|||
rcWorkArea.bottom <= rcWorkArea.top)
|
||||
return 0;
|
||||
|
||||
pdesktop->WorkArea = rcWorkArea;
|
||||
pmonitor->rcWork = rcWorkArea;
|
||||
if (fl & SPIF_UPDATEINIFILE)
|
||||
{
|
||||
// FIXME: what to do?
|
||||
|
|
|
@ -2112,7 +2112,7 @@ AllocErr:
|
|||
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;
|
||||
|
|
|
@ -258,19 +258,17 @@ WinPosInitInternalPos(PWINDOW_OBJECT Window, POINT *pt, RECTL *RestoreRect)
|
|||
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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue