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
f1ea0637
Commit
f1ea0637
authored
Jul 22, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: DCX_NORESETATTRS should be applied at DC release time.
parent
e79af2f0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
13 deletions
+17
-13
painting.c
dlls/user32/painting.c
+14
-7
dce.c
dlls/user32/tests/dce.c
+3
-6
No files found.
dlls/user32/painting.c
View file @
f1ea0637
...
...
@@ -168,6 +168,16 @@ static void update_visible_region( struct dce *dce )
/***********************************************************************
* reset_dce_attrs
*/
static
void
reset_dce_attrs
(
struct
dce
*
dce
)
{
RestoreDC
(
dce
->
hdc
,
1
);
/* initial save level is always 1 */
SaveDC
(
dce
->
hdc
);
/* save the state again for next time */
}
/***********************************************************************
* release_dce
*/
static
void
release_dce
(
struct
dce
*
dce
)
...
...
@@ -329,6 +339,7 @@ void free_dce( struct dce *dce, HWND hwnd )
if
(
!--
dce
->
count
)
{
/* turn it into a cache entry */
reset_dce_attrs
(
dce
);
release_dce
(
dce
);
dce
->
flags
|=
DCX_CACHE
;
}
...
...
@@ -455,6 +466,7 @@ static INT release_dc( HWND hwnd, HDC hdc, BOOL end_paint )
dce
=
(
struct
dce
*
)
GetDCHook
(
hdc
,
NULL
);
if
(
dce
&&
dce
->
count
)
{
if
(
!
(
dce
->
flags
&
DCX_NORESETATTRS
))
reset_dce_attrs
(
dce
);
if
(
end_paint
||
(
dce
->
flags
&
DCX_CACHE
))
delete_clip_rgn
(
dce
);
if
(
dce
->
flags
&
DCX_CACHE
)
dce
->
count
=
0
;
ret
=
TRUE
;
...
...
@@ -898,6 +910,7 @@ BOOL WINAPI EndPaint( HWND hwnd, const PAINTSTRUCT *lps )
HDC
WINAPI
GetDCEx
(
HWND
hwnd
,
HRGN
hrgnClip
,
DWORD
flags
)
{
static
const
DWORD
clip_flags
=
DCX_PARENTCLIP
|
DCX_CLIPSIBLINGS
|
DCX_CLIPCHILDREN
|
DCX_WINDOW
;
static
const
DWORD
user_flags
=
clip_flags
|
DCX_NORESETATTRS
;
/* flags that can be set by user */
struct
dce
*
dce
;
BOOL
bUpdateVisRgn
=
TRUE
;
HWND
parent
;
...
...
@@ -1021,18 +1034,12 @@ HDC WINAPI GetDCEx( HWND hwnd, HRGN hrgnClip, DWORD flags )
}
dce
->
hwnd
=
hwnd
;
dce
->
flags
=
(
dce
->
flags
&
~
clip_flags
)
|
(
flags
&
clip
_flags
);
dce
->
flags
=
(
dce
->
flags
&
~
user_flags
)
|
(
flags
&
user
_flags
);
if
(
SetHookFlags
(
dce
->
hdc
,
DCHF_VALIDATEVISRGN
))
bUpdateVisRgn
=
TRUE
;
/* DC was dirty */
if
(
bUpdateVisRgn
)
update_visible_region
(
dce
);
if
(
!
(
flags
&
DCX_NORESETATTRS
))
{
RestoreDC
(
dce
->
hdc
,
1
);
/* initial save level is always 1 */
SaveDC
(
dce
->
hdc
);
/* save the state again for next time */
}
TRACE
(
"(%p,%p,0x%x): returning %p
\n
"
,
hwnd
,
hrgnClip
,
flags
,
dce
->
hdc
);
return
dce
->
hdc
;
}
...
...
dlls/user32/tests/dce.c
View file @
f1ea0637
...
...
@@ -66,10 +66,7 @@ static void test_dc_attributes(void)
hdc
=
hdcs
[
i
]
=
GetDCEx
(
hwnd_cache
,
0
,
DCX_USESTYLE
|
DCX_NORESETATTRS
);
if
(
!
hdc
)
break
;
rop
=
GetROP2
(
hdc
);
if
(
hdc
==
old_hdc
)
todo_wine
ok
(
rop
==
def_rop
,
"wrong ROP2 %d after release %p/%p
\n
"
,
rop
,
old_hdc
,
hdc
);
else
ok
(
rop
==
def_rop
,
"wrong ROP2 %d after release %p/%p
\n
"
,
rop
,
old_hdc
,
hdc
);
ok
(
rop
==
def_rop
,
"wrong ROP2 %d after release %p/%p
\n
"
,
rop
,
old_hdc
,
hdc
);
if
(
hdc
==
old_hdc
)
{
found_dc
=
1
;
...
...
@@ -104,8 +101,8 @@ static void test_dc_attributes(void)
rop
=
GetROP2
(
hdc
);
if
(
hdc
==
old_hdc
)
{
todo_wine
ok
(
rop
==
R2_WHITE
||
broken
(
rop
==
def_rop
),
"wrong ROP2 %d after release %p/%p
\n
"
,
rop
,
old_hdc
,
hdc
);
ok
(
rop
==
R2_WHITE
||
broken
(
rop
==
def_rop
),
"wrong ROP2 %d after release %p/%p
\n
"
,
rop
,
old_hdc
,
hdc
);
SetROP2
(
old_hdc
,
def_rop
);
}
else
...
...
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