compilation fix: DefaultVisual() needs Display, not WXDisplay (and code cleanup in wxGetSubPixmap() as well)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35302 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -271,25 +271,27 @@ static WXPixmap wxGetSubPixmap( WXDisplay* xdisplay, WXPixmap xpixmap,
|
|||||||
int x, int y, int width, int height,
|
int x, int y, int width, int height,
|
||||||
int depth )
|
int depth )
|
||||||
{
|
{
|
||||||
int xscreen = DefaultScreen( (Display*)xdisplay );
|
Display * const dpy = (Display *)xdisplay;
|
||||||
Window xroot = RootWindow( (Display*)xdisplay, xscreen );
|
|
||||||
Visual* xvisual = DefaultVisual( xdisplay, xscreen );
|
|
||||||
|
|
||||||
XImage* ximage = XCreateImage( (Display*)xdisplay, xvisual, depth,
|
int xscreen = DefaultScreen( dpy );
|
||||||
|
Window xroot = RootWindow( dpy, xscreen );
|
||||||
|
Visual* xvisual = DefaultVisual( dpy, xscreen );
|
||||||
|
|
||||||
|
XImage* ximage = XCreateImage( dpy, xvisual, depth,
|
||||||
ZPixmap, 0, 0, width, height, 32, 0 );
|
ZPixmap, 0, 0, width, height, 32, 0 );
|
||||||
ximage->data = (char*)malloc( ximage->bytes_per_line * ximage->height );
|
ximage->data = (char*)malloc( ximage->bytes_per_line * ximage->height );
|
||||||
ximage = XGetSubImage( (Display*)xdisplay, (Pixmap)xpixmap,
|
ximage = XGetSubImage( dpy, (Pixmap)xpixmap,
|
||||||
x, y, width, height,
|
x, y, width, height,
|
||||||
AllPlanes, ZPixmap, ximage, 0, 0 );
|
AllPlanes, ZPixmap, ximage, 0, 0 );
|
||||||
|
|
||||||
GC gc = XCreateGC( (Display*)xdisplay, (Pixmap)xpixmap, 0, NULL );
|
GC gc = XCreateGC( dpy, (Pixmap)xpixmap, 0, NULL );
|
||||||
Pixmap ret = XCreatePixmap( (Display*)xdisplay, xroot,
|
Pixmap ret = XCreatePixmap( dpy, xroot,
|
||||||
width, height, depth );
|
width, height, depth );
|
||||||
|
|
||||||
XPutImage( (Display*)xdisplay, ret, gc, ximage,
|
XPutImage( dpy, ret, gc, ximage,
|
||||||
0, 0, 0, 0, width, height );
|
0, 0, 0, 0, width, height );
|
||||||
XDestroyImage( ximage );
|
XDestroyImage( ximage );
|
||||||
XFreeGC( (Display*)xdisplay, gc );
|
XFreeGC( dpy, gc );
|
||||||
|
|
||||||
return (WXPixmap)ret;
|
return (WXPixmap)ret;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user