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
8f565eb6
Commit
8f565eb6
authored
Dec 07, 2011
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Dec 07, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Add more window style tests, make them pass under Wine.
parent
0652bbc3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
20 deletions
+59
-20
win.c
dlls/user32/tests/win.c
+45
-11
win.c
dlls/user32/win.c
+14
-9
No files found.
dlls/user32/tests/win.c
View file @
8f565eb6
...
...
@@ -3696,6 +3696,7 @@ static void register_style_check_class(void)
};
atomStyleCheckClass
=
RegisterClass
(
&
wc
);
assert
(
atomStyleCheckClass
);
}
static
void
check_window_style
(
DWORD
dwStyleIn
,
DWORD
dwExStyleIn
,
DWORD
dwStyleOut
,
DWORD
dwExStyleOut
)
...
...
@@ -3723,12 +3724,23 @@ static void check_window_style(DWORD dwStyleIn, DWORD dwExStyleIn, DWORD dwStyle
dwActualStyle
=
GetWindowLong
(
hwnd
,
GWL_STYLE
);
dwActualExStyle
=
GetWindowLong
(
hwnd
,
GWL_EXSTYLE
);
ok
((
dwActualStyle
==
dwStyleOut
)
&&
(
dwActualExStyle
==
dwExStyleOut
),
"Style (0x%08x) should really be 0x%08x and/or Ex style (0x%08x) should really be 0x%08x
\n
"
,
dwActualStyle
,
dwStyleOut
,
dwActualExStyle
,
dwExStyleOut
);
ok
(
dwActualStyle
==
dwStyleOut
,
"expected style %#x, got %#x
\n
"
,
dwStyleOut
,
dwActualStyle
);
ok
(
dwActualExStyle
==
dwExStyleOut
,
"expected ex_style %#x, got %#x
\n
"
,
dwExStyleOut
,
dwActualExStyle
);
/* try setting the styles explicitly */
SetWindowLong
(
hwnd
,
GWL_EXSTYLE
,
dwExStyleIn
);
dwActualStyle
=
GetWindowLong
(
hwnd
,
GWL_STYLE
);
dwActualExStyle
=
GetWindowLong
(
hwnd
,
GWL_EXSTYLE
);
/* WS_EX_WINDOWEDGE can't always be changed */
if
(
dwExStyleIn
&
WS_EX_DLGMODALFRAME
)
dwExStyleOut
=
dwExStyleIn
|
WS_EX_WINDOWEDGE
;
else
if
((
dwActualStyle
&
(
WS_DLGFRAME
|
WS_THICKFRAME
))
&&
!
(
dwExStyleIn
&
WS_EX_STATICEDGE
))
dwExStyleOut
=
dwExStyleIn
|
WS_EX_WINDOWEDGE
;
else
dwExStyleOut
=
dwExStyleIn
&
~
WS_EX_WINDOWEDGE
;
ok
(
dwActualStyle
==
dwStyleOut
,
"expected style %#x, got %#x
\n
"
,
dwStyleOut
,
dwActualStyle
);
ok
(
dwActualExStyle
==
dwExStyleOut
,
"expected ex_style %#x, got %#x
\n
"
,
dwExStyleOut
,
dwActualExStyle
);
SetWindowLong
(
hwnd
,
GWL_STYLE
,
dwStyleIn
);
dwActualStyle
=
GetWindowLong
(
hwnd
,
GWL_STYLE
);
dwActualExStyle
=
GetWindowLong
(
hwnd
,
GWL_EXSTYLE
);
...
...
@@ -3736,15 +3748,18 @@ static void check_window_style(DWORD dwStyleIn, DWORD dwExStyleIn, DWORD dwStyle
if
((
dwStyleIn
&
(
WS_CHILD
|
WS_POPUP
))
==
WS_CHILD
)
dwStyleOut
=
dwStyleIn
;
else
dwStyleOut
=
dwStyleIn
|
WS_CLIPSIBLINGS
;
/* WS_EX_WINDOWEDGE can't always be changed */
if
(
(
dwExStyleIn
&
WS_EX_DLGMODALFRAME
)
||
(
dwStyleIn
&
WS_THICKFRAME
)
)
if
(
dwExStyleIn
&
WS_EX_DLGMODALFRAME
)
dwExStyleOut
=
dwExStyleIn
|
WS_EX_WINDOWEDGE
;
else
if
(
dwStyleIn
&
(
WS_CHILD
|
WS_POPUP
))
else
if
((
dwActualStyle
&
(
WS_DLGFRAME
|
WS_THICKFRAME
))
&&
!
(
dwExStyleIn
&
WS_EX_STATICEDGE
))
dwExStyleOut
=
dwExStyleIn
|
WS_EX_WINDOWEDGE
;
else
dwExStyleOut
=
dwExStyleIn
&
~
WS_EX_WINDOWEDGE
;
ok
(
dwActualStyle
==
dwStyleOut
,
"expected style %#x, got %#x
\n
"
,
dwStyleOut
,
dwActualStyle
);
/* FIXME: Remove the condition below once Wine is fixed */
if
(
dwActualExStyle
!=
dwExStyleOut
)
todo_wine
ok
(
dwActualExStyle
==
dwExStyleOut
,
"expected ex_style %#x, got %#x
\n
"
,
dwExStyleOut
,
dwActualExStyle
);
else
dwExStyleOut
=
dwExStyleIn
;
ok
((
dwActualStyle
==
dwStyleOut
)
&&
(
dwActualExStyle
==
dwExStyleOut
),
"%08x/%08x: Style (0x%08x) should really be 0x%08x and/or Ex style (0x%08x) should really be 0x%08x
\n
"
,
dwStyleIn
,
dwExStyleIn
,
dwActualStyle
,
dwStyleOut
,
dwActualExStyle
,
dwExStyleOut
);
ok
(
dwActualExStyle
==
dwExStyleOut
,
"expected ex_style %#x, got %#x
\n
"
,
dwExStyleOut
,
dwActualExStyle
);
DestroyWindow
(
hwnd
);
if
(
hwndParent
)
DestroyWindow
(
hwndParent
);
...
...
@@ -3756,17 +3771,36 @@ static void test_window_styles(void)
register_style_check_class
();
check_window_style
(
0
,
0
,
WS_CLIPSIBLINGS
|
WS_CAPTION
,
WS_EX_WINDOWEDGE
);
check_window_style
(
WS_DLGFRAME
,
0
,
WS_CLIPSIBLINGS
|
WS_CAPTION
,
WS_EX_WINDOWEDGE
);
check_window_style
(
WS_THICKFRAME
,
0
,
WS_THICKFRAME
|
WS_CLIPSIBLINGS
|
WS_CAPTION
,
WS_EX_WINDOWEDGE
);
check_window_style
(
WS_DLGFRAME
,
WS_EX_STATICEDGE
,
WS_CLIPSIBLINGS
|
WS_CAPTION
,
WS_EX_WINDOWEDGE
|
WS_EX_STATICEDGE
);
check_window_style
(
WS_THICKFRAME
,
WS_EX_STATICEDGE
,
WS_THICKFRAME
|
WS_CLIPSIBLINGS
|
WS_CAPTION
,
WS_EX_WINDOWEDGE
|
WS_EX_STATICEDGE
);
check_window_style
(
WS_OVERLAPPEDWINDOW
,
0
,
WS_CLIPSIBLINGS
|
WS_OVERLAPPEDWINDOW
,
WS_EX_WINDOWEDGE
);
check_window_style
(
WS_CHILD
,
0
,
WS_CHILD
,
0
);
check_window_style
(
WS_CHILD
|
WS_DLGFRAME
,
0
,
WS_CHILD
|
WS_DLGFRAME
,
WS_EX_WINDOWEDGE
);
check_window_style
(
WS_CHILD
|
WS_THICKFRAME
,
0
,
WS_CHILD
|
WS_THICKFRAME
,
WS_EX_WINDOWEDGE
);
check_window_style
(
WS_CHILD
|
WS_DLGFRAME
,
WS_EX_STATICEDGE
,
WS_CHILD
|
WS_DLGFRAME
,
WS_EX_STATICEDGE
);
check_window_style
(
WS_CHILD
|
WS_THICKFRAME
,
WS_EX_STATICEDGE
,
WS_CHILD
|
WS_THICKFRAME
,
WS_EX_STATICEDGE
);
check_window_style
(
WS_CHILD
|
WS_CAPTION
,
0
,
WS_CHILD
|
WS_CAPTION
,
WS_EX_WINDOWEDGE
);
check_window_style
(
WS_CHILD
|
WS_CAPTION
|
WS_SYSMENU
,
0
,
WS_CHILD
|
WS_CAPTION
|
WS_SYSMENU
,
WS_EX_WINDOWEDGE
);
check_window_style
(
WS_CHILD
,
WS_EX_WINDOWEDGE
,
WS_CHILD
,
0
);
check_window_style
(
WS_CHILD
,
WS_EX_DLGMODALFRAME
,
WS_CHILD
,
WS_EX_WINDOWEDGE
|
WS_EX_DLGMODALFRAME
);
check_window_style
(
WS_CHILD
,
WS_EX_DLGMODALFRAME
|
WS_EX_STATICEDGE
,
WS_CHILD
,
WS_EX_STATICEDGE
|
WS_EX_WINDOWEDGE
|
WS_EX_DLGMODALFRAME
);
check_window_style
(
WS_CHILD
|
WS_POPUP
,
0
,
WS_CHILD
|
WS_POPUP
|
WS_CLIPSIBLINGS
,
0
);
check_window_style
(
WS_CHILD
|
WS_POPUP
|
WS_DLGFRAME
,
0
,
WS_CHILD
|
WS_POPUP
|
WS_DLGFRAME
|
WS_CLIPSIBLINGS
,
WS_EX_WINDOWEDGE
);
check_window_style
(
WS_CHILD
|
WS_POPUP
|
WS_THICKFRAME
,
0
,
WS_CHILD
|
WS_POPUP
|
WS_THICKFRAME
|
WS_CLIPSIBLINGS
,
WS_EX_WINDOWEDGE
);
check_window_style
(
WS_CHILD
|
WS_POPUP
|
WS_DLGFRAME
,
WS_EX_STATICEDGE
,
WS_CHILD
|
WS_POPUP
|
WS_DLGFRAME
|
WS_CLIPSIBLINGS
,
WS_EX_STATICEDGE
);
check_window_style
(
WS_CHILD
|
WS_POPUP
|
WS_THICKFRAME
,
WS_EX_STATICEDGE
,
WS_CHILD
|
WS_POPUP
|
WS_THICKFRAME
|
WS_CLIPSIBLINGS
,
WS_EX_STATICEDGE
);
check_window_style
(
WS_CHILD
|
WS_POPUP
,
WS_EX_APPWINDOW
,
WS_CHILD
|
WS_POPUP
|
WS_CLIPSIBLINGS
,
WS_EX_APPWINDOW
);
check_window_style
(
WS_CHILD
|
WS_POPUP
,
WS_EX_WINDOWEDGE
,
WS_CHILD
|
WS_POPUP
|
WS_CLIPSIBLINGS
,
0
);
check_window_style
(
WS_CHILD
,
WS_EX_WINDOWEDGE
,
WS_CHILD
,
0
);
check_window_style
(
0
,
WS_EX_TOOLWINDOW
,
WS_CLIPSIBLINGS
|
WS_CAPTION
,
WS_EX_WINDOWEDGE
|
WS_EX_TOOLWINDOW
);
check_window_style
(
WS_POPUP
,
0
,
WS_POPUP
|
WS_CLIPSIBLINGS
,
0
);
check_window_style
(
WS_POPUP
,
WS_EX_WINDOWEDGE
,
WS_POPUP
|
WS_CLIPSIBLINGS
,
0
);
check_window_style
(
WS_CHILD
,
WS_EX_DLGMODALFRAME
,
WS_CHILD
,
WS_EX_WINDOWEDGE
|
WS_EX_DLGMODALFRAME
);
check_window_style
(
WS_CHILD
,
WS_EX_DLGMODALFRAME
|
WS_EX_STATICEDGE
,
WS_CHILD
,
WS_EX_STATICEDGE
|
WS_EX_WINDOWEDGE
|
WS_EX_DLGMODALFRAME
);
check_window_style
(
WS_POPUP
|
WS_DLGFRAME
,
0
,
WS_POPUP
|
WS_DLGFRAME
|
WS_CLIPSIBLINGS
,
WS_EX_WINDOWEDGE
);
check_window_style
(
WS_POPUP
|
WS_THICKFRAME
,
0
,
WS_POPUP
|
WS_THICKFRAME
|
WS_CLIPSIBLINGS
,
WS_EX_WINDOWEDGE
);
check_window_style
(
WS_POPUP
|
WS_DLGFRAME
,
WS_EX_STATICEDGE
,
WS_POPUP
|
WS_DLGFRAME
|
WS_CLIPSIBLINGS
,
WS_EX_STATICEDGE
);
check_window_style
(
WS_POPUP
|
WS_THICKFRAME
,
WS_EX_STATICEDGE
,
WS_POPUP
|
WS_THICKFRAME
|
WS_CLIPSIBLINGS
,
WS_EX_STATICEDGE
);
check_window_style
(
WS_CAPTION
,
WS_EX_STATICEDGE
,
WS_CLIPSIBLINGS
|
WS_CAPTION
,
WS_EX_STATICEDGE
|
WS_EX_WINDOWEDGE
);
check_window_style
(
0
,
WS_EX_APPWINDOW
,
WS_CLIPSIBLINGS
|
WS_CAPTION
,
WS_EX_APPWINDOW
|
WS_EX_WINDOWEDGE
);
...
...
dlls/user32/win.c
View file @
8f565eb6
...
...
@@ -1324,14 +1324,15 @@ HWND WIN_CreateWindowEx( CREATESTRUCTW *cs, LPCWSTR className, HINSTANCE module,
wndPtr
->
dwStyle
|=
WS_CAPTION
;
}
/*
* WS_EX_WINDOWEDGE appears to be enforced based on the other styles, so
* why does the user get to set it?
*/
if
((
wndPtr
->
dwExStyle
&
WS_EX_DLGMODALFRAME
)
||
(
wndPtr
->
dwStyle
&
(
WS_DLGFRAME
|
WS_THICKFRAME
)))
/* WS_EX_WINDOWEDGE depends on some other styles */
if
(
wndPtr
->
dwExStyle
&
WS_EX_DLGMODALFRAME
)
wndPtr
->
dwExStyle
|=
WS_EX_WINDOWEDGE
;
else
if
(
wndPtr
->
dwStyle
&
(
WS_DLGFRAME
|
WS_THICKFRAME
))
{
if
(
!
((
wndPtr
->
dwExStyle
&
WS_EX_STATICEDGE
)
&&
(
wndPtr
->
dwStyle
&
(
WS_CHILD
|
WS_POPUP
))))
wndPtr
->
dwExStyle
|=
WS_EX_WINDOWEDGE
;
}
else
wndPtr
->
dwExStyle
&=
~
WS_EX_WINDOWEDGE
;
...
...
@@ -2176,6 +2177,8 @@ LONG_PTR WIN_SetWindowLong( HWND hwnd, INT offset, UINT size, LONG_PTR newval, B
newval
=
style
.
styleNew
;
/* WS_CLIPSIBLINGS can't be reset on top-level windows */
if
(
wndPtr
->
parent
==
GetDesktopWindow
())
newval
|=
WS_CLIPSIBLINGS
;
/* FIXME: changing WS_DLGFRAME | WS_THICKFRAME is supposed to change
WS_EX_WINDOWEDGE too */
break
;
case
GWL_EXSTYLE
:
style
.
styleOld
=
wndPtr
->
dwExStyle
;
...
...
@@ -2186,9 +2189,11 @@ LONG_PTR WIN_SetWindowLong( HWND hwnd, INT offset, UINT size, LONG_PTR newval, B
/* WS_EX_TOPMOST can only be changed through SetWindowPos */
newval
=
(
style
.
styleNew
&
~
WS_EX_TOPMOST
)
|
(
wndPtr
->
dwExStyle
&
WS_EX_TOPMOST
);
/* WS_EX_WINDOWEDGE depends on some other styles */
if
((
newval
&
WS_EX_DLGMODALFRAME
)
||
(
wndPtr
->
dwStyle
&
WS_THICKFRAME
))
if
(
newval
&
WS_EX_DLGMODALFRAME
)
newval
|=
WS_EX_WINDOWEDGE
;
else
if
(
!
(
newval
&
WS_EX_STATICEDGE
)
&&
(
wndPtr
->
dwStyle
&
(
WS_DLGFRAME
|
WS_THICKFRAME
)))
newval
|=
WS_EX_WINDOWEDGE
;
else
if
(
wndPtr
->
dwStyle
&
(
WS_CHILD
|
WS_POPUP
))
else
newval
&=
~
WS_EX_WINDOWEDGE
;
break
;
case
GWLP_HWNDPARENT
:
...
...
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