Commit graph

22 commits

Author SHA1 Message Date
Alexander Lohnau
525d12bee5 Run clang-format
If you want git blame to ignore formatting revisions run:
git config blame.ignoreRevsFile .git-blame-ignore-revs
2021-08-29 07:11:06 +02:00
Vlad Zahorodnii
d0a0c70d9c Add aboutToBeDestroyed signal to various xdg-shell classes
With the aboutToBeDestroyed signal, the compositor will be able to
perform cleanup before the QObject::destroyed signal is emitted, which
saves us some nullptr checks.
2021-08-12 10:35:13 +00:00
Alexander Lohnau
3acd2b5a26 GIT_SILENT Add trailing comma to enums 2021-04-29 11:45:00 +02:00
Vlad Zahorodnii
bdb138bdcd Remove @since version tags
Currently, we have a mix of Frameworks versions and Plasma versions in
@since tags, which leads to some confusion. Since this is an unstable
library, one cannot rely on since version tags, we are free to add,
change, and remove apis to serve best to kwin requirements. Thus, we can
simply remove all since version tags to fix mixing up different product
versions.
2021-03-16 10:08:21 +02:00
Carson Black
4fe4a50aa4 xdgshell: wrap v3 of xdgshell protocol 2021-01-05 21:25:38 +00:00
Vlad Zahorodnii
f8dd1c615b Implement layer-shell v1 protocol 2020-09-03 13:42:36 +03:00
Vlad Zahorodnii
9b4e2dbdf8 xdg-shell: Add support for v2 2020-08-23 15:11:57 +03:00
Vlad Zahorodnii
85161bb644 xdg-shell: Reset xdg_toplevel and xdg_popup on unmap 2020-06-01 14:48:51 +03:00
Vlad Zahorodnii
e3ad23ccd8 xdg-shell: Rewrite wrappers for the xdg-shell protocol
The current xdg-shell wrappers don't match existing abstractions in the
xdg-shell protocol well, which makes it more difficult to refactor code
that is responsible for managing configure events and geometry in kwin.

Given that the xdg_decoration and the xdg_shell protocols are tightly
coupled together, I had to rewrite our wrappers for the xdg_decoration
protocol as well.
2020-06-01 14:48:51 +03:00
Aleix Pol
306f242ac8 Port namespaces and includes 2020-04-29 16:56:38 +02:00
Andreas Cord-Landwehr
9267f146fd KWayland: Convert license headers to SPDX
Summary:
Convert license headers to SPDX expressions and add license files as
required by REUSE specification.

Reviewers: zzag

Reviewed By: zzag

Subscribers: kde-frameworks-devel

Tags: #frameworks

Maniphest Tasks: T11550

Differential Revision: https://phabricator.kde.org/D28058
2020-03-16 19:57:44 +01:00
Vlad Zagorodniy
443721b555 [server] Make double-buffered properties in xdg-shell double-buffered
Summary:
So far all double-buffered properties in our implementation of xdg-shell
weren't actually double-buffered. When a property setter is invoked, we
pray to the God hoping that the client committed associated surface.

This change introduces private SurfaceRole class. The new class provides
a way for SurfaceInterface to commit pending state of associated shell
surface.

The chosen architecture allows us to do more in the future. For example,
we could use SurfaceRole to prevent associating several roles to a single
wl_surface object, e.g. xdg-toplevel to a pointer surface, etc.

Test Plan: This change breaks support for client-side decorated clients in KWin.

Reviewers: #kwin

Subscribers: kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D23745
2019-11-26 22:49:04 +02:00
David Edmundson
49e0cf53d4 Implement set_window_geometry
Summary:
Used by clients to say where their true window geometry is relative to
the buffer size. Important if a client has client side shadows which
shouldn't be included for positioning tasks.

Technically this should be double buffered, but for consistency with all
other XdgShell properties this will be a task left to ShellClient.

Test Plan: Unit test

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: zzag, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D20595
2019-05-14 12:32:53 +01:00
David Edmundson
d7f23df9d5 Xdg Decoration Support
Summary:
Usual massive boilerplate.

