Commit graph

806 commits

Author SHA1 Message Date
Vlad Zahorodnii
3cf004b68e Don't flush in SurfaceInterface::frameRendered()
Frame callbacks only indicate when the client can start rendering a new
frame, it's not meant to be precise. If the client wants to do some
black magic with frame scheduling and so on, it needs to use a protocol
such as presentation_time. This change removes the pointless flush to
prevent over-flushing client connections.
2020-08-18 07:28:03 +00:00
Aleix Pol
5efebc3a38 Provide an initial implementation for input-method-unstable-v1
Makes it possible to implement the protocol in your favourite
compositor.
2020-08-17 20:09:21 +02:00
David Edmundson
84337d25f9 Add a workaround to prevent klipper racing with clipboard updates
We have a situation where some clients drop their old offer before
creating a new one. This means klipper tries to fill in the empty
clipboard at the same time the client posts its new real contents.

This adds in a flag (via a hidden mimetype) that klipper is trying to
replace a null clipboard. If this flag is set and our clipboard is not
null because the client has updated it in the meantime we ignore the
klipper update.

It's a workaround, rather than an ideal fix at a data level, but it
solves the problem in the interim.

CCBUG: 424855
2020-08-14 15:01:32 +00:00
David Edmundson
89433eccec [autotests] Cleanup DataControlInterface test
The tests were not fully self-encapsulating and leaky.
2020-08-14 15:01:32 +00:00
Vlad Zahorodnii
89debdef60 Undo pointer-gestures v2 changes
The release request was introduced in v2, which we currently don't support.
2020-08-06 15:42:17 +03:00
Adrien Faveraux
23ef883e84 Fix Build Warning 2020-08-05 12:25:09 +00:00
Xaver Hugl
b7bd93c567 Makes the panelAutoHideHideCallback also handle panels set to "windows can cover" 2020-07-28 23:40:43 +02:00
Vlad Zahorodnii
3407b06c58 Fix build 2020-07-28 17:46:06 +03:00
adrien faveraux
9686a31454 Apply 1 suggestion(s) to 1 file(s) 2020-07-28 13:31:03 +00:00
Adrien Faveraux
2c0f977632 migrate Shadow to new approach 2020-07-28 13:31:03 +00:00
Adrien Faveraux
8e6a525fed Migrate dpms to new approach 2020-07-28 12:07:36 +00:00
Adrien Faveraux
dad8e5a79c migrate Plasma Desktop interface to the new approach 2020-07-28 13:29:32 +02:00
Adrien Faveraux
389aec2156 Migrate Migrate XdgForeign to new approach 2020-07-28 11:23:24 +00:00
Adrien Faveraux
ed264e2c55 migrate idle interface to the new approach 2020-07-28 11:01:31 +00:00
Adrien Faveraux
87abc0e483 move idle Inhibitor to the news approach 2020-07-28 10:46:30 +00:00
Aleix Pol
dfeb71d451 linuxdmabuf: don't leak private implementations
Found when running under ASAN
2020-07-28 10:23:30 +00:00
Vlad Zahorodnii
399560973e Bump plasma window management protocol version 2020-07-28 11:45:57 +03:00
Vlad Zahorodnii
4d1847b13e Drop support for the remote-access protocol
It's been replaced by PipeWire stuff.
2020-07-23 18:16:39 +03:00
Aleix Pol
e089092b54 Implement zkde_screencast_stream_unstable_v1 2020-07-23 12:57:17 +00:00
Aleix Pol
97219ec2d5 PlasmaWindow::internalId was deprecated in favor of ::uuid 2020-07-23 12:57:17 +00:00
David Edmundson
ef539368d9 Emit signal before DataControlSource destruction
SeatInterface cleans up when a data source goes away. However the
cleanup also makes use of metaobjects so needs to run before the leaf
class destructor is run.

All other AbstractDataSource objects emit the unbound signal, which
SeatInterface also connects to do a earlier cleanup. Otherwise we get a
crash if a data control source replaces itself.
2020-07-23 11:58:31 +01:00
Vlad Zahorodnii
3994faff50 Rename the aboutToBeUnbound() signal in SurfaceInterface
Rename the aboutToBeUnbound() signal to aboutToBeDestroyed() in order to
make the usage of the word "destroyed" consistent.
2020-07-16 14:31:41 +00:00
Aleix Pol Gonzalez
c57270fa4a Update surface_interface.cpp 2020-07-15 22:22:40 +00:00
David Edmundson
df9413638d Cache clientConnection in SurfaceInterface
Order of a client teardown is:
 - ClientConnection is removed from the static map
 - All our client owned resources are torn down
 - ClientConnection is deleted (via a previous deleteLater)

The recent refactor led to a behavioural change where ::client could
return a null pointer.

We want the client getter to be valid throughout the lifespan of
SurfaceInterface, by doing the lookup once we achieve that.

