Author: gadamopoulos
Date: Sun Apr 28 20:53:57 2013
New Revision: 58887
URL:
http://svn.reactos.org/svn/reactos?rev=58887&view=rev
Log:
[win32k]
- Initialize SM_CXSCREEN and SM_CYSCREEN metrics in co_IntInitializeDesktopGraphics
- Also move some code from IntCreatePrimarySurface to co_IntInitializeDesktopGraphics
Modified:
trunk/reactos/win32ss/gdi/ntgdi/device.c
trunk/reactos/win32ss/user/ntuser/winsta.c
Modified: trunk/reactos/win32ss/gdi/ntgdi/device.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/device.c…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/device.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/device.c [iso-8859-1] Sun Apr 28 20:53:57 2013
@@ -30,34 +30,13 @@
{
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);
Modified: trunk/reactos/win32ss/user/ntuser/winsta.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/winsta…
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/winsta.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/winsta.c [iso-8859-1] Sun Apr 28 20:53:57 2013
@@ -235,6 +235,7 @@
{
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 @@
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;
@@ -271,6 +271,21 @@
// Font is realized and this dc was previously set to internal DC_ATTR.
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;
}