Commit graph

1066 commits

Author SHA1 Message Date
Vlad Zahorodnii
e4bf7e0334 Drop Global and Resource classes
They're unused.
2021-07-22 11:41:08 +03:00
Vlad Zahorodnii
0d2879c62d Split BufferInterface
Currently, the BufferInterface encapsulates all the kinds of client
buffers. This has become a somewhat annoying issue as we want to
reference the shm pool if a shm buffer is destroyed, or have custom
buffer readiness logic for linux dma-buf client buffers.

Implementing all of that with the current abstractions will be
challenging as there's no good separation between different client
buffer types.

This change splits the BufferInterface class in three sub-classes -
DrmClientBuffer, LinuxDmaBufV1ClientBuffer, and ShmClientBuffer.

In addition to that, this change fixes the broken buffer ref'ing api.
2021-07-22 11:41:06 +03:00
Vlad Zahorodnii
a244769a3f Make layer-surface acknowledged configure serials double-buffered state
This will be needed to delay surface commits.
2021-07-21 17:26:12 +00:00
Vlad Zahorodnii
c5691ba4de Make xdg-surface acknowledged configure serials double-buffered state
This will be needed to delay applying surface state.
2021-07-21 17:26:12 +00:00
Vlad Zahorodnii
9210e25c52 Build surface-to-buffer matrix based on current state
This makes it more clear that the surface-to-buffer matrix is computed
based on the current surface state.
2021-07-21 06:18:38 +00:00
Vlad Zahorodnii
ce92ac7451 Merge SurfaceInterfacePrivate::commit() and SurfaceInterfacePrivate::surface_commit()
This removes an unnecessary layer of indirection.
2021-07-21 06:18:38 +00:00
Vlad Zahorodnii
c2f0db4a92 Split SurfaceInterfacePrivate::swapStates()
Currently, the swapStates() function does two things - (a) it merges one
state with another; (b) it applies the next state. This change splits the
swapStates() so it's simpler and the boolean trap can be removed.
2021-07-21 06:18:38 +00:00
Vlad Zahorodnii
6e734a1f90 Remove needless current state copy
If nothing has been committed to the cached state, no changes to the
current state will be done.

If a synchronized sub-surface has been committed, the pending state will
be merged with the cached state. The latter state will be applied when
the parent surface is committed.
2021-07-20 08:08:22 +00:00
Vlad Zahorodnii
c55de7b70b Emit the committed() signal after the state is applied
Currently, the committed signal is emitted after the client has called
wl_surface.commit. However, this breaks with synchronized subsurfaces.

Notably, Firefox splits a web page in a bunch of smaller layers, which
can be backed by wl_subsurface objects.

All the subsurfaces are in the sync mode. If a layer needs to be
repainted, Firefox will commit the corresponding subsurface with a frame
callback.

Since the committed signal is emitted when the wl_surface.commit request
is invoked, kwin will schedule a new frame immediately. Meaning, that it
is quite likely that firefox will have old contents.

The right thing to do would be to schedule a frame when all the ancestors
of the layer subsurface have been committed.

This change re-jitters the commit logic so the committed signal is
emitted when a new state is applied to the surface. It also slightly
cleans up how SubSurfaceInterface::parentCommit() is called.

It will be nice to cleanup the commit logic further by calling the
surface role's commit hook unconditionally, i.e. not check whether it's
a subsurface. But doing so may result in infinite recursions. How to
clean up that is still TBD.
2021-07-16 13:07:56 +03:00
Vlad Zahorodnii
17cccfa233 Allow placing subsurfaces below parent surface
According to the spec, if the parent surface is specified in the
wl_subsurface.place_below(), the subsurface has to be rendered below the
parent surface.

At the moment, kwaylandserver doesn't handle that case properly. It is
not possible for sub-surfaces to go below the parent surface.

Another issue is that we wrongly assume that the place_above request
will put the subsurface on top of the stack if the parent surface is
specified as sibling. It doesn't seem like that's the case, not
according to the spec.

This change splits the child sub-surface list in two lists - below and
above. The alternative solution is to store the parent surface in the
children list, but it's an error prone solution and it's conceptually
weird.
2021-07-08 05:33:14 +00:00
Emilio Cobos Álvarez
9d8b387d52 display: Add an outputsIntersecting helper.
This will be used to clean up https://invent.kde.org/plasma/kwin/-/merge_requests/1128.
2021-06-24 13:23:22 +02:00
Vlad Zahorodnii
4dd205ce4f Don't move keyboard focus on button press
Until the spec is clear about how the keyboard focus should be
transferred between sub-surfaces, it's better to remove this heuristic
and focus only the main surface.

