[ros-diffs] [gadamopoulos] 54189: [desk.cpl] - Apply a wallpaper and desktop background only when they have changed - Fixes changing desktop background to the color defined by the theme

gadamopoulos at svn.reactos.org gadamopoulos at svn.reactos.org
Tue Oct 18 13:36:45 UTC 2011


Author: gadamopoulos
Date: Tue Oct 18 13:36:44 2011
New Revision: 54189

URL: http://svn.reactos.org/svn/reactos?rev=54189&view=rev
Log:
[desk.cpl]
- Apply a wallpaper and desktop background only when they have changed
- Fixes changing desktop background to the color defined by the theme

Modified:
    trunk/reactos/dll/cpl/desk/background.c

Modified: trunk/reactos/dll/cpl/desk/background.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/background.c?rev=54189&r1=54188&r2=54189&view=diff
==============================================================================
--- trunk/reactos/dll/cpl/desk/background.c [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/desk/background.c [iso-8859-1] Tue Oct 18 13:36:44 2011
@@ -40,6 +40,9 @@
 
 typedef struct _DATA
 {
+    BOOL bWallpaperChanged;
+    BOOL bClrBackgroundChanged;
+
     BackgroundItem backgroundItems[MAX_BACKGROUNDS];
 
     PDIBITMAP pWallpaperBitmap;
@@ -365,6 +368,7 @@
     {
         /* Save selected color to var */
         g_GlobalData.desktop_color = cc.rgbResult;
+        pData->bClrBackgroundChanged = TRUE;
 
         /* Apply button will be activated */
         PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
@@ -509,6 +513,8 @@
         if (pData->pWallpaperBitmap == NULL)
             return;
     }
+
+    pData->bWallpaperChanged = TRUE;
 
     InvalidateRect(GetDlgItem(hwndDlg, IDC_BACKGROUND_PREVIEW),
                    NULL, TRUE);
@@ -802,8 +808,10 @@
                 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:




More information about the Ros-diffs mailing list