diff options
Diffstat (limited to 'krandr/randr.cpp')
-rw-r--r-- | krandr/randr.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/krandr/randr.cpp b/krandr/randr.cpp index 63c5c0450..d56b37481 100644 --- a/krandr/randr.cpp +++ b/krandr/randr.cpp @@ -562,6 +562,20 @@ RandRDisplay::RandRDisplay() return; } + // Sometimes the extension is available but does not return any screens (!) + // Check for that case + Display *randr_display = XOpenDisplay(NULL); + int screen_num; + Window root_window; + + screen_num = DefaultScreen (randr_display); + root_window = RootWindow (randr_display, screen_num); + if (XRRGetScreenResources (randr_display, root_window) == NULL) { + m_errorCode = i18n("No screens detected"); + m_valid = false; + return; + } + int major_version, minor_version; XRRQueryVersion(qt_xdisplay(), &major_version, &minor_version); |