Commit graph

692 commits

Author SHA1 Message Date
Martin Gräßlin
ccb4ac4280 Add a geometry event to PlasmaWindow
Summary:
This allows the compositor to expose the absolute window geometry to
processes which need it.

Reviewers: #plasma_on_wayland

Subscribers: plasma-devel

Tags: #plasma_on_wayland

Differential Revision: https://phabricator.kde.org/D2183
2016-07-15 13:31:54 +02:00
Martin Gräßlin
253cb85fdb [src/server] Verify that surface has a resource before sending pointer enter
Summary:
If we try to send a pointer enter on a null resource of a Surface
(e.g. after unbound) we hit a marshalling error:
error marshalling arguments for enter (signature uoff): null value passed for arg 1

The added test case hits this error without the change and passes
cleanly with the change.

Reviewers: #plasma_on_wayland

Subscribers: plasma-devel

Tags: #plasma_on_wayland

Differential Revision: https://phabricator.kde.org/D2159
2016-07-14 11:47:34 +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
Martin Gräßlin
e0716c2306 [server] Properly send a selection clear prior to keyboard focus enter
Summary:
When setting the keyboard focus the server needs also to send the current
selection to the client. So far KWayland only sent the selection if it was
set. That is if the last focused client cleared the selection it was not
updated and the client might have had an outdated selection.

To prevent this situation the server now explicitly sends the clear to the
client on enter if there is no selection. Also if the selection is cleared,
the SeatInterface now unsets it's current selection to make sure that the
next focused keyboard will get the clear selection sent.

Test Plan:
Existing test case adjusted and a new test case added which
simulates the interaction of two clients.

Reviewers: #plasma_on_wayland

Subscribers: plasma-devel

Tags: #plasma_on_wayland

Differential Revision: https://phabricator.kde.org/D2091
2016-07-13 09:21:01 +02:00
Martin Gräßlin
ab85e957a6 [server] Handle no XDG_RUNTIME_DIR situation more gracefully
Summary:
Even if the XDG_RUNTIME_DIR is not set, KWayland should not crash
if methods are invoked which only make sense after the server was
started successfully. This was not yet the case for
Display::dispatchEvents.

Also the wl_display was not destroyed in the situation that creating
the socket failed.

Test Plan:
Test case added which simulates the situation of no
XDG_RUNTIME_DIR being set.

Reviewers: #plasma_on_wayland

Subscribers: plasma-devel

Tags: #plasma_on_wayland

Differential Revision: https://phabricator.kde.org/D2077
2016-07-13 09:20:03 +02:00
Marco Martin
cd77833c3b add .data() to qpointer access
fix build on old gcc versions
2016-06-30 16:45:29 +02:00
Martin Gräßlin
bd7d7c1936 [server] Hide unused variable warning in PlasmaWindowManagementInterface::Private::getWindowCallback 2016-06-29 11:26:29 +02:00
Martin Gräßlin
4a3bdbbd7b [autotests] Verify the directChildServerSurfaces in TestSubSurface::testSurfaceAt
Unused variable warnings were reported. Let's do some testing with those
variables.
2016-06-29 11:24:35 +02:00
Martin Gräßlin
d52485ffb7 Add a parent_window event to Plasma Window interface
Summary:
This change adds a parent_window event to Plasma Window. From server
side it's possible to specify that a window is a transient for another
window - that is it has a parent window.

On client side this is exposed respectively with a new change signal.

Reviewers: #plasma_on_wayland, hein

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D1779
2016-06-29 08:03:55 +02:00
Martin Gräßlin
5ae8ac4327 Add a ToolTip role to PlasmaShellSurface
Summary:
As Wayland doesn't have a proper ToolTip window type yet, we add it
to PlasmaShellSurface, so that we can use it for Plasma's tooltips.

Reviewers: #plasma_on_wayland

Subscribers: plasma-devel

Tags: #plasma_on_wayland

Differential Revision: https://phabricator.kde.org/D2030
2016-06-29 08:01:26 +02:00
Martin Gräßlin
89a4c2f0e1 Properly handle destroying a Pointer resource
Summary:
On client side the newer wl_pointer_release is used which is a
destructor call. On server side the shared destroy callback is used
and it's ensured that KWayland doesn't crash if called into the
PointerInterface between unbound and destroyed.

Test Plan:
Test case extended to cover the condition of an unbound
PointerInterface.

Reviewers: #plasma_on_wayland

Subscribers: plasma-devel

Tags: #plasma_on_wayland

Differential Revision: https://phabricator.kde.org/D2037
2016-06-28 18:58:41 +02:00
Martin Gräßlin
0b208fcd63 [autotests] Get Server::Cursor::pointer under coverage
Just verifying that it's returning the expected value.
2016-06-28 18:39:19 +02:00
Martin Gräßlin
594665c1df [server] Delete dead code: KeyboardInterface::Private::sendKeymap
Not called from anywhere.
2016-06-28 17:26:28 +02:00
Martin Gräßlin
782f036c0d Properly handle destroying a Keyboard resource
Summary:
On client side the newer wl_keyboard_release is used which is a
destructor call. On server side the shared destroy callback is used
and it's ensured that KWayland doesn't crash if called into the
KeyboardInterface between unbound and destroyed.

Test Plan:
Test case extended to cover the condition of an unbound
KeyboardInterface.

Reviewers: #plasma_on_wayland

Subscribers: plasma-devel

Tags: #plasma_on_wayland

Differential Revision: https://phabricator.kde.org/D2036
2016-06-28 17:14:36 +02:00
Martin Gräßlin
34df9d8b2e Properly handle release of a touch resource
Summary:
On client side use wl_touch_release to get into the proper destroy
handler on server side. There the shared destroy implementation is
used.

The test case is extended to verify the condition and ensure that
our code doesn't crash in case SeatInterface calls into the already
unbound TouchInterface.

Reviewers: #plasma_on_wayland

Subscribers: plasma-devel

Tags: #plasma_on_wayland

Differential Revision: https://phabricator.kde.org/D2035
2016-06-28 17:06:49 +02:00
Martin Gräßlin
f53bc666eb [autotests] Extend test case for SeatInterface::setSelection
Verifies the condition that the currentSelection is the same as the
DataDeviceInterface passed to setSelection.
2016-06-28 14:57:42 +02:00
Martin Gräßlin
1c16f881e2 [autotests] Bring SeatInterface::focusedTextInputSurface under coverage 2016-06-28 14:53:45 +02:00
Martin Gräßlin
59bfac50ba [server] Add support for setting the clipboard selection DataDeviceInterface manually
Summary:
So far SeatInterface handled automatically which DataDeviceInterface
holds the current clipboard selection. While this works fine and is
correct it doesn't support use cases like a clipboard manager where
the clipboard is hold by a different ClientConnection than the one
from the focused keyboard.

This change allows to manually set the selected DataDeviceInterface
to override the automatic selection, though the automatic selection
is still in place. Thus the next update of a selection will override
the manually set selection again.

Reviewers: #plasma_on_wayland

Subscribers: plasma-devel

Tags: #plasma_on_wayland

Differential Revision: https://phabricator.kde.org/D1972
2016-06-28 10:48:30 +02:00
Martin Gräßlin
db602b8188 [server] Ensure that Resource::Private::get returns nullptr if passed a nullptr
Summary:
A Resource might be unbound, but not yet destroyed. In that case this
return a Resource instead of nullptr.

This change adds an explicit nullptr check.

Reviewers: #plasma_on_wayland

Subscribers: plasma-devel

Tags: #plasma_on_wayland

Differential Revision: https://phabricator.kde.org/D1938
2016-06-27 08:21:10 +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
52eeb16156 Add a notification role to PlasmaShellSurface
Summary:
Plasma needs to be able to mark windows as Notifications, so that KWin
can put them into the right layer.

Reviewers: #plasma_on_wayland

Subscribers: plasma-devel

Tags: #plasma_on_wayland

Differential Revision: https://phabricator.kde.org/D1928
2016-06-27 08:20:01 +02:00
Martin Gräßlin
7844e38e79 [autotests] Add test for showing desktop in PlasmaWindowManagement 2016-06-25 21:04:48 +02:00
Martin Gräßlin
c9ec19d522 [autotest] Extend testing for the requests in PlasmaWindowInterface 2016-06-25 11:41:19 +02:00
Martin Gräßlin
3f69ab1bf0 [server] Add resource check in QtExtendedSurfaceInterface::close
Summary:
The QtExtendedSurfaceInterface might be unbound and thus the resource
might be null when calling into close. Thus we need to do a nullptr
check.

Hit a crash there.

Test Plan:
Unfortunately no test case as we don't have a client side
implementation for this.

Reviewers: #plasma_on_wayland

Subscribers: plasma-devel

Tags: #plasma_on_wayland

Differential Revision: https://phabricator.kde.org/D1961
2016-06-20 16:27:13 +02:00
Martin Gräßlin
262b49d713 [server] Unset SurfaceInterface pointer in referenced objects when being destroyed
Summary:
This is a gotcha moment:
1. Create Surface with id 1
2. destroy that Surface
3. Create another Surface

Now if in step 3 the id is by pure chance getting reused and also 1, the
wl_resource pointer of the SurfaceInterface of step 1 and step 3 are
the same. This is rather unexpected and causes problems.

When creating a ShellSurface in step 1 and step 3 it would fail. KWayland
finds a ShellSurface which was already created for the Surface. The same
can happen with QtSurfaceExtensionInterface and PlasmaShellInterface which
also go into error state.

On client side this would trigger a protocol error and terminate the
application. An easy way to reproduce is opening the file open dialog
from within Kate multiple times.

This change addresses this problem by setting the surface pointer in
those classes to null when the parent Surface gets destroyed. Thus
creating a new ShellSurface won't find the old referenced Surface any
more.

For ShellSurface and PlasmaShellSurface a test case is added which hit
the condition without this change. For QtSurfaceExtension we don't have
the client side, so we cannot really simulate the condition.

Reviewers: #plasma_on_wayland

