951 Commits (master)

Author SHA1 Message Date
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
Kai Uwe Broulik 5db527a053 effects/mousemark: Port away from KPluralHandlingSpinBox
It's the only user of KTextWidgets in the entire repository.

Signed-off-by: Eike Hein <eike.hein@mbition.io>
3 years ago
Kai Uwe Broulik aef8ba8d1a Port KComboBox to QComboBox
None of the features it adds ontop of `QComboBox` are used.

Allows to drop the dependency on KCompletion.

Signed-off-by: Eike Hein <eike.hein@mbition.io>
3 years ago
Kai Uwe Broulik 00f2dc1d88 Remove KIconThemes dependency
It has been unused since 7706e17d but was left in CMakeLists.txt

Signed-off-by: Eike Hein <eike.hein@mbition.io>
3 years ago
Nicolas Fella a2ebad760f Implement services in our QPA
This is required for QDesktopServices to work.

Use QGenericUnixServices like the xcb and wayland QPA

BUG: 446144
3 years ago
Albert Astals Cid 858da39fa4 Increase minimum requirements
A newer kwindowsystem is needed for NET::WM2GTKApplicationId

kwin and kwayland-server version must match
3 years ago
Laurent Montel f23ef4c858 Use not deprecated SYSTEMD_USER_UNIT_INSTALL_DIR 3 years ago
Jonathan Riddell 11763bb32c Update version number for 5.24.80
GIT_SILENT
3 years ago
Jonathan Riddell 307fcdf0e1 Update version number for 5.23.90
GIT_SILENT
3 years ago
Vlad Zahorodnii e81a360194 Bump libepoxy to 1.3
1.3 has been released in 2015 which is sufficiently old enough.
3 years ago
Alexander Lohnau bd17ca0110 kwinscripts kcm: Port to new KPluginWidget class
Task: https://phabricator.kde.org/T12265
3 years ago
David Edmundson f4b870977b Re-enable systemd managed kwin
This was blocked on environment variables issues which are now resolved
3 years ago
David Edmundson b3f5f9764f [kwin_wrapper] Sync kwin env after spawning 3 years ago
Alexander Lohnau 70a2fb877a Register KWin effect macros for moc
Otherwise we get lots of moc warnings about there not being any relevant macro used
3 years ago
Alexander Lohnau 66352bfc87 Utilize KCoreAddons infrastructure for static plugins 3 years ago
Xaver Hugl c68f7f13f3 backends/drm,wayland: require gbm
The ifdefs for have_gbm obfuscate the code unnecessarily - the drm backend
is not a great experience with qpainter, so in practice noone should ship
it without gbm anyways.
3 years ago
Xaver Hugl bad5752110 platforms/drm: kill the EglStreams backend
The proprietary NVidia driver now supports gbm, which vastly improves the
user experience. For older devices that will not get gbm support dropping
EglStreams will likely not have a big impact as it has several session breaking
issues anyways.

By removing the backend a lot of logic can be simplified, most notably multi-gpu.
3 years ago
Xaver Hugl 6ff4de2e05 port everything away from Q_FOREACH 3 years ago
David Redondo 60c3b3ddfa Add support for hold gestures 3 years ago
Vlad Zahorodnii d6f02abad0 cmake: Make KF5Wayland required again
wayland platform plugin uses KF::Wayland.
3 years ago
Nicolas Fella 310684f1a7 Fix build by lowering KDE_COMPILERSETTINGS_LEVEL
It doesn't build against the stricter 5.85 level
3 years ago
Jonathan Riddell 57c06d0e00 Update kf5 version requirement to 5.86
GIT_SILENT
3 years ago
Vlad Zahorodnii 5be593d4e4 wayland: Drop internal connection
It's practically unused now.
3 years ago
Alex Richardson 8ab41804f0 Increase minimum KDecoration2 version
I just got a build failure because I hadn't updated KDecoration to
include 195bcf36df.
Bump the minimum version to trigger a CMake error instead of a
compilation failure. Since we expect to be using the same version of
KDecoration as KWin, this change uses ${PROJECT_VERSION} as the minimum
version.
3 years ago
Jonathan Riddell 35ff7eb0ed Update version number for 5.23.80
GIT_SILENT
3 years ago
Jonathan Riddell ebc7851671 Update version number for 5.22.90
GIT_SILENT
3 years ago
Méven Car 2eb5da1d6f Port autotests/integration/outputmanagement_test to kde_output_management_v2 3 years ago
Ismael Asensio 2aacea5026 Set a minimum version check for pipewire
Fixes compilation on systems with a lesser version than required
The minimum version is set to 0.3.29 as indicated in
https://invent.kde.org/plasma/kwin/-/merge_requests/1210
3 years ago
Xaver Hugl 5cc5d81cea guard gbm version for gbm_bo_get_fd_for_plane 3 years ago
Laurent Montel ee4c9cd6d5 Fix compile with last ecm
(With
https://invent.kde.org/frameworks/extra-cmake-modules/-/merge_requests/145
we have disabled the C and C++ specific compiler extensions)
3 years ago
Nicolas Fella 1e36e79fa3 Remove unused KIO dependency 3 years ago
Vlad Zahorodnii 811beb94e0 Remove Xrender backend
The Xrender backend was added at the time when OpenGL drivers were not
particularly stable. Nowadays though, it's a totally different situation.

The OpenGL render backend has been the default one for many years. It's
quite stable, and it allows implementing many advanced features that
other render backends don't.

Many features are not tested with it during the development cycle; the
only time when it is noticed is when changes in other parts of kwin break
the build in the xrender backend. Effectively, the xrender backend is
unmaintained nowadays.

Given that the xrender backend is effectively unmaintained and our focus
being shifted towards wayland, this change drops the xrender backend in
favor of the opengl backend.

Besides being de-facto unmaintained, another issue is that QtQuick does
not support and most likely will never support the Xrender API. This
poses a problem as we want thumbnail items to be natively integrated in
the qtquick scene graph.
3 years ago
Vlad Zahorodnii 7a063f9ab7 Build kwin with QT_NO_KEYWORDS 3 years ago
Vlad Zahorodnii 77a9d38166 Make libdrm required dependency
As is, kwin with the drm backend results in the most pleasant user
experience on Wayland. Given that and the fbdev being about to be
dropped, making libdrm a required dependency seems a reasonable decision.
3 years ago
Aleix Pol 3b05823f1f libinput: bump required version
So we can remove ifdefs and weird cases to support versions that are far
too old to support anyway.
3 years ago
Jonathan Riddell 2f0088de93 Update version number for 5.22.80
GIT_SILENT
3 years ago
Jonathan Riddell 0efc9e8e7f Update version number for 5.21.90
GIT_SILENT
3 years ago
Jonathan Riddell 2358a9b031 Update kf5 version requirement to 5.82
GIT_SILENT
3 years ago
Andrey Butirsky 91f47c9092 fix global shortcuts for non-Latin symbols
Re-use Qt's implementation of handling non-Latin layouts here
For full ASCII range support (Alt+`, etc.) Qt needs to be patched still,
see QTBUG-90611

BUG: 375518
4 years ago
Vlad Zahorodnii ade861d6de Refactor session code
At the moment, the session code is far from being extensible. If we
decide to add support for libseatd, it will be a challenging task with
the current design of session management code. The goal of this
refactoring is to fix that.

Another motivation behind this change is to prepare session related code
for upstreaming to kwayland-server where it belongs.
4 years ago
Nicolas Fella d7ab631e98 Find ECM with KF5 min version
Instead of some randon older version
4 years ago
Nicolas Fella b7e13da70f Merge two CMAKE_MODULE_PATH set calls 4 years ago
Nicolas Fella c777d5a3a7 Raise minimum CMake version to 3.16
As discussed in https://mail.kde.org/pipermail/plasma-devel/2021-February/119329.html

GIT_SILENT
4 years ago
Vlad Zahorodnii 6a26540065 wayland: Query pkg-config if Xwayland supports listenfd
-listen <fd> option is deprecated in favor of the -listenfd option. This
change makes kwin query whether Xwayland supports the -listenfd option
at build time. If the pkg-config file is missing, we'll use the old listen
option.
4 years ago
Aleix Pol b409f523f0 Revert "cmake: Get XKB information directly from PkgConfig"
This reverts commit 3c97cecdb0.

It seems to break on the CI and I don't understand why.
4 years ago
Aleix Pol 3c97cecdb0 cmake: Get XKB information directly from PkgConfig
Rather than having it abstracted in a local FindXKB package.
Makes the code more standard and removes a custom finder we ultimately
don't need.
4 years ago
Vlad Zahorodnii bd4d17b3a1 Drop QtScript dependency
QtScript is not used anywhere anymore plus it's dropped in Qt 6.
4 years ago
David Faure abab1660aa Define -DQT_NO_CAST_TO_ASCII and fix compilation 4 years ago
Vlad Zahorodnii 93e0265e4e Move source code to src/ directory
Once in a while, we receive complaints from other fellow KDE developers
about the file organization of kwin. This change addresses some of those
complaints by moving all of source code in a separate directory, src/,
thus making the project structure more traditional. Things such as tests
are kept in their own toplevel directories.

This change may wreak havoc on merge requests that add new files to kwin,
but if a patch modifies an already existing file, git should be smart
enough to figure out that the file has been relocated.

We may potentially split the src/ directory further to make navigating
the source code easier, but hopefully this is good enough already.
4 years ago
Nicolas Fella eedb8e44ea Use imported target for Threads 4 years ago
Nicolas Fella a110231f68 Use imported target for QtGui private headers
It's nicer
4 years ago
Laurent Montel 3c63750f6e GIT_SILENT: don't use deprecated cmake variable 4 years ago