Fixed black screen on game start for X11 contexts.

This commit is contained in:
archshift 2014-08-21 12:39:03 -07:00
parent f17dcd2019
commit 7e2534ee47
2 changed files with 19 additions and 1 deletions

View File

@ -97,6 +97,17 @@ bool cInterfaceGLX::Create(void *window_handle)
XWindow.Initialize(dpy);
Window parent = (Window)window_handle;
XWindowAttributes attribs;
if (!XGetWindowAttributes(dpy, parent, &attribs))
{
ERROR_LOG(VIDEO, "Window attribute retrieval failed");
return false;
}
s_backbuffer_width = attribs.width;
s_backbuffer_height = attribs.height;
win = XWindow.CreateXWindow(parent, vi);
return true;
}

View File

@ -22,9 +22,16 @@ Window cX11Window::CreateXWindow(Window parent, XVisualInfo *vi)
// Setup window attributes
attr.colormap = colormap;
XWindowAttributes attribs;
if (!XGetWindowAttributes(dpy, parent, &attribs))
{
ERROR_LOG(VIDEO, "Window attribute retrieval failed");
return 0;
}
// Create the window
win = XCreateWindow(dpy, parent,
0, 0, 1, 1, 0,
0, 0, attribs.width, attribs.height, 0,
vi->depth, InputOutput, vi->visual,
CWColormap, &attr);
XSelectInput(dpy, parent, StructureNotifyMask);