Commit graph

853 commits

Author SHA1 Message Date
Vlad Zahorodnii
152d7250a5 Pass a dedicated fd to each keyboard for the xkb keymap
Summary:
To better isolate the clients from each other eachh KeyboardInterface
creates it's own dedicated temporary file and sends the fd for this
temporary file to the client. This means the memory for the keymap is no
longer shared between all clients, every client has an own copy.

To support this the existing API to set the keymap is deprecated and
replaced by a new method setKeymapData which takes the content of the
keymap as a byte array. The now deprecated method which takes a file
descriptor is changed to use the new setKeymapData method. For that it
reads the content of the file.

The implementation in KeyboardInterface to create the file descriptor is
based on the implementation of KWin. As I implemented the change in KWin
(see 3b4c508ee3) it is not a problem from
GPL vs LGPL perspective.

The change includes test cases to verify that the content of the keymap
is properly passed to the client and that the memory is no longer shared.

BUG: 381674

Reviewers: #kwin, #frameworks, davidedmundson, zzag

Reviewed By: #kwin, zzag

Subscribers: plasma-devel, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D14910
2020-03-19 16:04:10 +02:00
Vlad Zahorodnii
f073c773da [server] Introduce SurfaceInterface::boundingRect()
Summary:
The new method provides a convenient way for determining the rectangle
that bounds the given surface and all of its sub-surfaces. This can be
very handy when determining the effective window geometry.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: apol, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D27828
2020-03-18 16:19:49 +02:00
Andreas Cord-Landwehr
9267f146fd KWayland: Convert license headers to SPDX
Summary:
Convert license headers to SPDX expressions and add license files as
required by REUSE specification.

Reviewers: zzag

Reviewed By: zzag

Subscribers: kde-frameworks-devel

Tags: #frameworks

Maniphest Tasks: T11550

Differential Revision: https://phabricator.kde.org/D28058
2020-03-16 19:57:44 +01:00
Carson Black
56e2680122 Add application menu dbus paths to org_kde_plasma_window interface
Summary:
This patch adds an interface allowing a compositor to send
the service name and object path of a PlasmaWindow's application menu
to the client.

Reviewers: #kwin, zzag, davidedmundson

Reviewed By: #kwin, zzag, davidedmundson

Subscribers: davidedmundson, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D27464
2020-03-06 19:50:12 -05:00
Friedrich W. H. Kossebau
b5a08d87b7 Use ecm_qt_install_logging_categories over manual categories file 2020-02-12 23:56:17 +01:00
David Edmundson
ca7ff1ecc1 [surface] Fix buffer offset when attaching buffers to surfaces
Test Plan:
Unit test
Will be tested by hotspots in drag icons

Reviewers: #kwin

Subscribers: kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D27190
2020-02-06 12:28:38 +01:00
Vlad Zahorodnii
1608b0d521 Update my last name 2020-01-24 03:06:11 +02:00
Friedrich W. H. Kossebau
6f69a44e2a Use K_DOXYGEN instead of deprecated DOXYGEN_SHOULD_SKIP_THIS
GIT_SILENT
2020-01-23 12:20:45 +01:00
Vlad Zahorodnii
a94443a6ff Update my email address 2020-01-14 18:26:11 +02:00
David Edmundson
6896e96014 [plasmashell] Update docs for panelTakesFocus to make it generic
Summary:
We want surfaces with a notification role to be able to switch ability
to take focus or not on the fly. The semantics are identical as the
panel
taking focus, we may as well re-use what exists and remove the implicit
limitation than re-invent the wheel and complicate things.

Test Plan: Docs

Reviewers: #kwin, romangg

Reviewed By: #kwin, romangg

Subscribers: romangg, apol, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D26175
2019-12-30 15:44:49 +00:00
David Edmundson
95956415c6 [plasmashell] Add signal for panelTakesFocus changing
Test Plan: Attached unit test

Reviewers: apol

Reviewed By: apol

Subscribers: apol, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D25965
2019-12-30 15:44:49 +00:00
David Faure
d18012b50b Make test more tolerant timing-wise
NO_CHANGELOG
2019-12-07 22:10:49 +01:00
Roman Gilg
663d780e71 [server] Do not own dmabuf implementation
Summary:
The dmabuf implementation should be managed by the compositor and not by the
interface which might go away through signals while the implementation goes
away in the compositor simultaneously.

Test Plan: Compiles.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D25576
2019-11-27 21:52:10 +01:00
Vlad Zagorodniy
443721b555 [server] Make double-buffered properties in xdg-shell double-buffered
Summary:
So far all double-buffered properties in our implementation of xdg-shell
weren't actually double-buffered. When a property setter is invoked, we
pray to the God hoping that the client committed associated surface.

