Alexandre Julliard : winex11: Create all the GL drawables using the gdi_display to avoid synchronization issues .
Alexandre Julliard
julliard at winehq.org
Mon May 12 13:41:09 CDT 2008
Module: wine
Branch: master
Commit: 6e9dea8a279757693f61205fc53b08dba933dc33
URL: http://source.winehq.org/git/wine.git/?a=commit;h=6e9dea8a279757693f61205fc53b08dba933dc33
Author: Alexandre Julliard <julliard at winehq.org>
Date: Mon May 12 19:37:54 2008 +0200
winex11: Create all the GL drawables using the gdi_display to avoid synchronization issues.
---
dlls/winex11.drv/window.c | 50 ++++++++++++++++++++++----------------------
1 files changed, 25 insertions(+), 25 deletions(-)
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
index 0b20338..791dcd0 100644
--- a/dlls/winex11.drv/window.c
+++ b/dlls/winex11.drv/window.c
@@ -414,7 +414,6 @@ static void sync_window_text( Display *display, Window win, const WCHAR *text )
*/
BOOL X11DRV_set_win_format( HWND hwnd, XID fbconfig_id )
{
- Display *display = thread_display();
struct x11drv_win_data *data;
XVisualInfo *vis;
int w, h;
@@ -429,6 +428,7 @@ BOOL X11DRV_set_win_format( HWND hwnd, XID fbconfig_id )
if (data->whole_window)
{
+ Display *display = thread_display();
Window client = data->client_window;
if (vis->visualid != XVisualIDFromVisual(visual))
@@ -438,6 +438,7 @@ BOOL X11DRV_set_win_format( HWND hwnd, XID fbconfig_id )
}
wine_tsx11_lock();
XFree(vis);
+ XFlush( display );
wine_tsx11_unlock();
if (client) goto done;
return FALSE;
@@ -457,7 +458,7 @@ BOOL X11DRV_set_win_format( HWND hwnd, XID fbconfig_id )
if (!parent) parent = root_window;
wine_tsx11_lock();
- data->colormap = XCreateColormap(display, parent, vis->visual,
+ data->colormap = XCreateColormap(gdi_display, parent, vis->visual,
(vis->class == PseudoColor ||
vis->class == GrayScale ||
vis->class == DirectColor) ?
@@ -467,17 +468,18 @@ BOOL X11DRV_set_win_format( HWND hwnd, XID fbconfig_id )
XInstallColormap(gdi_display, attrib.colormap);
if(data->gl_drawable) XDestroyWindow(gdi_display, data->gl_drawable);
- data->gl_drawable = XCreateWindow(display, parent, -w, 0, w, h, 0,
+ data->gl_drawable = XCreateWindow(gdi_display, parent, -w, 0, w, h, 0,
vis->depth, InputOutput, vis->visual,
CWColormap | CWOverrideRedirect,
&attrib);
if(data->gl_drawable)
{
- pXCompositeRedirectWindow(display, data->gl_drawable,
+ pXCompositeRedirectWindow(gdi_display, data->gl_drawable,
CompositeRedirectManual);
- XMapWindow(display, data->gl_drawable);
+ XMapWindow(gdi_display, data->gl_drawable);
}
XFree(vis);
+ XFlush( gdi_display );
wine_tsx11_unlock();
}
else
@@ -487,8 +489,8 @@ BOOL X11DRV_set_win_format( HWND hwnd, XID fbconfig_id )
wine_tsx11_lock();
- if(data->pixmap) XFreePixmap(display, data->pixmap);
- data->pixmap = XCreatePixmap(display, root_window, w, h, vis->depth);
+ if(data->pixmap) XFreePixmap(gdi_display, data->pixmap);
+ data->pixmap = XCreatePixmap(gdi_display, root_window, w, h, vis->depth);
if(!data->pixmap)
{
XFree(vis);
@@ -496,14 +498,15 @@ BOOL X11DRV_set_win_format( HWND hwnd, XID fbconfig_id )
return FALSE;
}
- if(data->gl_drawable) destroy_glxpixmap(display, data->gl_drawable);
- data->gl_drawable = create_glxpixmap(display, vis, data->pixmap);
+ if(data->gl_drawable) destroy_glxpixmap(gdi_display, data->gl_drawable);
+ data->gl_drawable = create_glxpixmap(gdi_display, vis, data->pixmap);
if(!data->gl_drawable)
{
- XFreePixmap(display, data->pixmap);
+ XFreePixmap(gdi_display, data->pixmap);
data->pixmap = 0;
}
XFree(vis);
+ XFlush( gdi_display );
wine_tsx11_unlock();
if (data->pixmap) SetPropA(hwnd, pixmap_prop, (HANDLE)data->pixmap);
}
@@ -517,9 +520,6 @@ BOOL X11DRV_set_win_format( HWND hwnd, XID fbconfig_id )
done:
data->fbconfig_id = fbconfig_id;
SetPropA(hwnd, fbconfig_id_prop, (HANDLE)data->fbconfig_id);
- wine_tsx11_lock();
- XFlush( display );
- wine_tsx11_unlock();
/* force DCE invalidation */
SetWindowPos( hwnd, 0, 0, 0, 0, 0,
SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOSIZE | SWP_NOMOVE |
@@ -530,7 +530,7 @@ done:
/***********************************************************************
* sync_gl_drawable
*/
-static void sync_gl_drawable(Display *display, struct x11drv_win_data *data)
+static void sync_gl_drawable(struct x11drv_win_data *data)
{
int w = data->client_rect.right - data->client_rect.left;
int h = data->client_rect.bottom - data->client_rect.top;
@@ -546,7 +546,7 @@ static void sync_gl_drawable(Display *display, struct x11drv_win_data *data)
if(usexcomposite)
{
wine_tsx11_lock();
- XMoveResizeWindow(display, data->gl_drawable, -w, 0, w, h);
+ XMoveResizeWindow(gdi_display, data->gl_drawable, -w, 0, w, h);
wine_tsx11_unlock();
return;
}
@@ -561,7 +561,7 @@ static void sync_gl_drawable(Display *display, struct x11drv_win_data *data)
return;
}
- pix = XCreatePixmap(display, root_window, w, h, vis->depth);
+ pix = XCreatePixmap(gdi_display, root_window, w, h, vis->depth);
if(!pix)
{
ERR("Failed to create pixmap for offscreen rendering\n");
@@ -570,11 +570,11 @@ static void sync_gl_drawable(Display *display, struct x11drv_win_data *data)
return;
}
- glxp = create_glxpixmap(display, vis, pix);
+ glxp = create_glxpixmap(gdi_display, vis, pix);
if(!glxp)
{
ERR("Failed to create drawable for offscreen rendering\n");
- XFreePixmap(display, pix);
+ XFreePixmap(gdi_display, pix);
XFree(vis);
wine_tsx11_unlock();
return;
@@ -584,14 +584,14 @@ static void sync_gl_drawable(Display *display, struct x11drv_win_data *data)
mark_drawable_dirty(data->gl_drawable, glxp);
- XFreePixmap(display, data->pixmap);
- destroy_glxpixmap(display, data->gl_drawable);
+ XFreePixmap(gdi_display, data->pixmap);
+ destroy_glxpixmap(gdi_display, data->gl_drawable);
TRACE( "Recreated GL drawable %lx to replace %lx\n", glxp, data->gl_drawable );
data->pixmap = pix;
data->gl_drawable = glxp;
- XFlush( display );
+ XFlush( gdi_display );
wine_tsx11_unlock();
SetPropA(data->hwnd, gl_drawable_prop, (HANDLE)data->gl_drawable);
@@ -1252,7 +1252,7 @@ static void sync_client_position( Display *display, struct x11drv_win_data *data
wine_tsx11_unlock();
}
- if (data->gl_drawable && (mask & (CWWidth|CWHeight))) sync_gl_drawable( display, data );
+ if (data->gl_drawable && (mask & (CWWidth|CWHeight))) sync_gl_drawable( data );
}
@@ -1496,15 +1496,15 @@ void X11DRV_DestroyWindow( HWND hwnd )
if (data->pixmap)
{
- destroy_glxpixmap(display, data->gl_drawable);
wine_tsx11_lock();
- XFreePixmap(display, data->pixmap);
+ destroy_glxpixmap(gdi_display, data->gl_drawable);
+ XFreePixmap(gdi_display, data->pixmap);
wine_tsx11_unlock();
}
else if (data->gl_drawable)
{
wine_tsx11_lock();
- XDestroyWindow(display, data->gl_drawable);
+ XDestroyWindow(gdi_display, data->gl_drawable);
wine_tsx11_unlock();
}
More information about the wine-cvs
mailing list