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
51f9bb76
Commit
51f9bb76
authored
Apr 17, 2023
by
Brendan Shanks
Committed by
Alexandre Julliard
Apr 18, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemac: Refactor constrain_window_frame() to use separate origin and size arguments.
parent
55ab59af
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
9 deletions
+15
-9
window.c
dlls/winemac.drv/window.c
+15
-9
No files found.
dlls/winemac.drv/window.c
View file @
51f9bb76
...
...
@@ -216,7 +216,7 @@ static void macdrv_mac_to_window_rect(struct macdrv_win_data *data, RECT *rect)
* Alter a window frame rectangle to fit within a) Cocoa's documented
* limits, and b) sane sizes, like twice the desktop rect.
*/
static
void
constrain_window_frame
(
CG
Rect
*
fram
e
)
static
void
constrain_window_frame
(
CG
Point
*
origin
,
CGSize
*
siz
e
)
{
CGRect
desktop_rect
=
macdrv_get_desktop_rect
();
int
max_width
,
max_height
;
...
...
@@ -224,12 +224,18 @@ static void constrain_window_frame(CGRect* frame)
max_width
=
min
(
32000
,
2
*
CGRectGetWidth
(
desktop_rect
));
max_height
=
min
(
32000
,
2
*
CGRectGetHeight
(
desktop_rect
));
if
(
frame
->
origin
.
x
<
-
16000
)
frame
->
origin
.
x
=
-
16000
;
if
(
frame
->
origin
.
y
<
-
16000
)
frame
->
origin
.
y
=
-
16000
;
if
(
frame
->
origin
.
x
>
16000
)
frame
->
origin
.
x
=
16000
;
if
(
frame
->
origin
.
y
>
16000
)
frame
->
origin
.
y
=
16000
;
if
(
frame
->
size
.
width
>
max_width
)
frame
->
size
.
width
=
max_width
;
if
(
frame
->
size
.
height
>
max_height
)
frame
->
size
.
height
=
max_height
;
if
(
origin
)
{
if
(
origin
->
x
<
-
16000
)
origin
->
x
=
-
16000
;
if
(
origin
->
y
<
-
16000
)
origin
->
y
=
-
16000
;
if
(
origin
->
x
>
16000
)
origin
->
x
=
16000
;
if
(
origin
->
y
>
16000
)
origin
->
y
=
16000
;
}
if
(
size
)
{
if
(
size
->
width
>
max_width
)
size
->
width
=
max_width
;
if
(
size
->
height
>
max_height
)
size
->
height
=
max_height
;
}
}
...
...
@@ -698,7 +704,7 @@ static void create_cocoa_window(struct macdrv_win_data *data)
get_cocoa_window_features
(
data
,
style
,
ex_style
,
&
wf
,
&
data
->
window_rect
,
&
data
->
client_rect
);
frame
=
cgrect_from_rect
(
data
->
whole_rect
);
constrain_window_frame
(
&
frame
);
constrain_window_frame
(
&
frame
.
origin
,
&
frame
.
size
);
if
(
frame
.
size
.
width
<
1
||
frame
.
size
.
height
<
1
)
frame
.
size
.
width
=
frame
.
size
.
height
=
1
;
...
...
@@ -1139,7 +1145,7 @@ static void sync_window_position(struct macdrv_win_data *data, UINT swp_flags, c
{
if
(
data
->
minimized
)
return
;
constrain_window_frame
(
&
frame
);
constrain_window_frame
(
&
frame
.
origin
,
&
frame
.
size
);
if
(
frame
.
size
.
width
<
1
||
frame
.
size
.
height
<
1
)
frame
.
size
.
width
=
frame
.
size
.
height
=
1
;
...
...
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