[platforms/wayland] Multi output support
Needs ReviewPublic

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

Details

Reviewers
None
Group Reviewers
KWin
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 7431
Build 7449: arc lint + arc unit
romangg created this revision.Wed, Jan 23, 10:35 AM
Restricted Application added a project: KWin. · View Herald TranscriptWed, Jan 23, 10:35 AM
Restricted Application added a subscriber: kwin. · View Herald Transcript
romangg requested review of this revision.Wed, Jan 23, 10:35 AM
romangg edited the summary of this revision. (Show Details)Wed, Jan 23, 10:41 AM
zzag added a subscriber: zzag.Wed, Jan 23, 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–6

Shouldn't they be in chronological order?

romangg added inline comments.Wed, Jan 23, 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.

311

qAsConst

(in both places)

plugins/platforms/wayland/wayland_backend.cpp
449

where do we use this?