There are use cases for the headers to be used, e.g. when implementing
wayland-specific workflows from an Effect.
In order to be able to use these, we also need to expose libkwin to be
imported as it carries the interfaces' symbols.
Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
It appears like gbm_VERSION can be a list, which if() does not like. So
pass the variable to the if() rather than its value. While on this, also
change GREATER_EQUAL to VERSION_GREATER_EQUAL so cmake compares
individual version components.
Qt requires xcb-icccm 0.3.9. On the other hand, 0.3.9 contains all the
types and functions used by kwin, so remove the corresponding
XCB_ICCM_FOUND checks to simplify the code.
Apparently CMAKE_AUTOMOC_MACRO_NAMES modifications are not visible in
sibling directories. To work around that, populate
CMAKE_AUTOMOC_MACRO_NAMES with libkwineffects plugin macros in the
top level CMakeLists.txt file.
There's other code that includes headers starting from src/ directory,
so putting the corresponding include_directory() in src/effects/ is
inappropriate.
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.
find_package(Wayland) already takes of the client lib, it's needed by
the wayland backend, so BUILD_TESTING specific find_package() can be
merged with it.
Since kwin play with CAP_SYS_NICE, secure_getenv will fail for xkbcommon
to load user level xkbmap. This allows kwin to load config under
~/.config/xkb
BUG: 447206
gbm_bo_create_with_modifiers implies the GBM_BO_USE_SCANOUT flag, which
disables complex (tiled or compressed) formats that cannot be used for
scanout. This reduces performance. We don't need to scan out buffers
created for sceencasting/etc., so this is suboptimal.
By switching to gbm_bo_create_with_modifiers2, we can explicitly pass
the flags and avoid falling back to lower performance formats. Also add
a config check and fall back to the old version, to retain compatibility
with older mesa versions.
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.
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.
It ensures that connector type naming is consistent across compositors
and saves us some work adding string mappings.
drmModeGetConnectorTypeName() uses the same naming scheme as the drm
backend so the client side should be unaffected by this change.
CCBUG: 385135
We use KWIN_NAME, KWIN_INTERNAL_NAME_X11 and KWIN_INTERNAL_WAYLAND
properly only in a few places. In other, we use hardcoded names.
Let's not bother and hardcode kwin names everywhere rather than have one
foot in and one foot out, it's simpler.