For example, if an application window has sub-surfaces but user doesn't
press any pointer button, any sub-surface can have focus.

Effectively, this reverts 6fe14f73d2.
2021-06-21 16:56:01 +03:00
Vlad Zahorodnii
5c6b1f4e8d Remove explicit flush in DataDeviceInterface
This allows the compositor batch events better.

If the event loop is about to block, client connections will be flushed.
2021-06-19 14:17:03 +03:00
Vlad Zahorodnii
98477eabc1 Remove manual flush when sending buffer release event
This way we can batch more events before flushing the client connection.
2021-06-19 11:12:35 +03:00
Vlad Zahorodnii
ac60e35818 Don't flush client connection when sending frame callbacks
This way, the compositor can batch more frame callbacks before flushing
the client connection. We attempted this before, but it broke tests.

Now, it seems like the tests pass, so we can remove the manual flush.
2021-06-19 11:12:25 +03:00
Aleix Pol
669d7fd652 xdgactivation: allow sourcing a request's client without a given surface 2021-06-14 17:43:03 +02:00
Aleix Pol
7dd092e910 Implement zwp_input_method_context_v1::grab_keyboard
Offers a new InputKeyboardV1Interface instance that wraps the
wl_keyboard and allows the compositor to forward the keyboard events.
2021-06-03 19:12:12 +02:00
David Edmundson
ecda92e023 Introduce a new signal when a drag is dropped 2021-06-03 11:17:59 +01:00
Vlad Zahorodnii
398841363b Move viewport state into a struct
It makes it more clear what state belongs to the wp_viewport extension.
2021-05-26 21:21:34 +03:00
Vlad Zahorodnii
86d39af6a0 Move surface state struct in KWaylandServer namespace
This way, it's less characters to type. In order to support delayed
surface commits, compositor extensions need to piggyback their state on
the state of the wl_surface. In other words, SurfaceState is going to
be used not only by SurfaceInterface, but the viewporter extension, the
xdg-shell extension, etc.
2021-05-26 21:21:05 +03:00
Aleix Pol
dde500c3ff Implementation of xdg_activation_v1
Offers KWaylandServer::XdgActivationV1Interface
2021-05-24 17:18:44 +02:00
Aleix Pol
b7d733fd76 textinput_v2: Make sendEnter/sendLeave the ones who decide the current surface
Instead of enabled/disabled. This made it possible for non-focussed
processes to interact with our virtual keyboard. In practice, this meant
that sometimes when switching applications, the disabled from the former
application would arrive after the enabled of the latter, leaving kwin
in a broken state (that the user could address by tapping on the screen
just once).
2021-05-22 02:23:53 +02:00
Aleix Pol
a4a10865e4 textinput: translate normal to normal
Not to alpha, maliit considers alpha to just be letters and goes to such
a mode.
2021-05-22 02:09:14 +02:00
Aleix Pol
75ba7fdc90 inputmethod: Make sure to test AutoCompletion
We were doing AutoCapitalization twice, I imagine it was a copy&paste
situation.
2021-05-21 19:17:17 +02:00
Aleix Pol
7e80c54d5d textinput: prefer smart pointers 2021-05-21 19:17:17 +02:00
Aleix Pol
961debb513 textinput: Expose enums to moc
Allows us to pass them to qDebug easily.
2021-05-21 19:17:17 +02:00
Xaver Hugl
93a4104b1e output interface: mark bind and release methods as override 2021-05-20 14:23:20 +02:00
David Edmundson
4a505823d7 Send surface_leave events before announcing output removal
It's the more logical order from the POV of a client
2021-05-19 22:58:38 +01:00
Laurent Montel
0c49d302ce Use Q_EMIT to make it compile against kf5.82 2021-05-13 11:33:08 +02:00
Vlad Zahorodnii
d740a45469 Fix invalid iterator in SurfaceInterfacePrivate::raiseChild()
The append method will invalidate the iterator, so we cannot call the
erase() method with the old iterator.
2021-05-13 10:16:25 +03:00
Vlad Zahorodnii
89dc01ada8 Add a PlasmaShellSurfaceInterface getter
This allows to simplify some compositor code.
2021-05-13 09:17:56 +03:00
Vlad Zahorodnii
c2fc33872e Introduce ClientConnection::aboutToBeDestroyed
This signal is useful if the compositor wants to perform some cleanup
before the disconnected signal is emitted or while the connection object
still has valid wl_client native handle.
2021-05-12 22:39:07 +03:00
Vlad Zahorodnii
da3f4923f1 Scanner: Clean up display destroy listener in deferred global destroy func
We also need to clean up the display destroy listener in the deferred
global destroy func to avoid use-after-free bugs on the display tear down.
2021-05-12 13:52:59 +00:00
Vlad Zahorodnii
e4271a787f Scanner: Remove global version check
libwayland-server ensures that the requested version is less than or
equal to the global version.

