mirror of
https://github.com/reactos/reactos.git
synced 2024-10-05 17:06:29 +00:00
[win32k]
- Initialize SM_CXSCREEN and SM_CYSCREEN metrics in co_IntInitializeDesktopGraphics - Also move some code from IntCreatePrimarySurface to co_IntInitializeDesktopGraphics svn path=/trunk/; revision=58887
This commit is contained in:
parent
1a40619b16
commit
177dae0796
|
@ -30,35 +30,14 @@ IntCreatePrimarySurface(VOID)
|
|||
{
|
||||
SIZEL SurfSize;
|
||||
SURFOBJ *pso;
|
||||
PDESKTOP rpDesk;
|
||||
|
||||
/* Create surface */
|
||||
pso = &PDEVOBJ_pSurface(gppdevPrimary)->SurfObj;
|
||||
SurfSize = pso->sizlBitmap;
|
||||
|
||||
/* Attach monitor */
|
||||
UserAttachMonitor((HDEV)gppdevPrimary);
|
||||
|
||||
DPRINT("IntCreatePrimarySurface, gppdevPrimary=%p, gppdevPrimary->pSurface = %p\n",
|
||||
gppdevPrimary, gppdevPrimary->pSurface);
|
||||
|
||||
/* Put the pointer in the center of the screen */
|
||||
gpsi->ptCursor.x = pso->sizlBitmap.cx / 2;
|
||||
gpsi->ptCursor.y = pso->sizlBitmap.cy / 2;
|
||||
|
||||
rpDesk = IntGetActiveDesktop();
|
||||
if (!rpDesk)
|
||||
{ /* First time going in from winlogon and starting up application desktop and
|
||||
haven't switch to winlogon desktop. Also still in WM_CREATE. */
|
||||
PTHREADINFO pti = PsGetCurrentThreadWin32Thread();
|
||||
rpDesk = pti->rpdesk;
|
||||
if (!rpDesk)
|
||||
{
|
||||
DPRINT1("No DESKTOP Window!!!!!\n");
|
||||
}
|
||||
}
|
||||
co_IntShowDesktop(rpDesk, SurfSize.cx, SurfSize.cy, TRUE);
|
||||
|
||||
// Init Primary Displays Device Capabilities.
|
||||
PDEVOBJ_vGetDeviceCaps(gppdevPrimary, &GdiHandleTable->DevCaps);
|
||||
|
||||
|
|
|
@ -235,6 +235,7 @@ co_IntInitializeDesktopGraphics(VOID)
|
|||
{
|
||||
TEXTMETRICW tmw;
|
||||
UNICODE_STRING DriverName = RTL_CONSTANT_STRING(L"DISPLAY");
|
||||
PDESKTOP pdesk;
|
||||
|
||||
ScreenDeviceContext = IntGdiCreateDC(&DriverName, NULL, NULL, NULL, FALSE);
|
||||
if (NULL == ScreenDeviceContext)
|
||||
|
@ -249,15 +250,14 @@ co_IntInitializeDesktopGraphics(VOID)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
/* Setup the cursor */
|
||||
co_IntLoadDefaultCursors();
|
||||
|
||||
hSystemBM = NtGdiCreateCompatibleDC(ScreenDeviceContext);
|
||||
|
||||
NtGdiSelectFont(hSystemBM, NtGdiGetStockObject(SYSTEM_FONT));
|
||||
GreSetDCOwner(hSystemBM, GDI_OBJ_HMGR_PUBLIC);
|
||||
|
||||
// FIXME: Move these to a update routine.
|
||||
/* Update the SERVERINFO */
|
||||
gpsi->aiSysMet[SM_CXSCREEN] = gppdevPrimary->gdiinfo.ulHorzRes;
|
||||
gpsi->aiSysMet[SM_CYSCREEN] = gppdevPrimary->gdiinfo.ulVertRes;
|
||||
gpsi->Planes = NtGdiGetDeviceCaps(ScreenDeviceContext, PLANES);
|
||||
gpsi->BitsPixel = NtGdiGetDeviceCaps(ScreenDeviceContext, BITSPIXEL);
|
||||
gpsi->BitCount = gpsi->Planes * gpsi->BitsPixel;
|
||||
|
@ -272,6 +272,21 @@ co_IntInitializeDesktopGraphics(VOID)
|
|||
gpsi->cxSysFontChar = IntGetCharDimensions(hSystemBM, &tmw, (DWORD*)&gpsi->cySysFontChar);
|
||||
gpsi->tmSysFont = tmw;
|
||||
|
||||
/* Put the pointer in the center of the screen */
|
||||
gpsi->ptCursor.x = gpsi->aiSysMet[SM_CXSCREEN] / 2;
|
||||
gpsi->ptCursor.y = gpsi->aiSysMet[SM_CYSCREEN] / 2;
|
||||
|
||||
/* Attach monitor */
|
||||
UserAttachMonitor((HDEV)gppdevPrimary);
|
||||
|
||||
/* Setup the cursor */
|
||||
co_IntLoadDefaultCursors();
|
||||
|
||||
/* Show the desktop */
|
||||
pdesk = IntGetActiveDesktop();
|
||||
ASSERT(pdesk);
|
||||
co_IntShowDesktop(pdesk, gpsi->aiSysMet[SM_CXSCREEN], gpsi->aiSysMet[SM_CYSCREEN], TRUE);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue