902 Commits (711cdc782505155f961c986216b5926432782fa8)

Author SHA1 Message Date
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
2 years ago
Vlad Zahorodnii 632c3508a7 build: Move libkwineffects specific ecm_setup_qtplugin_macro_names to src/libkwineffects 2 years ago
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.
2 years ago
Vlad Zahorodnii 432a5ab575 build: Remove include_directories(XKB) 2 years ago
Vlad Zahorodnii 569dc29ba4 build: Remove duplicate "REQUIRED"
Packages are already marked as REQUIRED using set_package_properties()
2 years ago
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.
2 years ago
Vlad Zahorodnii fe86eea311 build: Avoid mixing add_definitions() with find_package() 2 years ago
Vlad Zahorodnii a5db2e732b build: Group CMAKE_{C,CXX}_STANDARD 2 years ago
Vlad Zahorodnii 44ad8e9b9b build: Group include()s in CMakeLists.txt 2 years ago
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.
2 years ago
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.
2 years ago
Vlad Zahorodnii 0c28de5b42 wayland: Add support for ext-idle-notify-v1
Wayland protocols MR: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/29
2 years ago
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
2 years ago
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.
2 years ago
Nicolas Fella 4a10dfeeff Install po folder 2 years ago
Vlad Zahorodnii 169c784c51 wayland: Bump plasmashell protocol version
See https://invent.kde.org/libraries/plasma-wayland-protocols/-/merge_requests/48
2 years ago
Jonathan Esk-Riddell 48f684ca73 Update version number for 5.26.80
GIT_SILENT
2 years ago
Jonathan Esk-Riddell 8516faa6ad Update version number for 5.25.90
GIT_SILENT
2 years ago
Jonathan Esk-Riddell d053efde4c Update kf5 version requirement to 5.98.0
GIT_SILENT
2 years ago
Volker Krause 192a57e2e1 Port thumbnail item to use Qt Shader Tools for Qt 6 2 years ago
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
2 years ago
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
2 years ago
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>
2 years ago
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>
2 years ago
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
2 years ago
Volker Krause f8516c1b42 Port remaining QQC1 uses 2 years ago
Alexander Lohnau 1a38ea6aba Port to KCM desktop file generation method from kcmutils
This de-duplicates the translations needed for the KCMs.

Task: https://phabricator.kde.org/T15609
2 years ago
Vlad Zahorodnii aa739c59cf wayland: Make mapping from xinerama indices to Output correct
We assume that outputs in kwinApp()->platform()->enabledOutputs() are
stored in the xinerama order. However, this is not the case on Wayland
and it's not going to be changed because it increases the complexity.

This change makes Workspace::xineramaIndexToOutput() use Xinerama
extension API to map a xinerama index to the associated Output object.

With this, Xwayland applications will be able to put on outputs as
expected.

Note that xinerama indices are not cached because
Workspace::xineramaIndexToOutput() is not used in any hot code path. If
that changes, xinerama indices can be cached. The cache must be
invalidated whenever we get screens changed notify event from RANDR.
2 years ago
Aleix Pol d5ddf55e9b gbm: Don't pass any flags when creating buffers with modifiers
It seems it doesn't bring much and it may backfire. Especially don't
pass GBM_BO_USE_LINEAR as it will limit a lot the buffers that can be
created and GBM_BO_USE_RENDERING use seems to be more harmful than
helpful on most cases.
2 years ago
Jonathan Esk-Riddell dfc6c87057 Update qt5 version requirement to 5.15.2
GIT_SILENT
2 years ago
Aleix Pol aa59344be7 Platform: Improve our infrastructure to support dmabufs in backends
Allows creating buffers with modifiers.
Lets the windowed wayland backend support it, which makes testing
everything else much simpler.
2 years ago
Méven Car 9cc73a5bc6 Bump KF5_MIN_VERSION after b069aad160e514ec2f933f654ddcbbc6aca59ed5
GIT_SILENT
NO_CHANGELOG
2 years ago
Jonathan Esk-Riddell e08cd40e8e Update version number for 5.25.80
GIT_SILENT
2 years ago
Jonathan Esk-Riddell 8f009c2db1 Update version number for 5.24.90
GIT_SILENT
2 years ago
Nicolas Fella a902e78ff4 Mark libxcvt as required
It's used unconditionally later on

