The output management test checks the implementation of output
management capabilities in the virtual backend, which is not helpful.
This change replaces it with a more useful test that verifies how
windows are placed after an output change.
TestXdgShellClientRules implicitly assumes that the kwinrc config is
referenced only by the RuleBook object.
However, after changing the default placement policy in the
WaylandTestApplication, that's no longer the case. The kwinApp() object
now also holds a reference to the main config file. Because of that,
previous window rules leak to next tests, which breaks them.
In order to address that issue, this change makes TestXdgShellClientRules
open a separate config and wipe it clean after each test run. Not great,
but there doesn't seem to be other way around with current KSharedConfig
api.
Currently, if you move the cursor really fast between two outputs, there
may be stuck cursor on the previous output.
We need to query the old cursor visibility status before updating the
cursor position, otherwise the drm backend may not schedule an update to
move the cursor offscreen.
It's fine to have the animation duration hardcoded to 250ms. The main
issue with reading kscreen effect's config is that it adds inter-effect
dependencies, which is simply not worth the trouble.
The intro and the outro animations are very short and they usually
affect all windows on the screen. Windows have to travel a lot and in
very short time, this doesn't look.
Similar to other windows, this change makes the overview effect use the
out cubic curve for window movements (even though the HIG suggests us
using the InOutCubic easing curve). That way, user will look at
flatter parts of the easing curve more, i.e. the windows would move less
chaotically and simply jump to their target position.
Similar to the WindowHeap, this change makes the overview effect use the
out cubic everywhere else so the intro and the outro animations look
coherent.
Another advantage of the OutCubic easing curve is that it makes the
overview effect look more responsive and subtle.
Currently, the wayland server updates the server side decoration mode,
which is counter-intuitive, because it doesn't cache the last preferred mode.
With ServerSideDecorationInterface::preferredMode(), it can be simpler.
It's more common to see the parent object being the last argument in Qt
and this way you won't need to specify nullptr parent explicitly if the
xdg-popup or the xdg-toplevel surface doesn't need to be configured
implicitly, which makes tests slightly easier to read.
This commit does away with the special handling of the legacy cursor and
makes it be applied directly in DrmPipeline, using the same state as the
atomic cursor and without dirty flags.
Effect loading is already tested using integration tests, for example
the maximize test verifies that the maximize effect is loaded _and_ it
actually does something useful when a window is maximized or restored,
testScriptedEffectLoader only verifies that the effect is loaded, which
is less helpful than what integration tests provide us.
But perhaps the main problem with these tests is that they require us
building a mockverse around them. This litters code with ifdef
preprocessor directives and makes changing such code a living nightmare.
Another problem with these two tests is that they cannot use OpenGL
because it means mocking OpenGL, which we obviously not going to do.
With integration tests, it's not a problem.
The bottom line is that unit tests can be useful but they make life
notoriously difficult when it comes to testing components that depend on
other components.
The cursor being set out-of-band with atomic commits creates problems
because it can create false positive for atomic tests, if the cursor
state gets changed in between an atomic test and its matching commit.
This commit also ports the cursor to a swapchain instead of only one
image. This is not strictly required but may prevent artifacts and
will be needed for future optimisations.
Currently, kwin expects that the xdg-decoration is installed before the
initial commit. However, decoration tests do that after the initial
commit, which makes testMaximizeAndChangeDecorationModeAfterInitialCommit()
silently pass.
On a second look, it seems that the xdg-decoration spec is okay with the
xdg-decoration being created after the first commit (as long as it's
done before the surface is mapped). This needs to be fixed separately.
CCBUG: 445259
Context properties don't work with QML effects. At the moment, no effect
needs to access the options object, but it makes the QML API consistent.
The workspace is already a singleton type.
The natural geometry can live in a different coordinate space than the
target area. Remove the premature optimization so the cell is properly
placed if the two are in different coordinate spaces.
Currently, the ExpoLayout wants the natural geometry to be in the local
coordinate space because of the default layout mode.
With the natural layout, the ExpoLayout will run a simple loop that
repels overlapping cells.
Once no two items overlap, the items will be scaled down based on their
bounding rectangle and the target area.
The problem is that the ExpoLayout includes the area where items will be
eventually placed when computing the bounding rectangle, which can
result in a sort of a bug where almost all windows are shifted to one
side of the screen, which is not at 0,0.
This change removes the target area from the bounding rect math so the
coordinate space where natural geometry is specified is irrelevant.
It fixes the issue where windows can be shifted to one side of the
screen after adding or removing a window. It also makes the ExpoLayout
API more simpler on the QML side and ensures that no relayouting will be
performed if only the position of the WindowHeap changes.
If the preferred decoration mode changes after the initial commit but
before the surface is mapped, there's a chance that kwin can send a bad
configure event, it's been the case in the past. Add a test to prevent
such cases go unnoticed.
If the decoration is destroyed before the window is mapped, kwin can
respond with a configure event that has 0x0 size. New tests check that
problematic case.
BUG: 444962
Kwin announces a format with alpha when Dma-Bufs are available, even
when the texture doesn't contain any. This results in clients segfault
when trying to access the buffer assuming a maxsize wrt. the announced
format by ways of dimensions and bpp.
This patch moves the format masking to affect the Dma-Buf transport
only.
If eglSwapBuffers() fails, there won't be a buffer and so we need to
mark the frame as failed. Otherwise, the screen can be frozen.
eglSwapBuffers() can fail if some effect calls makeOpenGLContext()
between RenderBackend::beginFrame() and RenderBackend::endFrame(), which
is the case with the zoom effect. It can set wrong draw surface in
ZoomEffect::recreateTexture()
BUG: 445412
This simplifies focus related logic a bit. Instead of differentiating
between wayland and internal window focus, simply maintain window focus
that works both with regular wayland windows as well as the ones created
by kwin.
The thumbnail that represents the "desktop" in the switcher preview
is taken from the default wallpaper, and it will update automatically
as it changes in future versions of Plasma.
The current one is also added along the other thumbnails as a fallback.
BUG: 309401
FIXED-IN: 5.24
Currently, the test doesn't pass due to Xwayland encountering a protocol
error.
That protocol error occurs because the xdg-output is destroyed before
the wl_output.
This change moves the ownership of the xdg-output to wl-output so they
are destroyed together.
dmabuf-feedback allows the compositor to give the clients better feedback on what
formats and modifiers they should use, and for which device they should allocate.
This way they can reallocate for scanout whenever the compositor tells them to,
which makes direct scanout work for a lot more devices and applications.
KWin handles several types of pointing input devices, e.g. mice,
tablets, etc.
As is, enterEvent and leaveEvent are very ambiguous. This change
prepends "pointer" to those methods to make it explicit that they handle
pointer enter/leave events.
While it could be useful with tiled displays, the isFormatSupported and
supportedModifier functions can be called before prepareModeset, so where
m_formats is still empty. Additionally they're neither in a hot path nor
performance critical.
Whether or not we want to use explicit modifiers for our surfaces doesn't
matter for what format+modifiers drm planes support. This way direct scanout
works by default, without having to explicitly enable modifiers