Wayland has a limited size for strings in arguments. We should truncate
any strings that come from user-defined data before sending.
We keep the full title around within kwin as it keeps logic simpler.
Size length logic is lifted from QWaylandWindow's setTitle
BUG: 465775
We use the PMF syntax so the isValid() check is unnecessary as the
compiler will notify about wrong signal at compile time. It makes
writing autotests feel less boilerplaty.
This makes KWin switch to in-tree copy of KWaylandServer codebase.
KWaylandServer namespace has been left as is. It will be addressed later
by renaming classes in order to fit in the KWin namespace.
Currently, plasma window model test fails because the null icon is
received after executing the main body of the test.
FAIL! : PlasmaWindowModelTest::testVirtualDesktops() '!dataChangedSpy.wait(100)' returned FALSE. ()
Loc: [/data/projects/src/kwayland-server/autotests/client/test_plasma_window_model.cpp(583)]
We can fix the test by waiting for the iconChanged signal to be emitted,
but we will need to wait in all tests too. Furthermore, it doesn't make a
lot of sense to wait for an icon that was never set.
This change makes the compositor send an icon only if there is one.
It's a behavioral change, but it shouldn't regress anything because kwin
always sets icons via the plasma window management protocol even for apps
that have no valid app id.
It also makes the api of the PlasmaWindowInterface class more intuitive.
Currently, testIcon fails because the actual and the expected pixmaps
have mismatching formats.
The root cause is that images with an alpha channel will loose the alpha
channel if they are converted to QPixmap using QPixmap::fromImage().
The >> stream operator for the QPixmap class will deserialize pixel data
in a temporary QImage and then use QPixmap::fromImage() to get a pixmap
object.
The >> stream operator for the QIcon class will delegate the task of
reading the icon from a QDataStream to QPixmapIconEngine, which uses the
>> stream operator under the hood to deserialize icon data.
In order to fix testIcon, this change constructs a dummy icon from a
pixmap object returned by QPixmap::fromImage().
If a Wayland protocol deals with regions, they will be exposed as
QRegion objects in public API. Therefore, it makes sense to make
RegionInterface private as it's an implementation detail and it's
not intended to be used in public api.
The corresponding test was dropped because the CompositorInterface
no longer emits a signal to indicate that a wl_region has been created.
It should be also noted that wl_region stuff is already tested via
other means, e.g. surface damage, etc.
PlasmaWindowInterface is a "Server-managed multicasting resources". We
no longer need our wrapper to outlive objects so we can tidy that up.
It's weird to have a method call to an object delete the object, so
memory management is moved to the caller to be consistent.
The main reason why we have factory methods is that up to some point,
kwayland had its own signal to indicate when globals have to be removed.
Now that all globals add destroy listeners for the wl_display object,
we don't have that signal. Most factory methods are equivalent to doing
new T(display).
Besides adding unnecessary boilerplate code, another reason to get rid
of the factory methods is to reduce the amount of merge conflicts. If
several persons work on implementing wayland protocols at the same time,
sooner or later someone will have to resolve merge conflicts in Display.
libwayland-server allows the wl_display accept client connections on
more than one socket. We currently don't listen on multiple sockets,
but it would be nice if Display supported such operation mode.
One of the most disappointing things when writing autotests is dealing
with a race condition where destructor requests are processed after all
globals have been destroyed.
With this change, the Display object will destroy all clients and their
resources before destroying the wl_display object. The good thing about
doing so is that shut down logic becomes simple. We don't have to assume
that wl_resource objects can outlive their wl_global objects, etc. The
bad thing is that it exposed a couple of pre-existing latent bugs in the
data device and the xdg foreign code.
closesplasma/kwayland-server#2
Test Plan: See that the test works as expected.
Reviewers: #kwin, zzag
Reviewed By: #kwin, zzag
Subscribers: kde-frameworks-devel
Tags: #frameworks
Differential Revision: https://phabricator.kde.org/D28164
Summary:
In rare cases testWindowmanagement fails because the initial iconChanged
signal gets emitted after setIcon is called.
Reviewers: #kwin
Subscribers: kde-frameworks-devel
Tags: #frameworks
Differential Revision: https://phabricator.kde.org/D18421
Summary:
Adding "SkipSwitcher" to API, as a result of discussion in
BUG 375921
Depends on / related to D11924 and D11926.
Reviewers: hein, graesslin
Reviewed By: graesslin
Subscribers: kde-frameworks-devel, lbeltrame, rikmills, davidedmundson, #plasma, graesslin
Tags: #frameworks
Differential Revision: https://phabricator.kde.org/D11925
Summary: client requests to toggle those states, to be used by libtaskmanager
Test Plan: setting keep above from the taskbar works
Reviewers: #plasma, hein, graesslin, #plasma_on_wayland
Reviewed By: #plasma, hein
Subscribers: graesslin, hein, plasma-devel, #frameworks
Tags: #frameworks, #plasma
Differential Revision: https://phabricator.kde.org/D5757
Summary: Verified it it send before the initial_state and adjust tests and docs accordingly
Test Plan: All unit tests pass
Reviewers: #plasma, graesslin
Reviewed By: #plasma, graesslin
Subscribers: graesslin, plasma-devel, #frameworks
Tags: #plasma_on_wayland, #frameworks
Differential Revision: https://phabricator.kde.org/D5887
Summary:
This patch adds a pid event to the plasma window management protocol. It
allows the compositor to tell allow a mapping between windows and processes.
Bumps the version number of the interface to 8 to indicate this.
Test Plan: autotest added, passed
Reviewers: #plasma, hein, graesslin
Reviewed By: #plasma, hein, graesslin
Subscribers: apol, davidedmundson, plasma-devel, #frameworks
Tags: #frameworks, #plasma_on_wayland
Differential Revision: https://phabricator.kde.org/D5747
Summary:
Especially for Xwayland windows the compositor might not have a themed
icon name. Resulting in a task manager not having dedicated icons for
Xwayland windows.
This change deprecates the way how a compositor is supposed to set the
window icon. Instead of passing the themed icon name, it is now supposed to
pass the QIcon. In case it's a themed icon the existing way to pass to
the client is used.
Otherwise a new event is used to inform the client that there is an icon
- no data is transmitted at this point. The client can then create a
file descriptor and pass it to the compositor. The compositor serializes
the icon into the file descriptor and the client can read from it. This
all happens transparently on client side there is no api change at all.
The writing and reading of the icon is done in a thread. Due to that
Qt5::Concurrent is now a required dependency instead of an optional
dependency.
Reviewers: #plasma_on_wayland, hein
Subscribers: plasma-devel
Tags: #plasma_on_wayland
Differential Revision: https://phabricator.kde.org/D3049
The test started to segfault on build.kde.org. It looks like an event
survives the destruction of the server. Thus this change tries to
dispatchEvents once more before destroying everything.
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
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
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
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
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
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