Uses a setter and clear method pattern rather than having the code
repeated.
Instead of keeping a QPointer, now we are a QObject and we get notified
about destruction intention directly, so we can clear the pointer when
necessary.
Summary:
Notify the driver about the parts of the screen that will be repainted.
In some cases this can be benefitial. This is especially useful on lima
and panfrost devices (e.g. pinephone, pinebook, pinebook pro).
Test Plan:
Tested on a pinebook pro with a late mesa version.
Basically I implemented it, then it didn't work and I fixed it.
Maybe next step we want to look into our damage algorithm.
The main advantage of SPDX license identifiers over the traditional
license headers is that it's more difficult to overlook inappropriate
licenses for kwin, for example GPL 3. We also don't have to copy a
lot of boilerplate text.
In order to create this change, I ran licensedigger -r -c from the
toplevel source directory.
Otherwise we'll show a dangling cursor but otherwise the cursor will be
updated by other code paths, so we end up with a weird cursor in the
middle of the screen that doesn't move.
It is possible for updateOutputs to be called when a pageflip is pending.
Freeing a DrmOutput with a pending pageflip is not allowed (see ~DrmOutput assert - the page flip handler will be called on the freed memory, possibly leading to use-after-free).
This works around the problem by delaying the destruction with teardown().
BUG: 422460
In atomic setting mode, when external display tears down, it will blank
crtc with dump buffer by legacy api, then re-plug the external display,
the blank can not be removed. We think the blank is not needed in atomic
mode setting.
Signed-off-by: Chaojiang Luo <chaojiangluo@163.com>
We don't need to bind disabled outputs to surfaces that overlaps them.
This prevents error down the line and warnings about ignoring surface.enter events with Qt.
BUG: 419749
In previous code we used to update/show cursor even when the pointer
device was present, e.g mobile device. Guard it behind the cursor
enabled check.
BUG: 418977
FIXED-IN: 5.19.0
Summary:
BUG: 420077
Sample stack traces :
From bug:
#2 QImage::copy (this=this@entry=0x558117775e20, r=...) at image/qimage.cpp:1172
#3 0x00007f22d0a24cdf in QImage::detach (this=this@entry=0x558117775e20) at image/qimage.cpp:1091
#4 0x00007f22d0a25ae0 in QImage::fill (this=0x558117775e20, color=...) at image/qimage.cpp:1806
#5 0x00007f22d0a25f5f in QImage::fill (this=this@entry=0x558117775e20, color=color@entry=Qt::transparent) at image/qimage.cpp:1780
#6 0x00007f22bf3bdffd in KWin::DrmOutput::updateCursor (this=0x5581176fb780) at ./plugins/platforms/drm/drm_output.cpp:175
#7 0x00007f22bf3b0e55 in KWin::DrmBackend::updateCursor (this=0x558117669b60) at ./plugins/platforms/drm/drm_backend.cpp:701
Locally reproduced:
#0 0x00007f360611e159 in KWayland::Server::OutputDeviceInterface::transform() const (this=<optimized out>)
at /home/meven/kde/src/kwayland/src/server/outputdevice_interface.cpp:590
#1 0x00007f3607438059 in KWin::AbstractWaylandOutput::transform() const (this=this@entry=0x5645bed10f90) at /home/meven/kde/src/kwin/abstract_wayland_output.cpp:317
#2 0x00007f35ecd8acd3 in KWin::DrmOutput::matrixDisplay(QSize const&) const (this=0x5645bed10f90, s=...)
at /home/meven/kde/src/kwin/plugins/platforms/drm/drm_output.cpp:155
#3 0x00007f35ecd8efa9 in KWin::DrmOutput::updateCursor() (this=<optimized out>) at /home/meven/kde/src/kwin/plugins/platforms/drm/drm_output.cpp:179
#4 0x00007f35ecd81db5 in KWin::DrmBackend::updateCursor() (this=0x5645bec743a0) at /home/meven/kde/src/kwin/plugins/platforms/drm/drm_backend.cpp:701
#5 0x00007f36049e7fe7 in () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#6 0x00007f36075ee43f in KWin::Cursors::currentCursorChanged(KWin::Cursor*) (this=<optimized out>, _t1=<optimized out>)
at /home/meven/kde/build/kwin/kwin_autogen/EWIEGA46WW/moc_cursor.cpp:385
Test Plan: Could not reproduce
Reviewers: #kwin, zzag, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: ngraham, apol, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D28889
Summary:
It turns out DRM connectors are not static and may change over time.
This patch refreshes them right before looking for new outputs.
BUG: 419061
FIXED-IN: 5.19.0
Test Plan:
Seems to work better, it's still not ideal but I think there's an unrelated bug
sending updates to clients.
Reviewers: #kwin, davidedmundson, meven
Reviewed By: #kwin, davidedmundson, meven
Subscribers: dalbers, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D28642
Summary:
AbstractOutput::name() behaviour is changed so that it matches the X11
behaviour, showing an identifier like "HDMI-0".
XdgOutput.name is set to this name.
XdgOutput.description is currently set to the manufacturer name and
model, but it's not exposed to Qt so we probably don't care too much.
This should fix plasmashell changing applets when switching between X11
and wayland.
Test Plan:
Relevant unit test
I still need to run it on my laptop.
Reviewers: #kwin, #plasma, zzag
Reviewed By: #kwin, #plasma, zzag
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D28230
Summary:
Print automatically a few properties as well as the type, so it's easier
to read debug information.
Test Plan: Debugged a fix with it
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D28641
Summary:
As is KWin only had 1 Cursor which was a singleton. This made it impossible for
us to properly implement the tablet (as in drawing tablets) support and show where
we're drawing.
This patch makes it possible to have different Cursors in KWin, it makes all the
current code still follow the mouse but the tablet can still render a cursor.
Test Plan: Tests pass, been using it and works as well as before but with beautiful tablet cursors.
Reviewers: #kwin, cblack, davidedmundson
Reviewed By: #kwin, cblack, davidedmundson
Subscribers: davidedmundson, cblack, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D28155
Summary: No need to keep them around for no reason.
Test Plan: Tested the plugins I thought could be affected. Have been using it for a couple of days without problems
Reviewers: #kwin, zzag
Reviewed By: #kwin, zzag
Subscribers: zzag, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D28062
Summary:
Currently, we have only one shell client type - XdgShellClient. We use
it when we are dealing with Wayland clients. But it isn't really a good
idea because we may need to support shell surfaces other than xdg-shell
ones, for example input panel surfaces.
In order to make kwin more extensible, this change replaces all usages
of the XdgShellClient class with the AbstractClient class.
Test Plan: Existing tests pass.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D27778
Summary:
This functionality will instead be implemented in KScreen such that manual and
automatic output rotation can be used and configured through a single UI in
unison together.
Test Plan: Compiles.
Reviewers: #kwin, davidedmundson, zzag
Reviewed By: #kwin, zzag
Subscribers: kwin, bshah, davidedmundson, zzag
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D26036