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
f71be05b
Commit
f71be05b
authored
Aug 29, 2012
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: ScrollWindow should not use a cached DC, unlike ScrollWindowEx.
parent
4c660d6e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
15 deletions
+72
-15
painting.c
dlls/user32/painting.c
+21
-15
dce.c
dlls/user32/tests/dce.c
+51
-0
No files found.
dlls/user32/painting.c
View file @
f71be05b
...
@@ -1367,17 +1367,8 @@ INT WINAPI ExcludeUpdateRgn( HDC hdc, HWND hwnd )
...
@@ -1367,17 +1367,8 @@ INT WINAPI ExcludeUpdateRgn( HDC hdc, HWND hwnd )
}
}
/*************************************************************************
static
INT
scroll_window
(
HWND
hwnd
,
INT
dx
,
INT
dy
,
const
RECT
*
rect
,
const
RECT
*
clipRect
,
* ScrollWindowEx (USER32.@)
HRGN
hrgnUpdate
,
LPRECT
rcUpdate
,
UINT
flags
,
BOOL
is_ex
)
*
* Note: contrary to what the doc says, pixels that are scrolled from the
* outside of clipRect to the inside are NOT painted.
*
*/
INT
WINAPI
ScrollWindowEx
(
HWND
hwnd
,
INT
dx
,
INT
dy
,
const
RECT
*
rect
,
const
RECT
*
clipRect
,
HRGN
hrgnUpdate
,
LPRECT
rcUpdate
,
UINT
flags
)
{
{
INT
retVal
=
NULLREGION
;
INT
retVal
=
NULLREGION
;
BOOL
bOwnRgn
=
TRUE
;
BOOL
bOwnRgn
=
TRUE
;
...
@@ -1416,11 +1407,12 @@ INT WINAPI ScrollWindowEx( HWND hwnd, INT dx, INT dy,
...
@@ -1416,11 +1407,12 @@ INT WINAPI ScrollWindowEx( HWND hwnd, INT dx, INT dy,
newCaretPos
.
x
=
newCaretPos
.
y
=
0
;
newCaretPos
.
x
=
newCaretPos
.
y
=
0
;
if
(
!
IsRectEmpty
(
&
cliprc
)
&&
(
dx
||
dy
))
{
if
(
!
IsRectEmpty
(
&
cliprc
)
&&
(
dx
||
dy
))
{
DWORD
dcxflags
=
DCX_CACHE
;
DWORD
dcxflags
=
0
;
DWORD
style
=
GetWindowLongW
(
hwnd
,
GWL_STYLE
);
DWORD
style
=
GetWindowLongW
(
hwnd
,
GWL_STYLE
);
hwndCaret
=
fix_caret
(
hwnd
,
&
rc
,
dx
,
dy
,
flags
,
&
moveCaret
,
&
newCaretPos
);
hwndCaret
=
fix_caret
(
hwnd
,
&
rc
,
dx
,
dy
,
flags
,
&
moveCaret
,
&
newCaretPos
);
if
(
is_ex
)
dcxflags
|=
DCX_CACHE
;
if
(
style
&
WS_CLIPSIBLINGS
)
dcxflags
|=
DCX_CLIPSIBLINGS
;
if
(
style
&
WS_CLIPSIBLINGS
)
dcxflags
|=
DCX_CLIPSIBLINGS
;
if
(
GetClassLongW
(
hwnd
,
GCL_STYLE
)
&
CS_PARENTDC
)
if
(
GetClassLongW
(
hwnd
,
GCL_STYLE
)
&
CS_PARENTDC
)
dcxflags
|=
DCX_PARENTCLIP
;
dcxflags
|=
DCX_PARENTCLIP
;
...
@@ -1523,15 +1515,29 @@ INT WINAPI ScrollWindowEx( HWND hwnd, INT dx, INT dy,
...
@@ -1523,15 +1515,29 @@ INT WINAPI ScrollWindowEx( HWND hwnd, INT dx, INT dy,
/*************************************************************************
/*************************************************************************
* ScrollWindowEx (USER32.@)
*
* Note: contrary to what the doc says, pixels that are scrolled from the
* outside of clipRect to the inside are NOT painted.
*
*/
INT
WINAPI
ScrollWindowEx
(
HWND
hwnd
,
INT
dx
,
INT
dy
,
const
RECT
*
rect
,
const
RECT
*
clipRect
,
HRGN
hrgnUpdate
,
LPRECT
rcUpdate
,
UINT
flags
)
{
return
scroll_window
(
hwnd
,
dx
,
dy
,
rect
,
clipRect
,
hrgnUpdate
,
rcUpdate
,
flags
,
TRUE
);
}
/*************************************************************************
* ScrollWindow (USER32.@)
* ScrollWindow (USER32.@)
*
*
*/
*/
BOOL
WINAPI
ScrollWindow
(
HWND
hwnd
,
INT
dx
,
INT
dy
,
BOOL
WINAPI
ScrollWindow
(
HWND
hwnd
,
INT
dx
,
INT
dy
,
const
RECT
*
rect
,
const
RECT
*
clipRect
)
const
RECT
*
rect
,
const
RECT
*
clipRect
)
{
{
return
(
ERROR
!=
ScrollWindowEx
(
hwnd
,
dx
,
dy
,
rect
,
clipRect
,
0
,
NULL
,
return
scroll_window
(
hwnd
,
dx
,
dy
,
rect
,
clipRect
,
0
,
NULL
,
(
rect
?
0
:
SW_SCROLLCHILDREN
)
|
SW_INVALIDATE
|
SW_ERASE
|
(
rect
?
0
:
SW_SCROLLCHILDREN
),
FALSE
)
!=
ERROR
;
SW_INVALIDATE
|
SW_ERASE
));
}
}
...
...
dlls/user32/tests/dce.c
View file @
f71be05b
...
@@ -406,6 +406,56 @@ static void test_begin_paint(void)
...
@@ -406,6 +406,56 @@ static void test_begin_paint(void)
"clip box should have been reset %d,%d-%d,%d
\n
"
,
rect
.
left
,
rect
.
top
,
rect
.
right
,
rect
.
bottom
);
"clip box should have been reset %d,%d-%d,%d
\n
"
,
rect
.
left
,
rect
.
top
,
rect
.
right
,
rect
.
bottom
);
}
}
/* test ScrollWindow with window DCs */
static
void
test_scroll_window
(
void
)
{
PAINTSTRUCT
ps
;
HDC
hdc
;
RECT
clip
,
rect
;
/* ScrollWindow uses the window DC, ScrollWindowEx doesn't */
UpdateWindow
(
hwnd_owndc
);
SetRect
(
&
clip
,
25
,
25
,
50
,
50
);
ScrollWindow
(
hwnd_owndc
,
-
5
,
-
10
,
NULL
,
&
clip
);
hdc
=
BeginPaint
(
hwnd_owndc
,
&
ps
);
SetRectEmpty
(
&
rect
);
GetClipBox
(
hdc
,
&
rect
);
ok
(
rect
.
left
>=
25
&&
rect
.
top
>=
25
&&
rect
.
right
<=
50
&&
rect
.
bottom
<=
50
,
"invalid clip box %d,%d-%d,%d
\n
"
,
rect
.
left
,
rect
.
top
,
rect
.
right
,
rect
.
bottom
);
EndPaint
(
hwnd_owndc
,
&
ps
);
SetViewportExtEx
(
hdc
,
2
,
3
,
NULL
);
SetViewportOrgEx
(
hdc
,
30
,
20
,
NULL
);
ScrollWindow
(
hwnd_owndc
,
-
5
,
-
10
,
NULL
,
&
clip
);
hdc
=
BeginPaint
(
hwnd_owndc
,
&
ps
);
SetRectEmpty
(
&
rect
);
GetClipBox
(
hdc
,
&
rect
);
ok
(
rect
.
left
>=
25
&&
rect
.
top
>=
25
&&
rect
.
right
<=
50
&&
rect
.
bottom
<=
50
,
"invalid clip box %d,%d-%d,%d
\n
"
,
rect
.
left
,
rect
.
top
,
rect
.
right
,
rect
.
bottom
);
EndPaint
(
hwnd_owndc
,
&
ps
);
ScrollWindowEx
(
hwnd_owndc
,
-
5
,
-
10
,
NULL
,
&
clip
,
0
,
NULL
,
SW_INVALIDATE
|
SW_ERASE
);
hdc
=
BeginPaint
(
hwnd_owndc
,
&
ps
);
SetRectEmpty
(
&
rect
);
GetClipBox
(
hdc
,
&
rect
);
ok
(
rect
.
left
>=
-
5
&&
rect
.
top
>=
5
&&
rect
.
right
<=
20
&&
rect
.
bottom
<=
30
,
"invalid clip box %d,%d-%d,%d
\n
"
,
rect
.
left
,
rect
.
top
,
rect
.
right
,
rect
.
bottom
);
EndPaint
(
hwnd_owndc
,
&
ps
);
SetViewportExtEx
(
hdc
,
1
,
1
,
NULL
);
SetViewportOrgEx
(
hdc
,
0
,
0
,
NULL
);
ScrollWindowEx
(
hwnd_owndc
,
-
5
,
-
10
,
NULL
,
&
clip
,
0
,
NULL
,
SW_INVALIDATE
|
SW_ERASE
);
hdc
=
BeginPaint
(
hwnd_owndc
,
&
ps
);
SetRectEmpty
(
&
rect
);
GetClipBox
(
hdc
,
&
rect
);
ok
(
rect
.
left
>=
25
&&
rect
.
top
>=
25
&&
rect
.
right
<=
50
&&
rect
.
bottom
<=
50
,
"invalid clip box %d,%d-%d,%d
\n
"
,
rect
.
left
,
rect
.
top
,
rect
.
right
,
rect
.
bottom
);
EndPaint
(
hwnd_owndc
,
&
ps
);
}
static
void
test_invisible_create
(
void
)
static
void
test_invisible_create
(
void
)
{
{
HWND
hwnd_owndc
=
CreateWindowA
(
"owndc_class"
,
NULL
,
WS_OVERLAPPED
,
HWND
hwnd_owndc
=
CreateWindowA
(
"owndc_class"
,
NULL
,
WS_OVERLAPPED
,
...
@@ -559,6 +609,7 @@ START_TEST(dce)
...
@@ -559,6 +609,7 @@ START_TEST(dce)
test_parameters
();
test_parameters
();
test_dc_visrgn
();
test_dc_visrgn
();
test_begin_paint
();
test_begin_paint
();
test_scroll_window
();
test_invisible_create
();
test_invisible_create
();
test_dc_layout
();
test_dc_layout
();
...
...
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