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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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.
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.
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."
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.
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
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
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.
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
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
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