This change introduces private SurfaceRole class. The new class provides
a way for SurfaceInterface to commit pending state of associated shell
surface.

The chosen architecture allows us to do more in the future. For example,
we could use SurfaceRole to prevent associating several roles to a single
wl_surface object, e.g. xdg-toplevel to a pointer surface, etc.

Test Plan: This change breaks support for client-side decorated clients in KWin.

Reviewers: #kwin

Subscribers: kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D23745
2019-11-26 22:49:04 +02:00
Roman Gilg
19f2fddc0a Add missing include for Qt 5.14 build 2019-11-22 15:26:23 +01:00
Jan Grulich
e8d192433d FakeInput: add support for keyboard key press and release
Summary: Adds support for keyboard button press and release as defined in linux/input-event-codes.h

Reviewers: davidedmundson, apol, #plasma, romangg

Reviewed By: davidedmundson, #plasma

Subscribers: kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D23766
2019-10-22 13:23:58 +02:00
Friedrich W. H. Kossebau
75b287fdde Use ECMGenerateExportHeader to manage deprecated API better
Summary:
Allows
* projects linking to KWayland to hide deprecated API up to a
  given version or silence deprecation warnings after a given version,
  using
  * -DKWAYLAND_DISABLE_DEPRECATED_BEFORE_AND_AT
  * -DKWAYLAND_NO_DEPRECATED
  * -DKWAYLAND_DEPRECATED_WARNINGS_SINCE
  * -DKWAYLAND_NO_DEPRECATED_WARNINGS

  or
  * -DKF_DISABLE_DEPRECATED_BEFORE_AND_AT
  * -DKF_NO_DEPRECATED
  * -DKF_DEPRECATED_WARNINGS_SINCE
  * -DKF_NO_DEPRECATED_WARNINGS

No support for "EXCLUDE_DEPRECATED_BEFORE_AND_AT", needs to be done by
someone with detailed knowledge about disabling implementation, if wanted.

Reviewers: #kwin

Subscribers: zzag, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D24663
2019-10-20 03:25:00 +02:00
Friedrich W. H. Kossebau
fe266fbb5f Fix non-integer scale copy on creation of OutputChangeSet
Reviewers: #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D24662
2019-10-15 15:04:13 +02:00
David Faure
31e2f9c5d7 [KWayland] Port away from deprecated API in Qt 5.14
Test Plan: Builds

Reviewers: davidedmundson, zzag

Reviewed By: zzag

Subscribers: kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D24014
2019-09-17 14:20:17 +02:00
Frederik Gladhorn
baa1363558 Sort files alphabetically in cmake list
Summary: Adding further files is confusing, since the list is almost alphabetical.

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: zzag, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D24002
2019-09-17 09:30:53 +02:00
Friedrich W. H. Kossebau
3e0bbe26fd Use new INCLUDE_DIRS with ecm_add_qch, to have doxygen see more includes
GIT_SILENT
2019-09-16 02:38:59 +02:00
Frederik Gladhorn
c778475f2a Improve documentation
Summary:
Some of the documentation did not say what the purpose of the
respective class was, but rather gave a tautology.
For people new to the code base it helps to mention that
DPMS is power management.

That DataDevice is for copy-and-paste and drag-and-drop is
maybe obvious to people used to X11 API, but not very clear
to most others.

When first reading the KWayland code, some explanations
help getting around.

Reviewers: #kwin, romangg

Reviewed By: #kwin, romangg

Subscribers: romangg, zzag, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D23915
2019-09-15 20:59:53 +02:00
Frederik Gladhorn
f5d371a6bf Use const_iterator
Summary: When trivial, replace iterators with the const version.

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D23917
2019-09-14 11:09:16 +02:00
Frederik Gladhorn
a942955b72 Remove capture of this in lambda
Summary: When this is not used, there is no point in capturing it.

Reviewers: #kwin, zzag, broulik

Reviewed By: #kwin, zzag, broulik

Subscribers: kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D23916
2019-09-12 22:05:57 +02:00
David Edmundson
6568802c95 [server] Wrap proxyRemoveSurface in smart pointer
Summary:
proxyRemoteSurface is a fake wayland surface created for the drag and
drop between X and wayland clients.

The lifespan is not guaranteed to outlive the DataDevice.

Kwin closes Xwl before the other wayland client connections so it's
technically dangling for a bit when events could be dispatched.

Probably will never happen, but better to guard and be safe.

Test Plan: Compiles

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D22862
2019-08-28 18:38:25 +01:00
Roman Gilg
b8c28c8a85 [server] Use cached current mode more and assert validness
Summary:
We can use the cached current mode in one more case. Additionally make it
more explicit what a valid mode is and when to add them.

