prevent calling xrandr w/o extension available

BUG: 343844
FIXED-IN: 5.5
REVIEW: 125074
This commit is contained in:
Thomas Lübking 2015-09-06 16:44:07 +02:00
parent d04645266c
commit 0302b97aea
2 changed files with 30 additions and 25 deletions

View file

@ -42,6 +42,10 @@ void XRandRScreens::update()
};
m_geometries.clear();
m_names.clear();
if (!Xcb::Extensions::self()->isRandrAvailable()) {
fallback();
return;
}
T resources(rootWindow());
if (resources.isNull()) {
fallback();

View file

@ -1746,7 +1746,7 @@ void Workspace::slotInvertScreen()
using namespace Xcb::RandR;
bool succeeded = false;
//BEGIN Xrandr inversion - does atm NOT work with the nvidia blob
if (Xcb::Extensions::self()->isRandrAvailable()) {
ScreenResources res(active_client ? active_client->window() : rootWindow());
if (!res.isNull()) {
@ -1757,7 +1757,7 @@ void Workspace::slotInvertScreen()
continue;
}
if (gamma->size) {
qCDebug(KWIN_CORE) << "inverting screen using XRRSetCrtcGamma";
qCDebug(KWIN_CORE) << "inverting screen using xcb_randr_set_crtc_gamma";
const int half = gamma->size / 2 + 1;
uint16_t *red = gamma.red();
@ -1776,6 +1776,7 @@ void Workspace::slotInvertScreen()
}
}
}
}
if (succeeded)
return;