diff options
author | don bright <hugh.m.bright@gmail.com> | 2011-11-05 02:38:05 (GMT) |
---|---|---|
committer | don bright <hugh.m.bright@gmail.com> | 2011-11-05 02:38:05 (GMT) |
commit | 651651c00a381a62d2ca8806409fbf24c4967fa4 (patch) | |
tree | e4ef3546b819ca90f7be24133dd0e05ee59bc63d /tests/OffscreenContext.cc | |
parent | 81b4e9e5abe153abc8701a9f06e7d077511a4c5f (diff) |
fix bug that caused glxXMakeContextCurrent to fail sometimes
Diffstat (limited to 'tests/OffscreenContext.cc')
-rw-r--r-- | tests/OffscreenContext.cc | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/OffscreenContext.cc b/tests/OffscreenContext.cc index e4045af..d66c5ad 100644 --- a/tests/OffscreenContext.cc +++ b/tests/OffscreenContext.cc @@ -98,7 +98,24 @@ bool create_glx_dummy_window(OffscreenContext &ctx) // can't depend on xWin==NULL at failure. use a custom Xlib error handler instead. original_xlib_handler = XSetErrorHandler( XCreateWindow_error ); - Window xWin = XCreateSimpleWindow( dpy, DefaultRootWindow(dpy), 0,0,10,10, 0,0,0 ); + + Window root = DefaultRootWindow( dpy ); + XSetWindowAttributes xwin_attr; + int width = 42; + int height = 42; + xwin_attr.background_pixel = 0; + xwin_attr.border_pixel = 0; + xwin_attr.colormap = XCreateColormap( dpy, root, visinfo->visual, AllocNone); + xwin_attr.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask; + unsigned long int mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask; + + Window xWin = XCreateWindow( dpy, root, 0, 0, width, height, + 0, visinfo->depth, InputOutput, + visinfo->visual, mask, &xwin_attr ); + + // Window xWin = XCreateSimpleWindow( dpy, DefaultRootWindow(dpy), 0,0,42,42, 0,0,0 ); + + XSync( dpy, false ); if ( XCreateWindow_failed ) { XFree( visinfo ); |