Fix viewport on vertically stacked monitors

Summary:
We want to translate by the monitor position, so that needs to be
the negative of the position.

But Kwin/KScreen treats 0 as the top of all monitors. GL treats 0 as
bottom, so that all needs inverting.

Hence this should be a positive y value for the viewport.

BUG: 386099
BUG: 385655

Test Plan:
Had two monitors
Side by side was - fine
Stacked vertically - still fine

Modded X code to extend in y instead of x.
3 monitors worked fine.

Nested wayland only seems to support one screen?

Reviewers: #plasma

Subscribers: plasma-devel, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D8479
This commit is contained in:
David Edmundson 2017-10-25 18:03:22 +01:00
parent aa58243a48
commit 5d7e22e5dc
2 changed files with 2 additions and 2 deletions

View file

@ -194,7 +194,7 @@ bool EglGbmBackend::makeContextCurrent(const Output &output)
qreal scale = output.output->scale();
glViewport(-v.x() * scale, (v.height() - overall.height() - v.y()) * scale,
glViewport(-v.x() * scale, (v.height() - overall.height() + v.y()) * scale,
overall.width() * scale, overall.height() * scale);
return true;
}

View file

@ -108,7 +108,7 @@ void EglX11Backend::setupViewport(int screenId)
// TODO: are the values correct?
qreal scale = screens()->scale(screenId);
glViewport(-v.x(), v.height() - overall.height() - v.y(), overall.width() * scale, overall.height() * scale);
glViewport(-v.x(), v.height() - overall.height() + v.y(), overall.width() * scale, overall.height() * scale);
}
void EglX11Backend::endRenderingFrameForScreen(int screenId, const QRegion &renderedRegion, const QRegion &damagedRegion)