Commit graph

306 commits

Author SHA1 Message Date
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
Martin Gräßlin
d78ed75549 renderingservertest: Create a DataDeviceManagerInterface 2014-11-27 11:25:07 +01:00
Martin Gräßlin
1bc105e2e6 Close fd DataSourceInterface::requestData
Weston does it as well and otherwise the client blocks.
2014-11-27 11:23:37 +01:00
Martin Gräßlin
0e0933cbb1 Split SeatInterface::Private into own header file
We need to include the Private in the DataDeviceManager, thus it
needs to be in an own header.
2014-11-27 09:52:11 +01:00