This change removes the global version check to simplify the generated
code and reduce memory usage footprint, however the latter shouldn't be
that noticeable.
2021-05-12 14:41:15 +03:00
Vlad Zahorodnii
d9eb05c9a7 Fix delayed global removal
Unfortunately, we cannot just simply unset the wl_global's user data.
The compositor still needs to process client requests after the global
has been removed, for example bind requests or the requests that create
new resources.

CCBUG: 435258
2021-05-12 10:59:45 +03:00
Vlad Zahorodnii
94c92393b1 Prevent potential QMap detaching
Store resourceMap() in a local const variable to avoid detaching.
2021-05-05 23:02:01 +03:00
Vlad Zahorodnii
cdafb5d0da Remove irrelevant workarounds
We have a local fork of qtwaylandscanner so we don't need any quirks to
handle inert resources.
2021-05-05 22:57:53 +03:00
Friedrich W. H. Kossebau
6dd131d815 Port away from ECMSetupVersion's deprecated *_VERSION_STRING CMake variable
GIT_SILENT
2021-05-04 22:13:59 +02:00
Aleix Pol
674e1433af textinputv2: readability
Remove unnecessary casts
2021-05-01 03:24:24 +02:00
Aleix Pol
036663e76d textinputv2: announce the input panel to be hidden as the instance gets disabled
Otherwise we disable it and all events will be disabled (since surface
gets cleared).
This is especially useful since otherwise we lose synchronicity with the
client and weird behaviours happen (like when the client thinks it has a
keyboard but it actually does not).
2021-04-30 12:46:14 +00:00
Xaver Hugl
3b7a43e54b Add VRR to OutputDevice and OutputConfiguration 2021-04-29 13:37:37 +00:00
Aleix Pol
6a3e80d11d Use Q_ENUM on enum class
Otherwise it can't be passed to QDebug at all
2021-04-29 11:04:37 +00:00
Alexander Lohnau
3acd2b5a26 GIT_SILENT Add trailing comma to enums 2021-04-29 11:45:00 +02:00
Aleix Pol
445289d168 Fix leak in test
Unregister an interface when we're done with it. This also ensures we
don't have several running in parallel as well.
2021-04-22 17:31:26 +02:00
Aleix Pol
c9c1c3ae0d Make sure we don't leak interfaces
Properly set the parent
2021-04-22 17:30:54 +02:00
Aleix Pol
b2d648df5d datadevice: do not call a null dragSource
Fixes the following backtrace:
*0  KWaylandServer::DataDeviceInterface::dragSource() const (this=0x0)
at ./src/server/datadevice_interface.cpp:199
*1  0x00007f10d67b0c71 in
KWaylandServer::DataDeviceInterface::updateDragTarget(KWaylandServer::SurfaceInterface*,
unsigned int) (this=0x55c42e3ee9a0,
surface=surface@entry=0x55c42e4b3170, serial=serial@entry=3104)
    at ./src/server/datadevice_interface.cpp:278
*2  0x00007f10d67d8e52 in
KWaylandServer::SeatInterface::setDragTarget(KWaylandServer::SurfaceInterface*,
QPointF const&, QMatrix4x4 const&)
(this=this@entry=0x55c42d422ed0, surface=0x55c42e4b3170,
globalPosition=..., inputTransformation=...) at
/usr/include/c++/9/bits/atomic_base.h:413
*3  0x00007f10d67d9209 in
KWaylandServer::SeatInterface::setDragTarget(KWaylandServer::SurfaceInterface*,
QMatrix4x4 const&) (this=this@entry=0x55c42d422ed0, surface=<optimized
out>, inputTransformation=...)
    at ./src/server/seat_interface.cpp:578
