diff --git a/reactos/win32ss/gdi/ntgdi/device.c b/reactos/win32ss/gdi/ntgdi/device.c index 3740bea2108..a6d6c73cb1c 100644 --- a/reactos/win32ss/gdi/ntgdi/device.c +++ b/reactos/win32ss/gdi/ntgdi/device.c @@ -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); diff --git a/reactos/win32ss/user/ntuser/winsta.c b/reactos/win32ss/user/ntuser/winsta.c index 290b575ca27..3dbda1e73ab 100644 --- a/reactos/win32ss/user/ntuser/winsta.c +++ b/reactos/win32ss/user/ntuser/winsta.c @@ -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; }