Commit graph

235 commits

Author SHA1 Message Date
Marco Martin
4c3aa31cd3 Blur protocol in KWayland
a protocol to activate the blur behind windows and to
optionally set a sub region of the window where to apply
the blur to, in case the window is shaped
REVIEW:125015
2015-09-02 14:42:57 +02:00
Martin Gräßlin
029c18ae5c [client] Add a removed() signal to each class representing a global
Setup by the Registry to be emitted whenever the wl_global gets
removed for which a dedicated object has been created.

REVIEW: 124835
2015-08-20 11:42:10 +02:00
Martin Gräßlin
6888c18b79 [autotests] Fix typos 2015-08-19 08:10:58 +02:00
Martin Gräßlin
10c562a2f2 [client] Extend Registry by providing name and version of announced interfaces
This change addresses the sometimes cumbersome to use API of Registry.
So far to bind an interface one needed to connect to the signals when
setting up the registry. There was no other way to get the name and
version at a later point. This made it difficult to use one Registry
in different parts of an Wayland application.

This change adds a convenient:
struct AnnouncedInterface { quint32 name; quint32 version;};
AnnouncedInterface interface(Interface) const
QVector<AnnouncedInterface> interfaces(Interface) const

The first one is meant for interfaces like wl_shm which is normally only
announced once. The latter one is meant for interfaces like wl_output
for which normally multiple interfaces can get announced.

Those methods can be used without having to connect to the announced
spy.

REVIEW: 124734
2015-08-19 08:10:18 +02:00
Martin Gräßlin
f78c65033b Set default logging category to Critical 2015-07-31 16:28:56 +02:00
Martin Gräßlin
69832442a1 Add a Shadow protocol
The shadow protocol is inspired by the KWin's X11 protocol and the
DecorationShadow in KDecoration2.

A shadow is attached to a surface (after a commit on surface) and
consists of several image parts (represented through a buffer):
* top-left
* top
* top-right
* right
* bottom-right
* bottom
* bottom-left
* left

In addition there is an offset on each side.

For more information see also the X11 protocol described at [1].

Note: the protocol is currently missing documentation and changing
the shadow is not yet properly delegated to the server API.

[1] https://community.kde.org/KWin/Shadow
2015-07-15 11:11:30 +02:00
Martin Gräßlin
0068cfddad [server] Add missing include
Fixes build with gcc 4.8.

BUG: 350058
2015-07-09 20:28:20 +02:00
Martin Gräßlin
eb97db3fd1 Adding support for a fake input interface
This interface allows a client to fake input events and the server
might use them. There is an authentication mechanismn in place which
requires the server to mark the client as authenticated in order for
any events to be emitted at all.

This interface is intended for use cases like kdeconnect which allows
to remote control a device.
2015-07-09 10:10:42 +02:00
Martin Gräßlin
40d36443bd Add support for an idle time interface
The idle time interface is modelled for the use cases of the KIdleTime
framework to allow providing a Wayland specific implementation.

It supports registering idle timeouts which are triggered on server
side if there has not been any user activity on the seat for the
requested amount of time. Once user activity resumes a resume from idle
signal is emitted.

In additon there is the possibility to simulate user activity which
simulates the resume from idle.
2015-07-09 10:09:18 +02:00
Martin Gräßlin
a63fe2f0fb Better handle the creation of PlasmaWindow in PlasmaWindowManagementInterface
Sending a new PlasmaWindow as an event is quite problematic. The main
problem here is that it sends an id of 0 and this doesn't make sense
when the interface gets bound and all existing windows are send to the
client.

This changes the interaction to have the client create the resource for
the PlasmaWindow instead of the server creating it. The server generates
"window ids" and sends those to the client. The client now binds a
PlasmaWindow with the "window id" in the normal way.

In case the server doesn't know the id any more, it directly sends an
unmapped and destroyes the newly created resource again. It is not a
protocol error as that can happen (common example: file open dialog of
Qt 5 applications on Xwayland).
2015-06-29 10:04:51 +02:00
Marco Martin
7fd15ea066 generate fake mouseevents on touch for xwayland
on xwayland clients, send mouse press, move and release
corresponding to touchDown, move and release
this gives a very basic touchscreen support on
xwayland clients

