From 7e2534ee47dfa427140a1c307c2a920a52fd11f0 Mon Sep 17 00:00:00 2001 From: archshift Date: Thu, 21 Aug 2014 12:39:03 -0700 Subject: [PATCH] Fixed black screen on game start for X11 contexts. --- Source/Core/DolphinWX/GLInterface/GLX.cpp | 11 +++++++++++ Source/Core/DolphinWX/GLInterface/X11_Util.cpp | 9 ++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Source/Core/DolphinWX/GLInterface/GLX.cpp b/Source/Core/DolphinWX/GLInterface/GLX.cpp index acfcab6a69..b7741835ca 100644 --- a/Source/Core/DolphinWX/GLInterface/GLX.cpp +++ b/Source/Core/DolphinWX/GLInterface/GLX.cpp @@ -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; } diff --git a/Source/Core/DolphinWX/GLInterface/X11_Util.cpp b/Source/Core/DolphinWX/GLInterface/X11_Util.cpp index 5c78a7adf8..63fe15e493 100644 --- a/Source/Core/DolphinWX/GLInterface/X11_Util.cpp +++ b/Source/Core/DolphinWX/GLInterface/X11_Util.cpp @@ -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);