Currently, a vertex coordinate is transformed first, then mapped to
the global screen coordinates. This causes a problem if a transform
is applied to the top-most item and child items are not at (0, 0).
For example, scaled windows may have popping out sub-surfaces, etc.
With this change, the item transforms will be computed differently. For
example, if the parent item is transformed, a child's transform will
look as follows
[Parent's translation][Parent's transform][Child's translation]
instead of
[Parent's translation][Child's translation][Parent's transform]
In the future, I'd like to get rid of the Item::setTransform() call in
OpenGLWindow::performPaint() and have either AnimationEffect or
libkwineffects call Item::setTransform().
BUG: 440201
Deleting QQuickWindow will force any remaining runnables to complete.
This is important for any items (such as our new ThumbnailItem) that
deletes resources in queued cleanups.
We need to invoke this manually whilst we still have an active render
control with a valid context, otherwise remaining runnables will no-op.
We also then want to manually delete our scene contents before the view
so they're not orphaned temporarily.
This fixes a memory leak observed with the new Overview effect.
If a sub-surface should be considered unmapped, make the corresponding
item invisible.
Note that this must apply only to sub-surfaces. Whether the main surface
should be visible is up to kwin. It may want to play an animation when
the toplevel surface is unmapped, etc.
In GLTexture::update, reuse the mechanism from the GLTexture(QImage, ...)
constructor to upload QImage data directly when the QImage format
has compatible GL format and type codes. Before this change, all QImage
formats other than ARGB32_Premultiplied required a format conversion.
As per the xdg-shell specification, the compositor can only attach
a wl_buffer to an xdg_surface once the compositor has sent an
xdg_surface.configure event. Previously, there was a race condition
in which WaylandOutput objects were added/enabled on creation, making
it possible for the EglWaylandOutputs to be set up and for
EglWaylandBackend to draw a frame (thereby attaching a buffer), all
before the xdg_surface.configure configure event was received.
Compositors other than kwin would then send an unconfigured buffer
error and close the connection.
This commit avoids the problem by not marking the WaylandBackend
ready for use until all the output surfaces constructed at startup
have received their initial configure event. (In practice, this
takes one additional roundtrip.)
We're porting away from using plugin keywords (and have done that for
the breeze and oxygen decoration). However to allow that we need to
adjust the loading code.
Keep the old codepath for compatibility.
BUG: 440786
Blending is quite expensive especially with software rendering.
In the case of Firefox on Wayland, it uses a ARGB8888 buffer but marks the
entire surface as opaque, so the alpha channel can be ignored.
CCBUG: 440386
When the last output gets disconnected, create a virtual output as a
placeholder until we have access to a physical output again. While
this placecholder never gets rendered to, with virtual outputs in
general that is possible (with gbm and qpainter atm) and can be done
for future use cases like wireless displays.
CCBUG: 420160
CCBUG: 438839
QImage is implicitly shared. However, methods such as QImage::bits() may
detach. In order to avoid the detach, one either needs make the image
const or use QImage::constBits() method.
Currently, the GLTexture class uses QImage::bits() all over the place.
It prevents implicit detaching by storing images in const variables. Such
code is fragile. Adding an intermediate (optional) conversion step may
result in odd performance regressions.
Currently, the shape region is not copied to the Deleted. If either
SurfaceItemX11 or SurfaceItemXwayland needs to build quads for a shaped
window, it won't be able to do so properly because the corresponding
x11 window is long time gone.
If the shape region changes before the window is unmapped, you may still
see visual artifacts. Unfortunately, the only way to fix that bug is to
switch to wayland.
BUG: 440001
BUG: 438458
BUG: 435378
https://invent.kde.org/plasma/kwin/-/merge_requests/1220
This reverts commit 44ad9437c4 because it
breaks build:
platforms/x11/common/eglonxbackend.cpp:224:66: error: cannot initialize a parameter of type 'EGLNativeWindowType' (aka 'unsigned long') with an rvalue of type 'xcb_window_t *' (aka 'unsigned int *')
surface = eglCreateWindowSurface(eglDisplay(), config(), &window, nullptr);
^~~~~~~
It is perfectly valid to have a case where an item exists but has no
window. During these times the item will never be rendered.
Rather than guard in updateOffscreenTexture, it's more economical to
disable the frame rendering in the first place. Especially as then it's
easy to extend to item visibility.
BUG: 440318
Makes it possible to apply the dpms settings per screen instead of
applying it to all of them, which is wrong at many levels.
Will be even more important with other effects like rotation.
If kwin is explicitly restarted (kwin_wayland --replace) we reset the
crash count so that you can run it more than 10 times without exiting to
the logout screen.
Resetting to 0 causes a issue as that triggers ksplash to be shown
again.
BUG: 434489
We inintially created the wrapper to be light so avoided the QtCore
dependency and did it all in C.
In hindsight changing requirements means we want to add several more
features in here. The first step is to port to a more readable language
and toolkit.