fixed hardcoded workarea size

svn path=/trunk/; revision=7242
This commit is contained in:
Thomas Bluemel 2003-12-26 00:47:18 +00:00
parent ed3497f42e
commit b68bca0e99
2 changed files with 40 additions and 5 deletions

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Id: desktop.c,v 1.6 2003/12/22 15:30:21 navaraf Exp $
* $Id: desktop.c,v 1.7 2003/12/26 00:47:18 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -357,11 +357,23 @@ NtUserCreateDesktop(
return NULL;
}
/* FIXME: Set correct dimensions. */
DesktopObject->WorkArea.left = 0;
DesktopObject->WorkArea.top = 0;
DesktopObject->WorkArea.right = 640;
DesktopObject->WorkArea.bottom = 480;
DesktopObject->WorkArea.right = -1;
DesktopObject->WorkArea.bottom = -1;
if(ScreenDeviceContext)
{
PDC dc;
PSURFOBJ SurfObj;
dc = DC_LockDc(ScreenDeviceContext);
SurfObj = (PSURFOBJ)AccessUserObject((ULONG) dc->Surface);
if(SurfObj)
{
DesktopObject->WorkArea.right = SurfObj->sizlBitmap.cx;
DesktopObject->WorkArea.bottom = SurfObj->sizlBitmap.cy;
}
DC_UnlockDc(ScreenDeviceContext);
}
/* Initialize some local (to win32k) desktop state. */
DesktopObject->ActiveMessageQueue = NULL;

View file

@ -1,4 +1,4 @@
/* $Id: misc.c,v 1.39 2003/12/26 00:31:22 weiden Exp $
/* $Id: misc.c,v 1.40 2003/12/26 00:47:18 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -448,6 +448,7 @@ NtUserSystemParametersInfo(
}
case SPI_GETWORKAREA:
{
PRECT Rect;
PDESKTOP_OBJECT Desktop = PsGetWin32Thread()->Desktop;
if(!Desktop)
@ -456,6 +457,28 @@ NtUserSystemParametersInfo(
return FALSE;
}
Rect = (PRECT)Desktop->WorkArea;
if(Rect->right == -1)
{
HDC hDC;
PDC dc;
PSURFOBJ SurfObj;
hDC = IntGetScreenDC();
if(hDC)
{
dc = DC_LockDc(hDC);
if(dc && (SurfObj = (PSURFOBJ)AccessUserObject((ULONG) dc->Surface)))
{
Rect->left = 0;
Rect->top = 0;
Rect->right = SurfObj->sizlBitmap.cx;
Rect->bottom = SurfObj->sizlBitmap.cy;
DC_UnlockDc(hDC);
}
}
}
Status = MmCopyToCaller((PRECT)pvParam, Desktop->WorkArea, sizeof(RECT));
if(!NT_SUCCESS(Status))
{