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
4c6a4097
Commit
4c6a4097
authored
Dec 05, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Use an X11 error handler to catch BadMatch errors from XGetImage.
parent
d45eb00a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
9 deletions
+22
-9
bitblt.c
dlls/winex11.drv/bitblt.c
+22
-9
No files found.
dlls/winex11.drv/bitblt.c
View file @
4c6a4097
...
...
@@ -582,6 +582,12 @@ int main()
#endif
/* BITBLT_TEST */
/* handler for XGetImage BadMatch errors */
static
int
XGetImage_handler
(
Display
*
dpy
,
XErrorEvent
*
event
,
void
*
arg
)
{
return
(
event
->
request_code
==
X_GetImage
&&
event
->
error_code
==
BadMatch
);
}
/***********************************************************************
* BITBLT_GetDstArea
*
...
...
@@ -1423,16 +1429,23 @@ DWORD X11DRV_GetImage( PHYSDEV dev, HBITMAP hbitmap, BITMAPINFO *info,
}
else
{
Pixmap
pixmap
;
X11DRV_expect_error
(
gdi_display
,
XGetImage_handler
,
NULL
);
image
=
XGetImage
(
gdi_display
,
physdev
->
drawable
,
physdev
->
dc_rect
.
left
+
x
,
physdev
->
dc_rect
.
top
+
y
,
width
,
height
,
AllPlanes
,
ZPixmap
);
if
(
X11DRV_check_error
())
{
/* use a temporary pixmap to avoid the BadMatch error */
Pixmap
pixmap
;
wine_tsx11_lock
();
/* use a temporary pixmap to avoid BadMatch errors */
pixmap
=
XCreatePixmap
(
gdi_display
,
root_window
,
width
,
height
,
depth
);
XCopyArea
(
gdi_display
,
physdev
->
drawable
,
pixmap
,
get_bitmap_gc
(
depth
),
physdev
->
dc_rect
.
left
+
x
,
physdev
->
dc_rect
.
top
+
y
,
width
,
height
,
0
,
0
);
image
=
XGetImage
(
gdi_display
,
pixmap
,
0
,
0
,
width
,
height
,
AllPlanes
,
ZP
ixmap
);
XFreePixmap
(
gdi_display
,
pixmap
);
wine_tsx11_unlock
();
wine_tsx11_lock
();
pixmap
=
XCreatePixmap
(
gdi_display
,
root_window
,
width
,
height
,
depth
);
XCopyArea
(
gdi_display
,
physdev
->
drawable
,
pixmap
,
get_bitmap_gc
(
depth
),
physdev
->
dc_rect
.
left
+
x
,
physdev
->
dc_rect
.
top
+
y
,
width
,
height
,
0
,
0
);
image
=
XGetImage
(
gdi_display
,
pixmap
,
0
,
0
,
width
,
height
,
AllPlanes
,
ZPixmap
);
XFreePixmap
(
gdi_display
,
p
ixmap
);
wine_tsx11_unlock
(
);
}
}
if
(
!
image
)
return
ERROR_OUTOFMEMORY
;
...
...
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