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
cd0b4393
Commit
cd0b4393
authored
Jul 29, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Aug 02, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11.drv: Update devmode dmPosition instead of new_rect.
parent
d621a7a3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
29 deletions
+26
-29
display.c
dlls/winex11.drv/display.c
+26
-29
No files found.
dlls/winex11.drv/display.c
View file @
cd0b4393
...
...
@@ -35,7 +35,6 @@ static struct x11drv_settings_handler settings_handler;
struct
x11drv_display_setting
{
ULONG_PTR
id
;
RECT
new_rect
;
DEVMODEW
desired_mode
;
};
...
...
@@ -547,8 +546,9 @@ static BOOL overlap_placed_displays(const RECT *rect, const struct x11drv_displa
for
(
display_idx
=
0
;
display_idx
<
display_count
;
++
display_idx
)
{
set_rect_from_devmode
(
&
intersect
,
&
displays
[
display_idx
].
desired_mode
);
if
((
displays
[
display_idx
].
desired_mode
.
dmFields
&
DM_POSITION
)
&&
intersect_rect
(
&
intersect
,
&
displays
[
display_idx
].
new_r
ect
,
rect
))
intersect_rect
(
&
intersect
,
&
inters
ect
,
rect
))
return
TRUE
;
}
return
FALSE
;
...
...
@@ -572,7 +572,8 @@ static POINT get_placement_offset(const struct x11drv_display_setting *displays,
/* If there is no placed and attached display, place this display as it is */
for
(
display_idx
=
0
;
display_idx
<
display_count
;
++
display_idx
)
{
if
((
displays
[
display_idx
].
desired_mode
.
dmFields
&
DM_POSITION
)
&&
!
IsRectEmpty
(
&
displays
[
display_idx
].
new_rect
))
set_rect_from_devmode
(
&
rect
,
&
displays
[
display_idx
].
desired_mode
);
if
((
displays
[
display_idx
].
desired_mode
.
dmFields
&
DM_POSITION
)
&&
!
IsRectEmpty
(
&
rect
))
{
has_placed
=
TRUE
;
break
;
...
...
@@ -589,37 +590,38 @@ static POINT get_placement_offset(const struct x11drv_display_setting *displays,
for
(
display_idx
=
0
;
display_idx
<
display_count
;
++
display_idx
)
{
if
(
!
(
displays
[
display_idx
].
desired_mode
.
dmFields
&
DM_POSITION
)
||
IsRectEmpty
(
&
displays
[
display_idx
].
new_rect
))
set_rect_from_devmode
(
&
rect
,
&
displays
[
display_idx
].
desired_mode
);
if
(
!
(
displays
[
display_idx
].
desired_mode
.
dmFields
&
DM_POSITION
)
||
IsRectEmpty
(
&
rect
))
continue
;
/* Get four vertices of the placed display rectangle */
points
[
0
].
x
=
displays
[
display_idx
].
new_
rect
.
left
;
points
[
0
].
y
=
displays
[
display_idx
].
new_
rect
.
top
;
points
[
1
].
x
=
displays
[
display_idx
].
new_
rect
.
left
;
points
[
1
].
y
=
displays
[
display_idx
].
new_
rect
.
bottom
;
points
[
2
].
x
=
displays
[
display_idx
].
new_
rect
.
right
;
points
[
2
].
y
=
displays
[
display_idx
].
new_
rect
.
top
;
points
[
3
].
x
=
displays
[
display_idx
].
new_
rect
.
right
;
points
[
3
].
y
=
displays
[
display_idx
].
new_
rect
.
bottom
;
points
[
0
].
x
=
rect
.
left
;
points
[
0
].
y
=
rect
.
top
;
points
[
1
].
x
=
rect
.
left
;
points
[
1
].
y
=
rect
.
bottom
;
points
[
2
].
x
=
rect
.
right
;
points
[
2
].
y
=
rect
.
top
;
points
[
3
].
x
=
rect
.
right
;
points
[
3
].
y
=
rect
.
bottom
;
point_count
=
4
;
/* Intersected points when moving the display to be placed horizontally */
if
(
desired_rect
.
bottom
>=
displays
[
display_idx
].
new_
rect
.
top
&&
desired_rect
.
top
<=
displays
[
display_idx
].
new_
rect
.
bottom
)
if
(
desired_rect
.
bottom
>=
rect
.
top
&&
desired_rect
.
top
<=
rect
.
bottom
)
{
points
[
point_count
].
x
=
displays
[
display_idx
].
new_
rect
.
left
;
points
[
point_count
].
x
=
rect
.
left
;
points
[
point_count
++
].
y
=
desired_rect
.
top
;
points
[
point_count
].
x
=
displays
[
display_idx
].
new_
rect
.
right
;
points
[
point_count
].
x
=
rect
.
right
;
points
[
point_count
++
].
y
=
desired_rect
.
top
;
}
/* Intersected points when moving the display to be placed vertically */
if
(
desired_rect
.
left
<=
displays
[
display_idx
].
new_
rect
.
right
&&
desired_rect
.
right
>=
displays
[
display_idx
].
new_
rect
.
left
)
if
(
desired_rect
.
left
<=
rect
.
right
&&
desired_rect
.
right
>=
rect
.
left
)
{
points
[
point_count
].
x
=
desired_rect
.
left
;
points
[
point_count
++
].
y
=
displays
[
display_idx
].
new_
rect
.
top
;
points
[
point_count
++
].
y
=
rect
.
top
;
points
[
point_count
].
x
=
desired_rect
.
left
;
points
[
point_count
++
].
y
=
displays
[
display_idx
].
new_
rect
.
bottom
;
points
[
point_count
++
].
y
=
rect
.
bottom
;
}
/* Try moving each vertex of the display rectangle to each points */
...
...
@@ -705,17 +707,12 @@ static void place_all_displays(struct x11drv_display_setting *displays, INT disp
if
(
placing_idx
==
-
1
)
break
;
set_rect_from_devmode
(
&
displays
[
placing_idx
].
new_rect
,
&
displays
[
placing_idx
].
desired_mode
)
;
OffsetRect
(
&
displays
[
placing_idx
].
new_rect
,
min_offset
.
x
,
min_offset
.
y
)
;
displays
[
placing_idx
].
desired_mode
.
dmPosition
.
x
+=
min_offset
.
x
;
displays
[
placing_idx
].
desired_mode
.
dmPosition
.
y
+=
min_offset
.
y
;
displays
[
placing_idx
].
desired_mode
.
dmFields
|=
DM_POSITION
;
}
for
(
display_idx
=
0
;
display_idx
<
display_count
;
++
display_idx
)
{
displays
[
display_idx
].
desired_mode
.
dmPosition
.
x
=
displays
[
display_idx
].
new_rect
.
left
;
displays
[
display_idx
].
desired_mode
.
dmPosition
.
y
=
displays
[
display_idx
].
new_rect
.
top
;
left_most
=
min
(
left_most
,
displays
[
display_idx
].
new_rect
.
left
);
top_most
=
min
(
top_most
,
displays
[
display_idx
].
new_rect
.
top
);
left_most
=
min
(
left_most
,
displays
[
placing_idx
].
desired_mode
.
dmPosition
.
x
);
top_most
=
min
(
top_most
,
displays
[
placing_idx
].
desired_mode
.
dmPosition
.
y
);
}
/* Convert virtual screen coordinates to root coordinates */
...
...
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