Test Plan: Relevant autotests pass. KWin Wayland nested and DRM session work.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D23535
2019-08-28 15:01:24 +02:00
Roman Gilg
77730f7fa7 [server] Cache current mode
Summary:
Instead of looping over all modes for retrieving current mode data copy it
to a separate variable.

Test Plan:
KWin auto tests pass and KScreen in Wayland nested session shows correct
information.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kde-frameworks-devel

Tags: #frameworks

Maniphest Tasks: T11459

Differential Revision: https://phabricator.kde.org/D23493
2019-08-28 13:10:27 +02:00
Roman Gilg
18ec7ff484 Implement zwp_linux_dmabuf_v1
Summary: This interface provides a way for clients to create generic dmabuf-based wl_buffers.

Test Plan: Works with weston-simple-dmabuf-drm and weston-simple-dmabuf-egl in KWin.

Reviewers: #kwin, #plasma, graesslin, davidedmundson, mart, fredrik

Subscribers: zzag, kde-frameworks-devel, romangg, plasma-devel

Tags: #frameworks, #plasma_on_wayland

Maniphest Tasks: T8067

Differential Revision: https://phabricator.kde.org/D10747
2019-08-06 21:44:45 +02:00
Vlad Zagorodniy
280a82844f Use wayland-protocols
Summary:
So far we've been copying protocol specifications from wayland-protocols
repo to kwayland repo. The main issue with copying is that we have to
keep xml files in sync manually. A better approach would be to use xml
specs straight from wayland-protocols package.

Test Plan: Compiles.

Reviewers: #kwin, #frameworks, romangg, davidedmundson

Reviewed By: #kwin, romangg, davidedmundson

Subscribers: davidedmundson, apol, romangg, asturmlechner, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D22216
2019-07-08 10:53:44 +03:00
Aleix Pol
f41fd9b9e4 --verbose 2019-06-22 14:56:52 +02:00
Aleix Pol
0d43606d40 Proof of concept of a wayland protocol to allow the keystate dataengine to work
Test Plan: Tested with both the lock screen and the keyboard indicator plasmoid

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D20191
2019-06-22 12:25:59 +02:00
Vlad Zagorodniy
fdc54a9960 Allow compositors to send discrete axis values
Summary:
So far not all v5 features were implemented because most of them are
optional. But given that XWayland needs axis_discrete event maybe it's
time to implement them.

CCBUG: 404152

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, mthw, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D18933
2019-05-17 11:52:15 +03:00
Laurent Montel
16db84d40b Use QVariant::fromValue directly 2019-05-17 07:25:01 +02:00
David Edmundson
49e0cf53d4 Implement set_window_geometry
Summary:
Used by clients to say where their true window geometry is relative to
the buffer size. Important if a client has client side shadows which
shouldn't be included for positioning tasks.

Technically this should be double buffered, but for consistency with all
other XdgShell properties this will be a task left to ShellClient.

Test Plan: Unit test

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: zzag, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D20595
2019-05-14 12:32:53 +01:00
Roman Gilg
a5c4c32f1c Implement wl_surface::damage_buffer
Summary:
Missing from our surface handling was the damage_buffer call introduced in
version 4 of the wl_compositor interface.

Its only difference to a normal damage call is that the damaged region is
supposed to be defined by the client in buffer coordinates instead of
surface coordinates. This damage must be tracked separately in KWayland
and on commit with the buffer transformation united with the normal damage.

Test Plan: Autotest updated.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, zzag, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D15910
2019-05-08 09:50:32 +02:00
Kai Uwe Broulik
5a9df05460 Add CriticalNotification window type to PlasmaShellSurface protocol
Differential Revision: https://phabricator.kde.org/D20628
2019-05-02 10:11:40 +02:00
Erik Kurzinger
840268aa7e Implement wl_eglstream_controller Server Interface
Summary:
This implements a wrapper class for the wl_eglstream_controller Wayland
interface. It allows clients to inform the compositor when a new EGL Stream has
been created with an Wayland surface attached as its producer. The compositor
can then bind a GL texture as the stream's consumer allowing it access to the
surface's buffer contents for presentation. The only client currently expected
to make use of this interface is the NVIDIA EGL driver when running alongside a
compositor supporting EGLStream-based buffer sharing.

Reviewers: #kwin, romangg, davidedmundson

Reviewed By: #kwin, romangg, davidedmundson

Subscribers: kde-frameworks-devel

Tage: #frameworks

Differential Revision: https://phabricator.kde.org/D18824
2019-04-15 07:25:53 -07:00
David Edmundson
6dd0e17759 Hopefully fix flaky remote access test
Summary:
We have 4 events:

buffer1 created
buffer2 created
buffer1 paramters sent
buffer2 paramters sent

Some are batched

We should connect to buffer 1's parameters being sent after the first
buffer is recieved, not in the potential event loop waiting for buffer
2.

