xwayland: Fix primary output identification
Output::geometry() returns a logical geometry, while the crtc rect is in the device pixels.
This commit is contained in:
parent
cc49e25eac
commit
3f1e57de1c
1 changed files with 2 additions and 1 deletions
|
@ -593,10 +593,11 @@ void Xwayland::updatePrimary()
|
||||||
}
|
}
|
||||||
|
|
||||||
Output *const primaryOutput = workspace()->outputOrder().front();
|
Output *const primaryOutput = workspace()->outputOrder().front();
|
||||||
|
const QRect primaryOutputGeometry = Xcb::toXNative(primaryOutput->fractionalGeometry());
|
||||||
for (int i = 0; i < resources->num_crtcs; ++i) {
|
for (int i = 0; i < resources->num_crtcs; ++i) {
|
||||||
Xcb::RandR::CrtcInfo crtcInfo(crtcs[i], resources->config_timestamp);
|
Xcb::RandR::CrtcInfo crtcInfo(crtcs[i], resources->config_timestamp);
|
||||||
const QRect geometry = crtcInfo.rect();
|
const QRect geometry = crtcInfo.rect();
|
||||||
if (geometry.topLeft() == primaryOutput->geometry().topLeft()) {
|
if (geometry.topLeft() == primaryOutputGeometry.topLeft()) {
|
||||||
auto outputs = crtcInfo.outputs();
|
auto outputs = crtcInfo.outputs();
|
||||||
if (outputs && crtcInfo->num_outputs > 0) {
|
if (outputs && crtcInfo->num_outputs > 0) {
|
||||||
qCDebug(KWIN_XWL) << "Setting primary" << primaryOutput << outputs[0];
|
qCDebug(KWIN_XWL) << "Setting primary" << primaryOutput << outputs[0];
|
||||||
|
|
Loading…
Reference in a new issue