Subscribers: plasma-devel

Tags: #plasma_on_wayland

Differential Revision: https://phabricator.kde.org/D1937
2016-06-20 10:30:08 +02:00
Martin Gräßlin
aa5cf3143a [server] Fix error message in QtSurfaceExtension Interface
If a SurfaceExtension is already created for a Surface we should say
that and not that a PlasmaShellSurface is already created.
2016-06-17 15:25:03 +02:00
Martin Gräßlin
2417faff4d [autotests] Extend TestDataDevice for unbound check in createDataOffer
Extends the test case for checking that the nullptr check is taken
when trying to send a selection on an already unbound DataDevice.
2016-06-15 09:33:10 +02:00
Martin Gräßlin
e2d46c574c [server] Introduce a Resource::unbound signal emitted from unbind handler
Summary:
So far for internal cleanup we mostly listen to QObject::destroyed.
When a Resource gets unbind the wl_resource is set to null and the
Resource gets deleteLater. This creates a short time frame when the
Resource is still there, but the wl_resource is null. For most internal
usages the Resource is completely useless at that point and should no
longer be considered. So far it was still considered and could hit
crashers, if a code path did not nullptr check. Unfortunately
libwayland-server is not nullptr safe: if called with a null value it
tends to crash.

So this check introduces a new signal unbound which can be listend to
in addition to the destroyed signal. It's used in SeatInterface for
DataDeviceInterface, where we experienced a crash related to that.

A test case is added which exposes the crash, but it already needs
the unbound signal to get into the crashy condition. The actual crash
is fixed twice - with the help of the unbound signal, but also by
introducing the nullptr check where it's needed.

Reviewers: #plasma_on_wayland

Subscribers: plasma-devel

Tags: #plasma_on_wayland

Differential Revision: https://phabricator.kde.org/D1868
2016-06-15 09:05:13 +02:00
Martin Gräßlin
07e0f92d80 [autotests] Fix build with older compiler
We cannot create a QSignalSpy on a QPointer.
2016-06-14 11:22:58 +02:00
Martin Gräßlin
9a44631c24 [server] Don't assert when destroying a still referenced BufferInterface
Summary:
The fact that the buffer is still referenced - that is used - when the
BufferInterface gets destroyed is an error, but it is not fatal.

Unfortunately KWin/Wayland is still hitting this assert from time to
time and the assert is not helping to find the cause as a backtrace
does not show where a reference is still hold.

This change removes the hard assert by a soft warning. The advantage
of the warning is that the compositor is not killed and that we can
observe the reason and find a usage pattern which triggers the condition.

With that we will hopefully be able to find the case where the buffer
is still referenced when being destroyed and fix that.

Reviewers: #plasma_on_wayland

Differential Revision: https://phabricator.kde.org/D1783
2016-06-14 07:44:09 +02:00
Martin Gräßlin
acb0e85bb6 Add destructor request to org_kde_kwin_shadow and org_kde_kwin_shadow_manager
Summary:
This improves the cleanup of a shadow from client side. The server now
notices when the client destroyed the shadow.

Reviewers: #plasma_on_wayland

Subscribers: plasma-devel

Differential Revision: https://phabricator.kde.org/D1789
2016-06-14 07:37:11 +02:00
Martin Gräßlin
37f5256688 [autotests] Extend test for OutputInterface
Just adds more test conditions to the already existing test.
2016-06-13 19:19:06 +02:00
Martin Gräßlin
c11b1f1217 [autotest] Improve test for ShellSurface
Just verifying a few more conditions.
2016-06-13 16:49:31 +02:00
Martin Gräßlin
268f2ef6ff [autotests] Add test for error case of two PlasmaShellSurfaces for same Surface
Tricky to test as our client implementation is too smart to go into it.
Thus the Surface needs to be created with normal Wayland functionality.
2016-06-13 16:26:27 +02:00
Martin Gräßlin
57148c4bae [autotests] Extend test for PlasmaShellSurface::setRole
If the role is set to the same as before it should not emit the changed
signal.
2016-06-13 16:01:54 +02:00
Martin Gräßlin
65b7fd68d2 [autotests] Try to fix the flaky TestWayalndSurface::disconnect
Sometimes the test is failing due to a wait on the signalspy not
working and then the cleanup triggers a heap-use-after-free.

This change tries to address the problem by using a QTRY_COMPARE
instead of a wait on signalspy.
2016-06-13 14:55:36 +02:00
Martin Gräßlin
33c8634c00 [autotests] Add test for PlasmaShellSurface::setPanelBehavior
Also adds the metatypes on client and server side.
2016-06-13 14:01:49 +02:00
Martin Gräßlin
8e28a6c1c2 [autotest] Extend test for PlasmaShellSurface on server side
Verifies that the shell is returned correctly and the static getter
for wl_resource works as expected.
2016-06-13 13:31:00 +02:00
Martin Gräßlin
ee5e92fe14 [autotests] Add test for PlasmaShellSurface::setSkipTaskbar
Test exposes that the changed signal gets emitted even if the value
did not change.
2016-06-13 11:32:05 +02:00
Martin Gräßlin
19f8ca8376 [autotests] Verfiy setting the position in PlasmaShellSurface 2016-06-10 16:44:29 +02:00
Martin Gräßlin
597e0104fc [autotests] Extend the TestPlasmaShell::testRole to test change to Normal
Test case changes back to Normal and verifies that this is correct in
both client and server.
2016-06-10 15:50:20 +02:00
Martin Gräßlin
41ac06747e [autotest] Verify the static getter on PlasmaShellSurface
Extends the test to verify that the PlasmaShellSurface::get returns
the PlasmaShellSurface for a given Surface.
2016-06-10 15:46:40 +02:00
Martin Gräßlin
c89ae2105e [autotests] Verify that PlasmaShell::createSurface returns from cache
If a PlasmaShellSurface got already created for a Surface, the
PlasmaShell::createSurface should return that one. This change justs
adds a check to an autotest to verify this condition.
2016-06-10 15:38:05 +02:00
Martin Gräßlin
2120d13632 Introduce an initial state event into Plasma Window protocol
Summary:
The event is sent to the client once all initial state is transmitted.
This means the client is able to see the PlasmaWindow completely created
and not in the intermediate state with further updates being pushed after
being created.

The client side API is adjusted to emit the windowCreated signal after
the initial state event is received. In addition if the window is already
unmapped, the signal will never be emitted which means the not valid
windows are not exposed to the client at all.

The tests are adjusted to reflect the new reality, which in most cases
just means removing the comment that this needs to be improved.

There is one kind of unrelated change included: when an empty icon is
set, the client side now creates a QIcon() instead of going through
QIcon::fromTheme. This wrong behavior was exposed now by the auto tests.

Reviewers: #plasma, hein

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D1773
2016-06-06 13:07:35 +02:00
Martin Gräßlin
076e8ba253 [server] Trigger error if a transient request tries to parent to itself
Summary:
If the surface passed in the transient request is to the surface of the
shell surface, KWin aborts. It's an obvious invalid request, so handle
it properly by sending an error.

Reviewers: #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D1755
2016-06-03 12:45:05 +02:00
Martin Gräßlin
b3ccc12b75 [client] Detect errors in ConnectionThread
Summary:
So far ConnectionThread dispatched events without checking for (protocol)
errors. But Wayland errors are considered fatal. We do need to consider
them.

This change introduces a way to detect errors and expose them in
ConnectionThread. Errors are handled gracefully, they are exposed, but
not considered application fatal. E.g. a new ConnectionThread could be
created afterwards.

This allows to add tests to verify error conditions.

Reviewers: #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D1753
2016-06-03 11:27:04 +02:00
Martin Gräßlin
682652714d Introduce a test server
Summary:
The idea of shipping a test server is to have something like Xvfb for
Wayland. To be able to run a test application with a fake Wayland server.

To make this super easy the test server binary is installed into libexec
directory and provides a cmake function to run a test application with
the test server.

The test server takes full control over the process. It's a guiless
application and starts the passed test application once it is fully
set up. The environment is setup to have the test application connect
to the fake server (WAYLAND_SOCKET env variable and QT_QPA_PLATFORM).

When the started application finishes the test server goes down and
exits with the exit value of the test application. This allows a good
integration with ctest.

The test server is a virtual server which supports the following
interfaces:
* Shm
* Compositor
* Shell
* Seat
* DataDeviceManager
* Idle
* SubCompositor
* Output (1280x1024 at 60 Hz with 96 dpi)
* FakeInput

This is sufficient to bring up a QtWayland based application and
allows some basic interactions from a test application (e.g. fake
input).

So far the server fakes a repaint every 16 msec, but does not yet
pass events to the test applications.

To integrate this into an application for testing use:
    find_package(KF5Wayland CONFIG)
    add_executable(myTest myTest.cpp)
    target_link_libraries(myTest Qt5::Gui Qt5::Test)
    kwaylandtest(myTest)

When now running ctest in the build directory the test server gets
started and will start the myTest binary and report the passed/failed
in the expected and normal way.

This way a test case can easily be run against both X11 and Wayland.

Reviewers: #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D1726

Changelog: Virtual framebuffer server for auto tests
2016-06-01 16:15:08 +02:00
Martin Gräßlin
151a910f4c [server] Properly handle the case that a PlasmaWindow is unmapped before client bound it
Summary:
So far we directly destroyed the resource on the server side. But this
causes a wayland error when the client tries to cleanup. This results in
the client being destroyed. A problem which brings down plasmashell
regularly when short living windows are shown. This happens e.g. in
Dolphin with the adress auto complete.

This change addresses the problem by creating a temporary
PlasmaWindowInterface for the already unmapped window. It doesn't get
added to the list of known windows and it's only purpose is to properly
handle the unmap and the destroy of the just created resource.

