Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
87e49000
Commit
87e49000
authored
Aug 24, 2018
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Scale coordinates in Get/SetWindowPlacement() based on DPI awareness.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8de1b2c2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
6 deletions
+29
-6
sysparams.c
dlls/user32/sysparams.c
+20
-0
win.h
dlls/user32/win.h
+3
-0
winpos.c
dlls/user32/winpos.c
+6
-6
No files found.
dlls/user32/sysparams.c
View file @
87e49000
...
...
@@ -3245,6 +3245,16 @@ POINT point_win_to_thread_dpi( HWND hwnd, POINT pt )
}
/**********************************************************************
* point_thread_to_win_dpi
*/
POINT
point_thread_to_win_dpi
(
HWND
hwnd
,
POINT
pt
)
{
UINT
dpi
=
get_thread_dpi
();
if
(
!
dpi
)
dpi
=
get_win_monitor_dpi
(
hwnd
);
return
map_dpi_point
(
pt
,
dpi
,
GetDpiForWindow
(
hwnd
));
}
/**********************************************************************
* map_dpi_rect
*/
RECT
map_dpi_rect
(
RECT
rect
,
UINT
dpi_from
,
UINT
dpi_to
)
...
...
@@ -3270,6 +3280,16 @@ RECT rect_win_to_thread_dpi( HWND hwnd, RECT rect )
}
/**********************************************************************
* rect_thread_to_win_dpi
*/
RECT
rect_thread_to_win_dpi
(
HWND
hwnd
,
RECT
rect
)
{
UINT
dpi
=
get_thread_dpi
();
if
(
!
dpi
)
dpi
=
get_win_monitor_dpi
(
hwnd
);
return
map_dpi_rect
(
rect
,
dpi
,
GetDpiForWindow
(
hwnd
)
);
}
/**********************************************************************
* SetProcessDpiAwarenessContext (USER32.@)
*/
BOOL
WINAPI
SetProcessDpiAwarenessContext
(
DPI_AWARENESS_CONTEXT
context
)
...
...
dlls/user32/win.h
View file @
87e49000
...
...
@@ -133,8 +133,11 @@ extern UINT get_win_monitor_dpi( HWND hwnd ) DECLSPEC_HIDDEN;
extern
UINT
get_thread_dpi
(
void
)
DECLSPEC_HIDDEN
;
extern
POINT
map_dpi_point
(
POINT
pt
,
UINT
dpi_from
,
UINT
dpi_to
)
DECLSPEC_HIDDEN
;
extern
POINT
point_win_to_thread_dpi
(
HWND
hwnd
,
POINT
pt
)
DECLSPEC_HIDDEN
;
extern
POINT
point_thread_to_win_dpi
(
HWND
hwnd
,
POINT
pt
)
DECLSPEC_HIDDEN
;
extern
RECT
map_dpi_rect
(
RECT
rect
,
UINT
dpi_from
,
UINT
dpi_to
)
DECLSPEC_HIDDEN
;
extern
RECT
rect_win_to_thread_dpi
(
HWND
hwnd
,
RECT
rect
)
DECLSPEC_HIDDEN
;
extern
RECT
rect_thread_to_win_dpi
(
HWND
hwnd
,
RECT
rect
)
DECLSPEC_HIDDEN
;
extern
BOOL
set_window_pos
(
HWND
hwnd
,
HWND
insert_after
,
UINT
swp_flags
,
const
RECT
*
window_rect
,
const
RECT
*
client_rect
,
const
RECT
*
valid_rects
)
DECLSPEC_HIDDEN
;
...
...
dlls/user32/winpos.c
View file @
87e49000
...
...
@@ -1342,9 +1342,9 @@ BOOL WINAPI GetWindowPlacement( HWND hwnd, WINDOWPLACEMENT *wndpl )
wndpl
->
flags
=
WPF_RESTORETOMAXIMIZED
;
else
wndpl
->
flags
=
0
;
wndpl
->
ptMinPosition
=
pWnd
->
min_pos
;
wndpl
->
ptMaxPosition
=
pWnd
->
max_pos
;
wndpl
->
rcNormalPosition
=
pWnd
->
normal_rect
;
wndpl
->
ptMinPosition
=
EMPTYPOINT
(
pWnd
->
min_pos
)
?
pWnd
->
min_pos
:
point_win_to_thread_dpi
(
hwnd
,
pWnd
->
min_pos
)
;
wndpl
->
ptMaxPosition
=
EMPTYPOINT
(
pWnd
->
max_pos
)
?
pWnd
->
max_pos
:
point_win_to_thread_dpi
(
hwnd
,
pWnd
->
max_pos
)
;
wndpl
->
rcNormalPosition
=
rect_win_to_thread_dpi
(
hwnd
,
pWnd
->
normal_rect
)
;
WIN_ReleasePtr
(
pWnd
);
TRACE
(
"%p: returning min %d,%d max %d,%d normal %s
\n
"
,
...
...
@@ -1419,9 +1419,9 @@ static BOOL WINPOS_SetPlacement( HWND hwnd, const WINDOWPLACEMENT *wndpl, UINT f
if
(
!
pWnd
||
pWnd
==
WND_OTHER_PROCESS
||
pWnd
==
WND_DESKTOP
)
return
FALSE
;
if
(
flags
&
PLACE_MIN
)
pWnd
->
min_pos
=
wp
.
ptMinPosition
;
if
(
flags
&
PLACE_MAX
)
pWnd
->
max_pos
=
wp
.
ptMaxPosition
;
if
(
flags
&
PLACE_RECT
)
pWnd
->
normal_rect
=
wp
.
rcNormalPosition
;
if
(
flags
&
PLACE_MIN
)
pWnd
->
min_pos
=
point_thread_to_win_dpi
(
hwnd
,
wp
.
ptMinPosition
)
;
if
(
flags
&
PLACE_MAX
)
pWnd
->
max_pos
=
point_thread_to_win_dpi
(
hwnd
,
wp
.
ptMaxPosition
)
;
if
(
flags
&
PLACE_RECT
)
pWnd
->
normal_rect
=
rect_thread_to_win_dpi
(
hwnd
,
wp
.
rcNormalPosition
)
;
style
=
pWnd
->
dwStyle
;
...
...
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