Make sure it fails at the appropriate time when not found
2 years ago
Nicolas Fella 774dbf8d2f Use ECMFindQmlModule instead of ECMQmlModules 2 years ago
Xaver Hugl 14e7afcb4e color management: refactor and move to its own directory
The pipeline stages are also now properly managed, which should prevent
use-after-free errors.

BUG: 453026
2 years ago
Alexander Lohnau 719e97194d Port KWin Scripts KCM to QML
Task: https://phabricator.kde.org/T7289
2 years ago
Xaver Hugl 08ad2c8ed3 add libxcvt as a new hard dependency 2 years ago
Vlad Zahorodnii b64f95b703 Integrate kwaylandserver
This makes KWin switch to in-tree copy of KWaylandServer codebase.

KWaylandServer namespace has been left as is. It will be addressed later
by renaming classes in order to fit in the KWin namespace.
2 years ago
Xaver Hugl f6eee463ba Make lcms2 a hard dependency
When we do more color management stuff we'll need it in more places,
making it a hard requirement reduces the amount of needed ifdefs and
should make adding color management features a little simpler.
2 years ago
Andreas Sturmlechner 2aaa9ed5c2 Add missing KF5Auth dependency
Used in src/helpers/killer

Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
3 years ago
Vlad Zahorodnii 8fe567c4fa Add pre-commit hook for clang-format 3 years ago
Volker Krause 2a171e5fa8 Adapt build system to also support building against Qt6 3 years ago
Alex Richardson 0a0a1fd330 Use __has_include() instead of check_include_file()
Allows removing some CMake checks config-kwin.h contents. This is
supported by all compilers and required for C++17. While touching those
lines I also cleaned up an unnecessary HAVE_UNISTD_H check (glibc always
has it and and incorrect use of HAVE_SYS_PROCCTL_H.
3 years ago
Vlad Zahorodnii 994c5c24ae Drop fbdev backend
fbdev has been deprecated and unmaintained for a while. With Linux 5.14
including SimpleDRM driver, we can drop it. (at the time of writing this
commit message, the latest Linux version is 5.16).
3 years ago
Vlad Zahorodnii b0982f7bbc wayland: Drop ptrace logic
kwin disables ptrace for a good reason - to prevent other processes from
attaching to kwin and snooping sensitive data or taking control of kwin.
But, that will also make things such as memory statistics unavailable to
read, etc.

On the other hand, the supported platforms where kwin runs all have
security measures in places to forbid shady processes ptrace'ing kwin.
For example, on Linux it's YAMA.

On Linux, by default, a process can ptrace only its descendants. For
example, this can be used by debuggers; otherwise you would need to be
the superuser to attach to any process.

This change drops our ptrace logic in favor of system provided security
measures. It allows the System Monitor to gather kwin's memory usage
statistics and also simplifies code, the current debugger detection
logic is not really robust.

If the system provided security measures are proven to be insufficient,
we can add the ptrace disabling logic back, but it would be great to
avoid that because system monitor won't be able to gather resource usage
statistics, which can be useful for detecting memory leaks in plasma
wayland session, etc.
3 years ago
Kai Uwe Broulik 9f9e32e57d Remove unused Qt QuickWidgets dependency
Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
3 years ago
Kai Uwe Broulik 0793c24249 Add KWIN_BUILD_NOTIFICATIONS option
Notifications are really only useful in a setting with a full
shell environment where there is a notification center to display them.

Signed-off-by: Victoria Fischer <victoria.fischer@mbition.io>
3 years ago
Kai Uwe Broulik d54723cbf2 Add KWIN_BUILD_SCREENLOCKER option
Allows to build KWin without lockscreen support and thus drops the
kscreenlocker dependency.

Signed-off-by: Eike Hein <eike.hein@mbition.io>
3 years ago