If an output is rotated, we will compute a transform matrix for the
cursor plane to rotate its contents.
In order to compute that matrix we need the rect of the cursor in the
device-independent pixels, the scale factor and the output transform.
The problem is that we provide a rect of the cursor in the native
pixels. This may result in the cursor being partially or fully clipped.
CCBUG: 424589
XdgSurfaceClient tries to avoid sending unnecessary configure events,
but in some cases, the compositor has to send one even if the surface
state hasn't changed, for example in response to a set_maximized()
request, etc.
This change introduces a special flag to indicate that the scheduled
event has to be sent no matter what.
If you play some video and the software cursor doesn't hover it, then
the shadow cast by the cursor will be getting darker and darker with
every frame.
The main reason for that is that kwin paints the software cursor even
if the rect behind it hasn't been damaged or repainted.
If a cursor animation is driven purely by frame callbacks and kwin
uses hardware cursors, the cpu usage may spike to 100%.
This change addresses that issue by sending frame callbacks after a
compositing cycle has been performed.
That commit broke CI's build, while it's building fine locally.
Let's revert it until having a better understanding of the cause.
Also revert the attempt to fix it, which didn't succeed.
This reverts commit 9cbac6fe3a.
This reverts commit 3e15f64055.
Include header "rulebookdata.h" instead of class forwarding.
The header is automatically generated by kcmutils_generate_module_data
and includes a namespace
GLTexture::width() and GLTexture::height() return the size of the cursor
texture in native pixels, but we need a size in device independent pixels.
CCBUG: 424589
Only a subset of KDE applications (part of KXMLGUI ones) support
this setting, and on the other hand non KDE applications
may support it as well.
As there is no way to identify the subset of affected applications
not even with technical terms, make the description a bit more
generic, leaving it open to future improvements to the set of
supported applications.
Previously seat interface was keeping track of the repeat information,
but now it is taken care by KeyboardInterface, which is created only if
the setHasKeyboard is set to true.
So, since we are setting up various capabilities on seat in libinput,
re-parse configuration here, so that various information like key repeat
is notified to kwayland-server
BUG: 428039
On Wayland, a surface must be displayed the same way no matter how the
attached buffer is transformed. In order to guarantee that, we build the
surface-to-buffer matrix, which is used to compute the texture coords.
The surface-to-buffer matrix represents an affine transformation. Thus,
performing linear interpolation between texture coordinates won't end up
in corrupted rendered results. This is the main assumption that we make
during generation of contents window quads. After creating a sub-quad,
the new quad's texture coordinates are computed by interpolating between
the source quad's texture coords.
However, WindowQuad::makeSubQuad() makes a concrete assumption about the
order of texture coords, which might be false if the attached wayland
buffer is rotated 90 or 270 degrees.
This issue went unnoticed after merging the viewporter patches because
the developer who was working on it had been using primarily nested
kwin_wayland for testing purposes. And it appears like kwin schedules
full screen repaints even though it supports buffer age. It still needs
some investigation why that happens.
BUG: 428003
Qt checks OpenGL version to determine if some features can be enabled.
This change ensures that the format EGLPlatformContext returns has
properly initialized the OpenGL version, the context profile and the
format options (e.g. whether it's a debug context, etc).
Currently, we use glFinish() to ensure that stream consumers don't see
corrupted or rather incomplete buffers. This is a serious issue because
glFinish() not only prevents the gpu from processing new GL commands,
but it also blocks the compositor.
This change addresses the blocking issue by using native fences. With
the proposed change, after finishing recording a frame, a fence is
inserted in the command stream. When the native fence is signaled, the
pending pipewire buffer will be enqueued.
If the EGL_ANDROID_native_fence_sync extension is not supported, we'll
fall back to using glFinish().
Besides being unused, we should avoid making OpenGL contexts current
against the EGLSurface of the first output because it's a slippery road
that may end up in leaking context-specific resources in the mid of a
compositing restart.
On Wayland, internal windows that use OpenGL are rendered into fbos,
which are later handed over to kwin. In order to achieve that, our QPA
creates OpenGL contexts that share resources with the scene's context.
The problems start when compositing has been restarted. If user changes
any compositing settings, the underlying render backend will be
reinitialized and with it, the scene's context will be destroyed. Thus,
we no longer can accept framebuffer objects from internal windows.
This change addresses the framebuffer object sharing problem by adding
a so called global share context. It persists throughout the lifetime of
kwin. It can never be made current. The scene context and all contexts
created in our QPA share resources with it.
Therefore we can destroy the scene OpenGL context without affecting
OpenGL contexts owned by internal windows, e.g. the outline visual or
tabbox.
It's worth noting that Qt provides a way to create a global share
context. But for our purposes it's not suitable since the share
context must be known when QGuiApplication attempts to instantiate a
QOpenGLContext object. At that moment, the backend is not initialized
and thus the EGLDisplay is not available yet.
BUG: 415798
If the surfaceless context extension is unsupported by the underlying
platform, the QPA will use the EGLSurface of the first output to make
OpenGL contexts current.
If an internal window attempts to make an OpenGL context current while
compositing is being restarted, for example it's typically the case with
the composited outline visual, QPA will either try to make the context
current with a no longer valid EGLSurface for the first output or will
crash during the call to Platform::supportsSurfacelessContext(). The
latter needs more explanation. After the compositingToggled() signal has
been emitted, there is no scene and supportsSurfacelessContext() doesn't
handle this case.
In either case, we could return EGL_NO_SURFACE if compositing is being
restarted, but if the underlying platform doesn't support the surfaceless
context extension, then the composited outline will not be able to
delete used textures, framebuffer objects, etc.
This change addresses that problem by making sure that every platform
window has a pbuffer allocated in case the surfaceless context extension
is unsupported.
SurfaceInterface::inputIsInfinite() has been dropped. If the surface has
no any input region specified, SurfaceInterface::input() will return a
region that corresponds to the rect of the surface (0, 0, width, height).
While the new design is more robust, for example it's no longer possible
to forget to check SurfaceInterface::inputIsInfinite(), it has shown some
issues in the input stack of kwin.
Currently, acceptsInput() will return false if you attempt to click the
server-side decoration for a surface whose input region is not empty.
Therefore, it's possible for an application to set an input region with
a width and a height of 1. If user doesn't know about KSysGuard or the
possibility of closing apps via the task manager, they won't be able to
close such an application.
Another issue is that if an application has specified an empty input
region on purpose, user will be still able click it. With the new
behavior of SurfaceInterface::input(), this is no longer an issue and it
is handled properly by kwin.
In order to determine if a window accepts input at specified position,
we need to check if the decorated window and the server-side decoration
contain the given point.
While we have a way to determine if a point falls inside the input shape
of the decorated window, there is no any way to do the same for the deco.
Currently, flip output transformations in the software fallback code
path are equivalent to normal rotate output transformations.
This change implements flip output transformations according to the
wl_output spec.
Currently, when the DRM platform uses cursor planes, the cursor on
a rotated output may be cropped because the math behind the current
cursor transform matrix is off.
In order to fix the cropping issue, this change replaces the current
cursor transform matrix with the core part of the surface-to-buffer
matrix, which was written against the wl_output spec.
BUG: 427605
CCBUG: 427060
Currently, every time compositing is restarted, both the gbm and the egl
streams backend will re-obtain the EGLDisplay object.
This is wrong because the core assumption is that the EGL display doesn't
change once it has been obtained.
Currently, Qt clients send two maximize requests separated by the
initial commit. From spec's perspective, this is totally fine, the
client should receive two configure events with "maximized" state.
But because changeMaximize() in XdgToplevelClient and setMaximized()
operate on two different maximize modes, the second maximize request
will trick kwin into thinking that the client should be restored.
If Xwayland has crashed, the Workspace will block stacking order updates
and start destroying all X11 clients.
Once stacking order updates are unblocked, the Workspace will mark the X
stacking order as dirty and create a new Xcb::Tree object.
We don't want to create that Xcb::Tree object because accessing it
after the XCB connection has been shut down will lead to a crash.
BUG: 427688
FIXED-IN: 5.20.1