[platforms/wayland] Multi output support
ClosedPublic

Authored by romangg on Jan 23 2019, 10:35 AM.

Details

Summary

This patch rewrites large parts of the Wayland platform plugin, in order to
facilitate the testing of multi output behavior in nested KWin sessions.

For that a new class WaylandOutput is introduced, which is based on
AbstractOutput and by that shares functionality with our virtual and DRM
platform plugins.

The EGL/GBM and QPainter backends have been remodelled after the DRM one,
sharing similiarities there as well now.

Pointer grabbing has been rewritten to support multiple outputs, now using
pointer locking instead of confining and drawing in this case onto a sub-
surface, which get dynamically recreated in between the different output
surfaces while the cursor is being moved.

Window resizing is possible if host supports xdg-shell, but currently the
mode size does not yet fill the new window size.

The number of outputs can be set by command line argument --output-count,
scaling is also supported by setting the argument --scale.

Further steps could be:

  • Enabling automatic fill of resized windows via Wayland mode change
  • Multiple diverging initial sizes and scale factors for mulitple outputs

Watch it in action: https://youtu.be/FYItn1jvkbI

Test Plan

Tested it in live session.

Diff Detail

Repository
R108 KWin
Branch
waylandBackendMultiOutput
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 9901
Build 9919: arc lint + arc unit
romangg created this revision.Jan 23 2019, 10:35 AM
Restricted Application added a project: KWin. · View Herald TranscriptJan 23 2019, 10:35 AM
Restricted Application added a subscriber: kwin. · View Herald Transcript
romangg requested review of this revision.Jan 23 2019, 10:35 AM
romangg edited the summary of this revision. (Show Details)Jan 23 2019, 10:41 AM
zzag added a subscriber: zzag.Jan 23 2019, 11:14 AM
zzag added inline comments.
plugins/platforms/wayland/egl_wayland_backend.cpp
163

Does such extension exist?

plugins/platforms/wayland/egl_wayland_backend.h
5

Unrelated change.

5–7

Shouldn't they be in chronological order?

romangg added inline comments.Jan 23 2019, 11:26 AM
plugins/platforms/wayland/egl_wayland_backend.cpp
163

Pretty sure that not. Seems to be a search and replace error, when changing the m_wayland variable name to m_backen. THANKS!

Looks good.

plugins/platforms/wayland/egl_wayland_backend.cpp
243

I don't think that's true anymore. I did lots of fixes to it.
We can remove that comment

244

Use of temporary values is weird.

310–312

qAsConst

(in both places)

plugins/platforms/wayland/wayland_backend.cpp
449

where do we use this?

romangg added inline comments.Feb 22 2019, 8:45 AM
plugins/platforms/wayland/egl_wayland_backend.cpp
283–291

* instead of &.

310–312

The vector elements are pointers. qAsConst does not have any advantage in this case. But I forgot the asterisk on the auto keyword. Maybe that's why you thought there should be qAsConst?

zzag added inline comments.Feb 22 2019, 8:52 AM
plugins/platforms/wayland/egl_wayland_backend.cpp
310–312

We need qAsConst to prevent QVector from detaching. (m_outputs can be shared, right?)

romangg added inline comments.Feb 22 2019, 9:00 AM
plugins/platforms/wayland/egl_wayland_backend.cpp
310–312

Container elements are only pointer values though. So the deep copy is negligible. That's what I meant. If you prefer I will add qAsConst though.

romangg updated this revision to Diff 52275.EditedFeb 22 2019, 9:58 AM
romangg marked 10 inline comments as done.
  • Rebase on master
  • Review comments
romangg added inline comments.Feb 22 2019, 10:00 AM
plugins/platforms/wayland/wayland_backend.cpp
449

If the cursor is locked, it will be painted to a sub-surface.

davidedmundson accepted this revision.Mar 8 2019, 12:19 AM
This revision is now accepted and ready to land.Mar 8 2019, 12:19 AM
romangg updated this revision to Diff 54409.Mar 20 2019, 1:40 PM
  • Rebase on master
This revision was automatically updated to reflect the committed changes.