prevent calling xrandr w/o extension available
BUG: 343844 FIXED-IN: 5.5 REVIEW: 125074
This commit is contained in:
parent
d04645266c
commit
0302b97aea
2 changed files with 30 additions and 25 deletions
|
@ -42,6 +42,10 @@ void XRandRScreens::update()
|
||||||
};
|
};
|
||||||
m_geometries.clear();
|
m_geometries.clear();
|
||||||
m_names.clear();
|
m_names.clear();
|
||||||
|
if (!Xcb::Extensions::self()->isRandrAvailable()) {
|
||||||
|
fallback();
|
||||||
|
return;
|
||||||
|
}
|
||||||
T resources(rootWindow());
|
T resources(rootWindow());
|
||||||
if (resources.isNull()) {
|
if (resources.isNull()) {
|
||||||
fallback();
|
fallback();
|
||||||
|
|
|
@ -1746,7 +1746,7 @@ void Workspace::slotInvertScreen()
|
||||||
using namespace Xcb::RandR;
|
using namespace Xcb::RandR;
|
||||||
bool succeeded = false;
|
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());
|
ScreenResources res(active_client ? active_client->window() : rootWindow());
|
||||||
|
|
||||||
if (!res.isNull()) {
|
if (!res.isNull()) {
|
||||||
|
@ -1757,7 +1757,7 @@ void Workspace::slotInvertScreen()
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (gamma->size) {
|
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;
|
const int half = gamma->size / 2 + 1;
|
||||||
|
|
||||||
uint16_t *red = gamma.red();
|
uint16_t *red = gamma.red();
|
||||||
|
@ -1776,6 +1776,7 @@ void Workspace::slotInvertScreen()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (succeeded)
|
if (succeeded)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue