[xdgoutput] Explicitly set version of server interface
AbandonedPublic

Authored by davidedmundson on Apr 2 2020, 8:11 AM.

Details

Reviewers
None
Group Reviewers
KWin
Summary

Implication being that when v2 is used name and description will be set
appropriately. This brings us being spec-compliant if new wayland is
used against old kwin.

Resource check works by knowing that clients can't register a version
newer than the client so setName will then no-op internally.

Test Plan

Test failed till I bumped it to V2.

Diff Detail

Repository
R127 KWayland
Branch
master
Lint
Lint ErrorsExcuse: asdf
SeverityLocationCodeMessage
Errorsrc/client/output.h:83CppcheckunknownMacro
Errorsrc/server/tablet_interface.h:80CppcheckunknownMacro
Unit
No Unit Test Coverage
Build Status
Buildable 24626
Build 24644: arc lint + arc unit
davidedmundson created this revision.Apr 2 2020, 8:11 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptApr 2 2020, 8:11 AM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
davidedmundson requested review of this revision.Apr 2 2020, 8:11 AM
apol added a subscriber: apol.Apr 2 2020, 9:54 AM

Some concerns at the documentation level. Looks good overall.

src/server/display.h
287 ↗(On Diff #79102)

Should we deprecate the one without version?

src/server/xdgoutput_interface.h
105 ↗(On Diff #79102)

I'd write something like Only effective since version UnstableV2.

anthonyfieroni added inline comments.
src/server/display.h
296 ↗(On Diff #79102)

explicit, also take enum class by value.

davidedmundson marked an inline comment as done.Apr 2 2020, 10:29 AM
davidedmundson added inline comments.
src/server/display.h
287 ↗(On Diff #79102)

I'll add a doc.
I don't want to waste time with the macro stuff given we know there's only one user.

296 ↗(On Diff #79102)

I agree it's weird to take a const&, but it's what the others do

davidedmundson added inline comments.Apr 2 2020, 10:33 AM
src/server/display.h
296 ↗(On Diff #79102)

I can't make it explicit. It's not a constructor

zzag added a subscriber: zzag.Apr 2 2020, 1:43 PM
zzag added inline comments.
src/server/display.h
297

You can't introduce another createXdgOutputManager() because it's not overloaded. You probably need to rename this method, e.g. createXdgOutputManager2.

apol added inline comments.Apr 2 2020, 2:44 PM
src/server/display.h
296 ↗(On Diff #79102)

Passing an enum as const& is wrong although it doesn't make much of a difference in practice.

You can't introduce another createXdgOutputManager() because it's not overloaded. He's adding an overload, I don't understand.

zzag added inline comments.Apr 3 2020, 8:18 AM
src/server/display.h
296 ↗(On Diff #79102)

He's adding an overload, I don't understand.

Bad wording, my bad. We are allowed to overload only methods that are already overloaded.

From https://community.kde.org/Policies/Binary_Compatibility_Issues_With_C%2B%2B

You cannot...

For existing functions of any type:

add an overload (BC, but not SC: makes &func ambiguous), adding overloads to already overloaded functions is ok (any use of &func already needed a cast).

davidedmundson added inline comments.Apr 3 2020, 12:36 PM
src/server/display.h
297

As you've pasted, it is BC, which is what frameworks promises.
It's something that we definitely do currently.

It's also SC for literally every conceivable invocation, and we know how the only user of this class is using it.

zzag added inline comments.Apr 14 2020, 2:53 PM
src/server/display.h
281–288

Please use KWAYLAND_ENABLE_DEPRECATED_SINCE to make the compiler bark whenever someone uses the deprecated version of createXdgOutputManager.

davidedmundson abandoned this revision.May 1 2020, 3:16 PM

All these problems go away with KWaylandServer \o/