Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
e4e5566e
Commit
e4e5566e
authored
20 years ago
by
Alexandre Julliard
Browse files
Options
Downloads
Patches
Plain Diff
Avoid a few more uses of WIN_FindWndPtr.
parent
611bcf85
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
windows/win.c
+25
-15
25 additions, 15 deletions
windows/win.c
windows/winpos.c
+60
-48
60 additions, 48 deletions
windows/winpos.c
with
85 additions
and
63 deletions
windows/win.c
+
25
−
15
View file @
e4e5566e
...
@@ -2788,7 +2788,8 @@ BOOL WINAPI ShowOwnedPopups( HWND owner, BOOL fShow )
...
@@ -2788,7 +2788,8 @@ BOOL WINAPI ShowOwnedPopups( HWND owner, BOOL fShow )
while
(
--
count
>=
0
)
while
(
--
count
>=
0
)
{
{
if
(
GetWindow
(
win_array
[
count
],
GW_OWNER
)
!=
owner
)
continue
;
if
(
GetWindow
(
win_array
[
count
],
GW_OWNER
)
!=
owner
)
continue
;
if
(
!
(
pWnd
=
WIN_FindWndPtr
(
win_array
[
count
]
)))
continue
;
if
(
!
(
pWnd
=
WIN_GetPtr
(
win_array
[
count
]
)))
continue
;
if
(
pWnd
==
WND_OTHER_PROCESS
)
continue
;
if
(
pWnd
->
dwStyle
&
WS_POPUP
)
if
(
pWnd
->
dwStyle
&
WS_POPUP
)
{
{
...
@@ -2796,28 +2797,32 @@ BOOL WINAPI ShowOwnedPopups( HWND owner, BOOL fShow )
...
@@ -2796,28 +2797,32 @@ BOOL WINAPI ShowOwnedPopups( HWND owner, BOOL fShow )
{
{
if
(
pWnd
->
flags
&
WIN_NEEDS_SHOW_OWNEDPOPUP
)
if
(
pWnd
->
flags
&
WIN_NEEDS_SHOW_OWNEDPOPUP
)
{
{
pWnd
->
flags
&=
~
WIN_NEEDS_SHOW_OWNEDPOPUP
;
WIN_ReleasePtr
(
pWnd
);
/* In Windows, ShowOwnedPopups(TRUE) generates
/* In Windows, ShowOwnedPopups(TRUE) generates
* WM_SHOWWINDOW messages with SW_PARENTOPENING,
* WM_SHOWWINDOW messages with SW_PARENTOPENING,
* regardless of the state of the owner
* regardless of the state of the owner
*/
*/
SendMessage
A
(
pWnd
->
hwndSelf
,
WM_SHOWWINDOW
,
SW_SHOW
,
SW_PARENTOPENING
);
SendMessage
W
(
win_array
[
count
]
,
WM_SHOWWINDOW
,
SW_SHOW
,
SW_PARENTOPENING
);
pWnd
->
flags
&=
~
WIN_NEEDS_SHOW_OWNEDPOPUP
;
continue
;
}
}
}
}
else
else
{
{
if
(
IsWindowVisible
(
pWnd
->
hwndSelf
)
)
if
(
pWnd
->
dwStyle
&
WS_VISIBLE
)
{
{
pWnd
->
flags
|=
WIN_NEEDS_SHOW_OWNEDPOPUP
;
WIN_ReleasePtr
(
pWnd
);
/* In Windows, ShowOwnedPopups(FALSE) generates
/* In Windows, ShowOwnedPopups(FALSE) generates
* WM_SHOWWINDOW messages with SW_PARENTCLOSING,
* WM_SHOWWINDOW messages with SW_PARENTCLOSING,
* regardless of the state of the owner
* regardless of the state of the owner
*/
*/
SendMessage
A
(
pWnd
->
hwndSelf
,
WM_SHOWWINDOW
,
SW_HIDE
,
SW_PARENTCLOSING
);
SendMessage
W
(
win_array
[
count
]
,
WM_SHOWWINDOW
,
SW_HIDE
,
SW_PARENTCLOSING
);
pWnd
->
flags
|=
WIN_NEEDS_SHOW_OWNEDPOPUP
;
continue
;
}
}
}
}
}
}
WIN_Release
Wnd
Ptr
(
pWnd
);
WIN_ReleasePtr
(
pWnd
);
}
}
HeapFree
(
GetProcessHeap
(),
0
,
win_array
);
HeapFree
(
GetProcessHeap
(),
0
,
win_array
);
return
TRUE
;
return
TRUE
;
...
@@ -3053,16 +3058,16 @@ BOOL WINAPI AnyPopup(void)
...
@@ -3053,16 +3058,16 @@ BOOL WINAPI AnyPopup(void)
*/
*/
BOOL
WINAPI
FlashWindow
(
HWND
hWnd
,
BOOL
bInvert
)
BOOL
WINAPI
FlashWindow
(
HWND
hWnd
,
BOOL
bInvert
)
{
{
WND
*
wndPtr
=
WIN_FindWndPtr
(
hWnd
)
;
WND
*
wndPtr
;
TRACE
(
"%p
\n
"
,
hWnd
);
TRACE
(
"%p
\n
"
,
hWnd
);
if
(
!
wndPtr
)
return
FALSE
;
if
(
IsIconic
(
hWnd
))
hWnd
=
wndPtr
->
hwndSelf
;
/* make it a full handle */
if
(
wndPtr
->
dwStyle
&
WS_MINIMIZE
)
{
{
RedrawWindow
(
hWnd
,
0
,
0
,
RDW_INVALIDATE
|
RDW_ERASE
|
RDW_UPDATENOW
|
RDW_FRAME
);
RedrawWindow
(
hWnd
,
0
,
0
,
RDW_INVALIDATE
|
RDW_ERASE
|
RDW_UPDATENOW
|
RDW_FRAME
);
wndPtr
=
WIN_GetPtr
(
hWnd
);
if
(
!
wndPtr
||
wndPtr
==
WND_OTHER_PROCESS
)
return
FALSE
;
if
(
bInvert
&&
!
(
wndPtr
->
flags
&
WIN_NCACTIVATED
))
if
(
bInvert
&&
!
(
wndPtr
->
flags
&
WIN_NCACTIVATED
))
{
{
wndPtr
->
flags
|=
WIN_NCACTIVATED
;
wndPtr
->
flags
|=
WIN_NCACTIVATED
;
...
@@ -3071,16 +3076,21 @@ BOOL WINAPI FlashWindow( HWND hWnd, BOOL bInvert )
...
@@ -3071,16 +3076,21 @@ BOOL WINAPI FlashWindow( HWND hWnd, BOOL bInvert )
{
{
wndPtr
->
flags
&=
~
WIN_NCACTIVATED
;
wndPtr
->
flags
&=
~
WIN_NCACTIVATED
;
}
}
WIN_Release
Wnd
Ptr
(
wndPtr
);
WIN_ReleasePtr
(
wndPtr
);
return
TRUE
;
return
TRUE
;
}
}
else
else
{
{
WPARAM16
wparam
;
WPARAM
wparam
;
wndPtr
=
WIN_GetPtr
(
hWnd
);
if
(
!
wndPtr
||
wndPtr
==
WND_OTHER_PROCESS
)
return
FALSE
;
hWnd
=
wndPtr
->
hwndSelf
;
/* make it a full handle */
if
(
bInvert
)
wparam
=
!
(
wndPtr
->
flags
&
WIN_NCACTIVATED
);
if
(
bInvert
)
wparam
=
!
(
wndPtr
->
flags
&
WIN_NCACTIVATED
);
else
wparam
=
(
hWnd
==
GetForegroundWindow
());
else
wparam
=
(
hWnd
==
GetForegroundWindow
());
WIN_Release
Wnd
Ptr
(
wndPtr
);
WIN_ReleasePtr
(
wndPtr
);
SendMessageW
(
hWnd
,
WM_NCACTIVATE
,
wparam
,
(
LPARAM
)
0
);
SendMessageW
(
hWnd
,
WM_NCACTIVATE
,
wparam
,
(
LPARAM
)
0
);
return
wparam
;
return
wparam
;
}
}
...
...
This diff is collapsed.
Click to expand it.
windows/winpos.c
+
60
−
48
View file @
e4e5566e
...
@@ -928,59 +928,71 @@ BOOL WINAPI GetWindowPlacement( HWND hwnd, WINDOWPLACEMENT *wndpl )
...
@@ -928,59 +928,71 @@ BOOL WINAPI GetWindowPlacement( HWND hwnd, WINDOWPLACEMENT *wndpl )
*/
*/
static
BOOL
WINPOS_SetPlacement
(
HWND
hwnd
,
const
WINDOWPLACEMENT
*
wndpl
,
UINT
flags
)
static
BOOL
WINPOS_SetPlacement
(
HWND
hwnd
,
const
WINDOWPLACEMENT
*
wndpl
,
UINT
flags
)
{
{
WND
*
pWnd
=
WIN_FindWndPtr
(
hwnd
);
LPINTERNALPOS
lpPos
;
if
(
pWnd
)
DWORD
style
;
WND
*
pWnd
=
WIN_GetPtr
(
hwnd
);
if
(
!
pWnd
||
pWnd
==
WND_OTHER_PROCESS
)
return
FALSE
;
lpPos
=
WINPOS_InitInternalPos
(
pWnd
);
if
(
flags
&
PLACE_MIN
)
{
lpPos
->
ptIconPos
.
x
=
wndpl
->
ptMinPosition
.
x
;
lpPos
->
ptIconPos
.
y
=
wndpl
->
ptMinPosition
.
y
;
}
if
(
flags
&
PLACE_MAX
)
{
lpPos
->
ptMaxPos
.
x
=
wndpl
->
ptMaxPosition
.
x
;
lpPos
->
ptMaxPos
.
y
=
wndpl
->
ptMaxPosition
.
y
;
}
if
(
flags
&
PLACE_RECT
)
{
{
LPINTERNALPOS
lpPos
=
WINPOS_InitInternalPos
(
pWnd
);
lpPos
->
rectNormal
.
left
=
wndpl
->
rcNormalPosition
.
left
;
lpPos
->
rectNormal
.
top
=
wndpl
->
rcNormalPosition
.
top
;
lpPos
->
rectNormal
.
right
=
wndpl
->
rcNormalPosition
.
right
;
lpPos
->
rectNormal
.
bottom
=
wndpl
->
rcNormalPosition
.
bottom
;
}
if
(
flags
&
PLACE_MIN
)
style
=
pWnd
->
dwStyle
;
{
WIN_ReleasePtr
(
pWnd
);
lpPos
->
ptIconPos
.
x
=
wndpl
->
ptMinPosition
.
x
;
lpPos
->
ptIconPos
.
y
=
wndpl
->
ptMinPosition
.
y
;
if
(
style
&
WS_MINIMIZE
)
}
{
if
(
flags
&
PLACE_MAX
)
WINPOS_ShowIconTitle
(
hwnd
,
FALSE
);
{
if
(
wndpl
->
flags
&
WPF_SETMINPOSITION
&&
!
EMPTYPOINT
(
lpPos
->
ptIconPos
))
lpPos
->
ptMaxPos
.
x
=
wndpl
->
ptMaxPosition
.
x
;
SetWindowPos
(
hwnd
,
0
,
lpPos
->
ptIconPos
.
x
,
lpPos
->
ptIconPos
.
y
,
lpPos
->
ptMaxPos
.
y
=
wndpl
->
ptMaxPosition
.
y
;
0
,
0
,
SWP_NOSIZE
|
SWP_NOZORDER
|
SWP_NOACTIVATE
);
}
}
if
(
flags
&
PLACE_RECT
)
else
if
(
style
&
WS_MAXIMIZE
)
{
if
(
!
EMPTYPOINT
(
lpPos
->
ptMaxPos
)
)
SetWindowPos
(
hwnd
,
0
,
lpPos
->
ptMaxPos
.
x
,
lpPos
->
ptMaxPos
.
y
,
0
,
0
,
SWP_NOSIZE
|
SWP_NOZORDER
|
SWP_NOACTIVATE
);
}
else
if
(
flags
&
PLACE_RECT
)
SetWindowPos
(
hwnd
,
0
,
lpPos
->
rectNormal
.
left
,
lpPos
->
rectNormal
.
top
,
lpPos
->
rectNormal
.
right
-
lpPos
->
rectNormal
.
left
,
lpPos
->
rectNormal
.
bottom
-
lpPos
->
rectNormal
.
top
,
SWP_NOZORDER
|
SWP_NOACTIVATE
);
ShowWindow
(
hwnd
,
wndpl
->
showCmd
);
if
(
IsIconic
(
hwnd
))
{
if
(
GetWindowLongW
(
hwnd
,
GWL_STYLE
)
&
WS_VISIBLE
)
WINPOS_ShowIconTitle
(
hwnd
,
TRUE
);
/* SDK: ...valid only the next time... */
if
(
wndpl
->
flags
&
WPF_RESTORETOMAXIMIZED
)
{
{
lpPos
->
rectNormal
.
left
=
wndpl
->
rcNormalPosition
.
left
;
pWnd
=
WIN_GetPtr
(
hwnd
);
lpPos
->
rectNormal
.
top
=
wndpl
->
rcNormalPosition
.
top
;
if
(
pWnd
&&
pWnd
!=
WND_OTHER_PROCESS
)
lpPos
->
rectNormal
.
right
=
wndpl
->
rcNormalPosition
.
right
;
{
lpPos
->
rectNormal
.
bottom
=
wndpl
->
rcNormalPosition
.
bottom
;
pWnd
->
flags
|=
WIN_RESTORE_MAX
;
WIN_ReleasePtr
(
pWnd
);
}
}
}
if
(
pWnd
->
dwStyle
&
WS_MINIMIZE
)
{
WINPOS_ShowIconTitle
(
pWnd
->
hwndSelf
,
FALSE
);
if
(
wndpl
->
flags
&
WPF_SETMINPOSITION
&&
!
EMPTYPOINT
(
lpPos
->
ptIconPos
))
SetWindowPos
(
hwnd
,
0
,
lpPos
->
ptIconPos
.
x
,
lpPos
->
ptIconPos
.
y
,
0
,
0
,
SWP_NOSIZE
|
SWP_NOZORDER
|
SWP_NOACTIVATE
);
}
else
if
(
pWnd
->
dwStyle
&
WS_MAXIMIZE
)
{
if
(
!
EMPTYPOINT
(
lpPos
->
ptMaxPos
)
)
SetWindowPos
(
hwnd
,
0
,
lpPos
->
ptMaxPos
.
x
,
lpPos
->
ptMaxPos
.
y
,
0
,
0
,
SWP_NOSIZE
|
SWP_NOZORDER
|
SWP_NOACTIVATE
);
}
else
if
(
flags
&
PLACE_RECT
)
SetWindowPos
(
hwnd
,
0
,
lpPos
->
rectNormal
.
left
,
lpPos
->
rectNormal
.
top
,
lpPos
->
rectNormal
.
right
-
lpPos
->
rectNormal
.
left
,
lpPos
->
rectNormal
.
bottom
-
lpPos
->
rectNormal
.
top
,
SWP_NOZORDER
|
SWP_NOACTIVATE
);
ShowWindow
(
hwnd
,
wndpl
->
showCmd
);
if
(
IsWindow
(
hwnd
)
&&
pWnd
->
dwStyle
&
WS_MINIMIZE
)
{
if
(
pWnd
->
dwStyle
&
WS_VISIBLE
)
WINPOS_ShowIconTitle
(
pWnd
->
hwndSelf
,
TRUE
);
/* SDK: ...valid only the next time... */
if
(
wndpl
->
flags
&
WPF_RESTORETOMAXIMIZED
)
pWnd
->
flags
|=
WIN_RESTORE_MAX
;
}
WIN_ReleaseWndPtr
(
pWnd
);
return
TRUE
;
}
}
return
FALS
E
;
return
TRU
E
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment