Author: gadamopoulos Date: Sat Feb 25 20:06:15 2012 New Revision: 55862
URL: http://svn.reactos.org/svn/reactos?rev=55862&view=rev Log: [win32k] - move wallpaper info from WINSTATION_OBJECT to SPIVALUES. Also remove some unused fields from WINSTATION_OBJECT
Modified: trunk/reactos/subsystems/win32/win32k/include/sysparams.h trunk/reactos/subsystems/win32/win32k/include/winsta.h trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c trunk/reactos/subsystems/win32/win32k/ntuser/sysparams.c
Modified: trunk/reactos/subsystems/win32/win32k/include/sysparams.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/inc... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/sysparams.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/include/sysparams.h [iso-8859-1] Sat Feb 25 20:06:15 2012 @@ -33,6 +33,13 @@ UPM_UIEFFECTS = 0x80000000, UPM_DEFAULT = 0x80003E9E } USERPREFMASKS; + +typedef enum +{ + wmCenter = 0, + wmTile, + wmStretch +} WALLPAPER_MODE;
typedef struct _SPIVALUES { @@ -129,11 +136,16 @@ TEXTMETRICW tmMenuFont; TEXTMETRICW tmCaptionFont;
+ /* Wallpaper */ + HANDLE hbmWallpaper; + ULONG cxWallpaper, cyWallpaper; + WALLPAPER_MODE WallpaperMode; + UNICODE_STRING ustrWallpaper; + WCHAR awcWallpaper[MAX_PATH]; + BOOL bHandHeld; BOOL bFastTaskSwitch; UINT uiGridGranularity; - UNICODE_STRING ustrWallpaper; - WCHAR awcWallpaper[MAX_PATH];
ANIMATIONINFO animationinfo; BOOL bSnapToDefBtn;
Modified: trunk/reactos/subsystems/win32/win32k/include/winsta.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/inc... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/winsta.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/include/winsta.h [iso-8859-1] Sat Feb 25 20:06:15 2012 @@ -7,19 +7,8 @@ #define WSS_LOCKED (1) #define WSS_NOINTERACTIVE (2)
-typedef enum -{ - wmCenter = 0, - wmTile, - wmStretch -} WALLPAPER_MODE; - typedef struct _WINSTATION_OBJECT { - PVOID SharedHeap; /* Points to kmode memory! */ - - CSHORT Type; - CSHORT Size; KSPIN_LOCK Lock; UNICODE_STRING Name; LIST_ENTRY DesktopListHead; @@ -27,11 +16,6 @@ HANDLE SystemMenuTemplate; HANDLE ShellWindow; HANDLE ShellListView; - - /* Wallpaper */ - HANDLE hbmWallpaper; - ULONG cxWallpaper, cyWallpaper; - WALLPAPER_MODE WallpaperMode;
ULONG Flags; struct _DESKTOP* ActiveDesktop;
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntu... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c [iso-8859-1] Sat Feb 25 20:06:15 2012 @@ -1238,8 +1238,6 @@ COLORREF color_old; UINT align_old; int mode_old; - PTHREADINFO pti = PsGetCurrentThreadWin32Thread(); - PWINSTATION_OBJECT WinSta = pti->rpdesk->rpwinstaParent; DECLARE_RETURN(BOOL);
UserEnterExclusive(); @@ -1262,7 +1260,7 @@ /* * Paint desktop background */ - if (WinSta->hbmWallpaper != NULL) + if (gspv.hbmWallpaper != NULL) { SIZE sz; int x, y; @@ -1271,8 +1269,8 @@ sz.cx = WndDesktop->rcWindow.right - WndDesktop->rcWindow.left; sz.cy = WndDesktop->rcWindow.bottom - WndDesktop->rcWindow.top;
- if (WinSta->WallpaperMode == wmStretch || - WinSta->WallpaperMode == wmTile) + if (gspv.WallpaperMode == wmStretch || + gspv.WallpaperMode == wmTile) { x = 0; y = 0; @@ -1280,8 +1278,8 @@ else { /* Find the upper left corner, can be negtive if the bitmap is bigger then the screen */ - x = (sz.cx / 2) - (WinSta->cxWallpaper / 2); - y = (sz.cy / 2) - (WinSta->cyWallpaper / 2); + x = (sz.cx / 2) - (gspv.cxWallpaper / 2); + y = (sz.cy / 2) - (gspv.cyWallpaper / 2); }
hWallpaperDC = NtGdiCreateCompatibleDC(hDC); @@ -1303,9 +1301,9 @@ /*Do not fill the background after it is painted no matter the size of the picture */ doPatBlt = FALSE;
- hOldBitmap = NtGdiSelectBitmap(hWallpaperDC, WinSta->hbmWallpaper); - - if (WinSta->WallpaperMode == wmStretch) + hOldBitmap = NtGdiSelectBitmap(hWallpaperDC, gspv.hbmWallpaper); + + if (gspv.WallpaperMode == wmStretch) { if(Rect.right && Rect.bottom) NtGdiStretchBlt(hDC, @@ -1316,24 +1314,24 @@ hWallpaperDC, 0, 0, - WinSta->cxWallpaper, - WinSta->cyWallpaper, + gspv.cxWallpaper, + gspv.cyWallpaper, SRCCOPY, 0);
} - else if (WinSta->WallpaperMode == wmTile) + else if (gspv.WallpaperMode == wmTile) { /* Paint the bitmap across the screen then down */ - for(y = 0; y < Rect.bottom; y += WinSta->cyWallpaper) + for(y = 0; y < Rect.bottom; y += gspv.cyWallpaper) { - for(x = 0; x < Rect.right; x += WinSta->cxWallpaper) + for(x = 0; x < Rect.right; x += gspv.cxWallpaper) { NtGdiBitBlt(hDC, x, y, - WinSta->cxWallpaper, - WinSta->cyWallpaper, + gspv.cxWallpaper, + gspv.cyWallpaper, hWallpaperDC, 0, 0, @@ -1348,8 +1346,8 @@ NtGdiBitBlt(hDC, x, y, - WinSta->cxWallpaper, - WinSta->cyWallpaper, + gspv.cxWallpaper, + gspv.cyWallpaper, hWallpaperDC, 0, 0,
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/sysparams.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntu... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/sysparams.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/sysparams.c [iso-8859-1] Sat Feb 25 20:06:15 2012 @@ -592,7 +592,6 @@ HBITMAP hbmp, hOldBitmap; SURFACE *psurfBmp; ULONG ulTile, ulStyle; - PWINSTATION_OBJECT gpwinstaCurrent = GetW32ProcessInfo()->prpwinsta;
REQ_INTERACTIVE_WINSTA(ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION);
@@ -654,9 +653,9 @@ return 0; }
- gpwinstaCurrent->cxWallpaper = psurfBmp->SurfObj.sizlBitmap.cx; - gpwinstaCurrent->cyWallpaper = psurfBmp->SurfObj.sizlBitmap.cy; - gpwinstaCurrent->WallpaperMode = wmCenter; + gspv.cxWallpaper = psurfBmp->SurfObj.sizlBitmap.cx; + gspv.cyWallpaper = psurfBmp->SurfObj.sizlBitmap.cy; + gspv.WallpaperMode = wmCenter;
SURFACE_ShareUnlockSurface(psurfBmp);
@@ -671,23 +670,23 @@ /* Check the values we found in the registry */ if(ulTile && !ulStyle) { - gpwinstaCurrent->WallpaperMode = wmTile; + gspv.WallpaperMode = wmTile; } else if(!ulTile && ulStyle == 2) { - gpwinstaCurrent->WallpaperMode = wmStretch; + gspv.WallpaperMode = wmStretch; } } else { /* Remove wallpaper */ - gpwinstaCurrent->cxWallpaper = 0; - gpwinstaCurrent->cyWallpaper = 0; + gspv.cxWallpaper = 0; + gspv.cyWallpaper = 0; hbmp = 0; }
/* Take care of the old wallpaper, if any */ - hOldBitmap = gpwinstaCurrent->hbmWallpaper; + hOldBitmap = gspv.hbmWallpaper; if(hOldBitmap != NULL) { /* Delete the old wallpaper */ @@ -696,7 +695,7 @@ }
/* Set the new wallpaper */ - gpwinstaCurrent->hbmWallpaper = hbmp; + gspv.hbmWallpaper = hbmp;
NtUserRedrawWindow(UserGetShellWindow(), NULL, NULL, RDW_INVALIDATE | RDW_ERASE);