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
f5113d2d
Commit
f5113d2d
authored
Oct 24, 2013
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Set the display device property on the desktop window as soon as it is created.
parent
fe441a06
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
16 deletions
+39
-16
desktop.c
dlls/user32/desktop.c
+31
-2
desktop.c
programs/explorer/desktop.c
+8
-14
No files found.
dlls/user32/desktop.c
View file @
f5113d2d
...
...
@@ -32,6 +32,7 @@
#include "wingdi.h"
#include "winnls.h"
#include "controls.h"
#include "wine/unicode.h"
static
HBRUSH
hbrushPattern
;
static
HBITMAP
hbitmapWallPaper
;
...
...
@@ -97,8 +98,36 @@ static void init_wallpaper( const WCHAR *wallpaper )
*/
LRESULT
WINAPI
DesktopWndProc
(
HWND
hwnd
,
UINT
message
,
WPARAM
wParam
,
LPARAM
lParam
)
{
if
(
message
==
WM_NCCREATE
)
return
TRUE
;
return
0
;
/* all other messages are ignored */
static
const
WCHAR
display_device_guid_propW
[]
=
{
'_'
,
'_'
,
'w'
,
'i'
,
'n'
,
'e'
,
'_'
,
'd'
,
'i'
,
's'
,
'p'
,
'l'
,
'a'
,
'y'
,
'_'
,
'd'
,
'e'
,
'v'
,
'i'
,
'c'
,
'e'
,
'_'
,
'g'
,
'u'
,
'i'
,
'd'
,
0
};
static
const
WCHAR
guid_formatW
[]
=
{
'%'
,
'0'
,
'8'
,
'x'
,
'-'
,
'%'
,
'0'
,
'4'
,
'x'
,
'-'
,
'%'
,
'0'
,
'4'
,
'x'
,
'-'
,
'%'
,
'0'
,
'2'
,
'x'
,
'%'
,
'0'
,
'2'
,
'x'
,
'-'
,
'%'
,
'0'
,
'2'
,
'x'
,
'%'
,
'0'
,
'2'
,
'x'
,
'%'
,
'0'
,
'2'
,
'x'
,
'%'
,
'0'
,
'2'
,
'x'
,
'%'
,
'0'
,
'2'
,
'x'
,
'%'
,
'0'
,
'2'
,
'x'
,
0
};
switch
(
message
)
{
case
WM_NCCREATE
:
{
CREATESTRUCTW
*
cs
=
(
CREATESTRUCTW
*
)
lParam
;
const
GUID
*
guid
=
cs
->
lpCreateParams
;
if
(
guid
)
{
ATOM
atom
;
WCHAR
buffer
[
37
];
sprintfW
(
buffer
,
guid_formatW
,
guid
->
Data1
,
guid
->
Data2
,
guid
->
Data3
,
guid
->
Data4
[
0
],
guid
->
Data4
[
1
],
guid
->
Data4
[
2
],
guid
->
Data4
[
3
],
guid
->
Data4
[
4
],
guid
->
Data4
[
5
],
guid
->
Data4
[
6
],
guid
->
Data4
[
7
]
);
atom
=
GlobalAddAtomW
(
buffer
);
SetPropW
(
hwnd
,
display_device_guid_propW
,
ULongToHandle
(
atom
)
);
}
return
TRUE
;
}
default:
return
0
;
/* all other messages are ignored */
}
}
/***********************************************************************
...
...
programs/explorer/desktop.c
View file @
f5113d2d
...
...
@@ -633,11 +633,8 @@ static BOOL get_default_desktop_size( const WCHAR *name, unsigned int *width, un
return
found
;
}
static
void
set_desktop_guid
(
HWND
desktop
,
HMODULE
driver
)
static
void
set_desktop_guid
(
HWND
desktop
,
GUID
*
guid
,
HMODULE
driver
)
{
static
const
WCHAR
display_device_guid_propW
[]
=
{
'_'
,
'_'
,
'w'
,
'i'
,
'n'
,
'e'
,
'_'
,
'd'
,
'i'
,
's'
,
'p'
,
'l'
,
'a'
,
'y'
,
'_'
,
'd'
,
'e'
,
'v'
,
'i'
,
'c'
,
'e'
,
'_'
,
'g'
,
'u'
,
'i'
,
'd'
,
0
};
static
const
WCHAR
device_keyW
[]
=
{
'S'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
'\\'
,
'C'
,
'u'
,
'r'
,
'r'
,
'e'
,
'n'
,
't'
,
'C'
,
'o'
,
'n'
,
't'
,
'r'
,
'o'
,
'l'
,
'S'
,
'e'
,
't'
,
'\\'
,
...
...
@@ -646,18 +643,11 @@ static void set_desktop_guid( HWND desktop, HMODULE driver )
'{'
,
'%'
,
's'
,
'}'
,
'\\'
,
'0'
,
'0'
,
'0'
,
'0'
,
0
};
static
const
WCHAR
driverW
[]
=
{
'G'
,
'r'
,
'a'
,
'p'
,
'h'
,
'i'
,
'c'
,
's'
,
'D'
,
'r'
,
'i'
,
'v'
,
'e'
,
'r'
,
0
};
GUID
guid
;
RPC_WSTR
guid_str
;
ATOM
guid_atom
;
HKEY
hkey
;
WCHAR
key
[
sizeof
(
device_keyW
)
/
sizeof
(
WCHAR
)
+
39
];
UuidCreate
(
&
guid
);
UuidToStringW
(
&
guid
,
&
guid_str
);
TRACE
(
"display guid %s
\n
"
,
debugstr_w
(
guid_str
)
);
guid_atom
=
GlobalAddAtomW
(
guid_str
);
SetPropW
(
desktop
,
display_device_guid_propW
,
ULongToHandle
(
guid_atom
)
);
UuidToStringW
(
guid
,
&
guid_str
);
sprintfW
(
key
,
device_keyW
,
guid_str
);
RpcStringFreeW
(
&
guid_str
);
...
...
@@ -724,6 +714,7 @@ void manage_desktop( WCHAR *arg )
{
static
const
WCHAR
messageW
[]
=
{
'M'
,
'e'
,
's'
,
's'
,
'a'
,
'g'
,
'e'
,
0
};
HDESK
desktop
=
0
;
GUID
guid
;
MSG
msg
;
HDC
hdc
;
HWND
hwnd
,
msg_hwnd
;
...
...
@@ -766,9 +757,12 @@ void manage_desktop( WCHAR *arg )
SetThreadDesktop
(
desktop
);
}
UuidCreate
(
&
guid
);
TRACE
(
"display guid %s
\n
"
,
debugstr_guid
(
&
guid
)
);
/* create the desktop window */
hwnd
=
CreateWindowExW
(
0
,
DESKTOP_CLASS_ATOM
,
NULL
,
WS_POPUP
|
WS_CLIPSIBLINGS
|
WS_CLIPCHILDREN
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
NULL
);
WS_POPUP
|
WS_CLIPSIBLINGS
|
WS_CLIPCHILDREN
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
&
guid
);
/* create the HWND_MESSAGE parent */
msg_hwnd
=
CreateWindowExW
(
0
,
messageW
,
NULL
,
WS_POPUP
|
WS_CLIPSIBLINGS
|
WS_CLIPCHILDREN
,
...
...
@@ -785,7 +779,7 @@ void manage_desktop( WCHAR *arg )
ReleaseDC
(
hwnd
,
hdc
);
SetWindowLongPtrW
(
hwnd
,
GWLP_WNDPROC
,
(
LONG_PTR
)
desktop_wnd_proc
);
set_desktop_guid
(
hwnd
,
graphics_driver
);
set_desktop_guid
(
hwnd
,
&
guid
,
graphics_driver
);
SendMessageW
(
hwnd
,
WM_SETICON
,
ICON_BIG
,
(
LPARAM
)
LoadIconW
(
0
,
MAKEINTRESOURCEW
(
OIC_WINLOGO
)));
if
(
name
)
set_desktop_window_title
(
hwnd
,
name
);
SetWindowPos
(
hwnd
,
0
,
GetSystemMetrics
(
SM_XVIRTUALSCREEN
),
GetSystemMetrics
(
SM_YVIRTUALSCREEN
),
...
...
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