reviewed-by: Martin Graesslin <mgraesslin@kde.org>
2015-06-20 14:21:27 -07:00
Martin Gräßlin
42a1e1e99e Add a themed icon name to PlasmaWindow interface
Server can set a themed icon name, client gets it directly turned into a
QIcon. That only works with QGuiApplications as can be seen in the
adjusted paneltest.
2015-06-20 02:46:56 +02:00
Martin Gräßlin
2f02ee45cf Add support for panel behavior in PlasmaShellSurface
Allows to set a PlasmaShellSurface with role panel to be either:
* AlwaysVisible
* AutoHide
* WindowsCanCover
* WindowsGoBelow
2015-06-19 23:27:38 +02:00
Martin Gräßlin
1a4c431ae7 Request state changes in PlasmaWindow interface 2015-06-19 04:34:50 +02:00
Martin Gräßlin
93c1521624 Add close request to the PlasmaWindow interfaces 2015-06-19 01:43:58 +02:00
Martin Gräßlin
abf42dfdc3 Add state handling to PlasmaWindow interface
Allows to pass all on/off states from compositor to the PlasmaWindow.
2015-06-18 21:13:58 +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
441856a0e6 [server] Destroy created Surface/Region when ClientConnection goes away
Resources might not be properly destroyed if an application crashes and
doesn't call destroy.
2015-06-18 03:16:29 +02:00
Marco Martin
c0d78d5aa1 make KWayland usable from qmake 2015-06-17 17:05:32 -07:00
Martin Gräßlin
c67614ad9d [server] Expose PlasmaWindowInterface::unmap
Sends an umap to the client and destroys the resource afterwards.

The PlasmaWindowInterface gets automatically destroyed once there
are no more resources bound to it.
2015-06-18 00:11:32 +02:00
Martin Gräßlin
d6f0ff55bd [tests] Extend paneltest on how to use PlasmaWindow
Debugs out changes to window title.
2015-06-16 06:30:54 +02:00
Martin Gräßlin
83ce426353 [server] Add PlasmaWindowInterface to PlasmaWindowManagementInterface
Only a very small subset is supported at the moment allowing to change
window title, appId and virtual desktop.
2015-06-16 06:30:08 +02:00
Martin Gräßlin
9e1991b77e [server] Add resource safety checks to TouchInterface
Prevent marshalling errors.
2015-06-15 19:31:06 +02:00
Martin Gräßlin
946b1c8d78 Fix 3e53a6283d
The most trivial changes are the one which needs to be tested!
2015-06-14 05:48:36 +02:00
Martin Gräßlin
3e53a6283d [server] Add safety checks in SeatInterface::setFocusedFooSurface
Check whether the resource for the Keyboard/Pointer/TouchInterface
is still valid before trying to use it.

This was hitting crashes in wayland during the wl_foo_send_enter
calls.
2015-06-14 00:52:55 +02:00
Martin Gräßlin
fea4b92c92 [tests] Extend paneltest to enable/disable showDesktop mode
* Left button: enable
* Right button: disable
2015-06-13 00:16:48 +02:00
Martin Gräßlin
deeb0bc50e [server] Add PlasmaWindowManagementInterface 2015-06-13 00:16:48 +02:00
Martin Gräßlin
36644b8734 [server] Add support for QtSurfaceExtension protocol
The Qt surface extension is a small protocol to allow exchanging
additional data between QWindows and the compositor. What we are
currently only interested in is the possibility to close a surface
from the Compositor.

