Summary:
The initial blank needs to happen after the output device has been
initialized to get the current mode size.
Also we can't assert in legacy mode on the page flip pending since
a page flip can also be the result of a CRTC blank using a different.
BUG: 412684
FIXED-IN: 5.17.1
Test Plan: Full Plasma session
Reviewers: #kwin, zzag
Reviewed By: #kwin, zzag
Subscribers: zzag, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D24829
Summary:
With recent Mesa updates (19.2.1), MESA_EGL_NO_X11_HEADERS doesn't have
any effect. So, let's include fixx11h.h instead.
Test Plan: I am able to build kwin once again.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D24840
Summary:
This is necessary to keep openQA working, which uses LLVMpipe as a
renderer on a Cirrus device that operates in depth 16.
LLVMpipe advertises 24/32 bit sRGB configurations on this setup, but
they cannot be presented.
CCBUG: 408594
Test Plan: Compile tested only.
Reviewers: fvogt, #kwin, zzag
Reviewed By: fvogt, #kwin, zzag
Subscribers: romangg, sbergeron, fvogt, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D22203
Summary:
Context behaviour subtly changed in Qt5.14 which has exposed some
questionable things in this KCM.
Auorae::Decoration is a context property of the loaded QML.
QObject::~QObject signals it's own deletion before deleting children.
This means the bindings of loaded QML update in particular
aurorae.qml
DecorationOptions {
id: options
deco: decoration
}
DecorationOptions has a pointer to the previously set decoration which
is now dangling, and we crash.
Rather than adding more guards and smart pointers in DecorationOptions,
this patch deletes the QQmlContext before deleting the context
properties that we expose.
It also moves unreferring the shared qmlcontext we inherit from till
after we've deleted the child context, because it didn't make sense.
Test Plan:
Opened KCM
Closed the KCM
didn't crash
Reviewers: #kwin, zzag
Reviewed By: #kwin, zzag
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D24594
Summary:
Rotation in the past was not working in the DRM backend reliable. Now on 5.17
it even freezes the KWin session, so for now we need to just disable it trying.
Test Plan:
Tried to change Rotation with KScreen. Nothing happened but session was still
usable afterwards.
Reviewers: #kwin
Subscribers: ngraham, jriddell, bshah, zzag, apol, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D24112
Summary:
Everything is already multiplied in the buffer, we want to copy the
source directly.
Test Plan:
Looked at something with EffectQuickView and alpha
It now matched what it should be
Reviewers: #kwin, zzag
Reviewed By: #kwin, zzag
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D24368
Summary:
In order to properly implement xdg_surface.set_window_geometry we need
two kinds of geometry - frame and buffer. The frame geometry specifies
visible bounds of the client on the screen, excluding client-side drop
shadows. The buffer geometry specifies rectangle on the screen that the
attached buffer or x11 pixmap occupies on the screen.
This change renames the geometry property to frameGeometry in order to
reflect the new meaning assigned to it as well to make it easier to
differentiate between frame geometry and buffer geometry in the future.
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D24334
In file included from /build/src/kwin-5.16.90/plugins/platforms/hwcomposer/hwcomposer_backend.cpp:21:
/build/src/kwin-5.16.90/plugins/platforms/hwcomposer/hwcomposer_backend.h:58:11: error:
'QSize KWin::HwcomposerOutput::pixelSize() const' marked 'override', but does not override
58 | QSize pixelSize() const override;
| ^~~~~~~~~
Fixes dbb2cede08
Reviewed-by: Bhushan Shah <bshah@kde.org>
Summary:
There's no point for calling discardShape from the destructor of a
Scene::Window subclass because window quads cache will be destroyed
automagically by QScopedPointer.
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D24317
Summary:
EffectQuickView/Scene is a convenient class to render a QtQuick
scenegraph into an effect.
Current methods (such as present windows) involve creating an underlying
platform window which is expensive, causes a headache to filter out
again in the rest of the code, and only works as an overlay.
The new class exposes things more natively to an effect where we don't
mess with real windows, we can perform the painting anywhere in the view
and we don't have issues with hiding/closing.
QtQuick has both software and hardware accelerated modes, and kwin also
has 3 render backends. Every combination is supported.
* When used in OpenGL mode for both, we render into an FBO export the
texture ID then it's up to the effect to render that into a scene.
* When using software QtQuick rendering we blit into an image, upload
that into a KWinGLTexture which serves as an abstraction layer and
render that into the scene.
* When using GL for QtQuick and XRender/QPainter in kwin everything is
rendered into the internal FBO, blit and exported as an image.
* When using software rendering for both an image gets passed directly.
Mouse and keyboard events can be forwarded, only if the effect
intercepts them.
The class is meant to be generic enough that we can remove all the
QtQuick code from Aurorae.
The intention is also to replace EffectFrameImpl using this backend and
we can kill all of the EffectFrame code throughout the scenes.
The close button in present windows will also be ported to this,
simplifiying that code base.
Classes that handle the rendering and handling QML are intentionally
split so that in the future we can have a declarative effects API create
overlays from within the same context. Similar to how one can
instantiate windows from a typical QML scene.
Notes:
I don't like how I pass the kwin GL context from the backends into the
effect, but I need something that works with the library separation. It
also currently has wayland problem if I create a QOpenGLContext before
the QPA is set up with a scene - but I don't have anything better?
I know for the EffectFrame we need an API to push things through the
effects stack to handle blur/invert etc. Will deal with that when we
port the EffectFrame.
Test Plan: Used in an effect
Reviewers: #kwin, zzag
Reviewed By: #kwin, zzag
Subscribers: zzag, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D24215
Summary:
Qt's metaobject is rather sensitive with scope resolution.
Foo::Bar and Bar don't always match to a Qt metaobject, even if they
refer to the same thing to a compiler. Here we register
X11Compositor::SuspendReason but Q_ARG uses SuspendReason and they don't
match. This leads to a runtime failure where the method isn't invoked.
Rather than fixing metaobject usage, port the whole thing to lambdas
which does better compile time checking and is generally nicer to read.
BUG: 412353
Test Plan:
Ran xprop to block compositing. Compositing was blocked.
Grepped source code for Q_ARG use
Reviewers: #kwin, zzag
Reviewed By: #kwin, zzag
Subscribers: zzag, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D24244
Summary:
Currently each managed X11 client is represented with an instance of
Client class, however the name of that class is very generic and the
only reason why it's called that way is because historically kwin
was created as an x11 window manager, so "Client" was a sensible choice.
With introduction of wayland support, things had changed and therefore
Client needs to be renamed to X11Client in order to better reflect what
that class stands for.
Renaming of Client to X11Client was agreed upon during the last KWin
sprint.
Test Plan: Compiles, the test suite is still green.
Reviewers: #kwin, romangg
Reviewed By: #kwin, romangg
Subscribers: romangg, davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D24184
Summary:
Lot of mobile devices, as well as tablet devices use the DSI connector,
for internal screens. This is more common in ARM devices, so consider
them as internal display as well.
Test Plan: checked on the device with DSI screen, it was considered internal
Reviewers: #kwin, romangg
Reviewed By: #kwin, romangg
Subscribers: romangg, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D24209
Summary:
Rename ShellClient to XdgShellClient in order to reflect that it
represents only xdg-shell clients.
Test Plan: Compiles, tests still pass.
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D23589
Summary: wl-shell is deprecated and its support was dropped in kwin.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D23563
Summary:
So far wayland was used by internal clients to submit raster buffers
and position themselves on the screen. While we didn't have issues with
submitting raster buffers, there were some problems with positioning
task switchers. Mostly, because we had effectively two paths that may
alter geometry.
A better approach to deal with internal clients is to let our QPA use
kwin core api directly. This way we can eliminate unnecessary roundtrips
as well make geometry handling much easier and comprehensible.
The last missing piece is shadows. Both Plasma::Dialog and Breeze widget
style use platform-specific APIs to set and unset shadows. We need to
add shadows API to KWindowSystem. Even though some internal clients lack
drop-shadows at the moment, I don't consider it to be a blocker. We can
add shadows back later on.
CCBUG: 386304
Reviewers: #kwin, davidedmundson, romangg
Reviewed By: #kwin, romangg
Subscribers: romangg, kwin
Tags: #kwin
Maniphest Tasks: T9600
Differential Revision: https://phabricator.kde.org/D22810
Summary:
Because KWin is a very old project, we use three kinds of null pointer
literals: 0, NULL, and nullptr. Since C++11, it's recommended to use
nullptr keyword.
This change converts all usages of 0 and NULL literal to nullptr. Even
though it breaks git history, we need to do it in order to have consistent
code as well to ease code reviews (it's very tempting for some people to
add unrelated changes to their patches, e.g. converting NULL to nullptr).
Test Plan: Compiles.
Reviewers: #kwin, davidedmundson, romangg
Reviewed By: #kwin, davidedmundson, romangg
Subscribers: romangg, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D23618
Summary:
In some environemnts it is possible that udev detection of primary GPU
fails and it picks the first available card (normally card0). But it is
not desired, and it would be required to use different card (card1).
Introduce environment variable, which when used, will make it possible
to use different card node then one selected by udev.
You can use it like KWIN_DRM_DEVICE_NODE=/dev/dri/card1 kwin_wayland
Test Plan: Tested on the device where card0 was not usable for kms, but card1
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D24051
We have lots of inconsistency at the moment in CMakeLists.txt files. Most
of it is due to kwin being a very old project. This change hopefully fixes
all of it.
Summary:
With nearest filter fractional scaling is blurry, always use linear filter
instead on Wayland.
Test Plan: Run Plasma session with patch and scale factor 1.9.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Maniphest Tasks: T10481
Differential Revision: https://phabricator.kde.org/D23986
Summary:
We repeat quite a lot of code that finds an output by xcb_window_t and
translates global X11 screen coordinates to output coordinates.
Test Plan: Compiles.
Reviewers: #kwin, gladhorn
Reviewed By: #kwin, gladhorn
Subscribers: gladhorn, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D23947
Summary:
This patch further refines output management.
We go now through AbstractWaylandOutput virtual functions to enable and
disable outputs.
Dpms changes and enablement switches use separate code paths at start in the
Drm backend code since they are similar but not the directly same. Common code
is shared though, functions are renamed accordingly.
Asserts have been put in place to better understand and check the control
flow. A seemingly unnecessary call to DrmOutput::pageFlipped on reactivation
after Vt switch has been removed to allow for that.
In future patches we need to look additionally at the legacy mode switching
code path which was and is still not working and better handling of the
current monitor Dpms state. For example a monitor being switched off is not
properly acted on and the workspace still expanded.
Test Plan:
With one and two monitors:
* Dpms off/on
* Vt switches
* Screen disable/enable
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Maniphest Tasks: T11459
Differential Revision: https://phabricator.kde.org/D23600
Summary:
Make it more explicit what the relation is between Wayland and XDG objects
existing and enablement:
The ouput is enabled if and only if Wayland and XDG output objects exist.
We can simplify the code by replacing checks on the outputs with checking
the current enablement value.
Test Plan: Wayland nested and virtual backends.
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D23553
Summary:
This lifts the enablement code for outputs from the DRM backend to Platform
allowing other Wayland backends in the future to use this interface as well.
To do that we also create some helper functions on Platform level and have to
spill some KWayland classes into AbstractOutput what motivates a further split
of Platform into a Wayland child class like for AbstractOutput.
Test Plan: Disabled and enabled an output in DRM session.
Reviewers: #kwin
Subscribers: zzag, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D23545
Summary:
Since we now use in the backends the OutputDeviceInterface for output data
all access must be complete before the Wayland server goes down. For that
introduce a new function to prepare shutdown in the backends.
While at it also remove the output deletion, since they get deleted through
Qt's object system leading to crashes on double free.
Test Plan: Shutdown works without seg faults in the Drm backend.
Reviewers: #kwin, zzag
Reviewed By: #kwin, zzag
Subscribers: zzag, kwin
Tags: #kwin
Maniphest Tasks: T11459
Differential Revision: https://phabricator.kde.org/D23602
Summary:
Switch to Q_ASSERT in order to make code a bit more consistent. We have
places where both assert and Q_ASSERT are used next to each other. Also,
distributions like Ubuntu don't strip away assert(), let's hope that
things are a bit different with Q_ASSERT.
Test Plan: Compiles.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: romangg, davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D23605
Summary:
KWin blits contents into a QImage raster buffer. Because of this we
don't need our underlying GL surface to be double buffered as it
effectively makes the whole thing tripple buffered.
Test Plan: Ran Aurorae, looked the same, should save some memory
Reviewers: #kwin, zzag
Reviewed By: #kwin, zzag
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D23331