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
94552114
Commit
94552114
authored
Aug 07, 1999
by
Stephane Lussier
Committed by
Alexandre Julliard
Aug 07, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
X11drv SetDrawable function modifies the DC origin, this translation
should be reflected for the dc clipping region for CS_OWNDC and CS_CLASSDC.
parent
15c58c42
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
24 deletions
+28
-24
dce.c
windows/dce.c
+1
-24
wnd.c
windows/x11drv/wnd.c
+27
-0
No files found.
windows/dce.c
View file @
94552114
...
...
@@ -645,7 +645,7 @@ HDC16 WINAPI GetDCEx16( HWND16 hwnd, HRGN16 hrgnClip, DWORD flags )
*/
HDC
WINAPI
GetDCEx
(
HWND
hwnd
,
HRGN
hrgnClip
,
DWORD
flags
)
{
HRGN
h
CopyClipRgn
=
0
,
h
rgnVisible
=
0
;
HRGN
hrgnVisible
=
0
;
HDC
hdc
=
0
;
DCE
*
dce
;
DC
*
dc
;
...
...
@@ -796,32 +796,9 @@ HDC WINAPI GetDCEx( HWND hwnd, HRGN hrgnClip, DWORD flags )
}
bUpdateVisRgn
=
bUpdateVisRgn
||
(
dc
->
w
.
flags
&
DC_DIRTY
);
/*
* The pSetDrawable function might change the coordinate system (DCOrgX,DCOrgY)
* values. When it moves the origin, other data like the current clipping
* region will not be moved to that new origin. In the case of DCs that are class
* or window DCs that clipping region might be a valid value from a previous use
* of the DC and changing the origin of the DC without moving the clip region
* results in a clip region that is not placed properly in the DC.
* This code will retrieve the current clipping region, let the pSetDrawable
* modify the origin and reset the clipping. When the clipping is set, it is moved
* according to the new DC origin.
*/
if
(
(
wndPtr
->
class
->
style
&
(
CS_OWNDC
|
CS_CLASSDC
))
&&
(
dc
->
w
.
hClipRgn
>
0
))
{
hCopyClipRgn
=
CreateRectRgn
(
0
,
0
,
0
,
0
);
GetClipRgn
(
hdc
,
hCopyClipRgn
);
}
/* recompute visible region */
wndPtr
->
pDriver
->
pSetDrawable
(
wndPtr
,
dc
,
flags
,
bUpdateClipOrigin
);
if
(
hCopyClipRgn
)
{
SelectClipRgn
(
hdc
,
hCopyClipRgn
);
DeleteObject
(
hCopyClipRgn
);
}
if
(
bUpdateVisRgn
)
{
TRACE
(
"updating visrgn for %08x dce, hwnd [%04x]
\n
"
,
(
unsigned
)
dce
,
hwnd
);
...
...
windows/x11drv/wnd.c
View file @
94552114
...
...
@@ -680,6 +680,8 @@ void X11DRV_WND_SurfaceCopy(WND* wndPtr, DC *dcPtr, INT dx, INT dy,
void
X11DRV_WND_SetDrawable
(
WND
*
wndPtr
,
DC
*
dc
,
WORD
flags
,
BOOL
bSetClipOrigin
)
{
X11DRV_PDEVICE
*
physDev
=
(
X11DRV_PDEVICE
*
)
dc
->
physDev
;
INT
dcOrgXCopy
,
dcOrgYCopy
;
BOOL
offsetClipRgn
=
FALSE
;
if
(
!
wndPtr
)
/* Get a DC for the whole screen */
{
...
...
@@ -690,6 +692,24 @@ void X11DRV_WND_SetDrawable(WND *wndPtr, DC *dc, WORD flags, BOOL bSetClipOrigin
}
else
{
/*
* This function change the coordinate system (DCOrgX,DCOrgY)
* values. When it moves the origin, other data like the current clipping
* region will not be moved to that new origin. In the case of DCs that are class
* or window DCs that clipping region might be a valid value from a previous use
* of the DC and changing the origin of the DC without moving the clip region
* results in a clip region that is not placed properly in the DC.
* This code will save the dc origin, let the SetDrawable
* modify the origin and reset the clipping. When the clipping is set,
* it is moved according to the new DC origin.
*/
if
(
(
wndPtr
->
class
->
style
&
(
CS_OWNDC
|
CS_CLASSDC
))
&&
(
dc
->
w
.
hClipRgn
>
0
))
{
dcOrgXCopy
=
dc
->
w
.
DCOrgX
;
dcOrgYCopy
=
dc
->
w
.
DCOrgY
;
offsetClipRgn
=
TRUE
;
}
if
(
flags
&
DCX_WINDOW
)
{
dc
->
w
.
DCOrgX
=
wndPtr
->
rectWindow
.
left
;
...
...
@@ -708,6 +728,13 @@ void X11DRV_WND_SetDrawable(WND *wndPtr, DC *dc, WORD flags, BOOL bSetClipOrigin
}
dc
->
w
.
DCOrgX
-=
wndPtr
->
rectWindow
.
left
;
dc
->
w
.
DCOrgY
-=
wndPtr
->
rectWindow
.
top
;
/* reset the clip region, according to the new origin */
if
(
offsetClipRgn
)
{
OffsetRgn
(
dc
->
w
.
hClipRgn
,
dc
->
w
.
DCOrgX
-
dcOrgXCopy
,
dc
->
w
.
DCOrgY
-
dcOrgYCopy
);
}
physDev
->
drawable
=
X11DRV_WND_GetXWindow
(
wndPtr
);
#if 0
...
...
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