Reviewers: #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D1734
2016-06-01 15:43:21 +02:00
Martin Gräßlin
92c379d474 [autotests] Make PlasmaWindowModel Test a little bit more stable
This change ensures that when the PlasmaWindow got created on client
side is also processed on the server side before we go into unmap.
2016-06-01 14:53:38 +02:00
Martin Gräßlin
0b19734dd0 [server] Don't destroy SlideInterface when parent SurfaceInterface is destroyed
Summary:
Destroying the SlideInterface on the server side before the client has a
chance to cleanup results in a protocol error:
wl_display@1: error 0: invalid object 7

Which would terminate the client. If we would not destroy the resource,
but only delete the SlideInterface it could result in heap-use-after-free.

So just don't do anything, the client needs to cleanup which will result
in the SlideInterface being deleted.

Reviewers: #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D1714
2016-06-01 07:34:10 +02:00
Martin Gräßlin
555ef7f15a [server] Properly handle destructor in SlideInterface
Summary:
The destructor was not properly implement. Let's use the generic one
from Resource.

Test case is adjusted to verify that the SlideInterface gets cleaned up.

Reviewers: #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D1713
2016-06-01 07:33:43 +02:00
Martin Gräßlin
1f48daea1e [server] Don't destroy ShadowInterface when SurfaceInterface gets destroyed
Summary:
Unlike the other cases this one is not as dangerous as the shadow
protocol doesn't have a destructor request (yet).

Once that is added the problem would be the same: destroying the
ShadowInterface when the parent SurfaceInterface gets destroyed would
result in a protocol error on client side.

Reviewers: #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D1711
2016-06-01 07:33:12 +02:00
Martin Gräßlin
33e802913f [server] Don't destroy ServerSideDecorationInterface when parent SurfaceInterface is destroyed
Summary:
Destroying the ServerSideDecorationInterface on the server side before
the client has a chance to cleanup results in a protocol error:
wl_display@1: error 0: invalid object 7

Which would terminate the client. If we would not destroy the resource,
but only delete the ServerSideDecorationInterface it could result in
heap-use-after-free.

So just don't do anything, the client needs to cleanup which will result
in the ServerSideDecorationInterface being deleted.

Reviewers: #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D1710
2016-06-01 07:32:38 +02:00
Martin Gräßlin
5232dc5f0f [server] Don't destroy ContrastInterface when parent SurfaceInterface is destroyed
Summary:
Destroying the ContrastInterface on the server side before the client has
a chance to cleanup results in a protocol error:
wl_display@1: error 0: invalid object 7

Which would terminate the client. If we would not destroy the resource,
but only delete the ContrastInterface it could result in
heap-use-after-free.

So just don't do anything, the client needs to cleanup which will result
in the ContrastInterface being deleted.

Reviewers: #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D1709
2016-06-01 07:32:03 +02:00
Martin Gräßlin
3f1db0cfde [server] Don't destroy BlurInterface when parent SurfaceInterface is destroyed
Summary:
Destroying the BlurInterface on the server side before the client has a
chance to cleanup results in a protocol error:
wl_display@1: error 0: invalid object 7

Which would terminate the client. If we would not destroy the resource,
but only delete the BlurInterface it could result in heap-use-after-free.

So just don't do anything, the client needs to cleanup which will result
in the BlurInterface being deleted.

Reviewers: #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D1708
2016-06-01 07:31:25 +02:00
Bhavisha Dhruve
08bc189f8d Add support for touch events in fakeinput protocol and interface.
Summary:
This adds support for following in fakeinput interface:

- touch_down
- touch_motion
- touch_up
- touch_cancel
- touch_frame

Test Plan: added autotests passes

Reviewers: #plasma, bshah, graesslin

Reviewed By: #plasma, bshah, graesslin

Subscribers: bshah, graesslin, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D1672
2016-05-31 16:43:54 +05:30
Martin Gräßlin
aef650df51 [autotest] Prepare TestSlide for multiple test cases
Registry was not per test case, cleanup didn't clean up everything,
etc. Basically adding a second test case resulted in a crash.
2016-05-30 11:55:10 +02:00
Martin Gräßlin
b0b5e16667 [autotest] Prepare TestContrast for multiple test cases
Registry was not per test case, cleanup didn't clean up everything,
etc. Basically adding a second test case resulted in a crash.
2016-05-30 10:03:19 +02:00
Martin Gräßlin
08ef2642ba [autotest] Prepare TestBlur for multiple test cases
Registry was not per test case, cleanup didn't clean up everything,
etc. Basically adding a second test case resulted in a crash.
2016-05-30 09:49:38 +02:00
Martin Gräßlin
72f35fa7db [autotests] Try to stabialize TextInputTest::testEnterLeave
We saw it fail on build.kde.org a few times and it looks like a
entered spy gets triggered timing dependent (no surprise it's on
client side). So better check whether the entered spy got delivered
already and if not wait for the event.
2016-05-30 08:54:46 +02:00
Martin Gräßlin
ab98448fec [server] Standardize the destructor request handling for Resources
Summary:
This change standardizes the behavior regarding the destructor request.

The destructor should destroy the resource and nothing else. The
Wayland library invokes the static unbind method once the resource is
destroyed. The implementation provided by Resource::Private::unbind
triggers a delete later on the Resource. So there is no need to trigger
a deleteLater from the destructor request callback.

This change adds a generic implementation to Resource::Private which is
now used by all inheriting classes replacing the custom implementations.

Test Plan:
For a few Resources the test is extended to ensure that the Resource
gets deleted on server side.

Reviewers: #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D1679
2016-05-30 08:16:07 +02:00
Martin Gräßlin
908f86f299 [server] Don't destroy resource from dtor of a Resource sub class
Summary:
Not needed as the dtor of the Resource ensures that the wl_resource
gets destroyed.

Reviewers: #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D1680
2016-05-30 08:15:33 +02:00
Martin Gräßlin
a7d5013573 [autotest] Adjust Seat test for changes in 990e88ac
The text input change creates an additional serial, so the check
for last generated serial on the Display fails. The test is now
adjusted to the new semantics. A more reliable way would be to
verify the serial on the SeatInterface, though.
2016-05-25 15:32:59 +02:00
Martin Gräßlin
990e88ac1a Implement wl_text_input and zwp_text_input_v2 interfaces
Summary:
This change introduces support for text input. Text input allows to
compose text on the server (e.g. through a virtual keyboard) and sent
the composed text to the client.

There are multiple interfaces for text input. QtWayland 5.6 uses
wl_text_input, QtWayland 5.7 uses zwp_text_input_v2.

wl_text_input is from pre Wayland-Protocols times and considered as
UnstableV0 in this implementation. The other interface is UnstableV2.
Unfortunately the V2 variant is not yet part of Wayland-Protocols, but
used in Qt.

The implementation hides the different interfaces as good as possible.
The general idea is the same, the differences are rather minor.

This means changes to how interfaces are wrapped normally. On client
side in the Registry a manager is factored which represent either of
the two interfaces. Similar on the server side Display's factory method
takes an argument to decide which interface should be factored. This
way a user of the library can expose both interfaces and thus be
compatible with Qt 5.6 and Qt 5.7 onwards.

Reviewers: #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D1631
2016-05-25 15:10:42 +02:00
Martin Gräßlin
1834dde31a [autotest] Further tries on hardening the TestWaylandOutputDevice
* add event queue to the registry
* in testId ensure that the signal spy catches the right signal
2016-05-25 14:03:02 +02:00
Martin Gräßlin
5e8bffbdfc [autotest] Harden TestWaylandOutputDevice against random failures
This change ensures that Registry has processed all events before
continueing with the further processing.
2016-05-25 13:42:26 +02:00
Martin Gräßlin
d1a09838e1 [server] Prevent double delete of callback resources in SurfaceInterface
Summary:
When destroying a SurfaceInterface all callbacks are getting destroyed.
This used to iterate over the callbacks and performing
wl_resource_destroy on them. This triggered the destroy handler which
removes the resource from the callback list. Which means removing from
the list we are iterating on. This could result in a double delete or
accessing invalid memory.

This change copies all callbacks to a temporary list and clears the
normal lists. So the destroy handler does no longer modify the lists
currently being iterated on.

Test Plan: Added a test case which crashed with previous code

Reviewers: #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D1677
2016-05-25 09:03:10 +02:00
Martin Gräßlin
46cf9fc36c [server] Add resource nullptr check to ShellSurfaceInterface
The ShellSurface might have the resource destroyed, before being deleted,
so there is a short time frame where resource might be null.

Crash was caught by KWin.

Reviewed-By: sebas and notmart
2016-05-23 14:20:54 +02:00
Martin Gräßlin
5f5dbc5155 [server] Compare ClientConnection instead of wl_client in SeatInterface
A downstream KWin test shows a possible heap-use-after-free if we
access the wl_client pointer. Basically we get the client disconnected
just before the focused surface gets unbind. Thus for a short moment
the ClientConnection pointer is gone. This needs to be extended with
a test case, but for the moment it should be good enough to get KWin
green again.
2016-05-23 10:43:45 +02:00
Martin Gräßlin
f4f2725132 [server] Improve the handling when clients disconnect
Summary:
So far the server component performed manual cleanup in some cases
when a client disconnects. But this is not needed: the Wayland library
calls the static unbind methods which do cleanup. If we cleanup ourselves
this can result in double deletes in the worst case, so let's only use
the Wayland functionality.