*4  0x000055c42cb4563a in KWin::Xwl::XToWlDrag::setDragTarget()
(this=this@entry=0x55c42ea07a00) at ./src/toplevel.h:990
*5  0x000055c42cb47a68 in KWin::Xwl::XToWlDrag::offerCallback(QString
const&) (mime=..., this=0x55c42ea07a00) at ./src/xwl/drag_x.cpp:242
*6  KWin::Xwl::XToWlDrag::offerCallback(QString const&)
(this=0x55c42ea07a00, mime=...) at ./src/xwl/drag_x.cpp:237
*7  0x00007f10d5dc06fe in  () at /lib/x86_64-linux-gnu/libQt5Core.so.5
2021-04-22 12:21:42 +02:00
Xaver Hugl
3905cfe3ee Add support for overscan 2021-04-19 13:02:18 +02:00
Heiko Becker
d4e5468c70 cmake: Specify file extension for idleinhibit_v1_interface
Gets rid of a cmake warning.

GIT_SILENT
2021-04-16 16:23:17 +02:00
Laurent Montel
2908a02d92 It's deprecated in qt5.15 2021-04-08 22:32:25 +02:00
Vlad Zahorodnii
da81f4c9e8 Send valid UUIDs for output device globals
Currently, kwin sends invalid uuids. This change makes harder to send
invalid uuids by porting relevant parts of the OutputDeviceInterface to
QUuid.
2021-04-08 17:35:30 +00:00
Vlad Zahorodnii
8f3993c91b Drop workaround for QTBUG-52092
I've been using kwaylandserver without this workaround for a while and
haven't experienced any issues. Also, there were some sub-surface fixes
in QtWayland.
2021-04-08 10:17:01 +03:00
Vlad Zahorodnii
8b7136f70d Send only current wl_output mode
Non-current output modes were deprecated due to various reasons, e.g.
it's not possible to remove some nodes; two modes can have the same
resolution and the refresh rate but different flags, but wl_output.mode
fails to communicate that properly; the usefulness of non-current modes
is questionable. For more details, please refer to [1].

[1] https://gitlab.freedesktop.org/wayland/wayland/-/issues/92
2021-04-07 11:04:26 +00:00
Vlad Zahorodnii
f30bd9e341 Rework OutputInterface following new design principles 2021-04-07 11:04:26 +00:00
Vlad Zahorodnii
f16320e693 Don't use nested private class in ClientConnection
Nested private classes are highly discouraged in KWaylandServer due to
their flaws, e.g. it's very easy to forget to put Q_DECL_HIDDEN, etc.
2021-04-06 06:45:39 +00:00
Vlad Zahorodnii
35d601bb23 Don't use nested private class in FilteredDisplay
The usage of nested private classes is highly discouraged in
kwaylandserver due to various reasons, e.g. it's easy to forget to put
Q_DECL_HIDDEN, etc.
2021-04-05 11:35:06 +03:00
Vlad Zahorodnii
f119c9470d Fix some coding style issues in FilteredDisplay 2021-04-05 11:33:54 +03:00
Vlad Zahorodnii
ba4f796e24 Remove some unused includes 2021-04-05 11:20:24 +03:00
Vlad Zahorodnii
7058710eca Use code generated by qtwaylandscanner to send xdg-exported handle
This was overlooked during the port to the new approach.
2021-04-02 10:04:49 +03:00
Vlad Zahorodnii
18815f88fb Drop SurfaceInterface::trackedDamage()
There is no need for both kwin and kwaylandserver track damage.
2021-03-31 13:33:29 +00:00
Vlad Zahorodnii
75a6fd29fd Introduce SurfaceInterface::childSubSurfacesChanged
Currently, the SurfaceInterface class has a signal that is emitted
whenever any sub-surfaces in its sub-tree changes in a way that requires
a repaint. It is emitted when a sub-surface is resized, moved, or
damaged, etc. There is no way for the compositor to track changes in the
stacking order of sub-surfaces efficiently.

