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
9d9dac09
Commit
9d9dac09
authored
Aug 24, 2001
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added WIN_ListParents function and renamed WIN_BuildWinArray into
WIN_ListChildren. Made owner field in WND structure an HWND.
parent
41d6a96a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
47 additions
and
47 deletions
+47
-47
icontitle.c
controls/icontitle.c
+1
-3
window.c
dlls/x11drv/window.c
+3
-3
winpos.c
dlls/x11drv/winpos.c
+3
-3
win.h
include/win.h
+3
-3
dialog.c
windows/dialog.c
+2
-2
mdi.c
windows/mdi.c
+16
-16
painting.c
windows/painting.c
+6
-6
user.c
windows/user.c
+2
-2
win.c
windows/win.c
+0
-0
winpos.c
windows/winpos.c
+11
-9
No files found.
controls/icontitle.c
View file @
9d9dac09
...
...
@@ -58,12 +58,10 @@ HWND ICONTITLE_Create( HWND owner )
wndPtr
=
WIN_FindWndPtr
(
hWnd
);
if
(
wndPtr
)
{
WND
*
wnd
=
WIN_FindWndPtr
(
owner
);
wndPtr
->
owner
=
wnd
;
/* MDI depends on this */
wndPtr
->
owner
=
owner
;
/* MDI depends on this */
wndPtr
->
dwStyle
&=
~
(
WS_CAPTION
|
WS_BORDER
);
if
(
!
IsWindowEnabled
(
owner
))
wndPtr
->
dwStyle
|=
WS_DISABLED
;
WIN_ReleaseWndPtr
(
wndPtr
);
WIN_ReleaseWndPtr
(
wnd
);
return
hWnd
;
}
return
0
;
...
...
dlls/x11drv/window.c
View file @
9d9dac09
...
...
@@ -347,9 +347,9 @@ static void set_wm_hints( Display *display, WND *win )
/* transient for hint */
if
(
win
->
owner
)
{
struct
x11drv_win_data
*
owner_data
=
win
->
owner
->
pDriverData
;
XSetTransientForHint
(
display
,
data
->
whole_window
,
owner_
data
->
whole_window
);
group_leader
=
owner_
data
->
whole_window
;
Window
owner_win
=
X11DRV_get_whole_window
(
win
->
owner
)
;
XSetTransientForHint
(
display
,
data
->
whole_window
,
owner_
win
);
group_leader
=
owner_
win
;
}
else
group_leader
=
data
->
whole_window
;
...
...
dlls/x11drv/winpos.c
View file @
9d9dac09
...
...
@@ -573,7 +573,7 @@ static HWND SWP_DoOwnedPopups(HWND hwnd, HWND hwndInsertAfter)
if
(
hwndInsertAfter
!=
HWND_TOP
)
{
if
((
list
=
WIN_
BuildWinArray
(
GetDesktopWindow
()
)))
if
((
list
=
WIN_
ListChildren
(
GetDesktopWindow
()
)))
{
int
i
;
for
(
i
=
0
;
list
[
i
];
i
++
)
...
...
@@ -588,7 +588,7 @@ static HWND SWP_DoOwnedPopups(HWND hwnd, HWND hwndInsertAfter)
}
else
if
(
style
&
WS_CHILD
)
return
hwndInsertAfter
;
if
(
!
list
)
list
=
WIN_
BuildWinArray
(
GetDesktopWindow
()
);
if
(
!
list
)
list
=
WIN_
ListChildren
(
GetDesktopWindow
()
);
if
(
list
)
{
int
i
;
...
...
@@ -604,7 +604,7 @@ static HWND SWP_DoOwnedPopups(HWND hwnd, HWND hwndInsertAfter)
hwndInsertAfter
=
list
[
i
];
}
}
WIN_ReleaseWinArray
(
list
);
HeapFree
(
GetProcessHeap
(),
0
,
list
);
}
return
hwndInsertAfter
;
...
...
include/win.h
View file @
9d9dac09
...
...
@@ -25,7 +25,7 @@ typedef struct tagWND
struct
tagWND
*
next
;
/* Next sibling */
struct
tagWND
*
child
;
/* First child */
struct
tagWND
*
parent
;
/* Window parent (from CreateWindow) */
struct
tagWND
*
owner
;
/* Window owner */
HWND
owner
;
/* Window owner */
struct
tagCLASS
*
class
;
/* Window class */
HWINDOWPROC
winproc
;
/* Window procedure */
DWORD
dwMagic
;
/* Magic number (must be WND_MAGIC) */
...
...
@@ -92,8 +92,8 @@ extern HWND WIN_FindWinToRepaint( HWND hwnd );
extern
void
WIN_DestroyThreadWindows
(
HWND
hwnd
);
extern
BOOL
WIN_CreateDesktopWindow
(
void
);
extern
BOOL
WIN_IsWindowDrawable
(
WND
*
,
BOOL
);
extern
HWND
*
WIN_
BuildWinArray
(
HWND
hwnd
);
extern
void
WIN_ReleaseWinArray
(
HWND
*
wndArray
);
extern
HWND
*
WIN_
ListParents
(
HWND
hwnd
);
extern
HWND
*
WIN_ListChildren
(
HWND
hwnd
);
extern
BOOL
WIN_InternalShowOwnedPopups
(
HWND
owner
,
BOOL
fShow
,
BOOL
unmanagedOnly
);
extern
HWND
CARET_GetHwnd
(
void
);
...
...
windows/dialog.c
View file @
9d9dac09
...
...
@@ -1609,14 +1609,14 @@ HWND16 WINAPI GetDlgItem16( HWND16 hwndDlg, INT16 id )
HWND
WINAPI
GetDlgItem
(
HWND
hwndDlg
,
INT
id
)
{
int
i
;
HWND
*
list
=
WIN_
BuildWinArray
(
hwndDlg
);
HWND
*
list
=
WIN_
ListChildren
(
hwndDlg
);
HWND
ret
=
0
;
if
(
!
list
)
return
0
;
for
(
i
=
0
;
list
[
i
];
i
++
)
if
(
GetWindowLongW
(
list
[
i
],
GWL_ID
)
==
id
)
break
;
ret
=
list
[
i
];
WIN_ReleaseWinArray
(
list
);
HeapFree
(
GetProcessHeap
(),
0
,
list
);
return
ret
;
}
...
...
windows/mdi.c
View file @
9d9dac09
...
...
@@ -141,13 +141,13 @@ static HWND MDI_GetChildByID(HWND hwnd, UINT id)
HWND
*
win_array
;
int
i
;
if
(
!
(
win_array
=
WIN_
BuildWinArray
(
hwnd
)))
return
0
;
if
(
!
(
win_array
=
WIN_
ListChildren
(
hwnd
)))
return
0
;
for
(
i
=
0
;
win_array
[
i
];
i
++
)
{
if
(
GetWindowLongA
(
win_array
[
i
],
GWL_ID
)
==
id
)
break
;
}
ret
=
win_array
[
i
];
WIN_ReleaseWinArray
(
win_array
);
HeapFree
(
GetProcessHeap
(),
0
,
win_array
);
return
ret
;
}
...
...
@@ -282,7 +282,7 @@ static HWND MDI_GetWindow(MDICLIENTINFO *clientInfo, HWND hWnd, BOOL bNext,
dwStyleMask
|=
WS_DISABLED
|
WS_VISIBLE
;
if
(
!
hWnd
)
hWnd
=
clientInfo
->
hwndActiveChild
;
if
(
!
(
list
=
WIN_
BuildWinArray
(
GetParent
(
hWnd
)
)))
return
0
;
if
(
!
(
list
=
WIN_
ListChildren
(
GetParent
(
hWnd
)
)))
return
0
;
i
=
0
;
/* start from next after hWnd */
while
(
list
[
i
]
&&
list
[
i
]
!=
hWnd
)
i
++
;
...
...
@@ -304,7 +304,7 @@ static HWND MDI_GetWindow(MDICLIENTINFO *clientInfo, HWND hWnd, BOOL bNext,
if
(
bNext
)
goto
found
;
}
found:
WIN_ReleaseWinArray
(
list
);
HeapFree
(
GetProcessHeap
(),
0
,
list
);
return
last
;
}
...
...
@@ -857,7 +857,7 @@ static LONG MDICascade( HWND client, MDICLIENTINFO *ci )
if
(
ci
->
nActiveChildren
==
0
)
return
0
;
if
(
!
(
win_array
=
WIN_
BuildWinArray
(
client
)))
return
0
;
if
(
!
(
win_array
=
WIN_
ListChildren
(
client
)))
return
0
;
/* remove all the windows we don't want */
for
(
i
=
total
=
0
;
win_array
[
i
];
i
++
)
...
...
@@ -890,7 +890,7 @@ static LONG MDICascade( HWND client, MDICLIENTINFO *ci )
SWP_DRAWFRAME
|
SWP_NOACTIVATE
|
SWP_NOZORDER
);
}
}
WIN_ReleaseWinArray
(
win_array
);
HeapFree
(
GetProcessHeap
(),
0
,
win_array
);
if
(
has_icons
)
ArrangeIconicWindows
(
client
);
return
0
;
...
...
@@ -910,7 +910,7 @@ static void MDITile( HWND client, MDICLIENTINFO *ci, WPARAM wParam )
if
(
ci
->
nActiveChildren
==
0
)
return
;
if
(
!
(
win_array
=
WIN_
BuildWinArray
(
client
)))
return
;
if
(
!
(
win_array
=
WIN_
ListChildren
(
client
)))
return
;
/* remove all the windows we don't want */
for
(
i
=
total
=
0
;
win_array
[
i
];
i
++
)
...
...
@@ -975,7 +975,7 @@ static void MDITile( HWND client, MDICLIENTINFO *ci, WPARAM wParam )
x
+=
xsize
;
}
}
WIN_ReleaseWinArray
(
win_array
);
HeapFree
(
GetProcessHeap
(),
0
,
win_array
);
if
(
has_icons
)
ArrangeIconicWindows
(
client
);
}
...
...
@@ -1948,7 +1948,7 @@ void WINAPI CalcChildScroll( HWND hwnd, INT scroll )
GetClientRect
(
hwnd
,
&
clientRect
);
SetRectEmpty
(
&
childRect
);
if
((
list
=
WIN_
BuildWinArray
(
hwnd
)))
if
((
list
=
WIN_
ListChildren
(
hwnd
)))
{
int
i
;
for
(
i
=
0
;
list
[
i
];
i
++
)
...
...
@@ -1956,7 +1956,7 @@ void WINAPI CalcChildScroll( HWND hwnd, INT scroll )
DWORD
style
=
GetWindowLongW
(
list
[
i
],
GWL_STYLE
);
if
(
style
&
WS_MAXIMIZE
)
{
WIN_ReleaseWinArray
(
list
);
HeapFree
(
GetProcessHeap
(),
0
,
list
);
ShowScrollBar
(
hwnd
,
SB_BOTH
,
FALSE
);
return
;
}
...
...
@@ -1967,7 +1967,7 @@ void WINAPI CalcChildScroll( HWND hwnd, INT scroll )
WIN_ReleaseWndPtr
(
pWnd
);
}
}
WIN_ReleaseWinArray
(
list
);
HeapFree
(
GetProcessHeap
(),
0
,
list
);
}
UnionRect
(
&
childRect
,
&
clientRect
,
&
childRect
);
...
...
@@ -2145,11 +2145,11 @@ static BOOL WINAPI MDI_MoreWindowsDlgProc (HWND hDlg, UINT iMsg, WPARAM wParam,
HWND
hListBox
=
GetDlgItem
(
hDlg
,
MDI_IDC_LISTBOX
);
HWND
*
list
,
*
sorted_list
;
if
(
!
(
list
=
WIN_
BuildWinArray
(
(
HWND
)
lParam
)))
return
TRUE
;
if
(
!
(
list
=
WIN_
ListChildren
(
(
HWND
)
lParam
)))
return
TRUE
;
if
(
!
(
sorted_list
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
HWND
)
*
ci
->
nActiveChildren
)))
{
WIN_ReleaseWinArray
(
list
);
HeapFree
(
GetProcessHeap
(),
0
,
list
);
return
FALSE
;
}
...
...
@@ -2159,7 +2159,7 @@ static BOOL WINAPI MDI_MoreWindowsDlgProc (HWND hDlg, UINT iMsg, WPARAM wParam,
UINT
id
=
GetWindowLongW
(
list
[
i
],
GWL_ID
)
-
ci
->
idFirstChild
;
if
(
id
<
ci
->
nActiveChildren
)
sorted_list
[
id
]
=
list
[
i
];
}
WIN_ReleaseWinArray
(
list
);
HeapFree
(
GetProcessHeap
(),
0
,
list
);
for
(
i
=
0
;
i
<
ci
->
nActiveChildren
;
i
++
)
{
...
...
@@ -2260,13 +2260,13 @@ static void MDI_SwapMenuItems(HWND parent, UINT pos1, UINT pos2)
HWND
*
list
;
int
i
;
if
(
!
(
list
=
WIN_
BuildWinArray
(
parent
)))
return
;
if
(
!
(
list
=
WIN_
ListChildren
(
parent
)))
return
;
for
(
i
=
0
;
list
[
i
];
i
++
)
{
UINT
id
=
GetWindowLongW
(
list
[
i
],
GWL_ID
);
if
(
id
==
pos1
)
SetWindowLongW
(
list
[
i
],
GWL_ID
,
pos2
);
else
if
(
id
==
pos2
)
SetWindowLongW
(
list
[
i
],
GWL_ID
,
pos1
);
}
WIN_ReleaseWinArray
(
list
);
HeapFree
(
GetProcessHeap
(),
0
,
list
);
}
windows/painting.c
View file @
9d9dac09
...
...
@@ -651,7 +651,7 @@ static void RDW_UpdateRgns( WND* wndPtr, HRGN hRgn, UINT flags, BOOL firstRecurs
if
(
flags
&
(
RDW_INVALIDATE
|
RDW_VALIDATE
)
)
{
HWND
*
list
;
if
(
hRgn
>
1
&&
bChildren
&&
(
list
=
WIN_
BuildWinArray
(
wndPtr
->
hwndSelf
)))
if
(
hRgn
>
1
&&
bChildren
&&
(
list
=
WIN_
ListChildren
(
wndPtr
->
hwndSelf
)))
{
POINT
ptTotal
,
prevOrigin
=
{
0
,
0
};
POINT
ptClient
;
...
...
@@ -689,7 +689,7 @@ static void RDW_UpdateRgns( WND* wndPtr, HRGN hRgn, UINT flags, BOOL firstRecurs
}
WIN_ReleaseWndPtr
(
wnd
);
}
WIN_ReleaseWinArray
(
list
);
HeapFree
(
GetProcessHeap
(),
0
,
list
);
OffsetRgn
(
hRgn
,
ptTotal
.
x
,
ptTotal
.
y
);
bChildren
=
0
;
}
...
...
@@ -700,7 +700,7 @@ static void RDW_UpdateRgns( WND* wndPtr, HRGN hRgn, UINT flags, BOOL firstRecurs
if
(
bChildren
)
{
HWND
*
list
;
if
((
list
=
WIN_
BuildWinArray
(
wndPtr
->
hwndSelf
)))
if
((
list
=
WIN_
ListChildren
(
wndPtr
->
hwndSelf
)))
{
INT
i
;
for
(
i
=
0
;
list
[
i
];
i
++
)
...
...
@@ -711,7 +711,7 @@ static void RDW_UpdateRgns( WND* wndPtr, HRGN hRgn, UINT flags, BOOL firstRecurs
RDW_UpdateRgns
(
wnd
,
hRgn
,
flags
,
FALSE
);
WIN_ReleaseWndPtr
(
wnd
);
}
WIN_ReleaseWinArray
(
list
);
HeapFree
(
GetProcessHeap
(),
0
,
list
);
}
}
...
...
@@ -820,7 +820,7 @@ static HRGN RDW_Paint( WND* wndPtr, HRGN hrgn, UINT flags, UINT ex )
{
HWND
*
list
,
*
phwnd
;
if
(
(
list
=
WIN_
BuildWinArray
(
wndPtr
->
hwndSelf
))
)
if
(
(
list
=
WIN_
ListChildren
(
wndPtr
->
hwndSelf
))
)
{
for
(
phwnd
=
list
;
*
phwnd
;
phwnd
++
)
{
...
...
@@ -830,7 +830,7 @@ static HRGN RDW_Paint( WND* wndPtr, HRGN hrgn, UINT flags, UINT ex )
hrgn
=
RDW_Paint
(
wndPtr
,
hrgn
,
flags
,
ex
);
WIN_ReleaseWndPtr
(
wndPtr
);
}
WIN_ReleaseWinArray
(
list
);
HeapFree
(
GetProcessHeap
(),
0
,
list
);
}
}
...
...
windows/user.c
View file @
9d9dac09
...
...
@@ -224,7 +224,7 @@ BOOL WINAPI ExitWindowsEx( UINT flags, DWORD reserved )
/* We have to build a list of all windows first, as in EnumWindows */
if
(
!
(
list
=
WIN_
BuildWinArray
(
GetDesktopWindow
()
)))
return
FALSE
;
if
(
!
(
list
=
WIN_
ListChildren
(
GetDesktopWindow
()
)))
return
FALSE
;
/* Send a WM_QUERYENDSESSION message to every window */
...
...
@@ -243,7 +243,7 @@ BOOL WINAPI ExitWindowsEx( UINT flags, DWORD reserved )
if
(
!
IsWindow
(
*
phwnd
))
continue
;
SendMessageW
(
*
phwnd
,
WM_ENDSESSION
,
result
,
0
);
}
WIN_ReleaseWinArray
(
list
);
HeapFree
(
GetProcessHeap
(),
0
,
list
);
if
(
result
)
ExitKernel16
();
return
FALSE
;
...
...
windows/win.c
View file @
9d9dac09
This diff is collapsed.
Click to expand it.
windows/winpos.c
View file @
9d9dac09
...
...
@@ -553,7 +553,7 @@ HWND WINAPI ChildWindowFromPointEx( HWND hwndParent, POINT pt, UINT uFlags)
GetClientRect
(
hwndParent
,
&
rect
);
if
(
!
PtInRect
(
&
rect
,
pt
))
return
0
;
if
(
!
(
list
=
WIN_
BuildWinArray
(
hwndParent
)))
return
0
;
if
(
!
(
list
=
WIN_
ListChildren
(
hwndParent
)))
return
0
;
for
(
i
=
0
;
list
[
i
]
&&
!
retvalue
;
i
++
)
{
...
...
@@ -571,7 +571,7 @@ HWND WINAPI ChildWindowFromPointEx( HWND hwndParent, POINT pt, UINT uFlags)
}
WIN_ReleaseWndPtr
(
wnd
);
}
WIN_ReleaseWinArray
(
list
);
HeapFree
(
GetProcessHeap
(),
0
,
list
);
if
(
!
retvalue
)
retvalue
=
hwndParent
;
return
retvalue
;
}
...
...
@@ -1523,7 +1523,7 @@ BOOL WINPOS_SetActiveWindow( HWND hWnd, BOOL fMouse, BOOL fChangeFocus)
DWORD
old_thread
=
GetWindowThreadProcessId
(
hwndPrevActive
,
NULL
);
DWORD
new_thread
=
GetWindowThreadProcessId
(
hwndActive
,
NULL
);
if
((
list
=
WIN_
BuildWinArray
(
GetDesktopWindow
()
)))
if
((
list
=
WIN_
ListChildren
(
GetDesktopWindow
()
)))
{
for
(
phwnd
=
list
;
*
phwnd
;
phwnd
++
)
{
...
...
@@ -1531,12 +1531,12 @@ BOOL WINPOS_SetActiveWindow( HWND hWnd, BOOL fMouse, BOOL fChangeFocus)
if
(
GetWindowThreadProcessId
(
*
phwnd
,
NULL
)
==
old_thread
)
SendMessageW
(
*
phwnd
,
WM_ACTIVATEAPP
,
0
,
new_thread
);
}
WIN_ReleaseWinArray
(
list
);
HeapFree
(
GetProcessHeap
(),
0
,
list
);
}
hActiveQueue
=
hNewActiveQueue
;
if
((
list
=
WIN_
BuildWinArray
(
GetDesktopWindow
()
)))
if
((
list
=
WIN_
ListChildren
(
GetDesktopWindow
()
)))
{
for
(
phwnd
=
list
;
*
phwnd
;
phwnd
++
)
{
...
...
@@ -1544,7 +1544,7 @@ BOOL WINPOS_SetActiveWindow( HWND hWnd, BOOL fMouse, BOOL fChangeFocus)
if
(
GetWindowThreadProcessId
(
*
phwnd
,
NULL
)
==
new_thread
)
SendMessageW
(
*
phwnd
,
WM_ACTIVATEAPP
,
1
,
old_thread
);
}
WIN_ReleaseWinArray
(
list
);
HeapFree
(
GetProcessHeap
(),
0
,
list
);
}
if
(
hWnd
&&
!
IsWindow
(
hWnd
))
goto
CLEANUP
;
...
...
@@ -1625,6 +1625,7 @@ BOOL WINPOS_ActivateOtherWindow(HWND hwnd)
WND
*
pWnd
;
HWND
hwndActive
=
0
;
HWND
hwndTo
=
0
;
HWND
owner
;
/* Get current active window from the active queue */
if
(
hActiveQueue
)
...
...
@@ -1648,10 +1649,11 @@ BOOL WINPOS_ActivateOtherWindow(HWND hwnd)
return
0
;
}
if
(
!
(
pWnd
->
dwStyle
&
WS_POPUP
)
||
!
(
pWnd
->
owner
)
||
!
WINPOS_CanActivate
((
hwndTo
=
GetAncestor
(
pWnd
->
owner
->
hwndSelf
,
GA_ROOT
)))
)
owner
=
GetWindow
(
hwnd
,
GW_OWNER
);
if
(
!
(
pWnd
->
dwStyle
&
WS_POPUP
)
||
!
owner
||
!
WINPOS_CanActivate
((
hwndTo
=
GetAncestor
(
owner
,
GA_ROOT
)))
)
{
HWND
tmp
=
GetAncestor
(
pWnd
->
hwndSelf
,
GA_ROOT
);
HWND
tmp
=
GetAncestor
(
hwnd
,
GA_ROOT
);
hwndTo
=
hwndPrevActive
;
while
(
!
WINPOS_CanActivate
(
hwndTo
)
)
...
...
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