Adjusted:
* RegionInterface
* SurfaceInterface
* ShellSurfaceInterface (doesn't take a parent anymore)
* DpmsInterface
* QtSurfaceExtensionInterface
* KeyboardInterface
* PointerInterface
* TouchInterface
* DataOfferInterface
* PlasmaShellSurfaceInterface

For each adjusted case a test case is added to verify that the cleanup
works. Exceptions are DpmsInterface as the actual Resource is not exposed
at all in the Server component and DataOfferInterface as that is server
side created.

Reviewers: #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D1640
2016-05-19 16:21:27 +02:00
Martin Gräßlin
81f3a7d2e5 [autotests] Longer wait in TestWaylandOutputDevice::testId
Looks like the wait of 200 msec failed on build.kde.org and thus
triggered a heap-use-after-free.
2016-05-18 08:30:44 +02:00
Martin Gräßlin
b70402bec7 [autotest] Further try to make TestWaylandOutputDevice more robust
Following the idea from f99492a616
to add more done signal spies instead of changed.
2016-05-18 08:18:53 +02:00
Martin Gräßlin
ffb91b031c [autotest] Try to make TestWaylandOutputDevice::testEnabled more stable
The test failed on build.kde.org. Let's try to make the part which failed
more robust.
2016-05-18 07:59:58 +02:00
Allen Winter
700d519476 server/plasmawindowmanagement_interface.cpp - fix -Wreorder warning 2016-05-17 16:24:44 -04:00
Martin Gräßlin
f99492a616 [autotest] Try to make TestWaylandOutputDevice a little bit more robust
From time to time the test is failing on build.kde.org with an ASAN
heap-use-after-free error. From my investigation this seems to be caused
by the OutputDevice being constructed on the stack and being destroyed
while handling Wayland events, but before all are handled.

The test mostly operates on the changed signal. There is also a done
signal emitted later on. Wayland sends the done after a set of changes
is transmitted. Thus the test is adjusted to wait for done instead of
changed. So we can ensure that all events are handled before the object
gets destroyed.

I have never been able to reproduce the problem locally, so I cannot
guarantee that the issue is solved for good. If it still happens more
investigation will be needed.
2016-05-17 13:36:56 +02:00
Martin Gräßlin
32eae0863c [client] Add context pointer to connects in PlasmaWindowModel
Summary:
When the model gets destroyed the lambda connections were still invoked
and could cause crashers.

Test Plan: Test case added and each one verified that it crashed

Reviewers: #plasma, hein

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D1624
2016-05-17 12:47:14 +02:00
Martin Gräßlin
3fda8376b6 [client] Ensure PlasmaWindowModel removes deleted windows
Summary:
There is a possibility that a PlasmaWindow is unmapped when the
PlasmaWindowModel gets created. In this situation the unmapped
PlasmaWindow will be deleted in the next event cycle. So far
PlasmaWindowModel didn't handle this situation and the model might
hold deleted objects due to this.

This change addresses this potential problem and ensures the model
gets updated when a PlasmaWindow is deleted.

Test Plan: Test case which exposes the problem is added

Reviewers: #plasma, hein

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D1622
2016-05-17 12:42:34 +02:00
Martin Gräßlin
2c5bc69d1d [client] Ensure PlasmaWindowManagement updates active window if it goes away
Summary:
So far when the active PlasmaWindow got unmapped or destroyed, the
PlasmaWindowManagement didn't update the activeWindow. This means it
could expose a deleted object through it's API which could result in
a crash.

This change addresses the problem by updating the active window when
a window gets unmapped or destroyed.

Test Plan: Tests added which exposed the problem

Reviewers: #plasma, hein

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D1621
2016-05-17 09:02:10 +02:00
Martin Gräßlin
372955bf05 Improve the deconstruction of PlasmaWindows
Summary:
The protocol is extended by a dedicated destructor request. When a
PlasmaWindow is umapped we no longer destroy the resource directly,
but only send the unmap. The client is then supposed to clean up
(which it already did in that case) and will invoke the destructor.

The PlasmaWindowInterface object will be automatically deleted after
the unmap once all resources bound for it are destroyed.

The tests are extended by two new test cases which triggered protocol
errors on the client side prior to this change.

Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1594
2016-05-12 10:55:07 +02:00
Tobias C. Berner
f790973375 pid_t is defined in sys/types.h
Summary: To use pid_t one should include sys/types.h -- else the build fails on FreeBSD.

Reviewers: graesslin

Reviewed By: graesslin

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1579
2016-05-10 08:47:20 +02:00
Michael Pyne
3e6bc3621b Initialize Interface factory pointer to fix Coverity warning.
Coverity complains (in CID 1335150) about `Generator::parseInterface()`
since the default copy-ctor for `Interface` will end up copying
uninitialized memory (the unset `m_factory` member). Fixed by
initializing the m_factory.

REVIEW:127836
2016-05-04 21:14:07 -04:00
Allen Winter
c306d60d8f compiler warnings--
REVIEW: 127810
2016-05-02 09:53:12 -04:00
Martin Gräßlin
f2406ffec5 Version 5.7 becomes version 5.22
With KWayland becoming a framework the next version is going to be 5.22.
2016-04-27 07:43:43 +02:00
Eike Hein
ffdd37370b Add missing data role for closable state.
Summary:
Exposes closable state in the window model and adds tests. This was
included in the protocol and interface, but missing from the model.

Test Plan: Autotest extended.

Reviewers: graesslin

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1435
2016-04-21 19:46:54 +09:00
Eike Hein
9d3cea7092 Add a virtual_desktop_changable state to the window protocol.
Summary:
Analogous to NET::ActionChangeDesktop.

KWindowInfo::actionSupported(NET::ActionChangeDesktop) is hardcoded
to return true in kwin, but that's not how it should be; as this will
be fixed later the Wayland protocol needs this state bit as well for
parity.

Test Plan: PlasmaWindowModel test is extended.

Reviewers: graesslin

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1448
2016-04-20 01:16:35 +09:00
Eike Hein
90e80a548c Add states and request methods for move and resize.
Summary:
Adds states and request methods to determine whether a window can be put into
move or resize modes, and request move and resize modes, respectively.

request* naming pre-discussed with Martin. I chose to add *Mode to be more
explicit as well as avoid namespace conflicts with possible other Move/Resize
methods in the future.

Since these are not toggleable states, there is no requestToggle* methods.

Protocol version is not bumped (also pre-discussed with Martin) since we have
pending changes already bumping to 3.

Depends on D1417.

Test Plan: PlasmaWindowModel test extended.

Reviewers: graesslin

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1432
2016-04-19 20:50:28 +09:00
Eike Hein
f47e2f7b31 Switch to naming suggested by native speakers. 2016-04-19 18:40:57 +09:00
Eike Hein
dcc9c00ce5 Add API version info; fix references to protocol version. 2016-04-15 21:10:37 +09:00
Eike Hein
d812978f1c Add window shade support to protocol, interfaces and test.
Summary:
This adds support for 'shadable' and 'shaded' states to the protocol and
to the client and server classes, as well as the window model.

Test Plan: The PlasmaWindowModel test has been extended to test the new states.

Reviewers: graesslin

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1417
2016-04-15 20:39:14 +09:00
Martin Gräßlin
a41f18edfd [autotest] Add test for PlasmaWindowModel
Reviewers: #plasma, hein

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1409
2016-04-14 17:23:24 +02:00
Martin Gräßlin
67f5d375cc [autotest] Extend test to verify the code which handles buffer deletions
Summary:
Surface/SubSurface and Shadow handle the case that an attached buffer
gets destroyed by the client. So far we didn't have this code covered,
but it's rather important as incorrect reference counting can hit
asserts.

Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1403
2016-04-13 16:10:41 +02:00
Martin Gräßlin
c5a16a535d [autotest] Add a test case for QtSurfaceExtensionInterface
Summary:
KWayland does not have a client implementation of the QtSurfaceExtension
protocol. Thus the test is different: it starts a helper binary which
creates a QWindow. The test closes that one which should terminate the
started applications.

Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1388
2016-04-13 14:20:48 +02:00
Martin Gräßlin
9e3cd3bf7b [autotests] Add test case for FakeInputInterface
Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1400
2016-04-13 13:04:21 +02:00
Martin Gräßlin
9c10316991 [autotest] Add a test case for the shadow interface
Summary:
Basic functionality is covered. Changing of shadow elements not covered,
there seems to be lacking server API for that - no change signal.

Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1398
2016-04-13 09:59:23 +02:00
Martin Gräßlin
6e4391d01b [autotest] Add a test case for Idle interface
Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1389
2016-04-12 11:40:52 +02:00
Martin Gräßlin
194e359b9d [autotest] Extend tests for Dpms modes
Summary:
Now also tests:
* requesting mode from client side
* update supported change on server side

Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1357
2016-04-08 11:43:35 +02:00
Martin Gräßlin
6fe14f73d2 [server] Pass keyboard focus to child surface on pointer click
If the focused pointer and keyboard surface is the same we use pointer
clicks as a hint to which child surface should have keyboard focus.

Keyboard focus handling for sub surfaces is rather limited overall.
We just don't have a good model on how to determine which child surface
should get the keyboard focus. When passing focus to a surface there
is no way to know which of the sub-surfaces should get the focus.
Ideally the client should handle this, but that's just not the case.

The best we have is a reference through the pointer. But that's of
course also limited. Keyboard focus passed to the surface for another
reason (Alt+Tab) cannot select the proper sub-surface without interaction
from another input device.

Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1330
2016-04-07 07:57:00 +02:00
Martin Gräßlin
2066d9bc17 [server] Split KeyboardInterface::Private into dedicated header 2016-04-06 11:36:03 +02:00
Martin Gräßlin
031abb9722 [server] Split PoointerInterface::Private into dedicated header 2016-04-06 11:27:42 +02:00
Martin Gräßlin
84a1d5eadc [server] Support sub-surfaces from PointerInterface
Summary:
The idea behind this change is to make the existance of sub-surfaces
an implementation detail for pointer events. The user of the library
does not need to care about on which sub-surface the pointer is on.
It only needs to care about the main surface and passes the focus to
the main surface.

Internally the PointerInterface takes care of sending the enter to
the sub-surface at the current pointer position. Also whenever the
pointer position changes, the PointerInterface evaluates whether it
triggered a change for the focused sub-surface and sends enter/leave
events accordingly. If the focused sub-surface does not change, it
sends motion events as normally, but of course under consideration
of the sub-surface position.

Overall this means that from pointer usage perspective a user of the
library doesn't need to care about the fact that there are sub-surfaces
at all. The library does the correct thing for it.

Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1329
2016-04-06 09:58:30 +02:00
Martin Gräßlin
37851e2e08 [server] Add a method SurfaceInterface::surfaceAt(const QPointF&) -> SurfaceInterface*
Summary:
The new method returns the (child) surface at a given surface position
taking care of stacking order, whether surfaces are mapped, etc.

Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1319
2016-04-05 14:29:21 +02:00
Martin Gräßlin
a2a888bc76 [server] Add damage tracking feature to SurfaceInterface
Summary:
This change introduces a damage tracking feature in SurfaceInterface.
So far the SurfaceInterface only exposes the damage compared to the
last attached buffer. But this is not always usefull for the user of
the library. E.g. if:
* server renders
* client damages buffer and commits
* client damages buffer and commits
* server wants render

In this situation the last damage information is not helpful to the
user of the library. It would need the combined damage information over
all attached buffers.

The new API combines the damage of the two commits in the example above.
The user of the library can then call resetTrackedDamage once it
processed the current damage (e.g. by updating the OpenGL texture).

Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1281
2016-04-04 08:59:27 +02:00
Martin Gräßlin
d727d2e477 [server] Workaround for QtWayland bug https://bugreports.qt.io/browse/QTBUG-52192
Summary:
QtWayland doesn't map the parent sub-surfaces in a sub-surface tree.
According to the spec this would mean also the child sub-surface is not
mapped. But being strict according to the spec will make applications
like SystemSettings fail badly. Embedded child windows will not be
rendered and QtWayland is going to hard freeze. This is not acceptable,
thus we need to workaround this QtWayland bug till it's fixed.

It's worth mentioning that Weston as the reference compositor also
doesn't handle this situation according to spec and renders the
sub-surface. See https://bugs.freedesktop.org/show_bug.cgi?id=94735

The difficult part for the workaround is to determine whether a surface
should be considered unmapped. E.g. when the parent gets unmapped we need
to really unmap it. But what's the difference between an unmapped parent
surface which should be considered mapped and an unmapped parent surface
which should be considered unmapped?

The implementation goes with considering a new sub-surface always as
mapped - independently of whether it ever got a buffer attached. As soon
as it had a buffer attached and it gets unmapped again, it will go back
to a standard conform way.

The behavior now is not standard conform, thus the autotest is adjusted
to have QEXPECT_FAIL for the now no longer standard conform areas.

Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1250
2016-04-04 08:55:59 +02:00
Martin Gräßlin
7053e4fce6 [server] Don't emit unmapped if the Surface wasn't mapped
Summary:
If a Surface doesn't have a buffer attached and a null buffer gets
attached the buffer state doesn't really change. Thus neither the
unmapped signal nor the damaged signal should not be emitted.

Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1261
2016-04-04 08:55:17 +02:00
Martin Gräßlin
e616ade18e [autotest] Add test case for mapping/unmapping surfaces in a sub-surface tree
Summary:
New test case which verifies the behavior when a surface is considered
mapped or unmapped in a sub-surface tree.

Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1248
2016-04-04 08:54:31 +02:00
Hrvoje Senjan
cce8090787 Fix compilation with gcc 4.8
Reviewers: graesslin

Reviewed By: graesslin

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1237
2016-03-29 16:33:44 +02:00
Martin Gräßlin
d44b2ee30d [server] Add a convenient method to check whether a Surface is mapped
Summary:
In a SubSurface tree a Surface is only considered mapped if the Surface
has a buffer applied and the parent Surface is mapped.

The added method implements this check. It's useful for the compositor
to easily check this condition as it allows to easily figure out whether
a SubSurface needs to be rendered and it's also useful for implementing
the input handling as a not mapped sub-surface should not get any input
events.

Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1247
2016-03-29 12:08:10 +02:00
Martin Gräßlin
0551a39ab6 [server] Apply position change directly for desync sub-surfaces
Summary:
This is a workaround for https://bugreports.qt.io/browse/QTBUG-52118

It should take effect whenever the parent surface's state is applied,
but QtWayland never commits the parent surface. Thus the position is
always wrong.

Having a workaround for that in our server code is not good, but better
than completely broken applications such as Systemsettings.

Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1212
2016-03-24 16:11:48 +01:00
Martin Gräßlin
6d529abf8e [server] Remove sub-surface from parent when it's surface is destroyed
Summary:
From spec:
If the wl_surface associated with the wl_subsurface is destroyed,
the wl_subsurface object becomes inert. Note, that destroying either
object takes effect immediately.

Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1211
2016-03-24 16:05:00 +01:00
Martin Gräßlin
37f65cf186 [server] Add const variants to methods in SubSurfaceInterface
Summary: Fixes errors in API of methods which should be const not being const.

Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1214
2016-03-24 15:59:56 +01:00
Martin Gräßlin
04ccf04596 [server] Add a workaround for a freeze in QtWayland
Summary:
See: https://bugreports.qt.io/browse/QTBUG-52092

Freeze happens if a sub-surface is rendered to before the main surface
is rendered. The compositor has no chance to know that this is a window
which needs to be rendered, thus the application might freeze without
ever becoming visible.

Famous example applications being affected: all kcms with a nested
QQuickView. E.g.: kcmshell5 kwineffects

Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1208
2016-03-23 17:04:26 +01:00
Martin Gräßlin
84118fad13 [server] Add method to get to the main surface from a sub surface
Summary:
Recursively go up to the main surface, that is the top level surface
which doesn't have a parent.

This is useful to know to which surface tree a sub-surface belongs to.

Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1207
2016-03-23 17:01:14 +01:00
Martin Gräßlin
bfc94ce985 [server] Improve variable naming
transformFactorChanged -> transforChanged. It's not a factor.

Reviewed-By: sebas
2016-03-23 14:34:51 +01:00
Martin Gräßlin
610fbc672f [server] Don't double buffer adding/removing of sub-surfaces
QtWayland doesn't commit the parent surface when creating a sub-surface.
This results in a QtWayland application to freeze as it renders to the
surface and waits for the frame rendered, which it will never get as the
Compositor waits for the commit on the parent prior to mapping the
sub-surface.

To work around this behavior, we apply the adding/removing directly.
The behavior around this is actually not fully documented, so QtWayland
is not wrong per se. See:

https://lists.freedesktop.org/archives/wayland-devel/2016-March/027540.html

Once this is properly clarified and implemented in the Client, we should
revert this change.

Differential Revision: https://phabricator.kde.org/D1191
2016-03-23 14:21:29 +01:00
Martin Gräßlin
263e5d7969 [server] Add a subSurfaceTreeChanged signal to SurfaceInterface
The idea behind this signal is to notify whenever the tree of sub
surfaces changes in a way that a repaint of the Surface is required.
Possible situations are:
* surface damaged
* surface unmapped
* subsurface added/removed
* subsurface moved (position changed)
* subsurface stacking changed

Ideally it would be possible to provide the actual area which needs
repainting, but due to the possible complexity of the tree, synced
and desynced changes this doesn't look worth the effort. A user of
the signal might trigger too many repaints with it, but if it really
wants to be only notified about the actual changes, it can just track
the individual sub-surfaces.
2016-03-23 14:20:26 +01:00
Martin Gräßlin
b7f470e51b [server] Cache the state of synchronized sub surfaces
When committing the state of a sub-surface, the state should not
be immediately applied if the sub-surface is in synchronized mode.
Instead it should be cached and only applied after the parent surface's
state is applied.

To implement this the Surface::Private has now a third cached state
buffer. When committing the state is either swapped between pending and
current or pending and subSurfacePending. Once the parent state is
applied the state is swapped between subSurfacePending and current.

The logic for applying state changes is changed. Instead of copying the
complete state object, the individual state changes are now copied and the
source gets completely reset to default values. Only the children tree is
copied back, as that list needs to be modified.
2016-03-23 14:20:26 +01:00
Martin Gräßlin
8323d217a6 [server] Add a bool SubSurfaceInterface::isSynchronized() const
The mode is not sufficient to determine whether a SubSurface is in
synchronized mode.

Quoting spec:
"Even if a sub-surface is in desynchronized mode, it will behave as in
synchronized mode, if its parent surface behaves as in synchronized mode.
This rule is applied recursively throughout the tree of surfaces.
This means, that one can set a sub-surface into synchronized mode, and
then assume that all its child and grand-child sub-surfaces are
synchronized, too, without explicitly setting them."
2016-03-21 16:03:31 +01:00
Martin Gräßlin
05993458e2 [server] Send frameRendered to all sub-surfaces
If a surface got rendered it implies that all sub-surfaces also got
rendered. So pass the frameRendered to the complete sub-surface tree.
2016-03-21 16:03:31 +01: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
35e50175fd [client] Add setScale to Surface
Summary:
The wrapper for wl_surface::set_buffer_scale was still missing.
Main reason for implementation is the need for the added auto-test.

Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1188
2016-03-21 15:59:23 +01:00
Martin Gräßlin
09176d06b6 Merge branch 'Plasma/5.6' 2016-03-15 11:01:31 +01:00
Martin Gräßlin
5295d9d330 [server] Add more Q_DECLARE_METATYPE
For some types used in signals.
2016-03-15 10:59:08 +01:00
Martin Gräßlin
3d1b068da9 Merge branch 'Plasma/5.6' 2016-03-12 12:30:27 +01:00
Martin Gräßlin
31435417fd Add a default mode event to ServerSideDecorationManager
Summary:
The ServerSideDecorationManager gains a new event which gets sent
to the client when it binds the manager. The event indicates the
default server decoration mode used by the server. This allows the
client to know the decoration mode when it creates a decoration and
thus does not need to roundtrip to the server to get the mode.

Reviewers: #plasma, sebas

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1129
2016-03-12 12:29:31 +01:00
Martin Gräßlin
eab2ed8106 Merge branch 'Plasma/5.6' 2016-03-09 16:21:12 +01:00
Martin Gräßlin
1d8319cb3b [server] Default initialize the role of a PlasmaShellSurface
We want Normal as default and not a random value.
2016-03-09 16:19:33 +01:00
Martin Gräßlin
e3dc783548 [autotests] Add test case for PlasmaShellSurface setting role 2016-03-09 16:17:01 +01:00
Martin Gräßlin
aa2cc874e2 [server] Declare metatype for KWayland::Server::PlasmaShellSurfaceInterface::Role 2016-03-09 16:16:29 +01:00
Martin Gräßlin
fb6256dc48 [client] Add support for drag'n'drop
DataDevice exposes new methods to get the DataOffer provided through
drag'n'drop and also signals to indicate the various changes on the
DataDevice during drag'n'drop.

This allows to add a first basic auto test for the drag'n'drop
functionality covering both server and client side.
2016-03-03 09:47:12 +01:00
Martin Gräßlin
23a719c8af [server] Implement support for drag'n'drop through pointer device
Summary:
How drag'n'drop works on Wayland:
When a surface has a pointer grab and a button pressed on the surface
(implicit grab) the client can initiate a drag'n'drop operation on the
data device. For this the client needs to provide a data source
describing the data to be transmitted with the drag'n'drop operation.

When a drag'n'drop operation is active all pointer events are interpreted
as part of the drag'n'drop operation, the pointer device is grabbed.
Pointer events are no longer sent to the focused pointer but to the
focused data device. When the pointer moves to another surface an
enter event is sent to a data device for that surface and a leave
event is sent to the data device previously focused. An enter event
carries a data offer which is created from the data source for the
operation.

During pointer motion there is a feedback mechanism. The data offer
can signal to the data source that it can or cannot accept the data
at the current pointer position. This can be used by the client being
dragged from to update the cursor.

The drag'n'drop operation ends with the implicit grab being removed,
that is the pressed pointer button which triggered the operation gets
released. The server sends a drop event to the focused data device.

The data transfer can now be started. For that the receiving client
creates a pipe and passes the file descriptor through the data offer
to the sending data source. The sending client will write into the
file descriptor and close it to finish the transfer.

Drag'n'drop could also be initiated through a touch device grab, but
this is not yet implemented.

The implementation in this change focuses on the adjustments for pointer.
For the user of the library drag'n'drop is implemented in the
SeatInterface. Signals are emitted whenever drag is started or ended.
The interaction for pointer events hardly changes. Motion, button press
and button release can still be indicated in the same way. If a button
release removes the implicit grab the drop is automatically performed,
without the user of the library having to do anything.

The only change during drag and drop for the library user is that
setFocusedPointerSurface is blocked. To update the current drag target
the library user should use setDragTarget. Sending the enter/leave to the
data device gets performed automatically.

The data device which triggered the drag and drop operation is exposed
in the SeatInterface. The user of the library should make sure to render
the additional drag icon provided on the data device. At least QtWayland
based applications will freeze during drag and drop if the icon doesn't
get rendered.

The implementation is currently still lacking the client side and due to
that also auto test. It's currently only tested with QtWayland clients.

Reviewers: #plasma, sebas

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1046
2016-03-02 08:18:41 +01:00
Martin Gräßlin
eff6a69544 [autotest] Fix crash in TestWindowManagement::cleanup
Didn't delete the m_windowManagement causing a crash on teardown.
2016-03-02 08:16:23 +01:00
Martin Gräßlin
b6cea86610 [server] Properly initialize Cursor
Summary:
The Cursor wasn't properly initialized. E.g. the damage signal didn't
get connected resulting in the server not noticing when the cursor
changes. The damage only got connected if a new cursor got instelled by
the client on the same pointer.

This change ensures that the Cursor is properly initialized by calling
into the same method as when the cursor changed.

The tests are extended by a new test case for damaging the surface.

Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1022
2016-02-24 16:50:05 +01:00
Martin Gräßlin
b6b22da591 [server] Add a signal SeatInterface::focusedPointerChanged
Summary:
The signal gets emitted whenever the focused PointerInterfaces gets
newly set or reset to nullptr. This is needed to better track the
current cursor image in the compositor.

Reviewers: #plasma, sebas

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1007
2016-02-22 14:56:42 +01:00
Martin Gräßlin
0c3c71428e [server] Only send modifiers to client if they actually changed 2016-02-19 11:41:08 +01:00
Martin Gräßlin
565c832d39 [server] Expose executable path in ClientConnection
Summary: Convenient API to get the absolute executable path for the pid.

Reviewers: sebas, mart

Subscribers: plasma-devel

Differential Revision: https://phabricator.kde.org/D858
2016-01-25 10:56:16 +01:00
Martin Gräßlin
f51038c2b4 Add .arcconfig 2016-01-25 10:53:57 +01:00
Martin Gräßlin
4f8f9849f9 [autotest] Add tests for ServerSideDecoration protocol
REVIEW: 126301
2015-12-17 13:29:38 +01:00
Martin Gräßlin
d2f01dbbbe [server] Add implementation for server side decoration protocol 2015-12-17 13:29:38 +01:00
Martin Gräßlin
07c36644a2 Add protocol for server side decoration 2015-12-17 13:29:38 +01:00
Sebastian Kügler
18458d3252 fix OutputDevice::edid()
This patch transports the EDID data base64-encoded over the wire.

Apparently, we can't just send random QByteArrays as "strings" over, it
has to be encoded and decoded. So...

* base64-encode the data before sending to the client
* base64-decode it on the client side
* document the above, fix documentation woes in the xml definition
* change test accordingly

The test data used was actually invalid, it's a base64 string of the
actual data, so fix the tests (which actually breaks it), and encode on
the server-side and decode on the client side.

REVIEW:126380
2015-12-16 13:57:10 +01:00
Martin Gräßlin
042896a755 [server] Add Display::seats() -> QVector<SeatInterface*>
Similar to OutputInterfaces we can have multiple SeatInterfaces so
expose a way to get to all SeatInterfaces.

REVIEW: 126364
2015-12-15 15:49:12 +01:00
Martin Gräßlin
9d40118f23 [server] Add support for pointer input transformation
So far we only supported mapping global to surface-local coordinates
using a 2D-offset. With this change it's possible to register a
QMatrix4x4 to describe the transformation for going from global to
surface-local coordinates in a full 3D space.

The existing 2D-offset is transformed to use the new matrix based
variant describing a translation.

REVIEW: 126271
2015-12-08 14:15:27 +01:00
Martin Gräßlin
d96319b23d [server] Minimum supported idle timeout is 5 sec
A system isn't idle by definition below 5 sec. Before it's not possible
to properly determine whether the user is still interacting with the
system or not. Thus such a short timeout is not sufficient to determine
whether the system is idle.

Furthermore allowing short timeouts like 1 msec can be used to gather
information from the system. It would allow to reconstruct the timestamp
changes on the seat very reliable, which we do not want a Client to know.

And also this can be used to get events on each key press and key release
and the time between each of the events. This can be used to gather
statistics which would in worst case allow to reconstruct what the user
is typing. Determining where a word starts and ends should be relatively
straight forward if you know the timing. With the length of the word and
the statistics of alphabetic distribution it becomes possible to
reconstruct some words. And also individual letters. With enough
statistic and some known words one can determine how long it takes to
press a certain letter. At that point the idle interface would be a
keylogger.

To prevent such attacks the timestamp is now modified to be at least
5 sec. Why 5 sec? Because it's the smallest timestamp used in the
KIdleTime example application which I do not want to break.
5 sec are long enough to destroy this possible attack.

REVIEW: 126220
2015-12-08 14:15:08 +01:00
Martin Gräßlin
8748ef5199 [autotests] Declare metatype for Qt::Edges
Seems to fail compiling with Qt 5.4, so better fix it.
2015-12-02 09:16:54 +01:00
Martin Gräßlin
fc37f1a9eb [tests] Use QCoreApplication for ShadowTest 2015-11-18 10:21:36 +01:00
Martin Gräßlin
799d11fdb7 [tests] Add a shadow test application 2015-11-18 09:58:19 +01:00
Martin Gräßlin
9558edb96d [server] Fix possible crash after deleting an output(device)interface
After deleting an OutputInterface the resources are not necessarily
destroyed, so unbind might still be called. The existing code just
casted the resource's user data which could then point to invalidated
memory.

This change verifies that we still have a Private* for the resource.
If not, it doesn't have to do any cleanup anyway.

REVIEW: 126097
2015-11-17 16:37:01 +01:00
Martin Gräßlin
a28b9ee1e3 [autotests] Delete connection in thread in TestWindowmanagement
If that fixes the ASAN error, we should do it in all tests.
2015-11-11 09:03:42 +01:00
Martin Gräßlin
d72188130f [autotests] Use QStringLiteral for TestWindowManagement::testWindowTitle 2015-11-11 08:52:37 +01:00
Martin Gräßlin
65a79d98da [autotests] Switch all tests to GUILESS_MAIN 2015-11-11 08:36:31 +01:00
Martin Gräßlin
9297ce9c5a [autotests/client] Use GUILESS_MAIN for TestWindowManagement 2015-11-11 08:31:04 +01:00
Martin Gräßlin
5fe6365faa Fix build
How did that happen? I run the autotest...
2015-11-10 15:07:44 +01:00
Martin Gräßlin
67c45c1a4b [autotests] Destroy a created ClientConnection 2015-11-10 14:51:41 +01:00
Martin Gräßlin
868282fb08 [server] Add a convenient ClientConnection::destroy
Wrapper around wl_client_destroy. In case the ClientConnection got
created through Display::createClient we need to destroy the
ClientConnection again. The exiting client will not cause it to be
destroyed.

Reviewed-By: Bhushan Shah
2015-11-10 13:31:47 +01:00
Martin Gräßlin
f19fedb0f6 [autotests] Cleanup surface handling in TestWindowManagement
For some reason two surfaces were created and the surface not cleaned
up before the connection thread exits.

This caused ASAN to complain.
2015-11-09 09:40:58 +01:00
Marco Martin
2867b84101 address last comments of review 125871 2015-11-04 17:33:36 +01:00
Sebastian Kügler
29a4f496cf Add new interfaces to mapping file
REVIEW:125942
2015-11-04 15:43:26 +01:00
Sebastian Kügler
51ad392378 Autotests for outputmanagement and outputdevices protocols
REVIEW:125942
2015-11-04 15:38:41 +01:00
Sebastian Kügler
461e37d65e server side of new outputmanagement protocol
This implements the server part of the screen management protocol. The
protocol is implemented as a wayland protocol.

It provides the following mechanisms:
- a list of outputs, close to wl_output, with additional properties for
  enabled, uuid, edid, etc.. These OutputDevices correspond to a
  connected output that can be enabled by the compositor, but is not
  necessarily currently used for rendering.
- a global OutputManagement, which allows creating config objects, one
  per client. The client can make changes to the outputs through
  setScale(outputdevice*, scale) for example.
- an OutputConfiguration resource, that can be handed to a client and
  used for configuration. Changes are double buffered here. Only after
  OutputConfiguration.apply() has been called, the changes are relayed
  over the global OutputManagement.

The compositor is responsible to handle changes.

For a more detailed description, see the API docs in especially
outputconfiguration.h.

REVIEW:125942
2015-11-04 15:36:52 +01:00
Martin Gräßlin
219b1b755c [server] Flush client after sending a frameRendered callback 2015-11-04 14:50:15 +01:00
Marco Martin
df22d2ac31 add a static PlasmaShellSurfaceInterface::get(wl_resource*)
to get the associated plasmashell surface from anywhere having
the associated resource
2015-11-04 13:21:37 +01:00
Marco Martin
72316718df task geometries to wayland for minimize effect
this exposes the geometry of taskbar entries in
plasma-windowmanagement, in order to make the
minimize effects possible.
unlike on X11, it takes relative positions and
it has one geometry per panel, making possible
to have multiple taskbars working.
REVIEW:125871
2015-11-04 13:16:50 +01:00
Martin Gräßlin
79f410263b Support request resizing on ShellSurface
Implemented in both client and server side.

REVIEW: 125836
2015-10-29 10:24:58 +01:00
Martin Gräßlin
c72313be16 Support request moving on ShellSurface
Implemented in both client and server side.

REVIEW: 125828
2015-10-29 10:24:48 +01:00
Martin Gräßlin
8f7893b385 [server] Add support for flags on transient ShellSurfaceInterface
A transient surface can indicate through the flags that it does not
want to accept keyboard focus. This is now exposed through a dedicated
method.

REVIEW: 125552
2015-10-08 12:48:08 +02:00
Martin Gräßlin
65444264a9 [server] ShellSurface's transient is a dedicated mode
So far transient was a mutual exclusive mode causing a transient window
to not be able to be fullscreen. This seems wrong. Let's have transient
still as a dedicated mode allowing the window to be maximized and/or
fullscreen. Only popup stays a dedicated mode.

REVIEW: 125468
2015-10-01 10:54:31 +02:00
Marco Martin
27667222a4 introduce SkipTaskbar
support the skipTaskbar property in the window model
that property is set client side by
PlasmaShell::setSkipTaskbar
REVIEW:125453
2015-09-30 16:52:57 +02:00
Marco Martin
ac4ef26990 fake a movement before sending a click
this makes the touch to mouse clicks mapping for xwayland
clients be a bit more reliable in accepting and correctly managing events
2015-09-28 15:18:19 +02:00
Martin Gräßlin
7021be3ae2 Add Mainpage.dox to triggeri apidocs generation 2015-09-19 17:16:54 +02:00
Martin Gräßlin
efaa5c5233 [tools] Simulate a panel tooltip
On entered on the panel window we show a tooltip at the entered
position and make it follow the mouse.
2015-09-17 11:50:01 +02:00
Sebastian Kügler
239e702f0f Fix Typo in Surface::inputIsInfitine
- add correctly named method
- forward the wrongly named one
- adjust autotests

REVIEW:125260
2015-09-16 16:45:09 +02:00
Martin Gräßlin
2bd8a8b98a Add support for transient to ShellSurface(Interface)
On client side a setTransient method is added which wraps the semantic
of wl_shell_surface_set_transient.

On server side both set_transient and set_popup are implemented, though
for popup only the transient part is implemented. In particular the grab
is not yet handled and also no popup done is provided.

For the transient on server side the flags are ignored. Main reason is
that Qt does not use the flag, so testing whether it works is tricky
(needs a test application).

REVIEW: 125223
2015-09-16 08:25:37 +02:00
Martin Gräßlin
265504a088 Increase version requirements for wl_data_device_release
* wl_data_device_manager -> version 2
* wl_data_device -> version 2
* Wayland -> version 1.7

Unfortunately the client side is not yet completely correct. We
need to call wl_data_device_release only if we have a data device
of version 2. But there is no easy way to test this. To change we
will need to introduce a client side version tracking.

BUG: 352663
2015-09-15 08:44:42 +02:00
Martin Gräßlin
38d155ff5e Fix typo 2015-09-10 16:32:45 +02:00
Martin Gräßlin
6ac9f402a0 [server] Add more documentation 2015-09-10 13:36:42 +02:00
Martin Gräßlin
4ea7f34564 [server] Less warnings please 2015-09-10 11:09:38 +02:00
Martin Gräßlin
71fd67cca7 [server] Move static methods into anonymous namespace 2015-09-10 09:45:31 +02:00
Martin Gräßlin
bbfdf3f72a [server] Make s_version a static member of private class
Follows a useful change added in the kwaylandScanner tool the
s_version becomes part of the Private class.

Also fixes the related generation in the tool.
2015-09-10 09:23:36 +02:00
Martin Gräßlin
b7e9ffdf06 [server] Install slide_interface.h
CCMAIL: notmart@gmail.com
2015-09-10 08:19:39 +02:00
Marco Martin
9a23a1c406 fix autotest 2015-09-09 18:24:08 +02:00
Martin Gräßlin
f789f9df7f Add documentation for the namespaces
This triggers Doxygen into generating the Namespace list, so that
we have a good separation of Client and Server documentation.
2015-09-09 18:16:02 +02:00
Sebastian Kügler
28df14c441 small fixes for kwaylandScanner
* fix initializer type -- was hardcoded, seems like an oversight
* add semicolons after class declarations -- one less thing to fix in the
  resulting code

REVIEW:125110
2015-09-09 17:52:43 +02:00
Martin Gräßlin
423f4e7c2f [autotests] Extend tests for Dpms
REVIEW: 125018
2015-09-09 17:47:36 +02: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
c4bf620253 [server] Add a DpmsManagerInterface
Adding support for a org_kde_kwin_dpms interface. On server side
Dpms is mostly bound to the OutputInterface exposing just a very
small manager. Whether Dpms is supported and which mode is used is
tracked directly on the OutputInterface.
2015-09-09 17:43:08 +02:00
Martin Gräßlin
9d6df1f92a [server] Add a static OutputInterface::get(wl_resource*)
Allows to retrieve the OutputInterface* for a given native wl_resource.
To support this we need to track the resources bound for each Output.
2015-09-09 17:42:19 +02:00
Marco Martin
4b9ee54d66 Interface for a Slide effect
a kwayland interface plus autotests for
the slide KWin effect, marks a window the direction
it wants to slide from and the offset from the screen edge
2015-09-09 17:37:36 +02:00
Martin Gräßlin
0676d53961 [server] Another round of docu improvements 2015-09-09 17:31:13 +02:00
Martin Gräßlin
5e3bb70612 Fix doxygen generation
Doxygen doesn't like our callback listener at all. We need to hide
it from doxygen, otherwise docu doesn't get generated.
2015-09-09 16:39:50 +02:00
Martin Gräßlin
30122f1e05 API doc improvements 2015-09-09 13:49:58 +02:00
Martin Gräßlin
a074f84cf1 Add dedicated destructor requests to blur and contrast interface
Better resource management.

REVIEW: 125114
2015-09-09 09:42:32 +02:00
Martin Gräßlin
dd5c39d2a6 Implement release for wl_data_device
Callback added to server and client calls release instead of destroy.
2015-09-09 09:34:51 +02:00
Martin Gräßlin
7cd58b27fa [server] Implement raise/lower in QtExtendedSurfaceInterface 2015-09-09 09:17:05 +02:00
Martin Gräßlin
cfd0227a01 Fix typos
REVIEW: 125100
2015-09-08 10:19:24 +02:00
Martin Gräßlin
f4091f4869 [tools] Generation of server boilerplate code 2015-09-07 14:50:37 +02:00
Martin Gräßlin
ecb5e64b67 [server] Clean up headers of BlurInterface and ContrastInterface
* remove unused forward declarations
* remove unused included
2015-09-07 10:56:34 +02:00
Martin Gräßlin
c93f6e84a6 [tools] Generate CamelCase request names and arguments 2015-09-07 10:46:27 +02:00
Martin Gräßlin
7a69d3cc40 [tools] Generate boiler plate of requests on client side
In the header for each request a method is created, with following
features:
* ignores requests working as destructor
* adjusts return type for requests containing newId
* adds QObject *parent = nullptr for requests containing newId
* adds the arguements
* turns arguments from wayland into Qt types

In the cpp the same logic is applied. Methods are not properly
implemented and won't compile in the case of returning.
2015-09-07 10:10:37 +02:00
Martin Gräßlin
7a52d15eca [tools] Generator can parse xml protocol description to generate code
* parses the protocol
* can derive file name to generate from protocol name
* detects which interface is a global and which one is referenced
* generates client code for global and for resource
* comes with a mapping.txt file to translate wl -> KWayland
2015-09-04 13:58:14 +02:00
Volker Krause
51018e8e38 compile 2015-09-03 18:40:04 +02:00
Marco Martin
b99f95e3e2 support OnScreenDisplay window type
plasmashell needs some of their windows as on screen display
ideally only the shell will be allowed to use them
REVIEW:125036
2015-09-03 18:16:26 +02:00
Marco Martin
47d7a79f9d add missing files for the contrast effect 2015-09-03 16:27:20 +02:00
Marco Martin
1f4beb0334 Wayland protocol for background contrast
new wayland protocol used to define regions behind a window
in which the kwin background contrast effect should be applied
REVIEW:125030
2015-09-03 16:12:23 +02:00
Martin Gräßlin
62ddb960c4 Add a small tool to generate the boilerplate for Wayland interfaces
The small tool added here allows to automate the process of generating
the boiler plate for an interface. Currently it's able to generate the
Client side code representing a wl_global.

The tool does not get installed, so run it from build directory:
Example usage:
./kwaylandScanner -c Foo -f foo -g wl_foo

This will generate a wrapper for the wl_foo interface in files:
foo.h and foo.cpp
The class is called KWayland::Client::Foo.

The tool will be extended. Following things are on the TODO list:
* parse xml to get the Wayland names
* add listener (if needed)
* generate code for Wayland interfaces representing Resources
* generate the Server boiler plate

CCMAIL: mart@kde.org
CCMAIL: sebas@kde.org
2015-09-03 11:58:15 +02:00
Martin Gräßlin
66838ccf33 Fix compiler warnings 2015-09-02 16:20:10 +02:00
Martin Gräßlin
8dc1e73f5d [server] Use WL_KEYBOARD_REPEAT_INFO_SINCE_VERSION 2015-09-02 16:14:16 +02:00
Martin Gräßlin
13bf4c9484 Implement repeat info on wl_keyboard protocol
* Raises wl_seat supported version to 4 in both server and client
* Raises wl_keyboard supported version to 4 in wl_keyboard
* wl_pointer and wl_touch are still on version 3
* Raises minimum Wayland version to 1.6
2015-09-02 16:04:14 +02:00
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
Martin Gräßlin
fd6ab581a1 [server] ServerSurface::get takes id and client
id is in client scope, thus we need to include the client as well.
2015-04-02 09:41:48 +02:00
Martin Gräßlin
a6eb193a33 Install new headers 2015-03-25 14:23:08 +01:00
Martin Gräßlin
41f5d246f6 Fix unused variable warnings
Thanks CI system for reporting them.
2015-03-25 13:46:29 +01:00
Martin Gräßlin
49b926e249 [server] Add support for touch events in SeatInterface 2015-03-25 13:31:38 +01: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
bfccb15d2f [server] Don't set a parent on BufferInterface
BufferInterface used to have a SurfaceInterface as parent. This could
result in easily hitting the abort condition that the BufferInterface
was still referenced when it gets deleted by just having one other
user referencing the BufferInterface.

There is no need to have the BufferInterface deleted when the
SurfaceInterface to which it belongs gets deleted. The BufferInterface
will get deleted once it's completely unreferenced and also has a
destroy listener.
2015-03-04 07:43:21 +01:00
Martin Gräßlin
33a37f99b7 [server] Add a size property to SurfaceInterface
Basically just wraps the size of the attached buffer. Convenience to
not have to go down to the Buffer to read the size.

TODO: apply buffer scale and transform.
2015-03-03 10:16:11 +01:00
Martin Gräßlin
846a4e1d79 [server] BufferInterface can resolve size through egl extension
Uses eglQueryWaylandBufferWL (if available) to determine the size of the
buffer. In order to do so, the server library links against egl (1) and
one needs to register the EGLDisplay in Server::Display by the user of
the library. For this a new method Display::setEglDisplay is added.

1: not using epoxy as it doesn't wrap the Wayland interfaces yet.
2015-03-03 09:43:30 +01:00
Martin Gräßlin
b95858e961 [server] Add BufferInterface::size and ::setSize
This provides the size of the shared memory buffer. For other buffers
the user unfortunately needs to set the size manually.
2015-03-02 14:11:15 +01:00
Martin Gräßlin
4a1888fd43 Add support for setting cursor on the Pointer
Methods on client side added and proper handling on server side.
2015-02-27 17:36:43 +01:00
Martin Gräßlin
ff33fcdbfa [server] Provide wl_resource *resource() in BufferInterface
We need to be able to access the wl_resource* to bind it to a texture.
2015-02-24 08:53:13 +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
aa6b502440 [server] Flush clients after sending Output information
Explictly flush the client after we send all output information on bind
and flush all clients after output changes.
2015-02-18 09:35:07 +01:00
Martin Gräßlin
16b26b2428 [server] Use eventDispatcher on currentThread instead of QCoreApplication
This allows to start the Wayland server before the QCoreApplication is
created with an eventDispatcher being installed through
QCoreApplication::setEventDispatcher.
2015-02-18 09:32:40 +01:00
Martin Gräßlin
97756ff872 [tests] Improve startup of Xwayland server
Instead of performing dispatchEvents for a hard coded number of
expected events from Xwayland, we use select on the pipe to figure
out whether Xwayland has started writing the display number. As long
as select does not indicate that the pipe is ready we need to dispatch
further events.
2015-02-16 14:32:58 +01:00
Martina Flöser
2b133eccfd Refactoring ShellSurfaceInterfaces window mode handling
Introduction of enum windowMode to replace the three dedicated boolean
variables.
2015-02-16 09:29:37 +01:00
Martin Gräßlin
775908e02c [server] Fix incorrect assert
Display::createShm is allowed to be called when the Display is not
yet running. E.g. while starting up for the Xwayland case.
2015-02-09 17:13:20 +01:00
Martin Gräßlin
1927c3a1ae [server] Add static SurfaceInterface *SurfaceInterface::get(quint32 id) 2015-02-09 14:33:50 +01:00
Martin Gräßlin
272904313b [server] Add quint32 Resource::id() const
Wrapper for wl_resource_get_id.
2015-02-09 14:33:50 +01:00
Martin Gräßlin
1d5a032803 Introduce categorized logging
New logging categories KWAYLAND_SERVER and KWAYLAND_CLIENT.
2015-01-20 09:42:26 +01:00
Martina Flöser
6f755bf680 Implementation of setToplevel on client side 2015-01-19 10:07:07 +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
21d652e993 [tests] Create Output before XWayland is started
This is required to get a proper size in the XWayland server.
Without an output the size is 0,0.
2015-01-07 13:20:04 +01:00
Martin Gräßlin
8d5e14ebfe [tests] Renderingservertest supports maximizing a window 2014-12-15 09:51:28 +01:00
Martina Flöser
21f8d7c23a Implement ShellSurface::setMaximized
Client and Server part of setting a ShellSurface to maximized.
2014-12-15 08:59:02 +01:00
Martin Gräßlin
5dcb3589b3 Exclude some krazy checks which do not make sense for KWayland
This software is not portable. We don't need krazy checks telling us
that we should use Qt's portable types.
2014-12-12 08:43:16 +01:00
Martin Gräßlin
35e5517c4b Add missing newline at end of file 2014-12-12 08:36:47 +01:00
Martin Gräßlin
c5867c130e Fix typos 2014-12-12 08:36:07 +01:00
Martin Gräßlin
c859c62172 Normalize SIGNAL syntax
makes Krazy happy.
2014-12-12 08:33:10 +01:00
Martin Gräßlin
66b5c4382a Do not include QtModules 2014-12-12 08:32:01 +01:00
Martina Flöser
ee44d6aec0 Implement entered surface for Keyboard
Anologous to the implementation in Pointer:
* signal entered and left
* Surface *enteredSurface()

The passed in keys are not yet passed along and
currently ignored.
2014-12-08 09:48:35 +01:00
Martin Gräßlin
2d71265229 [autotests] Verify Client::Pointer::enteredSurface 2014-12-03 08:41:00 +01:00
Martin Gräßlin
5b03dfe324 Improve attaching buffer and commiting in SurfaceInterface
Now the code handles correctly the attaching of a null buffer
(emits a signal unmapped) and if a commit doesn't have a pending
buffer it won't be reset. Damage requests are ignored if no buffer
has been attached yet.
2014-11-28 08:33:32 +01:00
Martin Gräßlin
f4c0930a26 renderingservertest: Proper DPI for the Output
According to Wikipedia:
* screens have a default DPI of 96
* 96 dot/in are 38 dot/cm
* 1024/768 -> 269/202 mm
2014-11-27 19:25:17 +01:00
Martin Gräßlin
3fc96bdabd renderingservertest: Improve focus handling
Properly reset focus when surfaces get added/removed. E.g. when
writing in Kate additional surfaces are created for which we do
not want to pass focus.
2014-11-27 19:24:16 +01:00
Martin Gräßlin
67b1bf7d42 Install KF5WaylandServer and headers
CCMAIL: sebas@kde.org
2014-11-27 18:26:33 +01:00
Martin Gräßlin
e8dbd39c60 Display::start takes a StartMode argument
If one passes StartMode::ConnectClientsOnly the socket in
XDG_RUNTIME_DIR is not created and instead one can only connect to
this server using the Display::createClient method. A very nice
solution to just have a Server and one dedicated Client talk to each
other.
2014-11-27 16:42:16 +01:00
Martin Gräßlin
ef810d39f7 ConnectionThread can connect to a socket fd instead of name
This allows connecting a client without going via the socket
name. E.g. to create a socketpair in the server and fork to
exec the client.
2014-11-27 16:38:01 +01:00
Martin Gräßlin
963651632e Add safety checks to DataDeviceInterface
It's possible that the Resource got already unbound when calling
into clear selection, etc.
2014-11-27 14:02:54 +01:00
Martin Gräßlin
91fa946e30 Fix crash in PointerInterface after PointerInterface got destroyed
Connection to lambda was not bound to this.
2014-11-27 13:59:31 +01:00
Martin Gräßlin
78486bb506 Handle DataDeviceInterface selection in SeatInterface
The selection is supposed to be sent to the DataDeviceInterface just
before getting keyboard focus. In order to do that the SeatInterface
keeps track of the DataDeviceInterface which is the current selection
and the DataDeviceInterface of the focused keyboard client.

SeatInterface friends DataDeviceManagerInterface so that the latter
can register each created DataDevice for the SeatInterface.
2014-11-27 13:38:24 +01:00
Martin Gräßlin
9d2cfd122e pasteclient: read selection in thread 2014-11-27 12:45:42 +01:00
Martin Gräßlin
b016765f6c renderingservertest: each new Surface becomes the seat's focused surface 2014-11-27 11:25:28 +01:00