From 5071383cacde4d478e301369bf2afb2b0aa08d89 Mon Sep 17 00:00:00 2001 From: Giannis Adamopoulos Date: Tue, 18 Oct 2011 13:36:44 +0000 Subject: [PATCH] [desk.cpl] - Apply a wallpaper and desktop background only when they have changed - Fixes changing desktop background to the color defined by the theme svn path=/trunk/; revision=54189 --- reactos/dll/cpl/desk/background.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/reactos/dll/cpl/desk/background.c b/reactos/dll/cpl/desk/background.c index 9ba57c6335e..5c4067d945a 100644 --- a/reactos/dll/cpl/desk/background.c +++ b/reactos/dll/cpl/desk/background.c @@ -40,6 +40,9 @@ typedef struct typedef struct _DATA { + BOOL bWallpaperChanged; + BOOL bClrBackgroundChanged; + BackgroundItem backgroundItems[MAX_BACKGROUNDS]; PDIBITMAP pWallpaperBitmap; @@ -365,6 +368,7 @@ OnColorButton(HWND hwndDlg, PDATA pData) { /* Save selected color to var */ g_GlobalData.desktop_color = cc.rgbResult; + pData->bClrBackgroundChanged = TRUE; /* Apply button will be activated */ PropSheet_Changed(GetParent(hwndDlg), hwndDlg); @@ -510,6 +514,8 @@ ListViewItemChanged(HWND hwndDlg, PDATA pData, int itemIndex) return; } + pData->bWallpaperChanged = TRUE; + InvalidateRect(GetDlgItem(hwndDlg, IDC_BACKGROUND_PREVIEW), NULL, TRUE); @@ -802,8 +808,10 @@ BackgroundPageProc(HWND hwndDlg, switch(lpnm->code) { case PSN_APPLY: - SetWallpaper(pData); - SetDesktopBackColor(hwndDlg, pData); + if(pData->bWallpaperChanged) + SetWallpaper(pData); + if(pData->bClrBackgroundChanged) + SetDesktopBackColor(hwndDlg, pData); return TRUE; case LVN_ITEMCHANGED: