Fixed black screen on game start for X11 contexts.
This commit is contained in:
parent
f17dcd2019
commit
7e2534ee47
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue