[DESK.CPL]

- Don't convert the selected wallpaper if it is already a bitmap. Patch by Ricardo Hanke.
CORE-8802 #resolve

svn path=/trunk/; revision=66451
This commit is contained in:
Thomas Faber 2015-02-25 13:24:13 +00:00
parent 2aae46eafa
commit d733548fb4
3 changed files with 25 additions and 0 deletions

View file

@ -25,6 +25,7 @@ list(APPEND SOURCE
add_library(desk SHARED
${SOURCE}
guid.c
desk.rc
${CMAKE_CURRENT_BINARY_DIR}/desk.def)

View file

@ -913,6 +913,7 @@ SetWallpaper(PDATA pData)
TCHAR szWallpaper[MAX_PATH];
GpImage *image;
CLSID encoderClsid;
GUID guidFormat;
size_t length = 0;
GpStatus status;
@ -956,6 +957,15 @@ SetWallpaper(PDATA pData)
return;
}
GdipGetImageRawFormat(image, &guidFormat);
if (IsEqualGUID(&guidFormat, &ImageFormatBMP))
{
GdipDisposeImage(image);
RegCloseKey(regKey);
SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, pData->backgroundItems[pData->backgroundSelection].szFilename, SPIF_UPDATEINIFILE);
return;
}
if (FAILED(GdipGetEncoderClsid(L"image/bmp", &encoderClsid)))
{
GdipDisposeImage(image);

View file

@ -0,0 +1,14 @@
/* DO NOT USE THE PRECOMPILED HEADER FOR THIS FILE! */
#define WIN32_NO_STATuS
#define _INC_WINDOWS
#define COM_NO_WINDOWS_H
#include <windef.h>
#include <winbase.h>
#include <wingdi.h>
#include <objbase.h>
#include <initguid.h>
#include <gdiplus.h>
/* NO CODE HERE, THIS IS JUST REQUIRED FOR THE GUID DEFINITIONS */