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
9b2f59cb
Commit
9b2f59cb
authored
May 18, 2021
by
Zhiyi Zhang
Committed by
Alexandre Julliard
May 18, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Use get_primary_monitor_rect() helper.
Signed-off-by:
Zhiyi Zhang
<
zzhang@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
59e5a8d0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
18 deletions
+15
-18
input.c
dlls/user32/input.c
+7
-9
sysparams.c
dlls/user32/sysparams.c
+2
-4
user_private.h
dlls/user32/user_private.h
+1
-0
win.c
dlls/user32/win.c
+1
-2
winpos.c
dlls/user32/winpos.c
+4
-3
No files found.
dlls/user32/input.c
View file @
9b2f59cb
...
...
@@ -195,17 +195,15 @@ static void update_mouse_coords( INPUT *input )
if
(
input
->
u
.
mi
.
dwFlags
&
MOUSEEVENTF_ABSOLUTE
)
{
DPI_AWARENESS_CONTEXT
context
=
SetThreadDpiAwarenessContext
(
DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE
);
RECT
rc
;
if
(
input
->
u
.
mi
.
dwFlags
&
MOUSEEVENTF_VIRTUALDESK
)
{
RECT
rc
=
get_virtual_screen_rect
();
input
->
u
.
mi
.
dx
=
rc
.
left
+
((
input
->
u
.
mi
.
dx
*
(
rc
.
right
-
rc
.
left
))
>>
16
);
input
->
u
.
mi
.
dy
=
rc
.
top
+
((
input
->
u
.
mi
.
dy
*
(
rc
.
bottom
-
rc
.
top
))
>>
16
);
}
rc
=
get_virtual_screen_rect
();
else
{
input
->
u
.
mi
.
dx
=
(
input
->
u
.
mi
.
dx
*
GetSystemMetrics
(
SM_CXSCREEN
))
>>
16
;
input
->
u
.
mi
.
dy
=
(
input
->
u
.
mi
.
dy
*
GetSystemMetrics
(
SM_CYSCREEN
))
>>
16
;
}
rc
=
get_primary_monitor_rect
();
input
->
u
.
mi
.
dx
=
rc
.
left
+
((
input
->
u
.
mi
.
dx
*
(
rc
.
right
-
rc
.
left
))
>>
16
)
;
input
->
u
.
mi
.
dy
=
rc
.
top
+
((
input
->
u
.
mi
.
dy
*
(
rc
.
bottom
-
rc
.
top
))
>>
16
);
SetThreadDpiAwarenessContext
(
context
);
}
else
...
...
dlls/user32/sysparams.c
View file @
9b2f59cb
...
...
@@ -366,7 +366,7 @@ static BOOL CALLBACK get_primary_monitor_proc( HMONITOR monitor, HDC hdc, LPRECT
return
TRUE
;
}
static
RECT
get_primary_monitor_rect
(
void
)
RECT
get_primary_monitor_rect
(
void
)
{
RECT
rect
=
{
0
};
...
...
@@ -1818,9 +1818,7 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam,
spi_idx
=
SPI_SETWORKAREA_IDX
;
if
(
!
spi_loaded
[
spi_idx
])
{
SetRect
(
&
work_area
,
0
,
0
,
GetSystemMetrics
(
SM_CXSCREEN
),
GetSystemMetrics
(
SM_CYSCREEN
)
);
work_area
=
get_primary_monitor_rect
();
EnumDisplayMonitors
(
0
,
NULL
,
enum_monitors
,
(
LPARAM
)
&
work_area
);
spi_loaded
[
spi_idx
]
=
TRUE
;
}
...
...
dlls/user32/user_private.h
View file @
9b2f59cb
...
...
@@ -261,6 +261,7 @@ extern void update_window_state( HWND hwnd ) DECLSPEC_HIDDEN;
extern
void
wait_graphics_driver_ready
(
void
)
DECLSPEC_HIDDEN
;
extern
void
*
get_hook_proc
(
void
*
proc
,
const
WCHAR
*
module
,
HMODULE
*
free_module
)
DECLSPEC_HIDDEN
;
extern
RECT
get_virtual_screen_rect
(
void
)
DECLSPEC_HIDDEN
;
extern
RECT
get_primary_monitor_rect
(
void
)
DECLSPEC_HIDDEN
;
extern
LRESULT
call_current_hook
(
HHOOK
hhook
,
INT
code
,
WPARAM
wparam
,
LPARAM
lparam
)
DECLSPEC_HIDDEN
;
extern
DWORD
get_input_codepage
(
void
)
DECLSPEC_HIDDEN
;
extern
BOOL
map_wparam_AtoW
(
UINT
message
,
WPARAM
*
wparam
,
enum
wm_char_mapping
mapping
)
DECLSPEC_HIDDEN
;
...
...
dlls/user32/win.c
View file @
9b2f59cb
...
...
@@ -855,8 +855,7 @@ BOOL WIN_GetRectangles( HWND hwnd, enum coords_relative relative, RECT *rectWind
}
else
{
rect
.
right
=
GetSystemMetrics
(
SM_CXSCREEN
);
rect
.
bottom
=
GetSystemMetrics
(
SM_CYSCREEN
);
rect
=
get_primary_monitor_rect
();
}
if
(
rectWindow
)
*
rectWindow
=
rect
;
if
(
rectClient
)
*
rectClient
=
rect
;
...
...
dlls/user32/winpos.c
View file @
9b2f59cb
...
...
@@ -740,7 +740,7 @@ MINMAXINFO WINPOS_GetMinMaxInfo( HWND hwnd )
if
((
monitor
=
MonitorFromWindow
(
hwnd
,
MONITOR_DEFAULTTOPRIMARY
)))
{
RECT
rc_work
;
RECT
rc_work
,
rc_primary
;
MONITORINFO
mon_info
;
mon_info
.
cbSize
=
sizeof
(
mon_info
);
...
...
@@ -754,8 +754,9 @@ MINMAXINFO WINPOS_GetMinMaxInfo( HWND hwnd )
rc_work
=
mon_info
.
rcWork
;
}
if
(
MinMax
.
ptMaxSize
.
x
==
GetSystemMetrics
(
SM_CXSCREEN
)
+
2
*
xinc
&&
MinMax
.
ptMaxSize
.
y
==
GetSystemMetrics
(
SM_CYSCREEN
)
+
2
*
yinc
)
rc_primary
=
get_primary_monitor_rect
();
if
(
MinMax
.
ptMaxSize
.
x
==
(
rc_primary
.
right
-
rc_primary
.
left
)
+
2
*
xinc
&&
MinMax
.
ptMaxSize
.
y
==
(
rc_primary
.
bottom
-
rc_primary
.
top
)
+
2
*
yinc
)
{
MinMax
.
ptMaxSize
.
x
=
(
rc_work
.
right
-
rc_work
.
left
)
+
2
*
xinc
;
MinMax
.
ptMaxSize
.
y
=
(
rc_work
.
bottom
-
rc_work
.
top
)
+
2
*
yinc
;
...
...
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