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
dd57bbd1
Commit
dd57bbd1
authored
Jan 25, 2006
by
Vitaliy Margolen
Committed by
Alexandre Julliard
Jan 25, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user: Don't drop owned windows in WIN_EnumChildWindows.
Add a few tests for this.
parent
471782ae
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
3 deletions
+45
-3
win.c
dlls/user/tests/win.c
+45
-1
win.c
dlls/user/win.c
+0
-2
No files found.
dlls/user/tests/win.c
View file @
dd57bbd1
...
...
@@ -94,6 +94,14 @@ BOOL CALLBACK EnumChildProc( HWND hwndChild, LPARAM lParam)
return
TRUE
;
}
/* will search for the given window */
BOOL
CALLBACK
EnumChildProc1
(
HWND
hwndChild
,
LPARAM
lParam
)
{
trace
(
"EnumChildProc1 on %p
\n
"
,
hwndChild
);
if
((
HWND
)
lParam
==
hwndChild
)
return
FALSE
;
return
TRUE
;
}
static
HWND
create_tool_window
(
LONG
style
,
HWND
parent
)
{
HWND
ret
=
CreateWindowExA
(
0
,
"ToolWindowClass"
,
"Tool window 1"
,
style
,
...
...
@@ -451,7 +459,9 @@ static void test_parent_owner(void)
owner
=
create_tool_window
(
WS_OVERLAPPED
,
0
);
test
=
create_tool_window
(
WS_POPUP
,
NULL
);
test
=
create_tool_window
(
WS_POPUP
,
desktop
);
ok
(
!
GetWindow
(
test
,
GW_OWNER
),
"Wrong owner window
\n
"
);
numChildren
=
0
;
ok
(
!
EnumChildWindows
(
owner
,
EnumChildProc
,
(
LPARAM
)
&
numChildren
),
"EnumChildWindows should have returned FALSE
\n
"
);
...
...
@@ -471,6 +481,40 @@ static void test_parent_owner(void)
ok
(
!
EnumChildWindows
(
owner
,
EnumChildProc
,
(
LPARAM
)
&
numChildren
),
"EnumChildWindows should have returned FALSE
\n
"
);
ok
(
numChildren
==
2
,
"numChildren should be 2 got %d
\n
"
,
numChildren
);
DestroyWindow
(
child
);
child
=
create_tool_window
(
WS_VISIBLE
|
WS_OVERLAPPEDWINDOW
,
owner
);
ok
(
GetWindow
(
child
,
GW_OWNER
)
==
owner
,
"Wrong owner window
\n
"
);
numChildren
=
0
;
ok
(
EnumChildWindows
(
owner
,
EnumChildProc
,
(
LPARAM
)
&
numChildren
),
"EnumChildWindows should have returned TRUE
\n
"
);
ok
(
numChildren
==
1
,
"numChildren should be 1 got %d
\n
"
,
numChildren
);
ret
=
SetParent
(
child
,
owner
);
ok
(
GetWindow
(
child
,
GW_OWNER
)
==
owner
,
"Wrong owner window
\n
"
);
ok
(
ret
==
desktop
,
"SetParent return value %p expected %p
\n
"
,
ret
,
desktop
);
numChildren
=
0
;
ok
(
!
EnumChildWindows
(
owner
,
EnumChildProc
,
(
LPARAM
)
&
numChildren
),
"EnumChildWindows should have returned FALSE
\n
"
);
ok
(
numChildren
==
2
,
"numChildren should be 2 got %d
\n
"
,
numChildren
);
ret
=
SetParent
(
child
,
NULL
);
ok
(
GetWindow
(
child
,
GW_OWNER
)
==
owner
,
"Wrong owner window
\n
"
);
ok
(
ret
==
owner
,
"SetParent return value %p expected %p
\n
"
,
ret
,
owner
);
numChildren
=
0
;
ok
(
EnumChildWindows
(
owner
,
EnumChildProc
,
(
LPARAM
)
&
numChildren
),
"EnumChildWindows should have returned TRUE
\n
"
);
ok
(
numChildren
==
1
,
"numChildren should be 1 got %d
\n
"
,
numChildren
);
/* even GW_OWNER == owner it's still a desktop's child */
ok
(
!
EnumChildWindows
(
desktop
,
EnumChildProc1
,
(
LPARAM
)
child
),
"EnumChildWindows should have found %p and returned FALSE
\n
"
,
child
);
DestroyWindow
(
child
);
child
=
create_tool_window
(
WS_VISIBLE
|
WS_OVERLAPPEDWINDOW
,
NULL
);
ok
(
!
EnumChildWindows
(
desktop
,
EnumChildProc1
,
(
LPARAM
)
child
),
"EnumChildWindows should have found %p and returned FALSE
\n
"
,
child
);
DestroyWindow
(
child
);
DestroyWindow
(
test
);
...
...
dlls/user/win.c
View file @
dd57bbd1
...
...
@@ -2812,8 +2812,6 @@ static BOOL WIN_EnumChildWindows( HWND *list, WNDENUMPROC func, LPARAM lParam )
{
/* Make sure that the window still exists */
if
(
!
IsWindow
(
*
list
))
continue
;
/* skip owned windows */
if
(
GetWindow
(
*
list
,
GW_OWNER
))
continue
;
/* Build children list first */
childList
=
WIN_ListChildren
(
*
list
);
...
...
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