As things are right now, we can only do 32bit textures for dmabuf (see
gbm_bo_format in gbm.h). This means that we were lying to our receivers
when we had 24bit textures by then giving a 32bit texture instead.
This changes it so we request a dummy texture before starting and if we
are offered one we assume they're available and offer a 32bits stream
directly (i.e. BGRA).
The buffer offset for client-side decorated windows is not 0, this plus
mixing the frame position and the client size may result in clipped
thumbnails of client-side decorated applications, such as gedit, etc.
BUG: 428595
krunner stuff doesn't really belong in kwin, it has nothing to do with
compositing or any other things that are the domain of compositors.
Given that, being as a plugin suits the krunner integration stuff best.
This change introduces basic colord integration in wayland session. It
is implemented as a binary plugin.
If an output is connected, the plugin will create the corresponding
colord device using the D-Bus API and start monitoring the device for
changes.
When a colord devices changes, the plugin will read the VCGT tag of the
current ICC color profile and apply it.
The scripting api is not suitable for implementing all features that
should not be implemented in libkwin. For example, the krunner
integration or screencasting are the things that don't belong to be
compiled right into kwin and yet we don't have any other choice.
This change introduces a quick and dirty plugin infrastructure that
can be used to implement things such as colord integration, krunner
integration, etc.
Without the KWindowSystem integration plugin, Wayland experience will be
negatively affected because windows created by kwin itself won't behave
as desired. Therefore it makes little sense to load this plugin at runtime.
On wayland, we know we're always going to load our internal QPA. Instead
of shipping a plugin and loading it dynamically we can use Qt static
plugins.
This should result in slightly faster load times, but also reduce the
number of moving pieces for kwin.
This also prevents anyone outside kwin loading our QPA which wouldn't
have made any sense and just crashed.
Currently, the OpenGLBackend and the QPainterBackend have hooks to
indicate the start and the end of compositing cycle, but in both cases,
the hooks have different names. This change fixes that inconsistency.
In order to allow per screen rendering, we need the Compositor to be
able to drive rendering on each screen. Currently, it's not possible
because Scene::paint() paints all screen.
With this change, the Compositor will be able to ask the Scene to paint
only a screen with the specific id.
Qt 5.15 introduced new syntax for defining Connections. Fix warnings like this one:
QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
All platforms that provide support for the QPainter render backend use
per screen rendering. Since there is no any way to test Xinerama-style
rendering, it's better to drop the dead code.
Listen to logind for resume notification and turn the outputs on when it
happens, much like we do when pressing a key.
This way laptops come back on when the lid opens.
BUG: 428424
QGraphicsRotation and Scale are QObject wrappers. It's not useful in
data structures where we're creating mulitple of these every frame. It's
large enough to appear in hotspot as taking over 1% of a regular frame.
We don't even use the QGraphicsRotation mapping inside scene for a
reason, so it's not giving us much.
It's technically an API break in libkwineffects. Pragamatically no-one
would use these. We also lose QGraphicsScale's origin, but we never
exposed this in PaintData's public header.
If window thumbnails have to be downscaled, it's up to the application
what filter must be used. Also, we don't really use the lanczos filter
because both x and y scale factors are 1.
AnimationEffect schedules repaints in postPaintWindow() and performs
cleanup in preScreenPaint(). With the X11-style rendering, this doesn't
have any issues, scheduled repaints will be reset during the next
compositing cycle.
But with per screen rendering, we might hit the following case
- Paint screen 0
- Reset scheduled repaints
- AnimationEffect::prePaintScreen(): update the timeline
- AnimationEffect::postPaintScreen(): schedule a repaint
- Paint screen 1
- Reset scheduled repaints
- AnimationEffect::prePaintScreen(): destroy the animation
- AnimationEffect::postPaintScreen(): no repaint is scheduled
- Return to the event loop
In this scenario, the repaint region scheduled by AnimationEffect will
be lost when compositing is performed on screen 1.
There is no any other way to fix this issue but maintain repaint regions
per each individual screen if per screen rendering is enabled.
BUG: 428439
They would override KScreen in case we were using a dock station that
brings 2 displays.
We'd get:
- udev: event for the first hotplughed screen
- kwin: process all screens properly (both)
- kscreen: would offer the right configuration for such displays
- udev: process the event for the second hotplug udev event
- kwin: restore the configuration
- kscreen: would think this is a conscious decision and embrace it as a
configuration
With this change we are only re-reading the configuration in case the
outputs changed.
At the moment, despite the protocol supporting it, we were not feeding
the EDIDs. KScreen was falling back to the output name so it didn't fail
horribly but it's still a good idea to provide all the data.
When dragging files on the desktop, the cursor image might be just too
big for the cursor plane, in which case we need to abandon hardware
cursors for a brief moment and use a software cursor. Once the files
have been dropped and the cursor image is small enough, we can go back
to using hw cursors.
BUG: 424589
We use the GL_LINEAR magnification filter. This means that GL_REPEAT
wrap mode cannot be used for the software cursor because sampling texels
beyond the right texture edge is the same as sampling texels on the
left edge. This may produce undesired visual artifacts.
Currently, if there is no pointer, only the hardware cursor will be
hidden. If the software cursor is forced, you are going to see a dead
immovable cursor.
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
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.
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
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).