[platforms/wayland] Create output devices
ClosedPublic

Authored by romangg on Aug 26 2019, 7:16 PM.

Details

Summary

Since all Wayland session backends now use the same structure of
AbstractWaylandOutput we can create output devices like in the DRM backend.

First let us do this for Wayland nested sessions.

Test Plan

Manually with output-count 1 and 2. Outputs are correctly shown in KScreen.

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
romangg created this revision.Aug 26 2019, 7:16 PM
Restricted Application added a project: KWin. · View Herald TranscriptAug 26 2019, 7:16 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
romangg requested review of this revision.Aug 26 2019, 7:16 PM
romangg updated this revision to Diff 64704.Aug 26 2019, 9:42 PM
  • Enable before setting output properties
zzag added a subscriber: zzag.Aug 27 2019, 3:14 AM
zzag added inline comments.
plugins/platforms/wayland/wayland_output.cpp
63

There are couple places in KWin core with just // TODO. I still wonder what those comments mean. Please add some meaningful text to the todo comment.

64

Do you want to change these strings in the future?

plugins/platforms/wayland/wayland_output.h
53

Remove explicit.

56

Make init a private method and WaylandBackend a friend class.

romangg added inline comments.Aug 27 2019, 7:45 AM
plugins/platforms/wayland/wayland_output.cpp
64

Sure. We could go with something like org.kde.kwin as manufacturer and wayland-nested# where # is the output number.

plugins/platforms/wayland/wayland_output.h
56

Why do you prefer this? I try to omit friend classes in general since it dilutes the concept of access restrictions.

romangg added inline comments.Aug 27 2019, 7:53 AM
plugins/platforms/wayland/wayland_output.cpp
64

I meant wayland-nested# for model. Don't know of any pointers for the uuid.

zzag added inline comments.Aug 27 2019, 8:04 AM
plugins/platforms/wayland/wayland_output.h
56

The main reason is to avoid littering of public interface with implementation details of the class.

Also, if init() is public, it means that anybody can call it.

I try to omit friend classes

Yeah, it's actually a good idea to use friend as less as possible, but sometimes we have to use it otherwise code may become ridiculous.

zzag added inline comments.Aug 27 2019, 8:09 AM
plugins/platforms/wayland/wayland_output.cpp
64

Yeah, sounds good.

Don't know of any pointers for the uuid.

Derive it from manufacturer / model?

romangg added inline comments.Aug 27 2019, 10:12 AM
plugins/platforms/wayland/wayland_output.cpp
64

I found there is an ISO for uuids. We should somewhat adhere to that when we add it: https://en.wikipedia.org/wiki/Universally_unique_identifier

This revision was not accepted when it landed; it landed in state Needs Review.Aug 27 2019, 10:21 AM
This revision was automatically updated to reflect the committed changes.
romangg marked 2 inline comments as done.