mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 17:43:47 +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;
|
DWORD dwMouseHoverTime;
|
||||||
|
|
||||||
/* ReactOS */
|
/* ReactOS */
|
||||||
/* Rectangle of the work area */
|
|
||||||
RECTL WorkArea;
|
|
||||||
/* Pointer to the active queue. */
|
/* Pointer to the active queue. */
|
||||||
PVOID ActiveMessageQueue;
|
PVOID ActiveMessageQueue;
|
||||||
/* Handle of the desktop window. */
|
/* Handle of the desktop window. */
|
||||||
|
@ -69,9 +67,6 @@ IntDesktopObjectParse(IN PVOID ParseObject,
|
||||||
VOID APIENTRY
|
VOID APIENTRY
|
||||||
IntDesktopObjectDelete(PWIN32_DELETEMETHOD_PARAMETERS Parameters);
|
IntDesktopObjectDelete(PWIN32_DELETEMETHOD_PARAMETERS Parameters);
|
||||||
|
|
||||||
VOID FASTCALL
|
|
||||||
IntGetDesktopWorkArea(PDESKTOP Desktop, RECTL *Rect);
|
|
||||||
|
|
||||||
LRESULT CALLBACK
|
LRESULT CALLBACK
|
||||||
IntDesktopWindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
|
IntDesktopWindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||||
|
|
||||||
|
|
|
@ -419,35 +419,6 @@ IntValidateDesktopHandle(
|
||||||
return Status;
|
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
|
PDESKTOP FASTCALL
|
||||||
IntGetActiveDesktop(VOID)
|
IntGetActiveDesktop(VOID)
|
||||||
{
|
{
|
||||||
|
@ -1052,13 +1023,6 @@ NtUserCreateDesktop(
|
||||||
lpszDesktopName->Buffer,
|
lpszDesktopName->Buffer,
|
||||||
lpszDesktopName->Length);
|
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. */
|
/* Initialize some local (to win32k) desktop state. */
|
||||||
InitializeListHead(&DesktopObject->PtiList);
|
InitializeListHead(&DesktopObject->PtiList);
|
||||||
DesktopObject->ActiveMessageQueue = NULL;
|
DesktopObject->ActiveMessageQueue = NULL;
|
||||||
|
|
|
@ -344,10 +344,7 @@ IntGetMonitorsFromRect(OPTIONAL IN LPCRECTL pRect,
|
||||||
RECTL MonitorRect, IntersectionRect;
|
RECTL MonitorRect, IntersectionRect;
|
||||||
|
|
||||||
ExEnterCriticalRegionAndAcquireFastMutexUnsafe(&Monitor->Lock);
|
ExEnterCriticalRegionAndAcquireFastMutexUnsafe(&Monitor->Lock);
|
||||||
MonitorRect.left = 0; /* FIXME: get origin */
|
MonitorRect = Monitor->rcMonitor;
|
||||||
MonitorRect.top = 0; /* FIXME: get origin */
|
|
||||||
MonitorRect.right = MonitorRect.left + Monitor->GdiDevice->gdiinfo.ulHorzRes;
|
|
||||||
MonitorRect.bottom = MonitorRect.top + Monitor->GdiDevice->gdiinfo.ulVertRes;
|
|
||||||
ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(&Monitor->Lock);
|
ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(&Monitor->Lock);
|
||||||
|
|
||||||
DPRINT("MonitorRect: left = %d, top = %d, right = %d, bottom = %d\n",
|
DPRINT("MonitorRect: left = %d, top = %d, right = %d, bottom = %d\n",
|
||||||
|
@ -677,11 +674,8 @@ NtUserGetMonitorInfo(
|
||||||
}
|
}
|
||||||
|
|
||||||
/* fill monitor info */
|
/* fill monitor info */
|
||||||
MonitorInfo.rcMonitor.left = 0; /* FIXME: get origin */
|
MonitorInfo.rcMonitor = Monitor->rcMonitor;
|
||||||
MonitorInfo.rcMonitor.top = 0; /* FIXME: get origin */
|
MonitorInfo.rcWork = Monitor->rcWork;
|
||||||
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.dwFlags = 0;
|
MonitorInfo.dwFlags = 0;
|
||||||
|
|
||||||
if (Monitor->IsPrimary)
|
if (Monitor->IsPrimary)
|
||||||
|
|
|
@ -895,26 +895,24 @@ SpiGetSet(UINT uiAction, UINT uiParam, PVOID pvParam, FLONG fl)
|
||||||
}
|
}
|
||||||
return (UINT_PTR)KEY_METRIC;
|
return (UINT_PTR)KEY_METRIC;
|
||||||
|
|
||||||
case SPI_GETWORKAREA: // FIXME: the workarea should be part of the MONITOR
|
case SPI_GETWORKAREA:
|
||||||
{
|
{
|
||||||
PTHREADINFO pti = PsGetCurrentThreadWin32Thread();
|
PMONITOR pmonitor = IntGetPrimaryMonitor();
|
||||||
PDESKTOP pdesktop = pti->rpdesk;
|
|
||||||
RECTL rclWorkarea;
|
|
||||||
|
|
||||||
if(!pdesktop)
|
if(!pmonitor)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
IntGetDesktopWorkArea(pdesktop, &rclWorkarea);
|
return SpiGet(pvParam, &pmonitor->rcWork, sizeof(RECTL), fl);
|
||||||
return SpiGet(pvParam, &rclWorkarea, sizeof(RECTL), fl);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
case SPI_SETWORKAREA: // FIXME: the workarea should be part of the MONITOR
|
case SPI_SETWORKAREA:
|
||||||
{
|
{
|
||||||
PTHREADINFO pti = PsGetCurrentThreadWin32Thread();
|
/*FIXME: we should set the work area of the monitor
|
||||||
PDESKTOP pdesktop = pti->rpdesk;
|
that contains the specified rectangle*/
|
||||||
|
PMONITOR pmonitor = IntGetPrimaryMonitor();
|
||||||
RECT rcWorkArea;
|
RECT rcWorkArea;
|
||||||
|
|
||||||
if(!pdesktop)
|
if(!pmonitor)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (!SpiSet(&rcWorkArea, pvParam, sizeof(RECTL), fl))
|
if (!SpiSet(&rcWorkArea, pvParam, sizeof(RECTL), fl))
|
||||||
|
@ -929,7 +927,7 @@ SpiGetSet(UINT uiAction, UINT uiParam, PVOID pvParam, FLONG fl)
|
||||||
rcWorkArea.bottom <= rcWorkArea.top)
|
rcWorkArea.bottom <= rcWorkArea.top)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
pdesktop->WorkArea = rcWorkArea;
|
pmonitor->rcWork = rcWorkArea;
|
||||||
if (fl & SPIF_UPDATEINIFILE)
|
if (fl & SPIF_UPDATEINIFILE)
|
||||||
{
|
{
|
||||||
// FIXME: what to do?
|
// FIXME: what to do?
|
||||||
|
|
|
@ -2112,7 +2112,7 @@ AllocErr:
|
||||||
PRTL_USER_PROCESS_PARAMETERS ProcessParams;
|
PRTL_USER_PROCESS_PARAMETERS ProcessParams;
|
||||||
BOOL CalculatedDefPosSize = FALSE;
|
BOOL CalculatedDefPosSize = FALSE;
|
||||||
|
|
||||||
IntGetDesktopWorkArea(Window->pti->rpdesk, &WorkArea);
|
UserSystemParametersInfo(SPI_GETWORKAREA, 0, &WorkArea, 0);
|
||||||
|
|
||||||
rc = WorkArea;
|
rc = WorkArea;
|
||||||
ProcessParams = PsGetCurrentProcess()->Peb->ProcessParameters;
|
ProcessParams = PsGetCurrentProcess()->Peb->ProcessParameters;
|
||||||
|
|
|
@ -258,19 +258,17 @@ WinPosInitInternalPos(PWINDOW_OBJECT Window, POINT *pt, RECTL *RestoreRect)
|
||||||
if (!Wnd->InternalPosInitialized)
|
if (!Wnd->InternalPosInitialized)
|
||||||
{
|
{
|
||||||
RECTL WorkArea;
|
RECTL WorkArea;
|
||||||
PTHREADINFO pti = PsGetCurrentThreadWin32Thread();
|
|
||||||
PDESKTOP Desktop = pti->rpdesk; /* Or rather get it from the window? */
|
|
||||||
|
|
||||||
Parent = Window->spwndParent;
|
Parent = Window->spwndParent;
|
||||||
if(Parent)
|
if(Parent)
|
||||||
{
|
{
|
||||||
if(IntIsDesktopWindow(Parent))
|
if(IntIsDesktopWindow(Parent))
|
||||||
IntGetDesktopWorkArea(Desktop, &WorkArea);
|
UserSystemParametersInfo(SPI_GETWORKAREA, 0, &WorkArea, 0);
|
||||||
else
|
else
|
||||||
WorkArea = Parent->Wnd->rcClient;
|
WorkArea = Parent->Wnd->rcClient;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
IntGetDesktopWorkArea(Desktop, &WorkArea);
|
UserSystemParametersInfo(SPI_GETWORKAREA, 0, &WorkArea, 0);
|
||||||
|
|
||||||
Wnd->InternalPos.NormalRect = Window->Wnd->rcWindow;
|
Wnd->InternalPos.NormalRect = Window->Wnd->rcWindow;
|
||||||
IntGetWindowBorderMeasures(Window, &XInc, &YInc);
|
IntGetWindowBorderMeasures(Window, &XInc, &YInc);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue