This is responsible for plasmashell freezing when screen is locked.
The change itself was not wrong, but we first need to enable the
infrastructure to "fake" rendering when screen is locked/disabled, etc.
Summary:
This is a radical change to the approach KWin used to have. So far KWin
fall back to XRender compositing if it detected llvmpipe. With this
change KWin will use OpenGL compositing also on llvmpipe.
This has drawbacks: it's CPU emulated which we actually do not want.
But the question is whether it still makes sense to keep the no-GL
enforcement.
There are several things to consider here:
* QtQuick will use llvmpipe anyway (including things like Plasmashell)
* glamor might be used in the xorg layer which also uses llvmpipe on
XRender
* more consistent look
* we get OpenGL working in tests (important for e.g. openQA)
* hardware which does not support proper GL gets less, there are
GL drivers for KVM, there are GL drivers for rPI, etc. We don't
need to block it anymore because of possibly bad results on those
hardware. Also they mostly use glamor.
* there is still the way to manually select XRender/QPainter compositing
Reviewers: #kwin, #plasma
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D2184
Some error conditions did not have a warning, so all we got is
"Could not initialize rendering context". Which is not helpful to
figure out what is going wrong.
For virtual machines with Cirrus device the drmModeAddFB fails. So
far there was no error message at all, we only saw it failed.
With this change the drmModeAddFB is checked for error and a warning
is shown. Also further debug messages are added for other cases where
things can fail.
Reviewed-By: Eike Hein
Summary:
With this change auto-hiding panels are animated again by SlidingPopups
effect.
Test Plan: Test case adjusted, and tested in VM
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D2157
BUG: 354407
FIXED-IN: 5.8.0
A test to simulate auto-hiding panels. Preparation step for making the
slidingpopups effect working again for auto-hiding panels.
The test case simulates creating a panel at the screen edge, hides it
through the property and shows it again through the edge.
Summary:
The WaylandServer creates the XdgShellV5 interface and hooks it up
to create a ShellSurface whenever an xdg surface or xdg popup is created.
ShellClient gains some new ctors for the different variants and is
adjusted to delegate to xdg surface respectively.
With this change KWin mostly supports xdg-shell protocol. Still missing
is support for the "geometry" request which is rather difficult to
implement in KWin.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D2108
Summary:
With this change SlidingPopups is able to animate Wayland clients
properly, though windowHidden does not yet work for OpenGL based
windows (buffer seems to get lost somewhere).
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D2085
Summary:
This allows effects to animate when a window is shown again and when
a window gets hidden but not yet closed/destroyed. This situation
happens on X11 for e.g. auto hiding panels and on Wayland for pretty
much any window which properly unmaps (windowHidden) prior to destroy.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D2084
Summary:
So far when a ShellClient got unmapped ready_for_painting was set to
false. That is the ShellClient was treated in the same way as a not
yet shown window. It was completely excluded from painting, a close
animation impossible.
This change makes use of the functionality available in
Client::hiddenInternal(). The window is considered as hidden, thus
still excluded from e.g. getting input events, but could be rendered
any time as we still have a previous window pixmap (if referenced).
This allows to have it considered in the rendering pass, but effects
still cannot make use of it as that state is not yet exposed to the
effects.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D2083
Summary:
Have one dedicated method which performs the connection for both
Client and ShellClient. This fixes the desktopPresenceChanged signal
not being passed to the effects.
Note that not all signals are merged. Most signals setup for Client
don't make sense for ShellClient as ShellClient cannot block composite
or unredirect.
Test Plan:
Test case added for ShellClient to ensure that the signal
is correctly invoked on the ShellClient, Workspace and EffectsHandler.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D2059
Summary:
So far if the framebuffer platform run into an error on initialization
it did not continue and caused the system to freeze. With this change
it properly emits the initFailed signal in all error conditions which
causes kwin_wayland to terminate. This is a much better situation than
just staying in a running, but frozen state.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D2149
Summary:
This new helper tool allows to read the X11 shadow from a window
and visualize the individual parts.
Reviewers: #kwin
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D2101
Summary:
If KWin fails to start the Wayland server due to XDG_RUNTIME_DIR not
being set, kwin_wayland should terminate with an error condition but
not crash.
This change makes sure that KWin detects that the Wayland server does
not work and terminates the startup early and ensures that it doesn't
crash while going down.
An error message is shown that we could not create the Wayland server.
Test Plan:
Test case added which verifies that WaylandServer fails to
init. Manual testing that kwin_wayland exits with error 1.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D2078
Summary:
We need to properly tear down the application - this can be achieved
through QCoreApplication::exit. Otherwise there is a chance that the
cleanup handling crashes.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D2136
Summary:
If it's not possible to create a buffer to blank the output, KWin won't
be able to render to the output. In that case the output should not be
added to the list of outputs.
To support this DrmOutput::blank and DrmOutput::init return bool to
indicate whether they succeeded. DrmBackend handles this situation and
doesn't add the output to the list of outputs if init failed.
If after init there are no outputs KWin is in a state where it won't
be functional. Thus the platform emits the initFailed signal to
terminate.
BUG: 365242
FIXED-IN: 5.7.2
Test Plan: No hardware to reproduce the condition
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D2135
Summary:
If the format of the framebuffer is BGR we cannot create an RGB image
format from it - the rendering is incorrect. Unfortunately QImage does
not support a BGR image format.
To solve this problem we still use an RGB image format but on rendering
the front buffer is rgbSwapped to convert the RGB image to a BGR image.
BUG: 365243
FIXED-IN: 5.7.2
Test Plan: Tested on a neon kvm
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D2134
The struts test is extended by a setup containing two horizontal
screens, bottom aligned with the left screen smaller than the right.
Thus there is a dead area in the top left corner. In addition there's
a panel on top left screen.
Apparently KWin allowed windows to open in the dead area. The test
case reconstructs this by opening a window with the same size hints,
but in the test it's working correctly.
A few more cases where we need to ensure that the created window is
destroyed before going into next test method.
Interesting observation: the generated window ids are identical.
Possible problem with KWayland::ClientConnection?
New test method which verifies that a newly mapped window is rendered
correctly, that cursor image set on it is rendered correctly, also when
pointer moves.
Summary:
Many tests create a Wayland window, render it and then wait till it's
created in KWin as a ShellClient. To reduce code duplication the test
helper provides helper methods to wait for the next ShellClient to be
shown and to directly render and wait for the window for that to be
shown.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D2057
Summary:
A new namespace KWin::Test is added which provides a few helper
functions. It makes it easy to setup a KWayland client connection with
the base set to be able to create a Surface and flags to create
additional interfaces. This replaces the KWayland connection dance in
init() methods. For cleanup() there is also a dedicated helper function.
In addition there are helper functions to:
* render a surface
* create a surface
* create a shell surface
* flush the wayland client connection
* access to the created interfaces - for compatibility with existing code
The idea is to extend this Test library also for other common use cases
like creating an X11 connection and X11 windows, etc.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D2053
Summary:
A dedicated cmake function is added to create a test case. It takes
a NAME, the SRCS and additional LIBS.
Thus it's
integrationTest(NAME myTestCase SRCS test.cpp)
to create a standard integration test.
In addition kwin_wayland_test.cpp is compiled into a static library
to decrease the compile time a little bit.
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D2052
Summary:
The idea behind this autotest is inspired by bug 356328 which produced
incorrect rendering results. Also it's inspired by openQA which performs
image reference comparisons.
This test case tries to go further. It creates reference images which
must match the rendering result exactly. So far the test case verifies
the start condition - kwin started and one frame is rendered with default
cursor in the middle of the screen. And it verifies the moving of the
cursor without any windows shown. Whenever the cursor moves a repaint
should be triggered and the old and new area should be properly
repainted.
To support this the test needs some minor changes in KWin:
* Scene provides a frameRendered signal - needed for waiting on frame
* Scene and SceneQPainter are exported
* SceneQPainter provides access to it's Backend, so that we get to the
backbuffer
* ScriptedEffectLoader is exported for getting a list of all scripted
effects - (we don't want fade to manipulate the rendering)
Reviewers: #kwin, #plasma_on_wayland
Subscribers: plasma-devel, kwin
Tags: #plasma_on_wayland, #kwin
Differential Revision: https://phabricator.kde.org/D2046