Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
23d9ac25
Commit
23d9ac25
authored
Mar 24, 2005
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid calling WIN_ListChildren from the graphics drivers.
parent
cb7aa875
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
118 additions
and
136 deletions
+118
-136
wnd.c
dlls/ttydrv/wnd.c
+36
-33
user32.spec
dlls/user/user32.spec
+0
-1
event.c
dlls/x11drv/event.c
+7
-23
winpos.c
dlls/x11drv/winpos.c
+74
-78
winpos.c
windows/winpos.c
+1
-1
No files found.
dlls/ttydrv/wnd.c
View file @
23d9ac25
...
...
@@ -404,6 +404,28 @@ static UINT SWP_DoNCCalcSize( WINDOWPOS* pWinpos, const RECT* pNewWindowRect, RE
}
struct
move_owned_info
{
HWND
owner
;
HWND
insert_after
;
};
static
BOOL
CALLBACK
move_owned_popups
(
HWND
hwnd
,
LPARAM
lparam
)
{
struct
move_owned_info
*
info
=
(
struct
move_owned_info
*
)
lparam
;
if
(
hwnd
==
info
->
owner
)
return
FALSE
;
if
((
GetWindowLongW
(
hwnd
,
GWL_STYLE
)
&
WS_POPUP
)
&&
GetWindow
(
hwnd
,
GW_OWNER
)
==
info
->
owner
)
{
SetWindowPos
(
hwnd
,
info
->
insert_after
,
0
,
0
,
0
,
0
,
SWP_NOMOVE
|
SWP_NOSIZE
|
SWP_NOACTIVATE
|
SWP_NOSENDCHANGING
|
SWP_DEFERERASE
);
info
->
insert_after
=
hwnd
;
}
return
TRUE
;
}
/***********************************************************************
* SWP_DoOwnedPopups
*
...
...
@@ -414,55 +436,36 @@ static UINT SWP_DoNCCalcSize( WINDOWPOS* pWinpos, const RECT* pNewWindowRect, RE
*/
static
HWND
SWP_DoOwnedPopups
(
HWND
hwnd
,
HWND
hwndInsertAfter
)
{
HWND
*
list
=
NULL
;
HWND
owner
=
GetWindow
(
hwnd
,
GW_OWNER
);
LONG
style
=
GetWindowLongW
(
hwnd
,
GWL_STYLE
);
struct
move_owned_info
info
;
WARN
(
"(%p) hInsertAfter = %p
\n
"
,
hwnd
,
hwndInsertAfter
);
TRACE
(
"(%p) hInsertAfter = %p
\n
"
,
hwnd
,
hwndInsertAfter
);
if
((
style
&
WS_POPUP
)
&&
owner
)
{
/* make sure this popup stays above the owner */
HWND
hwndLocalPrev
=
HWND_TOP
;
if
(
hwndInsertAfter
!=
HWND_TOP
)
{
if
((
list
=
WIN_ListChildren
(
GetDesktopWindow
()
)))
{
int
i
;
for
(
i
=
0
;
list
[
i
];
i
++
)
{
if
(
list
[
i
]
==
owner
)
break
;
if
(
list
[
i
]
!=
hwnd
)
hwndLocalPrev
=
list
[
i
];
if
(
hwndLocalPrev
==
hwndInsertAfter
)
break
;
}
hwndInsertAfter
=
hwndLocalPrev
;
}
}
}
else
if
(
style
&
WS_CHILD
)
return
hwndInsertAfter
;
HWND
hwndLocalPrev
=
HWND_TOP
;
HWND
prev
=
GetWindow
(
owner
,
GW_HWNDPREV
);
if
(
!
list
)
list
=
WIN_ListChildren
(
GetDesktopWindow
()
);
if
(
list
)
{
int
i
;
for
(
i
=
0
;
list
[
i
];
i
++
)
{
if
(
list
[
i
]
==
hwnd
)
break
;
if
((
GetWindowLongW
(
list
[
i
],
GWL_STYLE
)
&
WS_POPUP
)
&&
GetWindow
(
list
[
i
],
GW_OWNER
)
==
hwnd
)
while
(
prev
&&
prev
!=
hwndInsertAfter
)
{
SetWindowPos
(
list
[
i
],
hwndInsertAfter
,
0
,
0
,
0
,
0
,
SWP_NOMOVE
|
SWP_NOSIZE
|
SWP_NOACTIVATE
|
SWP_NOSENDCHANGING
|
SWP_DEFERERASE
);
hwndInsertAfter
=
list
[
i
];
if
(
hwndLocalPrev
==
HWND_TOP
&&
GetWindowLongW
(
prev
,
GWL_STYLE
)
&
WS_VISIBLE
)
hwndLocalPrev
=
prev
;
prev
=
GetWindow
(
prev
,
GW_HWNDPREV
);
}
if
(
!
prev
)
hwndInsertAfter
=
hwndLocalPrev
;
}
HeapFree
(
GetProcessHeap
(),
0
,
list
);
}
else
if
(
style
&
WS_CHILD
)
return
hwndInsertAfter
;
return
hwndInsertAfter
;
info
.
owner
=
hwnd
;
info
.
insert_after
=
hwndInsertAfter
;
EnumWindows
(
move_owned_popups
,
(
LPARAM
)
&
info
);
return
info
.
insert_after
;
}
...
...
dlls/user/user32.spec
View file @
23d9ac25
...
...
@@ -733,6 +733,5 @@
@ cdecl WINPOS_ShowIconTitle(long long)
@ cdecl WIN_GetPtr(long)
@ cdecl WIN_LinkWindow(long long long)
@ cdecl WIN_ListChildren(long)
@ cdecl WIN_SetStyle(long long long)
@ cdecl WIN_UnlinkWindow(long)
dlls/x11drv/event.c
View file @
23d9ac25
...
...
@@ -585,34 +585,18 @@ static HWND find_drop_window( HWND hQueryWnd, LPPOINT lpPt )
if
(
!
IsIconic
(
hQueryWnd
))
{
POINT
pt
=
*
lpPt
;
ScreenToClient
(
hQueryWnd
,
&
pt
);
GetClientRect
(
hQueryWnd
,
&
tempRect
);
MapWindowPoints
(
hQueryWnd
,
0
,
(
LPPOINT
)
&
tempRect
,
2
);
if
(
PtInRect
(
&
tempRect
,
*
lpP
t
))
if
(
PtInRect
(
&
tempRect
,
p
t
))
{
HWND
*
list
=
WIN_ListChildren
(
hQueryWnd
);
HWND
bResult
=
0
;
if
(
list
)
HWND
ret
=
ChildWindowFromPointEx
(
hQueryWnd
,
pt
,
CWP_SKIPINVISIBLE
|
CWP_SKIPDISABLED
);
if
(
ret
&&
ret
!=
hQueryWnd
)
{
int
i
;
for
(
i
=
0
;
list
[
i
];
i
++
)
{
if
(
GetWindowLongW
(
list
[
i
],
GWL_STYLE
)
&
WS_VISIBLE
)
{
GetWindowRect
(
list
[
i
],
&
tempRect
);
if
(
PtInRect
(
&
tempRect
,
*
lpPt
))
break
;
}
}
if
(
list
[
i
])
{
if
(
IsWindowEnabled
(
list
[
i
]
))
bResult
=
find_drop_window
(
list
[
i
],
lpPt
);
}
HeapFree
(
GetProcessHeap
(),
0
,
list
);
ret
=
find_drop_window
(
ret
,
lpPt
);
if
(
ret
)
return
ret
;
}
if
(
bResult
)
return
bResult
;
}
}
...
...
dlls/x11drv/winpos.c
View file @
23d9ac25
...
...
@@ -470,6 +470,28 @@ static UINT SWP_DoNCCalcSize( WINDOWPOS* pWinpos, const RECT* pNewWindowRect, RE
}
struct
move_owned_info
{
HWND
owner
;
HWND
insert_after
;
};
static
BOOL
CALLBACK
move_owned_popups
(
HWND
hwnd
,
LPARAM
lparam
)
{
struct
move_owned_info
*
info
=
(
struct
move_owned_info
*
)
lparam
;
if
(
hwnd
==
info
->
owner
)
return
FALSE
;
if
((
GetWindowLongW
(
hwnd
,
GWL_STYLE
)
&
WS_POPUP
)
&&
GetWindow
(
hwnd
,
GW_OWNER
)
==
info
->
owner
)
{
SetWindowPos
(
hwnd
,
info
->
insert_after
,
0
,
0
,
0
,
0
,
SWP_NOMOVE
|
SWP_NOSIZE
|
SWP_NOACTIVATE
|
SWP_NOSENDCHANGING
|
SWP_DEFERERASE
);
info
->
insert_after
=
hwnd
;
}
return
TRUE
;
}
/***********************************************************************
* SWP_DoOwnedPopups
*
...
...
@@ -480,55 +502,36 @@ static UINT SWP_DoNCCalcSize( WINDOWPOS* pWinpos, const RECT* pNewWindowRect, RE
*/
static
HWND
SWP_DoOwnedPopups
(
HWND
hwnd
,
HWND
hwndInsertAfter
)
{
HWND
*
list
=
NULL
;
HWND
owner
=
GetWindow
(
hwnd
,
GW_OWNER
);
LONG
style
=
GetWindowLongW
(
hwnd
,
GWL_STYLE
);
struct
move_owned_info
info
;
WARN
(
"(%p) hInsertAfter = %p
\n
"
,
hwnd
,
hwndInsertAfter
);
TRACE
(
"(%p) hInsertAfter = %p
\n
"
,
hwnd
,
hwndInsertAfter
);
if
((
style
&
WS_POPUP
)
&&
owner
)
{
/* make sure this popup stays above the owner */
HWND
hwndLocalPrev
=
HWND_TOP
;
if
(
hwndInsertAfter
!=
HWND_TOP
)
{
if
((
list
=
WIN_ListChildren
(
GetDesktopWindow
()
)))
{
int
i
;
for
(
i
=
0
;
list
[
i
];
i
++
)
{
if
(
list
[
i
]
==
owner
)
break
;
if
(
list
[
i
]
!=
hwnd
)
hwndLocalPrev
=
list
[
i
];
if
(
hwndLocalPrev
==
hwndInsertAfter
)
break
;
}
hwndInsertAfter
=
hwndLocalPrev
;
}
}
}
else
if
(
style
&
WS_CHILD
)
return
hwndInsertAfter
;
HWND
hwndLocalPrev
=
HWND_TOP
;
HWND
prev
=
GetWindow
(
owner
,
GW_HWNDPREV
);
if
(
!
list
)
list
=
WIN_ListChildren
(
GetDesktopWindow
()
);
if
(
list
)
{
int
i
;
for
(
i
=
0
;
list
[
i
];
i
++
)
{
if
(
list
[
i
]
==
hwnd
)
break
;
if
((
GetWindowLongW
(
list
[
i
],
GWL_STYLE
)
&
WS_POPUP
)
&&
GetWindow
(
list
[
i
],
GW_OWNER
)
==
hwnd
)
while
(
prev
&&
prev
!=
hwndInsertAfter
)
{
SetWindowPos
(
list
[
i
],
hwndInsertAfter
,
0
,
0
,
0
,
0
,
SWP_NOMOVE
|
SWP_NOSIZE
|
SWP_NOACTIVATE
|
SWP_NOSENDCHANGING
|
SWP_DEFERERASE
);
hwndInsertAfter
=
list
[
i
];
if
(
hwndLocalPrev
==
HWND_TOP
&&
GetWindowLongW
(
prev
,
GWL_STYLE
)
&
WS_VISIBLE
)
hwndLocalPrev
=
prev
;
prev
=
GetWindow
(
prev
,
GW_HWNDPREV
);
}
if
(
!
prev
)
hwndInsertAfter
=
hwndLocalPrev
;
}
HeapFree
(
GetProcessHeap
(),
0
,
list
);
}
else
if
(
style
&
WS_CHILD
)
return
hwndInsertAfter
;
return
hwndInsertAfter
;
info
.
owner
=
hwnd
;
info
.
insert_after
=
hwndInsertAfter
;
EnumWindows
(
move_owned_popups
,
(
LPARAM
)
&
info
);
return
info
.
insert_after
;
}
...
...
@@ -924,9 +927,10 @@ BOOL X11DRV_SetWindowPos( WINDOWPOS *winpos )
*/
static
POINT
WINPOS_FindIconPos
(
HWND
hwnd
,
POINT
pt
)
{
RECT
rectParent
;
HWND
*
list
,
parent
;
short
x
,
y
,
xspacing
,
yspacing
;
RECT
rect
,
rectParent
;
HWND
parent
,
child
;
HRGN
hrgn
,
tmp
;
int
xspacing
,
yspacing
;
parent
=
GetAncestor
(
hwnd
,
GA_PARENT
);
GetClientRect
(
parent
,
&
rectParent
);
...
...
@@ -937,53 +941,45 @@ static POINT WINPOS_FindIconPos( HWND hwnd, POINT pt )
xspacing
=
GetSystemMetrics
(
SM_CXICONSPACING
);
yspacing
=
GetSystemMetrics
(
SM_CYICONSPACING
);
list
=
WIN_ListChildren
(
parent
);
y
=
rectParent
.
bottom
;
for
(;;)
/* Check if another icon already occupies this spot */
/* FIXME: this is completely inefficient */
hrgn
=
CreateRectRgn
(
0
,
0
,
0
,
0
);
tmp
=
CreateRectRgn
(
0
,
0
,
0
,
0
);
for
(
child
=
GetWindow
(
parent
,
GW_HWNDFIRST
);
child
;
child
=
GetWindow
(
child
,
GW_HWNDNEXT
))
{
WND
*
childPtr
;
if
(
child
==
hwnd
)
continue
;
if
((
GetWindowLongW
(
child
,
GWL_STYLE
)
&
(
WS_VISIBLE
|
WS_MINIMIZE
))
!=
(
WS_VISIBLE
|
WS_MINIMIZE
))
continue
;
if
(
!
(
childPtr
=
WIN_GetPtr
(
child
))
||
childPtr
==
WND_OTHER_PROCESS
)
continue
;
SetRectRgn
(
tmp
,
childPtr
->
rectWindow
.
left
,
childPtr
->
rectWindow
.
top
,
childPtr
->
rectWindow
.
right
,
childPtr
->
rectWindow
.
bottom
);
CombineRgn
(
hrgn
,
hrgn
,
tmp
,
RGN_OR
);
WIN_ReleasePtr
(
childPtr
);
}
DeleteObject
(
tmp
);
for
(
rect
.
bottom
=
rectParent
.
bottom
;
rect
.
bottom
>=
yspacing
;
rect
.
bottom
-=
yspacing
)
{
x
=
rectParent
.
left
;
do
for
(
rect
.
left
=
rectParent
.
left
;
rect
.
left
<=
rectParent
.
right
-
xspacing
;
rect
.
left
+=
xspacing
)
{
/* Check if another icon already occupies this spot */
/* FIXME: this is completely inefficient */
if
(
list
)
rect
.
right
=
rect
.
left
+
xspacing
;
rect
.
top
=
rect
.
bottom
-
yspacing
;
if
(
!
RectInRegion
(
hrgn
,
&
rect
)
)
{
int
i
;
WND
*
childPtr
;
for
(
i
=
0
;
list
[
i
];
i
++
)
{
if
(
list
[
i
]
==
hwnd
)
continue
;
if
(
!
IsIconic
(
list
[
i
]
))
continue
;
if
(
!
(
childPtr
=
WIN_GetPtr
(
list
[
i
]
))
||
childPtr
==
WND_OTHER_PROCESS
)
continue
;
if
((
childPtr
->
rectWindow
.
left
<
x
+
xspacing
)
&&
(
childPtr
->
rectWindow
.
right
>=
x
)
&&
(
childPtr
->
rectWindow
.
top
<=
y
)
&&
(
childPtr
->
rectWindow
.
bottom
>
y
-
yspacing
))
{
WIN_ReleasePtr
(
childPtr
);
break
;
/* There's a window in there */
}
WIN_ReleasePtr
(
childPtr
);
}
if
(
list
[
i
])
{
/* found something here, try next spot */
x
+=
xspacing
;
continue
;
}
/* No window was found, so it's OK for us */
pt
.
x
=
rect
.
left
+
(
xspacing
-
GetSystemMetrics
(
SM_CXICON
))
/
2
;
pt
.
y
=
rect
.
top
+
(
yspacing
-
GetSystemMetrics
(
SM_CYICON
))
/
2
;
DeleteObject
(
hrgn
);
return
pt
;
}
/* No window was found, so it's OK for us */
pt
.
x
=
x
+
(
xspacing
-
GetSystemMetrics
(
SM_CXICON
))
/
2
;
pt
.
y
=
y
-
(
yspacing
+
GetSystemMetrics
(
SM_CYICON
))
/
2
;
HeapFree
(
GetProcessHeap
(),
0
,
list
);
return
pt
;
}
while
(
x
<=
rectParent
.
right
-
xspacing
);
y
-=
yspacing
;
}
}
DeleteObject
(
hrgn
);
pt
.
x
=
pt
.
y
=
0
;
return
pt
;
}
...
...
windows/winpos.c
View file @
23d9ac25
...
...
@@ -435,7 +435,7 @@ HWND WINAPI ChildWindowFromPointEx( HWND hwndParent, POINT pt, UINT uFlags)
GetClientRect
(
hwndParent
,
&
rect
);
if
(
!
PtInRect
(
&
rect
,
pt
))
return
0
;
if
(
!
(
list
=
WIN_ListChildren
(
hwndParent
)))
return
0
;
if
(
!
(
list
=
WIN_ListChildren
(
hwndParent
)))
return
hwndParent
;
for
(
i
=
0
;
list
[
i
];
i
++
)
{
...
...
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