Commit graph

23 commits

Author SHA1 Message Date
Vlad Zahorodnii
4f4f425538 Drop support for wl_shell_surface
wl_shell_surface has been deprecated for quite a long time. Nowadays
most clients use the xdg-shell protocol to create desktop-style user
interface elements.
2020-05-20 16:09:30 +03:00
Aleix Pol
5d4cd7dcd3 Fix build 2020-04-29 15:59:23 +02:00
Kevin Funk
32d4edff51 Minor: Include Qt dirs as SYSTEM includes 2018-09-13 09:38:09 +02:00
Marco Martin
9feb359676 Wayland foreign protocol
Summary:
Implement the "foreign" wayland protocol.
A client can export a surface with an unique string as handle,
then another client can refer to that surface and set an own surface as
child of that surface.
Potential use cases are out-of-process dialogs, such as file dialogs,
meant to be used by sandboxed processes that may not have the access
it needs to implement such dialogs.
The handle needs to be shared between the processes with other means,
such as dbus or command line paramenters.

The public api of the server side only tracks parent/child relationships as this is the only data kwin would need it for, the rest of the api is not exported so should be safer from eventual protocol changes

Test Plan:
the autotest works, but has a lot of random crashes when deleting surfaces,
unfortunately backtraces don't tell much and the crashes never occur when running into valgrind
behavior may still be wrong, depending on how the protocol is supposed
to work if more clients try to set the same exported surface as parent

Reviewers: #plasma, #kwin, davidedmundson, graesslin

Reviewed By: #plasma, #kwin, graesslin

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

Tags: #frameworks, #plasma_on_wayland

Differential Revision: https://phabricator.kde.org/D7369
2017-10-13 11:30:13 +02: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
Martin Gräßlin
d92592a291 Support passing generic QIcon through PlasmaWindow interface
Summary:
Especially for Xwayland windows the compositor might not have a themed
icon name. Resulting in a task manager not having dedicated icons for
Xwayland windows.

This change deprecates the way how a compositor is supposed to set the
window icon. Instead of passing the themed icon name, it is now supposed to
pass the QIcon. In case it's a themed icon the existing way to pass to
the client is used.

Otherwise a new event is used to inform the client that there is an icon
- no data is transmitted at this point. The client can then create a
file descriptor and pass it to the compositor. The compositor serializes
the icon into the file descriptor and the client can read from it. This
all happens transparently on client side there is no api change at all.

The writing and reading of the icon is done in a thread. Due to that
Qt5::Concurrent is now a required dependency instead of an optional
dependency.

Reviewers: #plasma_on_wayland, hein

Subscribers: plasma-devel

Tags: #plasma_on_wayland

Differential Revision: https://phabricator.kde.org/D3049
2016-10-17 07:35:21 +02:00
Martin Gräßlin
618bebb63b Make linux/input.h compile time optional
Summary:
Instead of hard depending on the include of linux/input.h we check
whether that include file exists and properly ifdef all usages.

Unfortunately there is no replacement for those parts which do mapping
of input event codes.

Reviewers: #plasma_on_wayland

Subscribers: plasma-devel

Tags: #plasma_on_wayland

Differential Revision: https://phabricator.kde.org/D2344
2016-08-22 14:36:11 +02:00
Martin Gräßlin
b612251015 [tests] Add a test application for PlasmaShellSurface
Summary:
Creates a PlasmaShellSurface and allows to set the different roles
through command line argument.

Needed to verify that KWin properly handles the notification type.

Reviewers: #plasma_on_wayland

Subscribers: plasma-devel

Tags: #plasma_on_wayland

Differential Revision: https://phabricator.kde.org/D1932
2016-06-27 08:20:43 +02:00
Martin Gräßlin
598896987b [tests] Add a sub-surface test application
The test application creates a sub-surface tree consisting of overall
three surfaces:
* blue main surface
* red sub surface
* green sub surface to the red sub surface

All surfaces are in synchronized mode. There is a timer to turn the
green surface into yellow after five seconds.
2016-03-21 16:03:31 +01:00
Martin Gräßlin
799d11fdb7 [tests] Add a shadow test application 2015-11-18 09:58:19 +01:00
Martin Gräßlin
23f4a63908 [tests] Add an example for the Dpms interface
Uses QWidgets to render a very small UI.
* lists each Output
* for each output shows whether dpms is supported
* and which dpms mode it's in
* and provides a button to change the mode
2015-09-09 17:46:40 +02:00
Martin Gräßlin
dcb18dfc46 [client] Create Compositor from QtWayland integration
Adds a new test application qtwayland-integration-test which demonstrates
how one can create a Surface from the Compositor got from QtWayland.
2015-06-18 03:37:58 +02:00
Martin Gräßlin
1c1da06eb1 [tests] Add a test application for PlasmaShellInterface
Creates a panel.

REVIEW: 124053
2015-06-09 20:52:45 +02:00
Martin Gräßlin
bb7065be3d [client] Add Touch
Basic support for handling touch events on Client side.
2015-03-25 12:22:05 +01:00
Martin Gräßlin
b3b4adfe7f [tests] Install eventDispatcher before creating the QGuiApplication
This change demonstrates how one can install a custom event dispatcher
before creating the QGuiApplication and how to process Wayland events
using the event dispatcher to e.g. start an Xwayland server prior to
creating the application.

It also allows to use

--platform wayland

on the test application. The wayland QPA plugin will connect to the
KWayland server started prior to creating the application.
Please note that such a setup will freeze unless QtWayland has commit
1e32e71 [1].

[1] 1e32e71403
2015-02-18 09:43:04 +01:00
Martin Gräßlin
59d90f20c6 [tests] Add option to start rootless Xwayland server to renderingservertest
Will be started after the app is created.
2015-01-09 12:08:23 +01:00
Martin Gräßlin
35e5517c4b Add missing newline at end of file 2014-12-12 08:36:47 +01:00
Martin Gräßlin
9d2cfd122e pasteclient: read selection in thread 2014-11-27 12:45:42 +01:00
Martin Gräßlin
e05dfff919 Include(ECMMarkAsTest) in tests/
BUG: 341109
2014-11-20 16:45:32 +01:00
Martin Gräßlin
6c406df725 Adding a test application for paste
Counter part for the copyClient test app: the pasteClient test app
creates and maps a shell surface and waits for selection announce,
initiates the copy/paste mechanismn and prints out what got pasted.
After success it closes itself.
2014-11-12 14:05:46 +01:00
Martin Gräßlin
3f10218d77 Adding a test application for copy
The test application copyClient creates a ShellSurface, maps it as
fullscreen, renders a green buffer and when it gets pointer focus it
sets "foo" in mimetype "text/plain" into the selection.
2014-11-12 13:17:26 +01:00
Martin Gräßlin
5cd92ba7e2 Adding a test application supporting output to a QWidget
This test application "testRenderingServer" is able to start a
Wayland server and uses a QWidget to render the "scene". It manages
ShellSurfaces and renders them on the QWidget in a very static way.
Furthermore input events (key, pointer, wheel) are forwarded to the
top most Surface.

This test server is able to support kwin_wayland as a client, but
weston's test application in latest release fail due to missing
xdg_shell support.
2014-11-10 14:56:17 +01:00
Martin Gräßlin
376a2ffac9 Add a simple testServer binary 2014-11-07 09:08:29 +01:00