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
910f3ed4
Commit
910f3ed4
authored
Aug 27, 2018
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Scale coordinates in Get/SetCursorPos() based on DPI awareness.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
87d1a4a3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
input.c
dlls/user32/input.c
+15
-2
No files found.
dlls/user32/input.c
View file @
910f3ed4
...
...
@@ -240,6 +240,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetCursorPos( POINT *pt )
{
BOOL
ret
;
DWORD
last_change
;
UINT
dpi
;
if
(
!
pt
)
return
FALSE
;
...
...
@@ -256,6 +257,13 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetCursorPos( POINT *pt )
/* query new position from graphics driver if we haven't updated recently */
if
(
ret
&&
GetTickCount
()
-
last_change
>
100
)
ret
=
USER_Driver
->
pGetCursorPos
(
pt
);
if
(
ret
&&
(
dpi
=
get_thread_dpi
()))
{
DPI_AWARENESS_CONTEXT
context
;
context
=
SetThreadDpiAwarenessContext
(
DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE
);
*
pt
=
map_dpi_point
(
*
pt
,
get_monitor_dpi
(
MonitorFromPoint
(
*
pt
,
MONITOR_DEFAULTTOPRIMARY
)),
dpi
);
SetThreadDpiAwarenessContext
(
context
);
}
return
ret
;
}
...
...
@@ -289,14 +297,19 @@ BOOL WINAPI GetCursorInfo( PCURSORINFO pci )
*/
BOOL
WINAPI
DECLSPEC_HOTPATCH
SetCursorPos
(
INT
x
,
INT
y
)
{
POINT
pt
=
{
x
,
y
};
BOOL
ret
;
INT
prev_x
,
prev_y
,
new_x
,
new_y
;
UINT
dpi
;
if
((
dpi
=
get_thread_dpi
()))
pt
=
map_dpi_point
(
pt
,
dpi
,
get_monitor_dpi
(
MonitorFromPoint
(
pt
,
MONITOR_DEFAULTTOPRIMARY
)));
SERVER_START_REQ
(
set_cursor
)
{
req
->
flags
=
SET_CURSOR_POS
;
req
->
x
=
x
;
req
->
y
=
y
;
req
->
x
=
pt
.
x
;
req
->
y
=
pt
.
y
;
if
((
ret
=
!
wine_server_call
(
req
)))
{
prev_x
=
reply
->
prev_x
;
...
...
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