Add XDG Output Protocol
ClosedPublic

Authored by davidedmundson on Apr 15 2018, 9:33 PM.

Details

Summary

Done primarily for XWayland which for legacy reasons doesn't assume the
logical size of a display is pixelSize / outputScale. Meaning xwayland
windows that position themselves are wrong in a scaled environment.

It also allows the possibility for us to support fractional scaling
whilst keeping wl_output::scale as an integer.

The protocol is a bit odd as it operates via the FooManager + Foo
pattern rather than using globals like Output so I've wrapped it so it
behaves more like globals.

Test Plan

Diff Detail

Repository
R127 KWayland
Branch
davidedmundson/xdgoutput
Lint
No Linters Available
Unit
No Unit Test Coverage
davidedmundson created this revision.Apr 15 2018, 9:33 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptApr 15 2018, 9:33 PM
Restricted Application added a subscriber: Frameworks. · View Herald Transcript
davidedmundson requested review of this revision.Apr 15 2018, 9:33 PM

Some minor fixes

  • Replace XDGOUTPUTVERSION with the next framework release version.
  • xdgoutputtest.cpp is missing
src/client/registry.h
624

Function createXdgOutputUnstableV1 does not exist. Do you mean createXdgOutputManager?

Replace XDGOUTPUTVERSION with the next framework release version.

I will do that when merging as I don't know at time of review what version that is going to be.

romangg added inline comments.Apr 30 2018, 1:38 PM
src/server/display.h
263

the XdgOutputManagerInterface

src/server/xdgoutput_interface.cpp
108

You do not want to connect the destroyed signal of this (i.e. the one of the XdgOuputManagerInterface) here but the one of the new XdgOutputInterface, right?

132

Comment: client is requesting XdgOutput for output, that doesn't exist

davidedmundson marked 4 inline comments as done.Apr 30 2018, 2:53 PM

According to protocol the logical size and position events should only be send

(i) on creation of an xdg_output object and
(ii) when the size or position changed.

There is currently no check in the server interface, if the size and position really changed when the compositor tries to send the event. Looking at the KWin patch, this is currently done sometimes when there has been no change.

Maybe there should be a comparison of old and new value in KWayland to prohibit sending out events on unchanged values (this would mean saving the current values in XdgOutputV1Interface::Private).

src/server/xdgoutput_interface.cpp
84

This variable is only relevant until the compositor has sent for the first time the done event via XdgOutputInterface::done(). Afterwards it is always true. Is it meant this way? If yes, could we use another name making this fact more explicit, like: doneOnce?

On the other side what if a compositor never sends the done event via XdgOutputInterface::done() because the xdg output never changes its logical size or position after the compositor publishes the xdg output to clients and it expects clients to receive the current values on connecting to the resource?

romangg added inline comments.Apr 30 2018, 3:03 PM
src/server/xdgoutput_interface.cpp
84

The inline comment is in the wrong line. It is referring to the done member variable.

davidedmundson added inline comments.Apr 30 2018, 5:27 PM
src/server/xdgoutput_interface.cpp
84

If yes, could we use another name making this fact more explicit, like: doneOnce?

It is. I can make that change

On the other side what if a compositor never sends the done event via

It should be set on creation. If it's not the compositor is doing things wrong. I can update the docs to make it clear

Add check for if values haven't really changed
Renamed a var
A few more comments

Restricted Application edited subscribers, added: kde-frameworks-devel; removed: Frameworks. · View Herald TranscriptMay 15 2018, 11:45 AM
romangg accepted this revision.May 15 2018, 12:10 PM
This revision is now accepted and ready to land.May 15 2018, 12:10 PM
This revision was automatically updated to reflect the committed changes.