BUG: 424255
2020-07-15 22:55:37 +01:00
Vlad Zahorodnii
9a23695bab Use shorter name for variable that holds cached subsurface state 2020-07-15 11:05:59 +03:00
Vlad Zahorodnii
33f4254bd1 Port the wl_compositor wrapper to the new approach 2020-07-15 11:05:59 +03:00
Vlad Zahorodnii
46e4f0948b Port the wl_surface wrapper to the new approach 2020-07-15 11:05:57 +03:00
Vlad Zahorodnii
58cd4825e7 Port the wl_region wrapper to the new approach 2020-07-15 11:04:30 +03:00
Vlad Zahorodnii
c42fc80d33 Fix testServerSideDecoration 2020-07-15 08:20:00 +03:00
Vlad Zahorodnii
551b0dc7e0 Use ssd mode enums generated by qtwaylandscanner 2020-07-14 21:50:55 +03:00
Vlad Zahorodnii
7addf10211 Fix build 2020-07-14 21:28:20 +03:00
Adrien Faveraux
095edbed4c migrate Contrast to new approach 2020-07-14 18:24:24 +00:00
Adrien Faveraux
efdc6e44ee Migrate Server Decoration to new approach 2020-07-14 20:17:46 +02:00
Vlad Zahorodnii
ddac3d14d8 Fix build 2020-07-14 13:15:26 +03:00
Adrien Faveraux
aa2626ee4e move eglstream controler to the new approach 2020-07-14 10:10:04 +00:00
Adrien Faveraux
9ead826465 move server decoration palette to new approach 2020-07-13 15:35:57 +00:00
Vlad Zahorodnii
bd62038ada Drop some tests that matter only for KWayland::Client 2020-07-08 10:35:25 +03:00
Vlad Zahorodnii
ed261e2c5b Remove pointless wl_display_terminate()
Since we don't do wl_display_run(), wl_display_terminate() is pointless.
2020-07-08 07:25:23 +00:00
Vlad Zahorodnii
0d45f15c00 Drop unused method
Display::startLoop() isn't used anywhere and it only adds maintenance
burden, so drop it.
2020-07-08 07:25:23 +00:00
Vlad Zahorodnii
a634ce77c1 Allow creating global objects before Display is started
It can be especially useful if the compositor wants to ensure that all
globals have been created before starting to accept client connections.

Unfortunately, start() and terminate() stuff doesn't align well with it,
so the terminate() method was dropped to ensure that Display always
returns the same wl_display object.
2020-07-08 07:25:23 +00:00
David Edmundson
8792a8d6b8 On bind set stacking order only to newly bound client
sendStackingOrderChanged() iterates though all clients. Only the new
client needs to be send information at this point.
2020-07-06 16:47:05 +01:00
Vlad Zahorodnii
ec0c109f4d Provide an easy way to monitor buffer size changes
The main purpose behind the kwaylandserver library is to provide a set
of re-usable wayland compositor extension implementations. However, it's
worth noting that the design of kwaylandserver is far from perfect at
the moment.

KWaylandServer tries to hide all low level wayland details from the
compositor. But it's not the case with buffers, which diminishes the
whole point behind the library.

Creating OpenGL textures from Wayland buffers is the responsibility of
the compositor. So, when it comes to client buffers, we are one foot in
KWaylandServer, and the other foot in the compositor.

Since the surface size is a logical size, the compositor can't use it
for allocating memory for OpenGL textures. This change adds the buffer
size property in SurfaceInterface that can be used for allocating memory
for textures as well as monitoring buffer size changes.

I must say that the introduction of the buffer size property is a crude
hack because BufferInterface just needs to provide an OpenGL texture for
each plane. The main blocker for that is that it would involve moving
the backend, the compositor, and the wayland bits in the same place, for
example kwayland-server or ultimately kwin.
2020-06-30 09:25:24 +03:00
Vlad Zahorodnii
6adaf7bcc6 Document the buffer transform property
The buffer transform is a pretty confusing thing, so document it in
order to avoid misleading people.
2020-06-24 06:58:46 +00:00
Vlad Zahorodnii
ecca34dea3 Rename buffer-specific surface properties
The buffer scale and the buffer transform property specify transforms
that had been applied to the buffer's contents. Neither one of those
properties apply to the surface, in other words the buffer transform
property doesn't indicate that the surface was rotated or flipped or both.

This change doesn't gain anything in terms of new features, etc. It just
attempts to make things more clear.
2020-06-24 06:58:46 +00:00
David Edmundson
dd825dbfb3 Fix bad merge 2020-06-23 01:03:49 +01:00
David Edmundson
5ca1e73804 Merge branch 'Plasma/5.19' 2020-06-23 00:27:00 +01:00
David Edmundson
a664677051 Scope dragAndDropActionsChanged to source lifespan
The source can have a different lifespan to the offer being made.
If a source is removed and we get a drag actions changed before the
offer is cancelled we don't want to crash.

Couldn't reproduce locally, but the trace was good.

BUG: 423127
2020-06-23 00:23:53 +01:00
Vlad Zahorodnii
ac66d25364 Drop SurfaceInterface::inputIsInfitine
Since we don't guarantee SC and BC in KWaylandServer, we can drop
SurfaceInterface::inputIsInfitine().
2020-06-19 16:12:00 +00:00
David Edmundson
b332cb4d1f Assume enabled if DPMS is not supported
This fixes several unit tests in kwin where the virtual output is not
considered enabled causing behavioural changes.
2020-06-19 08:26:47 +00:00
Vlad Zahorodnii
45812785cf Introduce surface-to-buffer and buffer-to-surface matrices
The compositor needs to monitor changes in the mapping between the
surface local coordinates and the buffer coordinates because texture
coordinates correspond to the latter. One way to do it is to monitor
things such as the surface size, the buffer size, the buffer scale,
etc. The main problem with doing so is that there are so many factors
that contribute to how mapping between the surface local coordinate
space and the buffer coordinate space is performed.

In order to provide a generic way for monitoring changes in the mapping
between the surface local coordinate space and the buffer coordinate
space, this patch introduces two new matrices. The first one specifies
how the surface-local coordinates are mapped to buffer coordinates, and
the other one specifies how to map the buffer coordinates to surface
local coordinates.

With the new two matrices, the compositor has a generic way to get
notified when it has to re-compute texture coordinates.
2020-06-19 06:43:31 +00:00