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
1373e004
Commit
1373e004
authored
Jul 16, 2018
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Return the full MINMAXINFO data from WINPOS_GetMinMaxInfo().
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
18f7ec36
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
37 deletions
+28
-37
win.c
dlls/user32/win.c
+3
-6
win.h
dlls/user32/win.h
+1
-2
winpos.c
dlls/user32/winpos.c
+24
-29
No files found.
dlls/user32/win.c
View file @
1373e004
...
...
@@ -1569,12 +1569,9 @@ HWND WIN_CreateWindowEx( CREATESTRUCTW *cs, LPCWSTR className, HINSTANCE module,
cy
=
cs
->
cy
;
if
((
cs
->
style
&
WS_THICKFRAME
)
||
!
(
cs
->
style
&
(
WS_POPUP
|
WS_CHILD
)))
{
POINT
maxSize
,
maxPos
,
minTrack
,
maxTrack
;
WINPOS_GetMinMaxInfo
(
hwnd
,
&
maxSize
,
&
maxPos
,
&
minTrack
,
&
maxTrack
);
if
(
maxTrack
.
x
<
cx
)
cx
=
maxTrack
.
x
;
if
(
maxTrack
.
y
<
cy
)
cy
=
maxTrack
.
y
;
if
(
minTrack
.
x
>
cx
)
cx
=
minTrack
.
x
;
if
(
minTrack
.
y
>
cy
)
cy
=
minTrack
.
y
;
MINMAXINFO
info
=
WINPOS_GetMinMaxInfo
(
hwnd
);
cx
=
max
(
min
(
cx
,
info
.
ptMaxTrackSize
.
x
),
info
.
ptMinTrackSize
.
x
);
cy
=
max
(
min
(
cy
,
info
.
ptMaxTrackSize
.
y
),
info
.
ptMinTrackSize
.
y
);
}
if
(
cx
<
0
)
cx
=
0
;
...
...
dlls/user32/win.h
View file @
1373e004
...
...
@@ -121,8 +121,7 @@ static inline void WIN_ReleasePtr( WND *ptr )
extern
LRESULT
HOOK_CallHooks
(
INT
id
,
INT
code
,
WPARAM
wparam
,
LPARAM
lparam
,
BOOL
unicode
)
DECLSPEC_HIDDEN
;
extern
BOOL
WINPOS_RedrawIconTitle
(
HWND
hWnd
)
DECLSPEC_HIDDEN
;
extern
void
WINPOS_GetMinMaxInfo
(
HWND
hwnd
,
POINT
*
maxSize
,
POINT
*
maxPos
,
POINT
*
minTrack
,
POINT
*
maxTrack
)
DECLSPEC_HIDDEN
;
extern
MINMAXINFO
WINPOS_GetMinMaxInfo
(
HWND
hwnd
)
DECLSPEC_HIDDEN
;
extern
LONG
WINPOS_HandleWindowPosChanging
(
HWND
hwnd
,
WINDOWPOS
*
winpos
)
DECLSPEC_HIDDEN
;
extern
HWND
WINPOS_WindowFromPoint
(
HWND
hwndScope
,
POINT
pt
,
INT
*
hittest
)
DECLSPEC_HIDDEN
;
extern
void
WINPOS_ActivateOtherWindow
(
HWND
hwnd
)
DECLSPEC_HIDDEN
;
...
...
dlls/user32/winpos.c
View file @
1373e004
...
...
@@ -740,8 +740,7 @@ static void WINPOS_ShowIconTitle( HWND hwnd, BOOL bShow )
*
* Get the minimized and maximized information for a window.
*/
void
WINPOS_GetMinMaxInfo
(
HWND
hwnd
,
POINT
*
maxSize
,
POINT
*
maxPos
,
POINT
*
minTrack
,
POINT
*
maxTrack
)
MINMAXINFO
WINPOS_GetMinMaxInfo
(
HWND
hwnd
)
{
MINMAXINFO
MinMax
;
HMONITOR
monitor
;
...
...
@@ -837,10 +836,7 @@ void WINPOS_GetMinMaxInfo( HWND hwnd, POINT *maxSize, POINT *maxPos,
MinMax
.
ptMaxTrackSize
.
y
=
max
(
MinMax
.
ptMaxTrackSize
.
y
,
MinMax
.
ptMinTrackSize
.
y
);
if
(
maxSize
)
*
maxSize
=
MinMax
.
ptMaxSize
;
if
(
maxPos
)
*
maxPos
=
MinMax
.
ptMaxPosition
;
if
(
minTrack
)
*
minTrack
=
MinMax
.
ptMinTrackSize
;
if
(
maxTrack
)
*
maxTrack
=
MinMax
.
ptMaxTrackSize
;
return
MinMax
;
}
...
...
@@ -943,8 +939,8 @@ static POINT WINPOS_FindIconPos( HWND hwnd, POINT pt )
UINT
WINPOS_MinMaximize
(
HWND
hwnd
,
UINT
cmd
,
LPRECT
rect
)
{
UINT
swpFlags
=
0
;
POINT
size
;
LONG
old_style
;
MINMAXINFO
minmax
;
WINDOWPLACEMENT
wpl
;
TRACE
(
"%p %u
\n
"
,
hwnd
,
cmd
);
...
...
@@ -1006,7 +1002,7 @@ UINT WINPOS_MinMaximize( HWND hwnd, UINT cmd, LPRECT rect )
old_style
=
GetWindowLongW
(
hwnd
,
GWL_STYLE
);
if
((
old_style
&
WS_MAXIMIZE
)
&&
(
old_style
&
WS_VISIBLE
))
return
SWP_NOSIZE
|
SWP_NOMOVE
;
WINPOS_GetMinMaxInfo
(
hwnd
,
&
size
,
&
wpl
.
ptMaxPosition
,
NULL
,
NULL
);
minmax
=
WINPOS_GetMinMaxInfo
(
hwnd
);
old_style
=
WIN_SetStyle
(
hwnd
,
WS_MAXIMIZE
,
WS_MINIMIZE
);
if
(
old_style
&
WS_MINIMIZE
)
...
...
@@ -1016,8 +1012,8 @@ UINT WINPOS_MinMaximize( HWND hwnd, UINT cmd, LPRECT rect )
}
if
(
!
(
old_style
&
WS_MAXIMIZE
))
swpFlags
|=
SWP_STATECHANGED
;
SetRect
(
rect
,
wpl
.
ptMaxPosition
.
x
,
wpl
.
ptMaxPosition
.
y
,
wpl
.
ptMaxPosition
.
x
+
size
.
x
,
wpl
.
ptMaxPosition
.
y
+
s
ize
.
y
);
SetRect
(
rect
,
minmax
.
ptMaxPosition
.
x
,
minmax
.
ptMaxPosition
.
y
,
minmax
.
ptMaxPosition
.
x
+
minmax
.
ptMaxSize
.
x
,
minmax
.
ptMaxPosition
.
y
+
minmax
.
ptMaxS
ize
.
y
);
break
;
case
SW_SHOWNOACTIVATE
:
...
...
@@ -1033,11 +1029,11 @@ UINT WINPOS_MinMaximize( HWND hwnd, UINT cmd, LPRECT rect )
if
(
win_get_flags
(
hwnd
)
&
WIN_RESTORE_MAX
)
{
/* Restore to maximized position */
WINPOS_GetMinMaxInfo
(
hwnd
,
&
size
,
&
wpl
.
ptMaxPosition
,
NULL
,
NULL
);
minmax
=
WINPOS_GetMinMaxInfo
(
hwnd
);
WIN_SetStyle
(
hwnd
,
WS_MAXIMIZE
,
0
);
swpFlags
|=
SWP_STATECHANGED
;
SetRect
(
rect
,
wpl
.
ptMaxPosition
.
x
,
wpl
.
ptMaxPosition
.
y
,
wpl
.
ptMaxPosition
.
x
+
size
.
x
,
wpl
.
ptMaxPosition
.
y
+
s
ize
.
y
);
SetRect
(
rect
,
minmax
.
ptMaxPosition
.
x
,
minmax
.
ptMaxPosition
.
y
,
minmax
.
ptMaxPosition
.
x
+
minmax
.
ptMaxSize
.
x
,
minmax
.
ptMaxPosition
.
y
+
minmax
.
ptMaxS
ize
.
y
);
break
;
}
}
...
...
@@ -1597,19 +1593,18 @@ void WINPOS_ActivateOtherWindow(HWND hwnd)
*/
LONG
WINPOS_HandleWindowPosChanging
(
HWND
hwnd
,
WINDOWPOS
*
winpos
)
{
POINT
minTrack
,
maxTrack
;
LONG
style
=
GetWindowLongW
(
hwnd
,
GWL_STYLE
);
if
(
winpos
->
flags
&
SWP_NOSIZE
)
return
0
;
if
((
style
&
WS_THICKFRAME
)
||
((
style
&
(
WS_POPUP
|
WS_CHILD
))
==
0
))
{
WINPOS_GetMinMaxInfo
(
hwnd
,
NULL
,
NULL
,
&
minTrack
,
&
maxTrack
);
if
(
winpos
->
cx
>
maxTrack
.
x
)
winpos
->
cx
=
maxTrack
.
x
;
if
(
winpos
->
cy
>
maxTrack
.
y
)
winpos
->
cy
=
maxTrack
.
y
;
MINMAXINFO
info
=
WINPOS_GetMinMaxInfo
(
hwnd
);
winpos
->
cx
=
min
(
winpos
->
cx
,
info
.
ptMaxTrackSize
.
x
)
;
winpos
->
cy
=
min
(
winpos
->
cy
,
info
.
ptMaxTrackSize
.
y
)
;
if
(
!
(
style
&
WS_MINIMIZE
))
{
if
(
winpos
->
cx
<
minTrack
.
x
)
winpos
->
cx
=
minTrack
.
x
;
if
(
winpos
->
cy
<
minTrack
.
y
)
winpos
->
cy
=
minTrack
.
y
;
winpos
->
cx
=
max
(
winpos
->
cx
,
info
.
ptMinTrackSize
.
x
)
;
winpos
->
cy
=
max
(
winpos
->
cy
,
info
.
ptMinTrackSize
.
y
)
;
}
}
return
0
;
...
...
@@ -2727,7 +2722,7 @@ void WINPOS_SysCommandSizeMove( HWND hwnd, WPARAM wParam )
LONG
hittest
=
(
LONG
)(
wParam
&
0x0f
);
WPARAM
syscommand
=
wParam
&
0xfff0
;
HCURSOR
hDragCursor
=
0
,
hOldCursor
=
0
;
POINT
minTrack
,
maxTrack
;
MINMAXINFO
minmax
;
POINT
capturePoint
,
pt
;
LONG
style
=
GetWindowLongW
(
hwnd
,
GWL_STYLE
);
BOOL
thickframe
=
HAS_THICKFRAME
(
style
);
...
...
@@ -2770,7 +2765,7 @@ void WINPOS_SysCommandSizeMove( HWND hwnd, WPARAM wParam )
/* Get min/max info */
WINPOS_GetMinMaxInfo
(
hwnd
,
NULL
,
NULL
,
&
minTrack
,
&
maxTrack
);
minmax
=
WINPOS_GetMinMaxInfo
(
hwnd
);
WIN_GetRectangles
(
hwnd
,
COORDS_PARENT
,
&
sizingRect
,
NULL
);
origRect
=
sizingRect
;
if
(
style
&
WS_CHILD
)
...
...
@@ -2789,23 +2784,23 @@ void WINPOS_SysCommandSizeMove( HWND hwnd, WPARAM wParam )
if
(
ON_LEFT_BORDER
(
hittest
))
{
mouseRect
.
left
=
max
(
mouseRect
.
left
,
sizingRect
.
right
-
m
axTrack
.
x
+
capturePoint
.
x
-
sizingRect
.
left
);
mouseRect
.
right
=
min
(
mouseRect
.
right
,
sizingRect
.
right
-
min
Track
.
x
+
capturePoint
.
x
-
sizingRect
.
left
);
mouseRect
.
left
=
max
(
mouseRect
.
left
,
sizingRect
.
right
-
m
inmax
.
ptMaxTrackSize
.
x
+
capturePoint
.
x
-
sizingRect
.
left
);
mouseRect
.
right
=
min
(
mouseRect
.
right
,
sizingRect
.
right
-
min
max
.
ptMinTrackSize
.
x
+
capturePoint
.
x
-
sizingRect
.
left
);
}
else
if
(
ON_RIGHT_BORDER
(
hittest
))
{
mouseRect
.
left
=
max
(
mouseRect
.
left
,
sizingRect
.
left
+
min
Track
.
x
+
capturePoint
.
x
-
sizingRect
.
right
);
mouseRect
.
right
=
min
(
mouseRect
.
right
,
sizingRect
.
left
+
m
axTrack
.
x
+
capturePoint
.
x
-
sizingRect
.
right
);
mouseRect
.
left
=
max
(
mouseRect
.
left
,
sizingRect
.
left
+
min
max
.
ptMinTrackSize
.
x
+
capturePoint
.
x
-
sizingRect
.
right
);
mouseRect
.
right
=
min
(
mouseRect
.
right
,
sizingRect
.
left
+
m
inmax
.
ptMaxTrackSize
.
x
+
capturePoint
.
x
-
sizingRect
.
right
);
}
if
(
ON_TOP_BORDER
(
hittest
))
{
mouseRect
.
top
=
max
(
mouseRect
.
top
,
sizingRect
.
bottom
-
m
axTrack
.
y
+
capturePoint
.
y
-
sizingRect
.
top
);
mouseRect
.
bottom
=
min
(
mouseRect
.
bottom
,
sizingRect
.
bottom
-
min
Track
.
y
+
capturePoint
.
y
-
sizingRect
.
top
);
mouseRect
.
top
=
max
(
mouseRect
.
top
,
sizingRect
.
bottom
-
m
inmax
.
ptMaxTrackSize
.
y
+
capturePoint
.
y
-
sizingRect
.
top
);
mouseRect
.
bottom
=
min
(
mouseRect
.
bottom
,
sizingRect
.
bottom
-
min
max
.
ptMinTrackSize
.
y
+
capturePoint
.
y
-
sizingRect
.
top
);
}
else
if
(
ON_BOTTOM_BORDER
(
hittest
))
{
mouseRect
.
top
=
max
(
mouseRect
.
top
,
sizingRect
.
top
+
min
Track
.
y
+
capturePoint
.
y
-
sizingRect
.
bottom
);
mouseRect
.
bottom
=
min
(
mouseRect
.
bottom
,
sizingRect
.
top
+
m
axTrack
.
y
+
capturePoint
.
y
-
sizingRect
.
bottom
);
mouseRect
.
top
=
max
(
mouseRect
.
top
,
sizingRect
.
top
+
min
max
.
ptMinTrackSize
.
y
+
capturePoint
.
y
-
sizingRect
.
bottom
);
mouseRect
.
bottom
=
min
(
mouseRect
.
bottom
,
sizingRect
.
top
+
m
inmax
.
ptMaxTrackSize
.
y
+
capturePoint
.
y
-
sizingRect
.
bottom
);
}
/* Retrieve a default cache DC (without using the window style) */
...
...
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