Protocol description is copied from QtWayland 5.4.2 branch.
2015-06-10 00:56:31 +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
85a654b02b [server] Add bindings for PlasmaShell interface 2015-06-09 19:05:25 +02:00
Martin Gräßlin
0d000d0046 [server] Drop incorrect assert from PointerInterface::setFocusedSurface
It's totally fine to have d->resource to be null - there are checks for
it in the method.
2015-06-04 01:36:34 +02:00
Martin Gräßlin
19c03da560 [server] Don't discard callbacks on surface commit
Old callbacks need to be kept around, otherwise mesa might freeze.
2015-06-03 21:16:53 +02:00
Martin Gräßlin
75915984bb [server] Query whether BufferInterface's format has an alpha channel
Reviewed-By: Sebastian Kügler
2015-06-01 02:37:44 +02:00
Martin Gräßlin
4412063c0e [sever] Check whether it's a shmBuffer in BufferInterface::Private::format
Safety check before calling into wayland library.
2015-06-01 01:21:33 +02:00
Martin Gräßlin
b47c6566a8 [server] Send keymap if we have one when creating a keyboard 2015-05-28 10:15:42 +02:00
Martin Gräßlin
713dbc51fa [server] Restrict damage to the surface geometry
Before emitting the new damage we need to restrict it to the geometry
of the surface. That's required by the documentation and at least
QtWayland/OpenGL emits non-sense damage events.
2015-05-26 11:42:38 +02:00
Martin Gräßlin
35a854e991 [server] Only send surface leave if resources are still valid
If a resource is null, because e.g. the surface got already destroyed,
wayland will create an error while marshalling arguments causing
the connected client to in worst case abort.
2015-05-26 09:26:19 +02:00
Martin Gräßlin
ed080780fd [server] Make Display::dispatchEvents also work when event loop is started
Just delegates to dispatch in the d-ptr if the Display is already running.
2015-05-18 10:27:44 +02:00
Martin Gräßlin
b7e8611e70 [autotest] Drop custom flush code in testWaylandSeat
The flush handling for blocking is done in ConnectionThread, so not
needed.
2015-05-12 16:36:36 +02:00
Martin Gräßlin
09bfc4ac5e [autotests] Improve stability of testWaylandSurface
* uses an EventQueue
* better waits for events when testing for buffer released
2015-05-12 15:51:15 +02:00
Martin Gräßlin
681211ca33 [autotests] Improve stability of TestWaylandFullscreenShell
Apparently we need to add a small delay after starting weston otherwise
it fails to connect on the CI system.

Additionally we switch to using headless-backend.so which should also
make the setup more robust.
2015-05-12 14:00:48 +02:00
Martin Gräßlin
8a6cbfd874 [autotest] Make TestWaylandOutput more robust
If we use a thread for the connection we should also have an EventQueue.
2015-05-12 13:16:57 +02:00
Martin Gräßlin
aaf64644f7 [Server] Delete BufferInterface directly from destroyListenerCallback
It showed that we don't eed the delete later and that it could cause
a crash in QCoreApplication.
2015-04-21 09:00:10 +02:00
Martin Gräßlin
fda44f9540 [server] Default init link.prev/next of the destroyListener in BufferInterface
Better save than sorry.
2015-04-21 08:58:49 +02:00
Martin Gräßlin
d28f95f603 [server] Better split flushing events and dispatch events
Running real world applications (Xwayland) showed that it doesn't like
at all that we do a dispatch when we are going to flush. This caused
in a very reliable manner a "Connection closed" error in XWayland, taking
down the client and in return the (xwayland-enabled) server.
2015-04-21 08:56:19 +02:00
Martin Gräßlin
260c33e75d [server] Call wl_resourc_destroy from destroyCallbacks
That's what weston does.
2015-04-20 13:56:41 +02:00
Martin Gräßlin
7b1e1bac9b [server] Guard sending events to PointerInterface
After unbind the PointerInterface is not yet deleted, but resource
is null, thus we need to protect the calls.
2015-04-20 09:09:23 +02:00
Martin Gräßlin
c562f62696 [server] Nullptr check in Resource::Private::get
The resource pointer might be null in which case we shouldn't call
wl_resource_get_id on it.
2015-04-20 08:15:21 +02:00
Martin Gräßlin
9039db90f0 [server] Add BufferInterface::get
Allows to get a BufferInterface for a native wl_resource*.
2015-04-02 14:22:55 +02:00
Martin Gräßlin
3a01f7155a [server] Add ClientConnection::getResource
Returns the wl_resource associated with a given id for the client
if it exists.
2015-04-02 14:12:16 +02:00