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
dfa43541
Commit
dfa43541
authored
Feb 22, 2005
by
Rein Klazes
Committed by
Alexandre Julliard
Feb 22, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DefWindowProc's WM_NCCALC handler must not subtract space for
scrollbars if there is not enough space for it anyway. With tests to confirm the behavior.
parent
2d133baa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
6 deletions
+70
-6
win.c
dlls/user/tests/win.c
+53
-0
nonclient.c
windows/nonclient.c
+17
-6
No files found.
dlls/user/tests/win.c
View file @
dfa43541
...
...
@@ -2231,6 +2231,58 @@ static void test_validatergn(HWND hwnd)
DestroyWindow
(
child
);
}
void
nccalchelper
(
HWND
hwnd
,
INT
x
,
INT
y
,
RECT
*
prc
)
{
MoveWindow
(
hwnd
,
0
,
0
,
x
,
y
,
0
);
GetWindowRect
(
hwnd
,
prc
);
trace
(
"window rect is %ld,%ld - %ld,%ld
\n
"
,
prc
->
left
,
prc
->
top
,
prc
->
right
,
prc
->
bottom
);
DefWindowProcA
(
hwnd
,
WM_NCCALCSIZE
,
0
,
(
LPARAM
)
prc
);
trace
(
"nccalc rect is %ld,%ld - %ld,%ld
\n
"
,
prc
->
left
,
prc
->
top
,
prc
->
right
,
prc
->
bottom
);
}
void
test_nccalcscroll
(
HWND
parent
)
{
RECT
rc1
;
INT
sbheight
=
GetSystemMetrics
(
SM_CYHSCROLL
);
INT
sbwidth
=
GetSystemMetrics
(
SM_CXVSCROLL
);
HWND
hwnd
=
CreateWindowExA
(
0
,
"static"
,
NULL
,
WS_CHILD
|
WS_VISIBLE
|
WS_VSCROLL
|
WS_HSCROLL
,
10
,
10
,
200
,
200
,
parent
,
0
,
0
,
NULL
);
ShowWindow
(
parent
,
SW_SHOW
);
UpdateWindow
(
parent
);
/* test window too low for a horizontal scroll bar */
nccalchelper
(
hwnd
,
100
,
sbheight
,
&
rc1
);
ok
(
rc1
.
bottom
-
rc1
.
top
==
sbheight
,
"Height should be %d size is %ld,%ld - %ld,%ld
\n
"
,
sbheight
,
rc1
.
left
,
rc1
.
top
,
rc1
.
right
,
rc1
.
bottom
);
/* test window just high enough for a horizontal scroll bar */
nccalchelper
(
hwnd
,
100
,
sbheight
+
1
,
&
rc1
);
ok
(
rc1
.
bottom
-
rc1
.
top
==
1
,
"Height should be %d size is %ld,%ld - %ld,%ld
\n
"
,
1
,
rc1
.
left
,
rc1
.
top
,
rc1
.
right
,
rc1
.
bottom
);
/* test window too narrow for a vertical scroll bar */
nccalchelper
(
hwnd
,
sbwidth
-
1
,
100
,
&
rc1
);
ok
(
rc1
.
right
-
rc1
.
left
==
sbwidth
-
1
,
"Width should be %d size is %ld,%ld - %ld,%ld
\n
"
,
sbwidth
-
1
,
rc1
.
left
,
rc1
.
top
,
rc1
.
right
,
rc1
.
bottom
);
/* test window just wide enough for a vertical scroll bar */
nccalchelper
(
hwnd
,
sbwidth
,
100
,
&
rc1
);
ok
(
rc1
.
right
-
rc1
.
left
==
0
,
"Width should be %d size is %ld,%ld - %ld,%ld
\n
"
,
0
,
rc1
.
left
,
rc1
.
top
,
rc1
.
right
,
rc1
.
bottom
);
/* same test, but with client edge: not enough width */
SetWindowLong
(
hwnd
,
GWL_EXSTYLE
,
WS_EX_CLIENTEDGE
|
GetWindowLong
(
hwnd
,
GWL_EXSTYLE
));
nccalchelper
(
hwnd
,
sbwidth
,
100
,
&
rc1
);
ok
(
rc1
.
right
-
rc1
.
left
==
sbwidth
-
2
*
GetSystemMetrics
(
SM_CXEDGE
),
"Width should be %d size is %ld,%ld - %ld,%ld
\n
"
,
sbwidth
-
2
*
GetSystemMetrics
(
SM_CXEDGE
),
rc1
.
left
,
rc1
.
top
,
rc1
.
right
,
rc1
.
bottom
);
DestroyWindow
(
hwnd
);
}
START_TEST
(
win
)
{
pGetAncestor
=
(
void
*
)
GetProcAddress
(
GetModuleHandleA
(
"user32.dll"
),
"GetAncestor"
);
...
...
@@ -2287,6 +2339,7 @@ START_TEST(win)
test_keyboard_input
(
hwndMain
);
test_mouse_input
(
hwndMain
);
test_validatergn
(
hwndMain
);
test_nccalcscroll
(
hwndMain
);
UnhookWindowsHookEx
(
hhook
);
}
windows/nonclient.c
View file @
dfa43541
...
...
@@ -402,12 +402,23 @@ LONG NC_HandleNCCalcSize( HWND hwnd, RECT *winRect )
-
tmpRect
.
left
,
-
tmpRect
.
top
)
+
1
;
}
SetRect
(
&
tmpRect
,
0
,
0
,
0
,
0
);
NC_AdjustRectInner
(
&
tmpRect
,
style
,
exStyle
);
winRect
->
left
-=
tmpRect
.
left
;
winRect
->
top
-=
tmpRect
.
top
;
winRect
->
right
-=
tmpRect
.
right
;
winRect
->
bottom
-=
tmpRect
.
bottom
;
if
(
exStyle
&
WS_EX_CLIENTEDGE
)
if
(
winRect
->
right
-
winRect
->
left
>
2
*
GetSystemMetrics
(
SM_CXEDGE
)
&&
winRect
->
bottom
-
winRect
->
top
>
2
*
GetSystemMetrics
(
SM_CYEDGE
))
InflateRect
(
winRect
,
-
GetSystemMetrics
(
SM_CXEDGE
),
-
GetSystemMetrics
(
SM_CYEDGE
));
if
(
style
&
WS_VSCROLL
)
if
(
winRect
->
right
-
winRect
->
left
>=
GetSystemMetrics
(
SM_CXVSCROLL
)){
if
((
exStyle
&
WS_EX_LEFTSCROLLBAR
)
!=
0
)
winRect
->
left
+=
GetSystemMetrics
(
SM_CXVSCROLL
);
else
winRect
->
right
-=
GetSystemMetrics
(
SM_CXVSCROLL
);
}
if
(
style
&
WS_HSCROLL
)
if
(
winRect
->
bottom
-
winRect
->
top
>
GetSystemMetrics
(
SM_CYHSCROLL
))
winRect
->
bottom
-=
GetSystemMetrics
(
SM_CYHSCROLL
);
if
(
winRect
->
top
>
winRect
->
bottom
)
winRect
->
bottom
=
winRect
->
top
;
...
...
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