Commit graph

188 commits

Author SHA1 Message Date
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
Martin Gräßlin
8f2f94798d Cleanup SeatInterface after refactoring 2014-11-26 15:42:33 +01:00
Martin Gräßlin
7baf5896be Merge SeatInterface::Private::pointerForSurface and ::keyboardForSurface
templated helper method.
2014-11-26 15:34:46 +01:00
Martin Gräßlin
6504e067bc KeyboardInterface inherits Resource 2014-11-26 15:28:47 +01:00
Martin Gräßlin
99598167d7 Refactor KeyboardInterface
The KeyboardInterface gets created per wl_resource. For this all
more global information (e.g. key states) is moved into the
SeatInterface.
2014-11-26 15:00:44 +01:00
Martin Gräßlin
d7a9be72ea Get event timestamp from SeatInterface in KeyboardInterface 2014-11-26 13:04:36 +01:00
Martin Gräßlin
c6281ac64e Move pointer position into the Pointer struct in SeatInterface::Private 2014-11-26 11:57:10 +01:00
Martin Gräßlin
ce07100383 Make PointerInterface::focusedSurface public 2014-11-26 11:55:35 +01:00
Martin Gräßlin
bafb03bd3a Drop global position from PointerInterface
No longer needed, not even as a convenience wrapper.
2014-11-26 11:54:53 +01:00
Martin Gräßlin
d425515a99 Move pointer button handling from PointerInterface to SeatInterface
The button state is a seat-global state and not a per pointer state.
All pressed/released and axis events are moved to the SeatInterface
and just invoke the related method on the focused surface pointer.
2014-11-26 11:50:52 +01:00
Martin Gräßlin
a7463f6f32 Turn PointerInterface into a Resource 2014-11-26 11:03:32 +01:00
Martin Gräßlin
ef1a0a0e64 Create one PointerInterface for each pointer wl_resource
Makes PointerInterface more like other Interface classes wrapping
wl_resource. The most important change is the handling of the
focused surface. This is now kept in the SeatInterface and can also
be set if there is no PointerInterface for the client yet.

The unit tests had to be adjusted and some are also disabled as the
button events are not yet moved into SeatInterface.
2014-11-26 10:34:23 +01:00
Martin Gräßlin
961aaae8f1 [server] Add a SeatInterface::focusedPointer
This method is supposed to return the PointerInterface for the current
focused surface. At the moment it just creates the one global
PointerInterface. The existing SeatInterface::pointer method got
removed as that is actually wrong usage.
2014-11-25 16:04:07 +01:00
Martin Gräßlin
ff806d1657 Move focused pointer surface API to SeatInterface
There can only be one focused surface per Seat, thus the information
should be hold in the seat.

This only adjusts the API, the actual data is still hold in the
PointerInterface. This still needs adjustment.
2014-11-25 15:54:28 +01:00
Martin Gräßlin
41fbb0a6ee [server] Keep timestamp in SeatInterface instead of PointerInterface 2014-11-25 15:29:01 +01:00
Martin Gräßlin
12477a66fc [server] Move pointer position from PointerInterface to SeatInterface
PointerInterface should only wrap a Resource. In order to do so all
global state needs to move into the Global.
2014-11-25 14:24:52 +01:00
Martin Gräßlin
8f9a9fedb1 [server] Drop Display* from PointerInterface and KeyboardInterface
We can get it through the Global passed to PointerInterface and
KeyboardInterface. No need to pass it further around.
2014-11-25 13:58:25 +01:00
Martin Gräßlin
e6b91f5628 [server] Move PointerInterface into own .h and .cpp 2014-11-25 13:53:16 +01:00
Martin Gräßlin
80d0fb1e94 [server] Move KeyboardInterface into dedicated .h and .cpp 2014-11-25 13:39:24 +01:00