Should allow us to remove the injection in our QPT, as Qt 5.12 implements
this protocol directly. Will probably be relevant for other toolkits as
it's more standardised than our custom one.

Client is mostly 1:1 with the protocol, server side has some tweaking to
fit with kwayland turning an event based API into a state based one.

Test Plan:
Relevant unit test
Tried in modified kwin with our QPT disabled

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: zzag, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D17498
2018-12-21 13:07:52 +00:00
David Edmundson
4bbc085e0e [xdgshell] Add positioner constraint adjustment flag operators
Test Plan: Used in kwin

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D16318
2018-10-20 16:38:03 +01:00
Yuri Chornoivan
96df0ea6ae Fix minor EBN issues 2018-09-12 20:49:38 +03:00
David Edmundson
350f572a83 Populate shell version documentation 2018-07-16 16:13:16 +02:00
David Edmundson
8af1ec8885 Add XDG WM Base support to our XDGShell API
Summary:
This adds XDG WM Base (essentially XDG Shell v7/stable edition) into our
existing XDGShell classes which wrap v5, v6 and now this.

It's mostly copy and paste from V6 except for the enum types for gravity
and anchor edges on positioners.

There's been no attempt to share code with V6 as realistically that
won't get updates whereas XDGWMBase will; and at some point we will
want to drop V6 without things being too tangled.

Test Plan:
Same test suite as V6 has

Compiled GTK master and ran against suitably modified kwin
running WAYLAND_DEBUG=1 gtk-demo showed we were using this interface
Everything worked as well as V6 does.

Reviewers: #kwin, romangg

Reviewed By: #kwin, romangg

Subscribers: romangg, zzag, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D13510
2018-07-16 13:50:51 +02:00
David Edmundson
9faa26330c Update @since docs 2017-09-08 12:31:37 +01:00
David Edmundson
3c67cc1399 Support XDG v6
Summary:

The main clever part that's not just boring boiler plate is how we
handle the structure change
A surface now has an XDGSurface which then has a an Xdg TopLevel or a
Xdg Popup

We need to fit this into the public API which assumes a surface has a
Surface or a Popup.
The old Surface is similar to the new TopLevel.

The shoehorning works by relying on the fact that a surface without a
role is pretty useless.

Clients create the surface implicitly with the toplevel or implicitly
with the popup.
The server only announced it has a new "XdgSurface" when it gets a new
zxdg_surface_get_toplevel.

----

Popup decisions:
- On popup creation the server should copy the current info from the
positioner and then it gets deleted. Given kwaylands job is to keep
state, we expose all these parameter via popup.

- Due to this positioner is not exposed as a resource anywhere.

- Server API is 100% backwards compatiable.
i.e new code will work identically with v5 clients.

- Client API is not.  Grabs are called separately from the constructor,
and the parent surface changed to an xdgsurface, not a raw surface.
V5 code still works as-is, just not with the new constructors.

It seemed better to match the v6 (and what will be the stable v7) than
to try and do hacks and lose functionality.
Given the client needs to change the code to opt into V6 anyway. I don't
think this is a huge problem.

Test Plan: Current test still passes.

Reviewers: #plasma, graesslin

Reviewed By: #plasma, graesslin

Subscribers: graesslin, mart, plasma-devel, #frameworks

Tags: #frameworks, #plasma_on_wayland

Differential Revision: https://phabricator.kde.org/D6047
2017-09-04 16:56:24 +01:00
Friedrich W. H. Kossebau
c4ba4bd593 API dox: fix @link usage
@link either needs a matching @endlink tag,
or being used in javadoc style, {@link target [label]}
2017-05-26 02:57:20 +02:00
Martin Gräßlin
53f27feee7 Add support for xdg-shell
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.

Reviewers: #plasma_on_wayland

Subscribers: plasma-devel

Tags: #plasma_on_wayland

Differential Revision: https://phabricator.kde.org/D2102
2016-07-13 13:04:31 +02:00