This change replaces the subTreeChanged signal with a less noisy signal
that's emitted whenever the list of direct child sub-surfaces changes.
2021-03-31 13:24:58 +00:00
Vlad Zahorodnii
daadaa70de Send current primary selection after introducing focused surface
Toolkits such as GTK don't like that kwin sends the current primary
selection before the wl_keyboard.enter event.
2021-03-30 06:03:39 +00:00
Aleix Pol
4a357d503e Fix typo 2021-03-26 15:32:18 +01:00
Vlad Zahorodnii
755004acd0 Remove redundant check
Given that both pointers are not null and the size is a positive
integer, qstrncpy() can never return null.
2021-03-26 13:41:04 +02:00
Vlad Zahorodnii
c56712776a Fix management of keymap files
This is a regression that was introduced with the port to the new
approach.
2021-03-26 13:17:13 +02:00
Vlad Zahorodnii
83087817f4 Forward keyboard events via seat
This is needed for keyboard grabs. If the seat is notified about a
keyboard event, it will need to forward the event to the grab object,
which in its turn will decide what should happen to the event.
2021-03-26 09:08:12 +00:00
Vlad Zahorodnii
70daa07f27 Destroy output device globals with a delay
When hot plugging outputs, we may hit the wl_global race condition.

We need to delay the destruction of output device globals to prevent
hitting that race condition.
2021-03-26 07:50:32 +00:00
Vlad Zahorodnii
b27150387c Fix -Wunused-variable 2021-03-25 17:29:51 +02:00
David Edmundson
1fec9ed4ae Add API to remove globals without immediate destruction
Destroying a global leads to a race on the client. If a client binds
at just the wrong moment they will use an invalid ID and cause a
protocol error. The current best thing to do is to announce the removal
then remove the global (and thus the ID) only after a delay. Non-ideal,
but better than nothing.

Pragmatically this affects only:
Blur/Contrast/Slide/Output/OutputDevice

See https://gitlab.freedesktop.org/wayland/wayland/issues/10 for more.
2021-03-25 12:31:03 +00:00
Vlad Zahorodnii
71d4b463f0 autotests: Drop testPlasmaWindowModel
KWaylandServer doesn't implement the KWayland::Client::PlasmaWindowModel
class so there is no point for carrying this test.
2021-03-25 08:19:19 +00:00
Vlad Zahorodnii
0b688f6b6e Improve code readability in xdg-foreign wrapper
This moves out code that links/unlinks imported toplevels and child
surfaces in functions to improve code readability.
2021-03-25 07:53:36 +00:00
Vlad Zahorodnii
060940e426 Remove unused method in XdgImporterV2Interface 2021-03-25 07:53:36 +00:00
Vlad Zahorodnii
77a065e8de Remove redundant anonymous namespace
static functions already have translation unit internal linkage.
2021-03-24 15:08:31 +02:00
Vlad Zahorodnii
06cfe1a24a Fix a typo
This probably needs to be currentPrimarySelection.
2021-03-23 21:10:07 +02:00
Vlad Zahorodnii
a50f84a868 Merge notifyPointerPress() and notifyPointerRelease()
This brings the API of the SeatInterface class and the PointerInterface
class closer the corresponding Wayland API.
2021-03-23 11:20:03 +02:00
Vlad Zahorodnii
2af2ba6d4c Use common doxygen comment terminator style
In plasma code, it's more common to see `/** ... */` doxygen comments
rather than `/** ... **/`.

This change fixes up doxygen comment terminators to prevent inconsistency
issues.
2021-03-23 08:14:02 +00:00
Vlad Zahorodnii
c94787bbf4 Move DESIGN.md to toplevel directory
This makes DESIGN.md more noticeable.
2021-03-22 21:30:43 +02:00
Vlad Zahorodnii
a3ab80677c Fix handling of the case where specified surface can't imported
An xdg_imported resource must be created no matter whether there is an
exported surface with the specified handle.

This change fixes handling of that case in kwaylandserver by introducing
a dummy imported object.

If there is no exported surface with the given handle, the compositor
should create an xdg_imported resource and immediately send the
destroyed event.

