This ensures a couple of things:
- avoid pointlessly binding and unbinding the texture
- if the image format needs to be changed, it will be done only once
Use the unpack code path by default, it lets us to simplify the code and
also fix texture uploading when the image stride is not
"width * bytes per pixel".
It's widely supported, and other wayland compositors already require it,
so the chances of breaking things should be minimal, although some embedded
GPUs might be affected, in which case kwin will fallback to software
rendering. With the unpack being always available, we can simplify and
also fix bugs in texture uploading.
This means that we prefer direct scanout over a specific presentation mode (tearing),
which usually just means we first engage direct scanout and program the relevant
properties, and then switch to tearing afterwards.
It also removes a hack for direct scanout with legacy, and is one step less for
implementing overlay plane support.
I'm confident in the implementation and (significant) upstream changes before the protocol
is released as wp-colormanagement-v1 are unlikely, so I think allowing apps to make use of
it in practice is okay at this point.
Once the upstream protocol is released, we'll still drop the xx variant though and apps will
have to use the wp protocol in order to make use of color management features.
The NVidia driver maps them to hardware planes, which means they do not
apply to the cursor because the cursor plane doesn't have these color
operations.
BUG: 491634
The stack layer of a transient doesn't depend on its transient parent.
It is not clear why this code exists, it dates back to a commit 20 years
ago, which is massive and difficult to analyze. But, with that being said,
Window::belongsToLayer() doesn't place transients in parent's stack
layer, stack constraints are used instead.
Black point compensation introduced a tiny bit increased error in the floating point
calculations, but the errors are still way too small to actually matter.
To avoid those unnecessary calculations causing performance issues and more rounding
errors, this commit changes the allowed error to 10^-5.
A driver might optimize out a uniform, in which case setting it will fail. That does not however mean
that the rest can be ignored too or that the shader won't work because of that
The scene renderer doesn't use external_only formats as a single EGLImage, but only does
YUV conversion for some specific formats, so the test import should match that.
Adding the invalid modifier to nonExternalOnlyModifiers even for formats that otherwise only
have external_only modifiers means that KWin will advertise support for this modifier to clients,
but using the format without external_only samplers fails.
Applications that use QtWidgets can have a lot of rectangles in the
damage region. For example, when you navigate between directories in
Dolphin, each individual file or folder item will be added to the
damage region rather than the container view where they are.
On the other hand, issuing multiple glTexSubImage2D() function calls
is not great because it means stalling the cpu until the texture upload
completes.
This change attempts to improve that by simplifying the input damage.
If the input damage isn't complex, use it as is; otherwise use its
bounding rect.
The gains are not impressive. On my machine, I see fewer 5ms texture
upload time spikes when navigating in Dolphin, now I can observe 4ms
spikes instead. Still, I believe the change is reasonable enough.
The alpha modifier protocol allows clients to set a multiplier for the opacity
of a surface, which allows them to offload some operations to KWin, which
in turn may offload them to KMS in the future
...by removing the keyboard flag, moving keyboard shortcut handling into a separate
method and making the position to tile the window at explicit
This also means KWin doesn't do as many intermediary changes to window geometry on output
hotplugs, which may work around some clients not always reacting to no-op changes.
CCBUG: 479694
When a wl_surface is unmapped, we need to stop updating the buffer
in SurfacePixmapWayland.
However, SurfaceItemWayland::freeze() doesn't unset m_surface, so
the SurfacePixmapWayland keeps updating the buffer even after the
surface is unmapped. This results in some closed windows losing their
contents when playing a window closing animation.
Makes it consistent with other KCMs and and Kirigami KCMs.
**Before:**
![Screenshot_20240809_181201.png](/uploads/ff17bdcbdacda38d4abe752054d7f6d2/Screenshot_20240809_181201.png){width=431 height=399}![Screenshot_20240809_181210.png](/uploads/2e360efae4dd8982ab0a7b7af7ec85b4/Screenshot_20240809_181210.png){width=430 height=398}![Screenshot_20240809_181155.png](/uploads/6f534ffad87350a4d8fd47735f1c8c60/Screenshot_20240809_181155.png){width=431 height=399}
**After:**
![Screenshot_20240809_181243.png](/uploads/94babd127faaa8021054b7c46c806f93/Screenshot_20240809_181243.png){width=433 height=358}![Screenshot_20240809_181251.png](/uploads/25bd2d99ada694173ba875006dbe57bc/Screenshot_20240809_181251.png){width=436 height=361}
![Screenshot_20240809_181236.png](/uploads/03f0fb73e357728ae558649381cecdf7/Screenshot_20240809_181236.png){width=443 height=367}
@teams/vdg
This allows copy pasting text between the overview and regular clients.
QMimeData::data() has a synchronous API. It is a problem for us, the
compositor, because it means we need to block the main thread to read
the mime data. This change adds a one second timeout. If no data arrives
within the next 1 second, the qpa will give up in order to avoid freezing
the screen further. Not sure how this can be handled better without
changing the API of the QMimeData to add async overloads.
BUG: 445751
The check for a shadow buffer used a variable before it was set to the new value,
and the shaders are broken for some reason, so I reverted them to use the previous
code with only the transfer function parameters added.