Add support for xdg-shell
ClosedPublic

Authored by graesslin on Jul 6 2016, 2:42 PM.

Details

Summary

This change introduces support for the unstable xdg-shell interface in
the server. The implementation is based on version 5 of the unstable
interface. This is the version used by toolkits like e.g. GTK.

There is also a version 6 of the protocol under development which is
incompatible. This makes it difficult to implement it in a backward
compatible way.

Because of that the implementation is a little bit different to other
interfaces and inspired by the TextInput interfaces:
On client side an XdgShell class is exposed which does not represent
it directly. Instead it delegates everything to an XdgShellUnstableV5
implementation. For the Surface/Popup the same is done.

In the Registry it's possible to create an XdgShell and it accepts
the XdgShellUnstableV5 and in future will accept XdgUnstableV6, etc.

On server side it also follows the approach from TextInput. That is
there is a version enum which gets passed to the factory method in
Display. It currently supports only V5, but in future can be extended
for V6. As there is lots of similar code between wl_shell, xdg_shell
and in future xdg_shell_unstable_v6 a templated GenericShellInterface
class is added which combines the common parts.

Diff Detail

Repository
R127 KWayland
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
graesslin updated this revision to Diff 4983.Jul 6 2016, 2:42 PM
graesslin retitled this revision from to Add support for xdg-shell.
graesslin updated this object.
graesslin edited the test plan for this revision. (Show Details)
graesslin added a reviewer: Plasma on Wayland.
Restricted Application added a project: Plasma on Wayland. · View Herald TranscriptJul 6 2016, 2:42 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
graesslin updated this revision to Diff 5000.Jul 7 2016, 9:13 AM
  • renamed the server files to have them named like client files
  • renamed some methods on client side to have them like Shell
graesslin updated this revision to Diff 5071.Jul 11 2016, 8:32 AM

Adding size/setSize/sizeChanged as in ShellSurface

sebas accepted this revision.Jul 12 2016, 10:35 PM
sebas added a reviewer: sebas.
sebas added a subscriber: sebas.

Some suggestions inline, but nothing major.

src/client/registry.h
818

Creates a*n* XdgShell [...]

src/client/xdgshell.h
323

sent

366

an

src/client/xdgshell_v5.cpp
321

whitespace before {

src/server/xdgshell_interface.h
48

Could use @since 5.25. It's kind of clear from the accessor in Display, but just looking at this class, it should be clear when it appeared.

124

with -> width

179

@see windowClass

200

Whether (capitalized)

205

Whether (caps)

This revision is now accepted and ready to land.Jul 12 2016, 10:35 PM
graesslin marked 9 inline comments as done.Jul 13 2016, 11:04 AM
This revision was automatically updated to reflect the committed changes.