No longer crash when running with DirectDraw with a DDClipper in
-desktop mode.
This commit is contained in:
parent
5538ec4661
commit
77e3cd8cd0
|
@ -147,7 +147,15 @@ HRESULT WINAPI Xlib_IDirectDrawSurface4Impl_Lock(
|
|||
int dest_x = wndPtr->rectClient.left;
|
||||
int dest_y = wndPtr->rectClient.top;
|
||||
|
||||
XGetSubImage(display, drawable, 0, 0, width, height, 0xFFFFFFFF,
|
||||
if (!drawable) { /* we are running in -desktop mode */
|
||||
drawable = X11DRV_WND_GetXWindow(WIN_GetDesktop());
|
||||
/* FIXME: not sure whether these are the right offsets */
|
||||
dest_x+=wndPtr->rectWindow.left;
|
||||
dest_y+=wndPtr->rectWindow.top;
|
||||
WIN_ReleaseDesktop();
|
||||
}
|
||||
|
||||
TSXGetSubImage(display, drawable, 0, 0, width, height, 0xFFFFFFFF,
|
||||
ZPixmap, dspriv->image, dest_x, dest_y);
|
||||
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
|
@ -192,6 +200,20 @@ static void Xlib_copy_surface_on_screen(IDirectDrawSurface4Impl* This) {
|
|||
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
}
|
||||
|
||||
if (!drawable) {
|
||||
WND *tmpWnd = WIN_FindWndPtr(This->s.ddraw->d->window);
|
||||
drawable = X11DRV_WND_GetXWindow(tmpWnd);
|
||||
WIN_ReleaseWndPtr(tmpWnd);
|
||||
|
||||
/* We don't have a context for this window. Host off the desktop */
|
||||
if( !drawable ) {
|
||||
FIXME("Have to use Desktop Root Window??? Bummer.\n");
|
||||
drawable = X11DRV_WND_GetXWindow(WIN_GetDesktop());
|
||||
WIN_ReleaseDesktop();
|
||||
}
|
||||
ddpriv->drawable = drawable;
|
||||
}
|
||||
|
||||
if (This->s.ddraw->d->pixel_convert != NULL)
|
||||
This->s.ddraw->d->pixel_convert(This->s.surface_desc.u1.lpSurface,
|
||||
|
|
|
@ -18,6 +18,7 @@ extern XFontStruct * TSXLoadQueryFont(Display*, const char*);
|
|||
extern XModifierKeymap * TSXGetModifierMapping(Display*);
|
||||
extern XImage * TSXCreateImage(Display*, Visual*, unsigned int, int, int, char*, unsigned int, unsigned int, int, int);
|
||||
extern XImage * TSXGetImage(Display*, Drawable, int, int, unsigned int, unsigned int, unsigned long, int);
|
||||
extern XImage * TSXGetSubImage(Display*, Drawable, int, int, unsigned int, unsigned int, unsigned long, int, XImage*, int, int);
|
||||
extern Display * TSXOpenDisplay(const char*);
|
||||
extern void TSXrmInitialize(void);
|
||||
extern char * TSXGetAtomName(Display*, Atom);
|
||||
|
|
|
@ -74,6 +74,7 @@ XGetKeyboardMapping
|
|||
XGetModifierMapping
|
||||
XGetScreenSaver
|
||||
XGetSelectionOwner
|
||||
XGetSubImage
|
||||
XGetVisualInfo
|
||||
XGetWMHints
|
||||
XGetWMSizeHints
|
||||
|
|
|
@ -59,6 +59,17 @@ XImage * TSXGetImage(Display* a0, Drawable a1, int a2, int a3, unsigned int a4,
|
|||
return r;
|
||||
}
|
||||
|
||||
XImage * TSXGetSubImage(Display* a0, Drawable a1, int a2, int a3, unsigned int a4, unsigned int a5, unsigned long a6, int a7, XImage* a8, int a9, int a10)
|
||||
{
|
||||
XImage * r;
|
||||
TRACE("Call XGetSubImage\n");
|
||||
EnterCriticalSection( &X11DRV_CritSection );
|
||||
r = XGetSubImage(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
|
||||
LeaveCriticalSection( &X11DRV_CritSection );
|
||||
TRACE("Ret XGetSubImage\n");
|
||||
return r;
|
||||
}
|
||||
|
||||
Display * TSXOpenDisplay(const char* a0)
|
||||
{
|
||||
Display * r;
|
||||
|
|
Loading…
Reference in New Issue