Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #789 from archshift/linuxvideo
Fix for black screen on Linux upon starting a game
  • Loading branch information
lioncash committed Aug 21, 2014
2 parents 25e29c3 + 7e2534e commit 48f52b9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
11 changes: 11 additions & 0 deletions Source/Core/DolphinWX/GLInterface/GLX.cpp
Expand Up @@ -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;
}
Expand Down
9 changes: 8 additions & 1 deletion Source/Core/DolphinWX/GLInterface/X11_Util.cpp
Expand Up @@ -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);
Expand Down

1 comment on commit 48f52b9

@roadsign
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I forgot to post that on issue tracker... thought I needed to test it a little more since I'd just updated my graphics driver.

Please sign in to comment.