Summary:
This adds XDG WM Base (essentially XDG Shell v7/stable edition) into our
existing XDGShell classes which wrap v5, v6 and now this.
It's mostly copy and paste from V6 except for the enum types for gravity
and anchor edges on positioners.
There's been no attempt to share code with V6 as realistically that
won't get updates whereas XDGWMBase will; and at some point we will
want to drop V6 without things being too tangled.
Test Plan:
Same test suite as V6 has
Compiled GTK master and ran against suitably modified kwin
running WAYLAND_DEBUG=1 gtk-demo showed we were using this interface
Everything worked as well as V6 does.
Reviewers: #kwin, romangg
Reviewed By: #kwin, romangg
Subscribers: romangg, zzag, kde-frameworks-devel
Tags: #frameworks
Differential Revision: https://phabricator.kde.org/D13510
Summary:
When we add WMBase (the new name stable XdgShell) we get a clash with
XDGShellV5. This clash consists of all functions in the generated C file
which clashes at linker time, as well as multiple xdg_blah_interface
structs which would get redefined.
XDGShellV5 in practice is used by literally no-one (Qt never defaulted
to it if wl-shell was available) and has been dropped from GTK when
they added v6. But it's used by some kwin unit tests so breaking
would cause issues for stable kwin release tests... so it's a pain.
We can't mod the XML as we need the strings sent down the wire to remain
the same and we need the same names for our forward declared structs
that the client code can cast to.
This patch copies the generated files and modifies them manually.
Hacky, but we know this code will never change again - and IMHO this
task isn't one worth investing too much time into.
Test Plan:
Finished my XDG WM Base patch (see next phab) and things compile \o/
Unit test still passes
Ran: QT_WAYLAND_SHELL_INTEGRATION=xdg-shell-v5 dolphin --platform wayland and verified it worked
Reviewers: #plasma, romangg
Reviewed By: #plasma, romangg
Subscribers: romangg, kde-frameworks-devel
Tags: #frameworks
Differential Revision: https://phabricator.kde.org/D13488
Summary:
- selfInitialization
- memleak
I could probably suppress the selfInitialization warning, but probably
is cleaner this way. Opinions welcome. This also fixes the memleak in
autotest.
Test Plan:
- arc lint --everything
- Fix issues
- build
- run tests
Reviewers: #frameworks, aacid
Reviewed By: aacid
Subscribers: apol, aacid, kde-frameworks-devel
Tags: #frameworks
Differential Revision: https://phabricator.kde.org/D13559
Summary:
This solves for me not working relative pointer motion with grab/lock in
Xwayland applications.
Looking at the Xwayland code it is clear, that it expects a frame event on
wl_pointer versions 5 and above after relative motion events. wl_pointer
version 5 support was added to KWayland in c29035a6.
If the cursor is locked no absolute motion events are sent. In this case to
make sure relative motion events are processed by the client, send the frame
event after every relative motion.
BUG: 395815
Test Plan: Manually with Neverball in Xwayland mode.
Reviewers: #plasma, #kwin, #frameworks, davidedmundson
Reviewed By: #plasma, #kwin, davidedmundson
Subscribers: davidedmundson, kde-frameworks-devel
Tags: #frameworks
Maniphest Tasks: T8923
Differential Revision: https://phabricator.kde.org/D13257
Summary:
We had a data funciton...then didn't use it, effectively skpping half of
the point of the test.
Test Plan: Ran the test
Reviewers: #kwin, mart
Reviewed By: #kwin, mart
Subscribers: romangg, kde-frameworks-devel
Tags: #frameworks
Differential Revision: https://phabricator.kde.org/D13495
Summary:
GTK applications seem to call wl_data_device::set_selection multiple times with
the same wl_data_source object, replacing it with itself. If we cancel it, they
will destroy it and the selection will be gone.
With this patch it is again possible to copy from GTK applications.
BUG: 395366
Test Plan: Patch provided by the reporter, he reported success.
Reviewers: #plasma, #frameworks, romangg
Reviewed By: #plasma, romangg
Subscribers: michalsrb, romangg, graesslin, kde-frameworks-devel
Tags: #frameworks
Differential Revision: https://phabricator.kde.org/D13535
Summary:
- xml linter to make sure that we don't add broken protocols
- merge-conflict so that we don't commit merge-conflict markers
- spell check for documentation
- cppcheck to check the code
Test Plan: broke some files manually, and then ran arc lint
Reviewers: #frameworks, mart
Reviewed By: mart
Subscribers: kde-frameworks-devel
Tags: #frameworks
Differential Revision: https://phabricator.kde.org/D13533
Summary:
Use lambda function to reduce code duplication and put
function definitions in the same order as in the header file.
Test Plan: All autotests succeed.
Reviewers: #plasma, davidedmundson
Reviewed By: #plasma, davidedmundson
Subscribers: davidedmundson, kde-frameworks-devel
Tags: #frameworks
Differential Revision: https://phabricator.kde.org/D13191
Summary: Not released yet.
Test Plan: No testing performed at all.
Reviewers: #plasma, stikonas
Reviewed By: stikonas
Subscribers: kde-frameworks-devel
Tags: #frameworks
Differential Revision: https://phabricator.kde.org/D13377
Summary:
Interfaces must be cleaned up correctly and client proxys
destroyed. Otherwise we get a memory corruption.
Reviewers: #plasma, davidedmundson
Reviewed By: #plasma, davidedmundson
Subscribers: kde-frameworks-devel
Tags: #frameworks
Differential Revision: https://phabricator.kde.org/D13190
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:
Done primarily for XWayland which for legacy reasons doesn't assume the
logical size of a display is pixelSize / outputScale. Meaning xwayland
windows that position themselves are wrong in a scaled environment.
It also allows the possibility for us to support fractional scaling
whilst keeping wl_output::scale as an integer.
The protocol is a bit odd as it operates via the FooManager + Foo
pattern rather than using globals like Output so I've wrapped it so it
behaves more like globals.
Test Plan: #plasma
Reviewers: romangg
Subscribers: #frameworks
Tags: #frameworks
Maniphest Tasks: T8501
Differential Revision: https://phabricator.kde.org/D12235
Summary:
This change implements the required changes for wl_seat version 5.
There seem to be applications which require version 5 and refuse to
start if the server doesn't provide it. Thus we need to provide it.
The main difference with version 5 is that pointer need to send a
frame event after each logical group of events. As we don't support the
new events from version 5 yet, we just emit the frame after each event
and implement the suggested semantics for the enter/leave behavior.
To really make use of this, we will have to implement additions in the
API and then in KWin to expose the new API elements. But to just support
the semantics we don't need it.
BUG: 389189
FIXED-IN: 5.45
Test Plan: Extended autotest
Reviewers: #kwin, #plasma, #frameworks
Subscribers: plasma-devel
Tags: #frameworks, #plasma
Differential Revision: https://phabricator.kde.org/D10235
Summary:
Previously KWin supported only version 2 of wl_output interface
In third version there was an important addition that allowed clients to
unbind outputs they may previously have bound.
Bumping versions in both client and server part of KWayland to support
this behaviour.
Reviewers: davidedmundson, graesslin
Reviewed By: graesslin
Subscribers: jgrulich, #frameworks
Tags: #frameworks
Maniphest Tasks: T7785
Differential Revision: https://phabricator.kde.org/D10929
Summary:
This addresses the following situation:
1. Start drag on a QtWayland based window
2. Press escape
3. Release mouse
-> this results in a crash. The main reason for this is that QtWayland
destroys the DataSource in step 2 and KWayland did not expect this at
all. The drag and drop operation continued and results in step 3 in the
drag target to request data from the no longer existing DataSource.
This change addresses the root of the problem by cancelling the drag
operation when the DataSource gets destroyed.
BUG: 389221
FIXED-IN: 5.44
Test Plan:
New test case exposing the problem and manual testing with
kwin_wayland and dolphin (based on bug report)
Reviewers: #frameworks, #kwin, #plasma
Subscribers: plasma-devel
Tags: #frameworks, #plasma
Differential Revision: https://phabricator.kde.org/D10142
Summary:
Qt seems to damage and commit child subsurfaces although their parent
got destroyed. This actually doesn't make any sense as without a parent
surface they cannot be shown. But nevertheless we should not crash in
such a situation.
This change guards the places in the commit handling code where the
parent gets accessed.
BUG: 389231
Test Plan: New test case which exposes the problem
Reviewers: #frameworks, #kwin, #plasma
Subscribers: plasma-devel
Tags: #plasma, #frameworks
Differential Revision: https://phabricator.kde.org/D10300
Summary:
It's kept separate in case we ever merge the server decoration manager
interface upstream, and this is too kwin specific to have in a
potentially shared spec.
Code is a copy+paste of existing boilerplate.
Replaces use of the deprecated qt extended surface.
I'd like to target 5.42 as otherwise we'll have a regression when we
release Plasma 5.12 as Qt's XDGv6 doesn't have a working qt extended
surface.
Test Plan: Attached unit test
Reviewers: #plasma, graesslin
Reviewed By: #plasma, graesslin
Subscribers: plasma-devel, #frameworks
Tags: #frameworks, #plasma
Differential Revision: https://phabricator.kde.org/D9599
Summary:
So far only the client was able to simulate user activity. This new
method allows the server to also simulate user activity on all created
idle timeouts. This is required by KWin to prevent idle timeouts when
the user interacts through KDE Connect's virtual touchpad. In that
situation the mouse pointer is used without updating the input time
stamp as it doesn't come from "real" input devices and thus the idle
timeout prevention is not activated.
Reviewers: #frameworks, #plasma, #kwin
Subscribers: plasma-devel
Tags: #plasma_on_wayland, #frameworks
Differential Revision: https://phabricator.kde.org/D9510
We should only enforce the check whether a data source has set the
actions for drag on drop on a selection if it's at least version 3. For
backward compatibility we used to set a default action which would
ensure that a version <3 and >3 client can interact with each other. But
due to that the action was set to a default value which breaks any
selection. Sorry about that.
This change ensures the backward compatibility behavior does not break
selection.
As the regression causes all clients to quit it is a severe regression
which requires fast action. Due to that I'm doing a maintainer push
without review. I encourage everyone to do a post commit review.
Sorry for not noticing the regression before. The backward compatibility
was the last thing I added in that patch set and apparently I did not
run all tests again.
Summary:
The main difference compared to version 2 is additional drag and drop
actions. The source and destination can negotiate whether the data
should be copied or moved or the user should be asked for either or.
This seems to be important for GTK, but is not yet implemented in Qt.
The main motivation for adding support is that it is required by SDL to
launch on Wayland.
BUG: 386993
Test Plan: Extended test case, sdl apps now start
Reviewers: #frameworks, #plasma, #kwin
Subscribers: plasma-devel
Tags: #plasma_on_wayland, #frameworks
Differential Revision: https://phabricator.kde.org/D9136
Summary:
m_imported was parented to the TestForeign class, which lasts for all
the tests. This caused an error on teardown.
Test Plan: Ran with ASAN. Finally everything passes!
Reviewers: #plasma, graesslin
Reviewed By: #plasma, graesslin
Subscribers: plasma-devel, #frameworks
Tags: #frameworks, #plasma_on_wayland
Differential Revision: https://phabricator.kde.org/D9407
Summary:
Internally XdgForeign has some delete laters
If we clean up the connection immediately we delete them after we kill
the connection resulting in an error.
Kwin isn't going to tear down the connection in response to a resource
unbinding so we can just fix the test.
Test Plan:
Compiled with ASAN
Got further
Reviewers: #plasma, graesslin
Reviewed By: #plasma, graesslin
Subscribers: plasma-devel, #frameworks
Tags: #frameworks, #plasma
Differential Revision: https://phabricator.kde.org/D9406
Summary:
This test deletes the client wayland connection.
We then finish the test and call test cleanup which
releases m_idleInhititManager.
Calling release after the connection is destroyed is an error.
Hence the explicit destroy.
Test Plan:
Built tests with ASAN
No more crash
Reviewers: #plasma, graesslin
Reviewed By: #plasma, graesslin
Subscribers: plasma-devel, #frameworks
Tags: #frameworks, #plasma
Differential Revision: https://phabricator.kde.org/D9402
Summary:
A protocol that attaches to a surface and contains two strings which can
change.
The intended use is for clients to link a DBus Appmenu object with a
surface.
This is in preparation for the Qt Extended Surface deprecation which
currently handles this in Kwin.
Test Plan: Attached unit test
Reviewers: #plasma, graesslin
Reviewed By: #plasma, graesslin
Subscribers: broulik, graesslin, plasma-devel, #frameworks
Tags: #frameworks, #plasma_on_wayland
Differential Revision: https://phabricator.kde.org/D8919
Summary:
The current code captures a char* from a wayland event in a lambda.
By creating the QString first when we capture that by value we'll
implicitly shallow copy it.
The other issue was
someHash.erase(it);
*it->foo();
Even though where the iterator points to is still valid, the iterator
itself is an object that gets modified in erase which ASAN didn't like.
Test Plan:
Ran test.
Those particular errors went away
Tests passed
Subscribers: plasma-devel, #frameworks
Tags: #plasma_on_wayland, #frameworks
Differential Revision: https://phabricator.kde.org/D9319
Summary: This test needs the weston executable. Skip the test if the program wasn't found.
Reviewers: graesslin
Reviewed By: graesslin
Subscribers: plasma-devel, #frameworks
Tags: #plasma_on_wayland, #frameworks
Differential Revision: https://phabricator.kde.org/D8858
Summary:
This allows a server to filter which globals are visible and bindable by
clients.
Design rationale:
Could be it's own class with Display as an arg, but we need the lifespan
to exactly match Display, and the cardinality to match Display and it
needs to be set after we're started but before clients connect.
Better to enfore rules with code than with documentation.
I'm filtering by interface name as there isn't any other good
identifier of what a wl_global refers to, even if you could assume
you can cast the userdata to a Server::Global.
Test Plan: Attached unit test
Reviewers: #plasma, graesslin, bcooksley
Reviewed By: #plasma, graesslin
Subscribers: bcooksley, graesslin, plasma-devel, #frameworks
Tags: #frameworks, #plasma
Differential Revision: https://phabricator.kde.org/D8050
Summary:
This protocol allows to indicate that a wl_surface should inhibit idle
actions such as DPMS, screen locking if the surface is visible.
The protocol is quite simple: it just creates an IdleInhibitor for a
Surface. If such an IdleInhibitor exists the Surface is considered to
inhibit idle.
On the server side it is also exposed like that through the API. The
IdleInhibitorInterface is private to the library and only
SurfaceInterface is extended to expose whether it currently inhibits
idle.
CCBUG: 385956
Test Plan: New test case added
Reviewers: #frameworks, #kwin, #plasma_on_wayland
Subscribers: plasma-devel
Tags: #plasma_on_wayland, #frameworks
Differential Revision: https://phabricator.kde.org/D8396
Summary:
This is a preparation step to support idle_inhibit_unstable_v1 protocol.
As in Plasma powermanagement, screen locking, dpms, etc. is not
controlled by the wayland compositor but by external components through
the IdleTimeout interface the compositor needs a way to inhibit the idle
timeouts. So once idle_inhibit_unstable_v1 is implemented the compositor
can hook this up to the inhibit API in IdleInterface and thus inhibit
powermanagement, etc. as requested by the idle_inhibit_unstable_v1
protocol.
The added API is straight forward:
* inhibit: inhibits idle timeouts
* uninhibit: uninhibits again
* inhibit and uninhibit must be called in pairs, so twice inhibit,
means uninhibit must be called twice
* isInhibited: whether it's inhibited
* and a signal that it changed
The signal is mostly used internally to stop the timers.
Test Plan: Test case extended
Reviewers: #frameworks, #kwin, #plasma_on_wayland
Subscribers: plasma-devel
Tags: #plasma_on_wayland, #frameworks
Differential Revision: https://phabricator.kde.org/D8383
Summary:
Implement the "foreign" wayland protocol.
A client can export a surface with an unique string as handle,
then another client can refer to that surface and set an own surface as
child of that surface.
Potential use cases are out-of-process dialogs, such as file dialogs,
meant to be used by sandboxed processes that may not have the access
it needs to implement such dialogs.
The handle needs to be shared between the processes with other means,
such as dbus or command line paramenters.
The public api of the server side only tracks parent/child relationships as this is the only data kwin would need it for, the rest of the api is not exported so should be safer from eventual protocol changes
Test Plan:
the autotest works, but has a lot of random crashes when deleting surfaces,
unfortunately backtraces don't tell much and the crashes never occur when running into valgrind
behavior may still be wrong, depending on how the protocol is supposed
to work if more clients try to set the same exported surface as parent
Reviewers: #plasma, #kwin, davidedmundson, graesslin
Reviewed By: #plasma, #kwin, graesslin
Subscribers: davidedmundson, graesslin, plasma-devel, #frameworks
Tags: #frameworks, #plasma_on_wayland
Differential Revision: https://phabricator.kde.org/D7369
Summary:
This allows a server to filter which globals are visible and bindable by
clients.
Design rationale:
Could be it's own class with Display as an arg, but we need the lifespan
to exactly match Display, and the cardinality to match Display and it
needs to be set after we're started but before clients connect.
Better to enfore rules with code than with documentation.
I'm filtering by interface name as there isn't any other good
identifier of what a wl_global refers to, even if you could assume
you can cast the userdata to a Server::Global.
Test Plan: Attached unit test
Reviewers: #plasma, graesslin
Reviewed By: #plasma, graesslin
Subscribers: graesslin, plasma-devel, #frameworks
Tags: #frameworks, #plasma
Differential Revision: https://phabricator.kde.org/D8050