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
8698b600
Commit
8698b600
authored
Aug 24, 2018
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Map region to the window DPI in redraw_region().
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
87e49000
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
5 deletions
+35
-5
region.c
server/region.c
+12
-0
user.h
server/user.h
+1
-0
window.c
server/window.c
+22
-5
No files found.
server/region.c
View file @
8698b600
...
...
@@ -724,6 +724,18 @@ void mirror_region( const rectangle_t *client_rect, struct region *region )
}
/* scale a region for a given dpi factor */
void
scale_region
(
struct
region
*
region
,
unsigned
int
dpi_from
,
unsigned
int
dpi_to
)
{
rectangle_t
*
rect
,
*
end
;
if
(
!
region
->
num_rects
)
return
;
for
(
rect
=
region
->
rects
,
end
=
rect
+
region
->
num_rects
;
rect
<
end
;
rect
++
)
scale_dpi_rect
(
rect
,
dpi_from
,
dpi_to
);
scale_dpi_rect
(
&
region
->
extents
,
dpi_from
,
dpi_to
);
}
/* make a copy of a region; returns dst or NULL on error */
struct
region
*
copy_region
(
struct
region
*
dst
,
const
struct
region
*
src
)
{
...
...
server/user.h
View file @
8698b600
...
...
@@ -135,6 +135,7 @@ extern int is_region_empty( const struct region *region );
extern
void
get_region_extents
(
const
struct
region
*
region
,
rectangle_t
*
rect
);
extern
void
offset_region
(
struct
region
*
region
,
int
x
,
int
y
);
extern
void
mirror_region
(
const
rectangle_t
*
client_rect
,
struct
region
*
region
);
extern
void
scale_region
(
struct
region
*
region
,
unsigned
int
dpi_from
,
unsigned
int
dpi_to
);
extern
struct
region
*
copy_region
(
struct
region
*
dst
,
const
struct
region
*
src
);
extern
struct
region
*
intersect_region
(
struct
region
*
dst
,
const
struct
region
*
src1
,
const
struct
region
*
src2
);
...
...
server/window.c
View file @
8698b600
...
...
@@ -649,6 +649,15 @@ static void map_dpi_rect( struct window *win, rectangle_t *rect, unsigned int fr
scale_dpi_rect
(
rect
,
from
,
to
);
}
/* map a region between different DPI scaling levels */
static
void
map_dpi_region
(
struct
window
*
win
,
struct
region
*
region
,
unsigned
int
from
,
unsigned
int
to
)
{
if
(
!
from
)
from
=
get_monitor_dpi
(
win
);
if
(
!
to
)
to
=
get_monitor_dpi
(
win
);
if
(
from
==
to
)
return
;
scale_region
(
region
,
from
,
to
);
}
/* check if window and all its ancestors are visible */
static
int
is_visible
(
const
struct
window
*
win
)
{
...
...
@@ -1388,7 +1397,7 @@ static void validate_parents( struct window *child )
/* add/subtract a region (in client coordinates) to the update region of the window */
static
void
redraw_window
(
struct
window
*
win
,
struct
region
*
region
,
int
frame
,
unsigned
int
flags
)
{
struct
region
*
tmp
;
struct
region
*
child_rgn
,
*
tmp
;
struct
window
*
child
;
if
(
flags
&
RDW_INVALIDATE
)
...
...
@@ -1450,11 +1459,19 @@ static void redraw_window( struct window *win, struct region *region, int frame,
LIST_FOR_EACH_ENTRY
(
child
,
&
win
->
children
,
struct
window
,
entry
)
{
if
(
!
(
child
->
style
&
WS_VISIBLE
))
continue
;
if
(
!
rect_in_region
(
tmp
,
&
child
->
window_rect
))
continue
;
offset_region
(
tmp
,
-
child
->
client_rect
.
left
,
-
child
->
client_rect
.
top
);
redraw_window
(
child
,
tmp
,
1
,
flags
);
offset_region
(
tmp
,
child
->
client_rect
.
left
,
child
->
client_rect
.
top
);
if
(
!
(
child_rgn
=
create_empty_region
()))
continue
;
if
(
copy_region
(
child_rgn
,
tmp
))
{
map_dpi_region
(
child
,
child_rgn
,
win
->
dpi
,
child
->
dpi
);
if
(
rect_in_region
(
child_rgn
,
&
child
->
window_rect
))
{
offset_region
(
child_rgn
,
-
child
->
client_rect
.
left
,
-
child
->
client_rect
.
top
);
redraw_window
(
child
,
child_rgn
,
1
,
flags
);
}
}
free_region
(
child_rgn
);
}
free_region
(
tmp
);
}
...
...
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