In most places, it's actually not needed and we actually provide wrong
damage region at the moment anyway. In long term, it would be great to
drop the Window::damaged signal.
The loop in `Window::handleInteractiveMoveResize` "bruteforces" the
value for `nextMoveResizeGeom` such that the area of
`nextMoveResizeGeom` contains at least `requiredPixels`. In each loop
iteration, one or more attributes (left, right, top, bottom) of
`nextMoveResizeGeom` are selected to be moved +/-1.0 towards the value of
`currentMoveResizeGeom`. The loop terminates if either the area of
`nextMoveResizeGeom` is large enough or `nextMoveResizeGeom ==
currentMoveResizeGeom`.
The problem is that the variables compared and adjusted here are floating
point variables, and their difference may not be a whole number. Using
+/-1.0 adjustments can make the loop oscillate indefinitely around the
target value.
This commit ensures loop termination by using `qFuzzyCompare` to compare
floating point values and correctly handles the cases where adjustments
smaller than 1.0 are needed to reach the target value.
The main motivation behind this change is to let kwin use the PRESENT
extension to present output contents when using QPainter backend, so we
get PresentCompleteNotify events.
Besides that, we could potentially make X11 windowed backend forward
wl_shm_buffers to Xorg.
Currently, we use a timer to get notified when a frame is presented, but
there's a better way using PRESENT extension's PresentCompleteNotify events.
Note that we implicitly rely on the fact that EGL implementation uses
the PRESENT extension to present pixmaps, which is usually the case.
QPainter backend needs some adjustments.
Some outputs have the same EDID, which results in two connected outputs
having the same hash. To find out which config values need to be used,
also check the connector name.
Some applications do not provide a window class according to
the spec (WM_CLASS on X11, appId on Wayland), so KWin cannot
"detect" this property.
In those cases, notify the user that this is a bug within the
application (so it is not confused for a KWin misbehavior)
and also prevent setting a wrong description.
BUG: 462644
FIXED-IN: 5.27
Fullscreen windows are most likely games or videos, where the blend effect is an
annoyance that freezes the screen for a moment when a accent color change is triggered
in the background.
The main motivation behind this change is to get rid of the dependency
on EGLSurface so the order in which output layers are presented or
updated doesn't matter.
At the moment, if both the cursor and the primary layers are updated
within same frame, the read and draw surfaces in present() will be wrong
for the primary layer.
With fbos, the read and draw surfaces won't matter.
Having both selectionChanged and selectionCleared as well as
sendSelection and sendClearSelection complicates things. API users
have to connect to both signals, internally the methods have logic
to call themselves but in the end do the same as the protocols only
know send_selection.
It's a necessary step to let kwin repaint the cursor from Compositor.
Unfortunately, it also means that we need to add more (temporary) code
to paint the cursor in backends.
Currently, output backends track the cursor behind the scenes. This
results in some amount of code duplication, for example the handling of
hidden cursors, every backend handles in its own unique way, some don't
do it correctly. Another issue is that output backend interact with
other components behind the back. This can be a problem for tasks such
as backing the cursor with an output layer.
This change introduces explicit output cursor manipulation APIs in the
Output class. There's a good chance that it's going to be revised more
in the future as part of streamlining output layer manipulation apis.
With the proposed changes, the workspace would need to call
Output::setCursor() or Output::moveCursor() to set/unset or move the
cursor, respectively.