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
300217e3
Commit
300217e3
authored
Apr 17, 2018
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Implement AdjustWindowRectExForDpi().
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
77013e97
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
2 deletions
+67
-2
nonclient.c
dlls/user32/nonclient.c
+19
-0
win.c
dlls/user32/tests/win.c
+46
-2
user32.spec
dlls/user32/user32.spec
+1
-0
winuser.h
include/winuser.h
+1
-0
No files found.
dlls/user32/nonclient.c
View file @
300217e3
...
...
@@ -323,7 +323,26 @@ BOOL WINAPI DECLSPEC_HOTPATCH AdjustWindowRectEx( LPRECT rect, DWORD style, BOOL
SystemParametersInfoW
(
SPI_GETNONCLIENTMETRICS
,
0
,
&
ncm
,
0
);
adjust_window_rect
(
rect
,
style
,
menu
,
exStyle
,
&
ncm
);
return
TRUE
;
}
/***********************************************************************
* AdjustWindowRectExForDpi (USER32.@)
*/
BOOL
WINAPI
DECLSPEC_HOTPATCH
AdjustWindowRectExForDpi
(
LPRECT
rect
,
DWORD
style
,
BOOL
menu
,
DWORD
exStyle
,
UINT
dpi
)
{
NONCLIENTMETRICSW
ncm
;
if
(
style
&
WS_MINIMIZE
)
return
TRUE
;
TRACE
(
"(%s) %08x %d %08x %u
\n
"
,
wine_dbgstr_rect
(
rect
),
style
,
menu
,
exStyle
,
dpi
);
ncm
.
cbSize
=
sizeof
(
ncm
);
SystemParametersInfoForDpi
(
SPI_GETNONCLIENTMETRICS
,
0
,
&
ncm
,
0
,
dpi
);
adjust_window_rect
(
rect
,
style
,
menu
,
exStyle
,
&
ncm
);
return
TRUE
;
}
...
...
dlls/user32/tests/win.c
View file @
300217e3
...
...
@@ -69,6 +69,8 @@ static DWORD (WINAPI *pGetLayout)(HDC hdc);
static
BOOL
(
WINAPI
*
pMirrorRgn
)(
HWND
hwnd
,
HRGN
hrgn
);
static
BOOL
(
WINAPI
*
pGetWindowDisplayAffinity
)(
HWND
hwnd
,
DWORD
*
affinity
);
static
BOOL
(
WINAPI
*
pSetWindowDisplayAffinity
)(
HWND
hwnd
,
DWORD
affinity
);
static
BOOL
(
WINAPI
*
pAdjustWindowRectExForDpi
)(
LPRECT
,
DWORD
,
BOOL
,
DWORD
,
UINT
);
static
BOOL
(
WINAPI
*
pSystemParametersInfoForDpi
)(
UINT
,
UINT
,
void
*
,
UINT
,
UINT
);
static
BOOL
test_lbuttondown_flag
;
static
DWORD
num_gettext_msgs
;
...
...
@@ -1053,6 +1055,39 @@ static void wine_AdjustWindowRectEx( RECT *rect, LONG style, BOOL menu, LONG exS
if
(
style
&
WS_HSCROLL
)
rect
->
bottom
+=
GetSystemMetrics
(
SM_CYHSCROLL
);
}
static
void
wine_AdjustWindowRectExForDpi
(
RECT
*
rect
,
LONG
style
,
BOOL
menu
,
LONG
exStyle
,
UINT
dpi
)
{
NONCLIENTMETRICSW
ncm
;
int
adjust
=
0
;
ncm
.
cbSize
=
sizeof
(
ncm
);
pSystemParametersInfoForDpi
(
SPI_GETNONCLIENTMETRICS
,
0
,
&
ncm
,
0
,
dpi
);
if
((
exStyle
&
(
WS_EX_STATICEDGE
|
WS_EX_DLGMODALFRAME
))
==
WS_EX_STATICEDGE
)
adjust
=
1
;
/* for the outer frame always present */
else
if
((
exStyle
&
WS_EX_DLGMODALFRAME
)
||
(
style
&
(
WS_THICKFRAME
|
WS_DLGFRAME
)))
adjust
=
2
;
/* outer */
if
(
style
&
WS_THICKFRAME
)
adjust
+=
ncm
.
iBorderWidth
+
ncm
.
iPaddedBorderWidth
;
if
((
style
&
(
WS_BORDER
|
WS_DLGFRAME
))
||
(
exStyle
&
WS_EX_DLGMODALFRAME
))
adjust
++
;
/* The other border */
InflateRect
(
rect
,
adjust
,
adjust
);
if
((
style
&
WS_CAPTION
)
==
WS_CAPTION
)
{
if
(
exStyle
&
WS_EX_TOOLWINDOW
)
rect
->
top
-=
ncm
.
iSmCaptionHeight
+
1
;
else
rect
->
top
-=
ncm
.
iCaptionHeight
+
1
;
}
if
(
menu
)
rect
->
top
-=
ncm
.
iMenuHeight
+
1
;
if
(
exStyle
&
WS_EX_CLIENTEDGE
)
InflateRect
(
rect
,
GetSystemMetrics
(
SM_CXEDGE
),
GetSystemMetrics
(
SM_CYEDGE
));
}
static
void
test_nonclient_area
(
HWND
hwnd
)
{
DWORD
style
,
exstyle
;
...
...
@@ -5282,8 +5317,15 @@ static void test_AWR_flags(void)
rect2
=
rect
;
AdjustWindowRectEx
(
&
rect
,
style
,
FALSE
,
exstyle
);
wine_AdjustWindowRectEx
(
&
rect2
,
style
,
FALSE
,
exstyle
);
ok
(
EqualRect
(
&
rect
,
&
rect2
),
"rects do not match: win %s wine %s
\n
"
,
wine_dbgstr_rect
(
&
rect
),
wine_dbgstr_rect
(
&
rect2
));
ok
(
EqualRect
(
&
rect
,
&
rect2
),
"%08x %08x rects do not match: win %s wine %s
\n
"
,
style
,
exstyle
,
wine_dbgstr_rect
(
&
rect
),
wine_dbgstr_rect
(
&
rect2
));
if
(
pAdjustWindowRectExForDpi
)
{
pAdjustWindowRectExForDpi
(
&
rect
,
style
,
FALSE
,
exstyle
,
192
);
wine_AdjustWindowRectExForDpi
(
&
rect2
,
style
,
FALSE
,
exstyle
,
192
);
ok
(
EqualRect
(
&
rect
,
&
rect2
),
"%08x %08x rects do not match: win %s wine %s
\n
"
,
style
,
exstyle
,
wine_dbgstr_rect
(
&
rect
),
wine_dbgstr_rect
(
&
rect2
));
}
}
}
}
...
...
@@ -10521,6 +10563,8 @@ START_TEST(win)
pMirrorRgn
=
(
void
*
)
GetProcAddress
(
gdi32
,
"MirrorRgn"
);
pGetWindowDisplayAffinity
=
(
void
*
)
GetProcAddress
(
user32
,
"GetWindowDisplayAffinity"
);
pSetWindowDisplayAffinity
=
(
void
*
)
GetProcAddress
(
user32
,
"SetWindowDisplayAffinity"
);
pAdjustWindowRectExForDpi
=
(
void
*
)
GetProcAddress
(
user32
,
"AdjustWindowRectExForDpi"
);
pSystemParametersInfoForDpi
=
(
void
*
)
GetProcAddress
(
user32
,
"SystemParametersInfoForDpi"
);
if
(
argc
==
4
&&
!
strcmp
(
argv
[
2
],
"create_children"
))
{
...
...
dlls/user32/user32.spec
View file @
300217e3
...
...
@@ -2,6 +2,7 @@
@ stdcall AddClipboardFormatListener(long)
@ stdcall AdjustWindowRect(ptr long long)
@ stdcall AdjustWindowRectEx(ptr long long long)
@ stdcall AdjustWindowRectExForDpi(ptr long long long long)
@ stdcall AlignRects(ptr long long long)
# @ stub AllowForegroundActivation
@ stdcall AllowSetForegroundWindow (long)
...
...
include/winuser.h
View file @
300217e3
...
...
@@ -3369,6 +3369,7 @@ WINUSERAPI HKL WINAPI ActivateKeyboardLayout(HKL,UINT);
WINUSERAPI
BOOL
WINAPI
AddClipboardFormatListener
(
HWND
);
WINUSERAPI
BOOL
WINAPI
AdjustWindowRect
(
LPRECT
,
DWORD
,
BOOL
);
WINUSERAPI
BOOL
WINAPI
AdjustWindowRectEx
(
LPRECT
,
DWORD
,
BOOL
,
DWORD
);
WINUSERAPI
BOOL
WINAPI
AdjustWindowRectExForDpi
(
RECT
*
,
DWORD
,
BOOL
,
DWORD
,
UINT
);
WINUSERAPI
BOOL
WINAPI
AllowSetForegroundWindow
(
DWORD
);
WINUSERAPI
BOOL
WINAPI
AnimateWindow
(
HWND
,
DWORD
,
DWORD
);
#define AnsiLowerA CharLowerA
...
...
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