It helps to express the ownership of the pipe fd in ScreenShotSinkPipe2
better.
ScreenShotSinkPipe2 is not made to take a FileDescriptor too because
it's complicated by CaptureInteractive().
kwineffects.h is included in many files and not everyone needs the
RenderTarget and RenderViewport, so forward declare them to reduce the
amount of parsing work for the compiler.
At the moment, the buffers for wsi are allocated implicitly by the EGL
implementation, which is fine for "normal" use cases. But we start
hitting the ceiling the moment we need to something more advanced. For
example the EGL backend creates a dummy fbo object wrapping the default
framebuffer, meaning that we cannot pass it to qtquick (because it can
use its own opengl context).
Another reason for using explicit buffers is that it lets us to clean up
some output related abstractions.
The only purpose ScreenPaintData had was to pass around a copy of the viewport
projection matrix and the effectscreen, which can be handled in a simpler
way separately.
Instead of calling effects->renderTargetRect() and effects->renderTargetScale(),
pass the actually used render target and viewport in all the necessary methods.
This ensures that if an effect renders a screen with a modified scale or
projection matrix, the modified values get used instead of the "global" ones
Qt would need to allocate fewer "tainted" data objects, and using the
same engine both in effects and in kwin is vital for features such as
QML based effects.
When checking for overlap with other windows when placing a new window and cascading to avoid complete overlap, ignore those windows that are already covered by other windows further on the top anyway.
The computation of the covered area is not entirely accurate as it uses the bounding rect rather than the combined rects of the windows, but okay enough for our use case imo.
BUG: 466135
These shortcuts currently don't use the Meta key, which allows them to
block app shortcuts (for example, in the Reaper DAW app). In general
it's a good idea for global shortcuts to use the Meta key to avoid
these kinds of conflicts since apps typically don't use the Meta key
for their own shortcuts. Other axis shortcuts set by KWin components
already do this, so let's do the same thing here.
BUG: 466915
FIXED-IN: 6.0
While the documentation is not clear, it seems that preedit_cursor is
always required for every preedit_string event. Send preedit_cursor for
the preedit_string event we generate upon commit_string.
Scene used to use the clip region as is even if the window is
transformed. That's no longer the case, so stop mutating the clip region
in favor of a more declarative approach to handling window painting.
In order to work around hardware and drivers that aren't capable of applying
a LUT, calculate a per-channel factor for brightness and color temperature
modification. While this ignores color calibration, this makes night color
work until a proper shader based color pipeline is implemented.
BUG: 455720
The ShortcutHandler type provides scripts QML idiomatic way to register
global shortcuts.
There's one caveat about this API though. Since KGlobalAccel does not
allow to change the shortcut by repeating KGlobalAccel::setShortcut(),
the ShortcutHandler requires the default shortcut to be set before it's
constructed.