Skip to content

Commit 3630aa2

Browse files
committed
Fix crash when XRandR is not available
In this case calling XRRGetScreenInfo will lead to segfault, so check for extension first.
1 parent 65d0682 commit 3630aa2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

doomsday/sdk/libgui/src/displaymode_x11.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,11 @@ class RRInfo
5454
/**
5555
* Queries all the available modes in the display configuration.
5656
*/
57-
RRInfo() : _numSizes(0)
57+
RRInfo() : _conf(NULL), _numSizes(0)
5858
{
59+
int dummy;
60+
if (!XRRQueryExtension(QX11Info::display(), &dummy, &dummy)) return; // Not available.
61+
5962
_conf = XRRGetScreenInfo(QX11Info::display(), QX11Info::appRootWindow());
6063
if(!_conf) return; // Not available.
6164

0 commit comments

Comments
 (0)