Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
12472258
Commit
12472258
authored
Dec 03, 2012
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Refresh the desktop when the wallpaper is changed.
parent
3a1f31ea
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
17 deletions
+35
-17
controls.h
dlls/user32/controls.h
+1
-1
desktop.c
dlls/user32/desktop.c
+7
-10
sysparams.c
dlls/user32/sysparams.c
+21
-5
desktop.c
programs/explorer/desktop.c
+6
-1
No files found.
dlls/user32/controls.h
View file @
12472258
...
...
@@ -148,7 +148,7 @@ extern struct dce *set_class_dce( struct tagCLASS *class, struct dce *dce ) DECL
extern
HBRUSH
DEFWND_ControlColor
(
HDC
hDC
,
UINT
ctlType
)
DECLSPEC_HIDDEN
;
/* desktop */
extern
BOOL
DESKTOP_SetPattern
(
LPCWSTR
pattern
)
DECLSPEC_HIDDEN
;
extern
BOOL
update_wallpaper
(
const
WCHAR
*
wallpaper
,
const
WCHAR
*
pattern
)
DECLSPEC_HIDDEN
;
/* icon title */
extern
HWND
ICONTITLE_Create
(
HWND
hwnd
)
DECLSPEC_HIDDEN
;
...
...
dlls/user32/desktop.c
View file @
12472258
...
...
@@ -56,12 +56,10 @@ const struct builtin_class_descr DESKTOP_builtin_class =
/***********************************************************************
* DESKTOP_LoadBitmap
*/
static
HBITMAP
DESKTOP_LoadBitmap
(
void
)
static
HBITMAP
DESKTOP_LoadBitmap
(
const
WCHAR
*
filename
)
{
HBITMAP
hbitmap
;
WCHAR
filename
[
MAX_PATH
];
if
(
!
SystemParametersInfoW
(
SPI_GETDESKWALLPAPER
,
MAX_PATH
,
filename
,
0
))
return
0
;
if
(
!
filename
[
0
])
return
0
;
hbitmap
=
LoadImageW
(
0
,
filename
,
IMAGE_BITMAP
,
0
,
0
,
LR_CREATEDIBSECTION
|
LR_LOADFROMFILE
);
if
(
!
hbitmap
)
...
...
@@ -78,9 +76,9 @@ static HBITMAP DESKTOP_LoadBitmap(void)
/***********************************************************************
* init_wallpaper
*/
static
void
init_wallpaper
(
void
)
static
void
init_wallpaper
(
const
WCHAR
*
wallpaper
)
{
HBITMAP
hbitmap
=
DESKTOP_LoadBitmap
();
HBITMAP
hbitmap
=
DESKTOP_LoadBitmap
(
wallpaper
);
if
(
hbitmapWallPaper
)
DeleteObject
(
hbitmapWallPaper
);
hbitmapWallPaper
=
hbitmap
;
...
...
@@ -172,11 +170,9 @@ BOOL WINAPI SetDeskWallPaper( LPCSTR filename )
/***********************************************************************
* DESKTOP_SetPattern
*
* Set the desktop pattern.
* update_wallpaper
*/
BOOL
DESKTOP_SetPattern
(
LPCWSTR
pattern
)
BOOL
update_wallpaper
(
const
WCHAR
*
wallpaper
,
const
WCHAR
*
pattern
)
{
int
pat
[
8
];
...
...
@@ -201,6 +197,7 @@ BOOL DESKTOP_SetPattern( LPCWSTR pattern )
DeleteObject
(
hbitmap
);
}
}
init_wallpaper
();
init_wallpaper
(
wallpaper
);
RedrawWindow
(
GetDesktopWindow
(),
0
,
0
,
RDW_INVALIDATE
|
RDW_ERASE
|
RDW_NOCHILDREN
);
return
TRUE
;
}
dlls/user32/sysparams.c
View file @
12472258
...
...
@@ -1293,6 +1293,7 @@ static union sysparam_all_entry * const default_entries[] =
(
union
sysparam_all_entry
*
)
&
entry_CAPTIONHEIGHT
,
(
union
sysparam_all_entry
*
)
&
entry_CAPTIONWIDTH
,
(
union
sysparam_all_entry
*
)
&
entry_CARETWIDTH
,
(
union
sysparam_all_entry
*
)
&
entry_DESKWALLPAPER
,
(
union
sysparam_all_entry
*
)
&
entry_DOUBLECLICKTIME
,
(
union
sysparam_all_entry
*
)
&
entry_DOUBLECLKHEIGHT
,
(
union
sysparam_all_entry
*
)
&
entry_DOUBLECLKWIDTH
,
...
...
@@ -1374,6 +1375,23 @@ void SYSPARAMS_Init(void)
}
}
static
BOOL
update_desktop_wallpaper
(
void
)
{
DWORD
pid
;
if
(
GetWindowThreadProcessId
(
GetDesktopWindow
(),
&
pid
)
&&
pid
==
GetCurrentProcessId
())
{
WCHAR
wallpaper
[
MAX_PATH
],
pattern
[
256
];
entry_DESKWALLPAPER
.
hdr
.
loaded
=
entry_DESKPATTERN
.
hdr
.
loaded
=
FALSE
;
if
(
get_entry
(
&
entry_DESKWALLPAPER
,
MAX_PATH
,
wallpaper
)
&&
get_entry
(
&
entry_DESKPATTERN
,
256
,
pattern
))
update_wallpaper
(
wallpaper
,
pattern
);
}
else
SendMessageW
(
GetDesktopWindow
(),
WM_SETTINGCHANGE
,
SPI_SETDESKWALLPAPER
,
0
);
return
TRUE
;
}
/***********************************************************************
* SystemParametersInfoW (USER32.@)
*
...
...
@@ -1484,14 +1502,12 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam,
ret
=
set_entry
(
&
entry_GRIDGRANULARITY
,
uiParam
,
pvParam
,
fWinIni
);
break
;
case
SPI_SETDESKWALLPAPER
:
ret
=
set_entry
(
&
entry_DESKWALLPAPER
,
uiParam
,
pvParam
,
fWinIni
);
if
(
!
pvParam
||
set_entry
(
&
entry_DESKWALLPAPER
,
uiParam
,
pvParam
,
fWinIni
))
ret
=
update_desktop_wallpaper
();
break
;
case
SPI_SETDESKPATTERN
:
if
(
!
pvParam
||
set_entry
(
&
entry_DESKPATTERN
,
uiParam
,
pvParam
,
fWinIni
))
{
WCHAR
buf
[
256
];
ret
=
get_entry
(
&
entry_DESKPATTERN
,
256
,
buf
)
&&
DESKTOP_SetPattern
(
buf
);
}
ret
=
update_desktop_wallpaper
();
break
;
case
SPI_GETKEYBOARDDELAY
:
ret
=
get_entry
(
&
entry_KEYBOARDDELAY
,
uiParam
,
pvParam
);
...
...
programs/explorer/desktop.c
View file @
12472258
...
...
@@ -85,6 +85,11 @@ static LRESULT WINAPI desktop_wnd_proc( HWND hwnd, UINT message, WPARAM wp, LPAR
if
(
!
using_root
)
PaintDesktop
(
(
HDC
)
wp
);
return
TRUE
;
case
WM_SETTINGCHANGE
:
if
(
wp
==
SPI_SETDESKWALLPAPER
)
SystemParametersInfoW
(
SPI_SETDESKWALLPAPER
,
0
,
NULL
,
FALSE
);
return
0
;
case
WM_PAINT
:
{
PAINTSTRUCT
ps
;
...
...
@@ -311,7 +316,7 @@ void manage_desktop( WCHAR *arg )
SetWindowLongPtrW
(
hwnd
,
GWLP_WNDPROC
,
(
LONG_PTR
)
desktop_wnd_proc
);
SendMessageW
(
hwnd
,
WM_SETICON
,
ICON_BIG
,
(
LPARAM
)
LoadIconW
(
0
,
MAKEINTRESOURCEW
(
OIC_WINLOGO
)));
if
(
name
)
set_desktop_window_title
(
hwnd
,
name
);
SystemParametersInfo
A
(
SPI_SETDESKPATTERN
,
-
1
,
NULL
,
FALSE
);
SystemParametersInfo
W
(
SPI_SETDESKWALLPAPER
,
0
,
NULL
,
FALSE
);
ClipCursor
(
NULL
);
initialize_display_settings
(
hwnd
);
initialize_appbar
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment