Commit graph

926 commits

Author SHA1 Message Date
Aleix Pol
d0b87a900f screencasting: Add an autotest
Adds an autotest that makes sure a screencasting stream works as
expected.
Adds an optional dependency to KPipeWire only effective to run the test.
2023-03-31 00:19:59 +02:00
Vlad Zahorodnii
f20cf30693 Fix populating CMAKE_AUTOMOC_MACRO_NAMES with kwineffects macros
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.
2023-03-27 12:05:18 +00:00
Vlad Zahorodnii
1211d8e3d6 Prefix more kwineffects includes with libkwineffects/ 2023-03-25 21:05:12 +00:00
Vlad Zahorodnii
e88a4e34a3 Remove some include_directories()
It seems we've settled on dir/dir/header.h includes, so let's use them
consistently.
2023-03-23 14:37:48 +02:00
Vlad Zahorodnii
2c0acdca11 Drop unused kitemviews dependency
Seems unused. KWin compiles fine without it.
2023-03-21 20:32:04 +02:00
Vlad Zahorodnii
9aebfcb2ff Include src/ directory in the proper place
There's other code that includes headers starting from src/ directory,
so putting the corresponding include_directory() in src/effects/ is
inappropriate.
2023-03-17 21:14:14 +00:00
Friedrich W. H. Kossebau
b2a50cffd8 Adapt to Qt6 name of QAccessibilityClient 2023-03-14 13:33:16 +00:00
Vlad Zahorodnii
19fec2a657 backends/x11: Use DRI3 directly
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.
2023-03-09 15:56:46 +00:00
Vlad Zahorodnii
49977d38f2 build: Remove redundant find_package() for Wayland::Client
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.
2023-03-01 21:18:24 +02:00
Vlad Zahorodnii
5184a630bb build: Search for wayland client libs only when building tests 2023-03-01 20:34:17 +02:00
Vlad Zahorodnii
b93e01a724 Drop old kconf update scripts 2023-03-01 18:34:07 +02:00
Vlad Zahorodnii
10df3b0eb0 Remove Qt 5 specific code 2023-02-28 18:30:26 +02:00
Vlad Zahorodnii
d9f5d432be Port to KF6 2023-02-28 18:30:26 +02:00
Jonathan Esk-Riddell
3de1498252 Update version number for 5.27.80
GIT_SILENT
2023-01-27 14:55:36 +00:00
Jonathan Esk-Riddell
0c1e73ce82 Update kf5 version requirement to 5.102.0
GIT_SILENT
2023-01-21 20:06:15 +00:00
Jonathan Esk-Riddell
a873830a86 Update version number for 5.28.80
GIT_SILENT
2023-01-19 12:28:32 +00:00
Jonathan Esk-Riddell
0e0b9dea12 Update version number for 5.26.90
GIT_SILENT
2023-01-19 11:17:01 +00:00
Weng Xuetian
6e87fae7f7 Support XKB_CONTEXT_NO_SECURE_GETENV flag
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
2023-01-07 11:35:42 +00:00
Asahi Lina
a508149882 dmabuf: Create buffers without the SCANOUT flag
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.
2022-12-21 12:34:24 +00:00
Vlad Zahorodnii
ae4c3c1a65 backends/x11: Use PRESENT extension to get notified about frame completion
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.
2022-12-15 08:09:22 +00:00
David Edmundson
c4b134da8d Implement wp-fractional-scale-v1
This allows clients to provide buffers at native resolutions when
fractional scaling is used.

Virtual backend is adjusted to support scales as floats
2022-12-12 12:16:18 +00:00
Vlad Zahorodnii
182026a4bd backends/wayland: Use linux-dmabuf directly
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.
2022-12-09 15:23:27 +02:00
Xaver Hugl
b261050be1 wayland: implement tearing_control_v1 2022-12-05 12:52:18 +00:00
Luigi Toscano
c18a0b80bf Install translated documentation from po/ too
... when KDocTools is found.
2022-11-27 00:05:59 +01:00
Vlad Zahorodnii
f881bdf51b backends/drm: Use drmModeGetConnectorTypeName()
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
2022-11-23 13:31:00 +00:00
Vlad Zahorodnii
632c3508a7 build: Move libkwineffects specific ecm_setup_qtplugin_macro_names to src/libkwineffects 2022-11-03 11:46:41 +00:00
Vlad Zahorodnii
a235cd6d26 build: Hardcode kwin name
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.
2022-11-02 10:21:23 +00:00
Vlad Zahorodnii
432a5ab575 build: Remove include_directories(XKB) 2022-10-31 21:27:30 +00:00
Vlad Zahorodnii
569dc29ba4 build: Remove duplicate "REQUIRED"
Packages are already marked as REQUIRED using set_package_properties()
2022-10-31 20:18:46 +00:00
Vlad Zahorodnii
993c4e2d05 build: Mark KDecoration2 REQUIRED using set_package_properties()
This way there will be a more complete list of missing dependencies in
the feature summary.
2022-10-31 20:18:46 +00:00
Vlad Zahorodnii
fe86eea311 build: Avoid mixing add_definitions() with find_package() 2022-10-31 20:18:46 +00:00
Vlad Zahorodnii
a5db2e732b build: Group CMAKE_{C,CXX}_STANDARD 2022-10-31 20:18:46 +00:00
Vlad Zahorodnii
44ad8e9b9b build: Group include()s in CMakeLists.txt 2022-10-31 20:18:46 +00:00
Vlad Zahorodnii
7fffe99328 build: Add -Wno-unused-parameter compiler option
Due to being a compositor, kwin has to conform to some certain
interfaces. It means a lot of virtual functions and function tables to
integrate with C APIs. Naturally, we not always want to use every
argument in such functions.

Since we get -Wunused-parameter from -Wall, we have to plumb those
unused arguments in order to suppress compiler warnings at the moment.

However, I don't think that extra work is worth it. We cannot change or
alter prototypes in any way to fix the warning the desired way. Q_UNUSED
and similar macros are not good indicators of whether an argument is
used too, we tend to overlook putting or removing those macros. I've
also noticed that Q_UNUSED are not used to guide us with the removal no
longer needed parameters.

Therefore, I think it's worth adding -Wno-unused-parameter compiler
option to stop the compiler producing warnings about unused parameters.
It changes nothing except that we don't need to put Q_UNUSED anymore,
which can be really cumbersome sometimes. Note that it doesn't affect
unused variables, you'll still get a -Wunused-variable compiler warning
if a variable is unused.
2022-10-31 15:50:37 +00:00
Vlad Zahorodnii
de3aa69c1e Fix some tests not building with Qt 6
Client-side wrappers for input-method-unstable-v1 fail to build because
wl_keyboard_interface is referenced in the header file generated by
wayland-scanner.

Unfortunately, qt6_generate_wayland_protocol_client_sources() forces
--include-core-only argument, this is addressed in Qt 6.4.1, but in
meanwhile let's ship a copy of Qt6WaylandClientMacros.cmake file until
the required Qt version is out.
2022-10-20 09:37:00 +00:00
Vlad Zahorodnii
0c28de5b42 wayland: Add support for ext-idle-notify-v1
Wayland protocols MR: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/29
2022-10-20 06:36:58 +00:00
Vlad Zahorodnii
c147340878 wayland: Add support for high resolution scrolling
In libinput 1.19, three new pointer axis events were added in order to
provide support for high-resolution scrolling.

LIBINPUT_EVENT_POINTER_AXIS is de-facto deprecated and new users of
libinput should use instead SCROLL_WHEEL, SCROLL_FINGER, and
SCROLL_CONTINUOUS.

Discrete deltas were replaced with v120 delta values. 120 corresponds to
a single discrete delta. Smaller values correspond to "partial" wheel
ticks.

https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/72
2022-10-11 14:04:13 +03:00
Vlad Zahorodnii
bcd43ff44d backends/x11: Implement own keyboard interception
At the moment, the keyboard interception code in the effects system
relies on Qt code processing key events. However, since QDesktopWidget
is removed in Qt 6, this is a blocker for Qt 6 port.

This change ports the X11 backend to private xkb keymap as indicates in
the todo comment. It allows us to drop the last QDesktopWidget usage.
2022-10-10 09:16:50 +00:00
Nicolas Fella
4a10dfeeff Install po folder 2022-10-02 16:45:13 +02:00
Vlad Zahorodnii
169c784c51 wayland: Bump plasmashell protocol version
See https://invent.kde.org/libraries/plasma-wayland-protocols/-/merge_requests/48
2022-09-21 13:46:55 +00:00
Jonathan Esk-Riddell
48f684ca73 Update version number for 5.26.80
GIT_SILENT
2022-09-15 13:57:28 +01:00
Jonathan Esk-Riddell
8516faa6ad Update version number for 5.25.90
GIT_SILENT
2022-09-15 11:49:43 +01:00
Jonathan Esk-Riddell
d053efde4c Update kf5 version requirement to 5.98.0
GIT_SILENT
2022-09-15 11:10:15 +01:00
Volker Krause
192a57e2e1 Port thumbnail item to use Qt Shader Tools for Qt 6 2022-09-06 10:12:37 +00:00
Xaver Hugl
c4b9626117 backends/drm: replace manual IN_FORMATS parsing with libdrm functions
!2819 reminded me that it's time to replace this mess with libdrm functions

Upstream MR: https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/146
2022-08-30 08:30:01 +00:00
Heiko Becker
3eaf811352 CMake: Require at least plasma-wayland-protocols >= 1.8
It needs [1] from plasma-wayland-protocols.git or fails with
"outputmanagement_v2_interface.cpp:214:50: error:
'error_already_applied' was not declared in this scope" otherwise.

[1] f882bd942283262c27811a937e0d674d365ed72a
2022-08-29 20:28:26 +02:00
Kai Uwe Broulik
3646620430 utils: Introduce RamFile class for memfd
This class can be used to create an anonymous file, for instance
to pass data between compositor and clients, through means of a
file descriptor, as is done in various Wayland protocols, notably
the keymap exchange.

It also implements sealing the file, so that it can be shared
between multiple clients without them being able to modify it.

If supported, memfd_create is used, otherwise a `QTemporaryFile`
is used.

Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
2022-08-19 15:26:22 +02:00
Kai Uwe Broulik
84bde36cc0 Make EGL a REQUIRED dependency
Target kwin links against EGL::EGL unconditionally.

Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
2022-08-09 07:21:07 +00:00
Nicolas Fella
9a34ebbffc [x11] Refactor output updates
The current code has multiple index-based for loops iterating over items we get from XCB

Dealing with raw indices is error-prone and not pretty

By using std::span we can replace these loops with range-based for loops

Also remove some intermediate containers that aren't neccesary
2022-08-06 02:26:39 +00:00
Volker Krause
f8516c1b42 Port remaining QQC1 uses 2022-08-02 18:06:54 +02:00