Test Plan:
Passes locally
Haven't tested on build.k.o

Reviewers: #kwin

Subscribers: kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D19476
2019-03-04 10:22:47 +00:00
David Edmundson
58af3e8200 Only commit XdgOutput::done if changed
Summary:
XdgOutput no-ops if one calls setLogicalSize(someSize)  and someSize
matches the last sent size

However, as we have an explicit done signal, we currently end up sending
this regardless.

This patches tracks if we've made any changes to commit in the done
event.

CCBUG: 400987

Reviewers: #kwin, romangg

Reviewed By: #kwin, romangg

Subscribers: romangg, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D19255
2019-02-25 14:13:05 +00:00
Jan Grulich
1cb96f6439 FakeInput: add support for pointer move with absolute coordinates
Summary: For remote desktop support, we need to move with the pointer using absolute positin.

Test Plan: I tested this with xdg-desktop-portal-kde and krfb and it worked.

Reviewers: davidedmundson, graesslin, zzag

Reviewed By: davidedmundson, zzag

Subscribers: graesslin, zzag, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D18114
2019-02-14 13:44:36 +01:00
David Edmundson
7de356da21 Add explicit SurfaceInterface::commited signal
Summary:
Whilst some interfaces that are double-buffered against the wl_surface
are proxied through SurfaceInterface, some are not, most notably
XdgShell.

We need some low level signal to know when the surface has been
committed which doesn't rely on their being a damaged buffer.

Test Plan:
Unit test
Used in kwin

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: zzag, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D18582
2019-02-12 14:07:06 +00:00
Roman Gilg
d10ff90865 [server] Add surface data proxy mechanism
Summary:
Allows a compositor to set a proxy surface to handle drag and drop
operations place of the actual surface the drag originated from.

One proxy surface can handle multiple origin surfaces at the same time. These
need to get registered once. The active remote surface gets set when a pointer
button is pressed on the surface.

Test Plan: Manually with KWin's Xwayland DnD patches.

Reviewers: #kwin

Subscribers: davidedmundson, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D15421
2019-02-06 10:51:54 +01:00
Roman Gilg
8b99a103b1 [server] Add selectionChanged signal
Summary: This signal notifies a compositor about selection changes on a seat.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D15023
2019-02-06 09:30:42 +01:00
Vlad Zagorodniy
ba786ee2ec [server] Generate correct touch ids
Summary:
testWaylandSeat fails because the seat interface generates incorrect id
for the second touch.

Test Plan: testWaylandSeat passes.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D18628
2019-01-31 17:45:46 +02:00
Vlad Zagorodniy
0d170cecb4 [autotests] Stabilize testWindowmanagement
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
2019-01-31 17:45:19 +02:00
David Edmundson
2176e0bc3b Make XdgTest spec compliant
Summary:
Right now it worked in kwin, but was in fact breaking the spec sending
buffers before it was configured.

There also seems to be an unclearly written (but very very sensible)
rule about comitting the surface after initial properties in order to
recieve the configure event.

After these changes it works in Weston too.

Test Plan: Ran test in kwin_wayland and weston

Reviewers: #kwin

Subscribers: kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D18577
2019-01-28 12:10:42 +00:00
Fabian Vogt
2184206c8b Add option to use wl_display_add_socket_auto
Summary:
If automaticSocketNaming is enabled, it will use wl_display_add_socket_auto
to allocate the next free socket. The resulting name can be retrieved using
socketName after a successful start afterwards.

Test Plan: Ran the new autotest, passes. kwin_wayland still uses the old behaviour.

Reviewers: #kwin, #plasma, romangg

Reviewed By: #kwin, #plasma, romangg

Subscribers: davidedmundson, zzag, romangg, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D17122
2019-01-25 13:32:03 +01:00
Vlad Zagorodniy
57e1bc0430 [server] Send initial org_kde_plasma_virtual_desktop_management.rows
Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D18521
2019-01-25 14:20:23 +02:00
Marco Martin
ee1e49ad68 Add rows info to the plasma virtual desktop protocol
Summary:
in order for the pager to work correctly and not having to use a weird mix of wayland and dbus apis, the rows
number needs to be in the protocol

Test Plan: new passing autotest

Reviewers: #plasma, #kwin, davidedmundson

Reviewed By: #plasma, #kwin, davidedmundson

Subscribers: zzag, davidedmundson, hein, kde-frameworks-devel

Tags: #frameworks

Maniphest Tasks: T4457

Differential Revision: https://phabricator.kde.org/D17691
2019-01-22 15:22:41 +01:00
Vlad Zagorodniy
5d775a4e28 [client] Wrap wl_shell_surface_set_{class,title}
Summary: We have to wrap these two requests just for convenience.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D18440
2019-01-22 10:54:05 +02:00