A dummy imported object is needed because generated code sets resource
implementation; otherwise we would set an implementation without any
user data to mark the resource as inert.
2021-03-22 17:46:12 +00:00
Vlad Zahorodnii
d4901d16fa Call XdgImportedV2Interface::send_destroyed() that takes no resource
XdgImportedV2Interface already knows what the associated resource is, so
we can call send_destroyed() method that takes no resource to let auto
generated code figure out what resource must be used. It simplifies code.
2021-03-22 19:42:05 +02:00
Vlad Zahorodnii
e4b9f9761f Simplify emission of XdgForeignInterface::transientChanged signal
We can emit the transientChanged signal directly on the foreign object.
2021-03-22 17:15:02 +00:00
Vlad Zahorodnii
9445bfb6d8 Simplify QHash lookups
QHash provides a convenience helper to lookup a value, use it. It makes
the code simpler.
2021-03-22 17:15:02 +00:00
Vlad Zahorodnii
2f102e7544 Fix various minor coding style issues
This fixes various coding style issues, e.g. wrong variable name
capitalization, wrong brace placement, etc.
2021-03-22 17:15:02 +00:00
Vlad Zahorodnii
e5bde36e96 Get rid of unnecessary private classes in xdg-foreign wrappers
There's no point for using the d-pointer pattern because the importer
and the exporter classes are private already, they are not exposed in
public api.
2021-03-22 17:15:02 +00:00
Vlad Zahorodnii
5b060bcab0 Remove since version tag in OutputInterface
kwaylandserver is an unstable library, this renders since version tags
highly unreliable.
2021-03-22 18:58:48 +02:00
Vlad Zahorodnii
ca69d9e62a Remove noop destructors 2021-03-22 17:42:28 +02:00
Vlad Zahorodnii
0461b7fe27 autotests: Fix testXdgForeign
Currently, testXdgForeign fails because imported and exported resources
are destroyed immediately from destructor request handlers and code that
performs cleanup in the exported-imported mapping tables accesses the
dangling pointers.

Previously, it wasn't an issue because the destruction of exported and
imported resources was delayed using QObject::deleteLater().
2021-03-22 15:31:41 +00:00
Kevin Ottens
d92fa7f140 Add the activity management protocol server implementation 2021-03-22 11:28:57 +00:00
Vlad Zahorodnii
b822c1e63a Simplify handling of inert input method context
If the input method context object becomes inert, just delete it.
2021-03-22 10:16:34 +00:00
Weng Xuetian
823a34a10d Add explicit done to OutputInterface and deprecate zxdg_output_v1.done if version 3 is used.
In zxdg_output_v1 version 3, done is deprecated and should be replaced
with wl_output.done. This makes automatically send done upon change not
suitable for the usage. OutputInterface user should now use done()
explicitly to send the update.

CCBUG: 433224
2021-03-19 10:39:07 -07:00
Usarin Heininga
2414deb86b Expose missing client UUids in plasma windowManagementInterface
StackingOrder.
2021-03-19 13:54:50 +00:00
Vlad Zahorodnii
61a6ee4b07 Rename some methods in xdg-foreign classes 2021-03-17 10:46:11 +02:00
Vlad Zahorodnii
1f83657c65 Remove unused signals 2021-03-17 10:46:02 +02:00
Vlad Zahorodnii
8fc6cb85a6 Remove redundant class forward declarations 2021-03-17 10:43:58 +02:00
Vlad Zahorodnii
9763aec020 Send an icon only if there is one
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.
2021-03-16 15:43:59 +02:00
Vlad Zahorodnii
f321882177 autotests: Fix testWindowmanagement
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().
2021-03-16 15:28:46 +02:00
Vlad Zahorodnii
bdb138bdcd Remove @since version tags
Currently, we have a mix of Frameworks versions and Plasma versions in
@since tags, which leads to some confusion. Since this is an unstable
library, one cannot rely on since version tags, we are free to add,
change, and remove apis to serve best to kwin requirements. Thus, we can
simply remove all since version tags to fix mixing up different product
versions.
2021-03-16 10:08:21 +02:00
Vlad Zahorodnii
a6ef2cc9e4 Remove pointer asserts in gesture related functions
These asserts were overlooked in 59ae762300.
2021-03-15 18:53:24 +02:00
Vlad Zahorodnii
59ae762300 Replace input device asserts with if checks
KWin may call pointer or touch-related function even if the
corresponding capabilities are missing.
2021-03-15 16:41:14 +00:00
Vlad Zahorodnii
62c8a3829c Don't print a warning if the compositor sets focused surface without wl_keyboard capability
KWin may set focused keyboard surface even if there is no wl_keyboard
capability. :/
2021-03-15 16:41:14 +00:00
Vlad Zahorodnii
43a56a6ce8 Explicitly destroy inert tablet resources
This makes handling of inert resources easier.
2021-03-15 16:34:46 +00:00
Vlad Zahorodnii
16db81b5cc Make RegionInterface private
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.
2021-03-15 16:28:30 +00:00