From 23c1c259f09c29a56095791be6844eff2fa6e901 Mon Sep 17 00:00:00 2001 From: Giannis Adamopoulos Date: Sat, 25 Feb 2012 20:06:15 +0000 Subject: [PATCH] [win32k] - move wallpaper info from WINSTATION_OBJECT to SPIVALUES. Also remove some unused fields from WINSTATION_OBJECT svn path=/trunk/; revision=55862 --- .../win32/win32k/include/sysparams.h | 16 +++++++-- .../subsystems/win32/win32k/include/winsta.h | 16 --------- .../subsystems/win32/win32k/ntuser/desktop.c | 34 +++++++++---------- .../win32/win32k/ntuser/sysparams.c | 19 +++++------ 4 files changed, 39 insertions(+), 46 deletions(-) diff --git a/reactos/subsystems/win32/win32k/include/sysparams.h b/reactos/subsystems/win32/win32k/include/sysparams.h index 665c75ca3c1..c48f9ae7e38 100644 --- a/reactos/subsystems/win32/win32k/include/sysparams.h +++ b/reactos/subsystems/win32/win32k/include/sysparams.h @@ -34,6 +34,13 @@ typedef enum _USERPREFMASKS UPM_DEFAULT = 0x80003E9E } USERPREFMASKS; +typedef enum +{ + wmCenter = 0, + wmTile, + wmStretch +} WALLPAPER_MODE; + typedef struct _SPIVALUES { /* Metrics */ @@ -129,11 +136,16 @@ typedef struct _SPIVALUES 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; diff --git a/reactos/subsystems/win32/win32k/include/winsta.h b/reactos/subsystems/win32/win32k/include/winsta.h index ed0c75c6255..f2d0fba2ea6 100644 --- a/reactos/subsystems/win32/win32k/include/winsta.h +++ b/reactos/subsystems/win32/win32k/include/winsta.h @@ -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; @@ -28,11 +17,6 @@ typedef struct _WINSTATION_OBJECT HANDLE ShellWindow; HANDLE ShellListView; - /* Wallpaper */ - HANDLE hbmWallpaper; - ULONG cxWallpaper, cyWallpaper; - WALLPAPER_MODE WallpaperMode; - ULONG Flags; struct _DESKTOP* ActiveDesktop; diff --git a/reactos/subsystems/win32/win32k/ntuser/desktop.c b/reactos/subsystems/win32/win32k/ntuser/desktop.c index 91e4ca1394c..c44a1fc4264 100644 --- a/reactos/subsystems/win32/win32k/ntuser/desktop.c +++ b/reactos/subsystems/win32/win32k/ntuser/desktop.c @@ -1238,8 +1238,6 @@ NtUserPaintDesktop(HDC hDC) 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 @@ NtUserPaintDesktop(HDC hDC) /* * Paint desktop background */ - if (WinSta->hbmWallpaper != NULL) + if (gspv.hbmWallpaper != NULL) { SIZE sz; int x, y; @@ -1271,8 +1269,8 @@ NtUserPaintDesktop(HDC hDC) 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 @@ NtUserPaintDesktop(HDC hDC) 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 @@ NtUserPaintDesktop(HDC hDC) /*Do not fill the background after it is painted no matter the size of the picture */ doPatBlt = FALSE; - hOldBitmap = NtGdiSelectBitmap(hWallpaperDC, WinSta->hbmWallpaper); + hOldBitmap = NtGdiSelectBitmap(hWallpaperDC, gspv.hbmWallpaper); - if (WinSta->WallpaperMode == wmStretch) + if (gspv.WallpaperMode == wmStretch) { if(Rect.right && Rect.bottom) NtGdiStretchBlt(hDC, @@ -1316,24 +1314,24 @@ NtUserPaintDesktop(HDC hDC) 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 @@ NtUserPaintDesktop(HDC hDC) NtGdiBitBlt(hDC, x, y, - WinSta->cxWallpaper, - WinSta->cyWallpaper, + gspv.cxWallpaper, + gspv.cyWallpaper, hWallpaperDC, 0, 0, diff --git a/reactos/subsystems/win32/win32k/ntuser/sysparams.c b/reactos/subsystems/win32/win32k/ntuser/sysparams.c index ae2351c8fe1..e7fe5f8f6a5 100644 --- a/reactos/subsystems/win32/win32k/ntuser/sysparams.c +++ b/reactos/subsystems/win32/win32k/ntuser/sysparams.c @@ -592,7 +592,6 @@ SpiSetWallpaper(PVOID pvParam, FLONG fl) HBITMAP hbmp, hOldBitmap; SURFACE *psurfBmp; ULONG ulTile, ulStyle; - PWINSTATION_OBJECT gpwinstaCurrent = GetW32ProcessInfo()->prpwinsta; REQ_INTERACTIVE_WINSTA(ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION); @@ -654,9 +653,9 @@ SpiSetWallpaper(PVOID pvParam, FLONG fl) 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 @@ SpiSetWallpaper(PVOID pvParam, FLONG fl) /* 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 @@ SpiSetWallpaper(PVOID pvParam, FLONG fl) } /* Set the new wallpaper */ - gpwinstaCurrent->hbmWallpaper = hbmp; + gspv.hbmWallpaper = hbmp; NtUserRedrawWindow(UserGetShellWindow(), NULL, NULL, RDW_INVALIDATE | RDW_ERASE);