Skip to content

Commit

Permalink
Backports [13766] to -fixes.
Browse files Browse the repository at this point in the history
Fixes a segfault with mythtv-setup when using X11 forwarding and XRandR is not available.

See #3401 for more detail.

Fixes #3401



git-svn-id: http://svn.mythtv.org/svn/branches/release-0-20-fixes@14223 7dbf422c-18fa-0310-86e9-fd20926502f2
  • Loading branch information
stuartm committed Aug 18, 2007
1 parent eab920d commit cf01b63
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion mythtv/libs/libmyth/DisplayResX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,24 @@ static XRRScreenConfiguration *GetScreenConfig(Display*& display)
}

X11L;

Window root = RootWindow(display, DefaultScreen(display));
XRRScreenConfiguration *cfg = XRRGetScreenInfo(display, root);

XRRScreenConfiguration *cfg = NULL;
int event_basep = 0, error_basep = 0;
if (XRRQueryExtension(display, &event_basep, &error_basep))
cfg = XRRGetScreenInfo(display, root);

if (!cfg)
{
if (display)
{
XCloseDisplay(display);
display = NULL;
}
cerr<<"DisplaResX: Unable to XRRgetScreenInfo"<<endl;
}

X11U;

return cfg;
Expand Down

0 comments on commit cf01b63

Please sign in to comment.