Commit graph

989 commits

Author SHA1 Message Date
Alexander Lohnau
66352bfc87 Utilize KCoreAddons infrastructure for static plugins 2021-11-24 10:48:51 +00:00
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.
2021-11-12 08:25:15 +00:00
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.
2021-11-10 11:43:36 +00:00
Xaver Hugl
6ff4de2e05 port everything away from Q_FOREACH 2021-11-08 14:19:05 +00:00
David Redondo
60c3b3ddfa Add support for hold gestures 2021-10-26 08:16:52 +00:00
Vlad Zahorodnii
d6f02abad0 cmake: Make KF5Wayland required again
wayland platform plugin uses KF::Wayland.
2021-10-12 06:32:55 +00:00
Nicolas Fella
310684f1a7 Fix build by lowering KDE_COMPILERSETTINGS_LEVEL
It doesn't build against the stricter 5.85 level
2021-10-11 21:59:39 +02:00
Jonathan Riddell
57c06d0e00 Update kf5 version requirement to 5.86
GIT_SILENT
2021-10-11 20:48:20 +01:00
Vlad Zahorodnii
5be593d4e4 wayland: Drop internal connection
It's practically unused now.
2021-10-07 13:28:08 +00:00
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.
2021-10-07 07:40:16 +00:00
Jonathan Riddell
35ff7eb0ed Update version number for 5.23.80
GIT_SILENT
2021-09-16 10:33:42 +01:00
Jonathan Riddell
ebc7851671 Update version number for 5.22.90
GIT_SILENT
2021-09-16 09:21:13 +01:00
Méven Car
2eb5da1d6f Port autotests/integration/outputmanagement_test to kde_output_management_v2 2021-09-14 14:42:31 +00:00
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
2021-09-04 04:24:07 +02:00
Xaver Hugl
5cc5d81cea guard gbm version for gbm_bo_get_fd_for_plane 2021-08-25 14:39:35 +00:00
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)
2021-06-28 08:03:12 +02:00
Nicolas Fella
1e36e79fa3 Remove unused KIO dependency 2021-06-09 16:18:41 +02:00
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.
2021-06-09 11:21:57 +03:00
Vlad Zahorodnii
7a063f9ab7 Build kwin with QT_NO_KEYWORDS 2021-06-08 10:52:15 +03:00
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.
2021-05-14 18:00:40 +00:00
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.
2021-05-14 17:47:46 +00:00
Jonathan Riddell
2f0088de93 Update version number for 5.22.80
GIT_SILENT
2021-05-13 15:09:31 +01:00
Jonathan Riddell
0efc9e8e7f Update version number for 5.21.90
GIT_SILENT
2021-05-13 10:21:29 +01:00
Jonathan Riddell
2358a9b031 Update kf5 version requirement to 5.82
GIT_SILENT
2021-05-13 09:56:06 +01:00
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
2021-04-05 19:39:06 +00:00
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.
2021-03-23 08:01:19 +00:00
Nicolas Fella
d7ab631e98 Find ECM with KF5 min version
Instead of some randon older version
2021-03-04 15:11:30 +00:00
Nicolas Fella
b7e13da70f Merge two CMAKE_MODULE_PATH set calls 2021-03-04 15:11:30 +00:00
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
2021-03-04 12:47:58 +01:00
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.
2021-03-02 13:29:22 +00:00
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.
2021-03-02 02:14:39 +01:00
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.
2021-03-01 20:33:38 +01:00
Vlad Zahorodnii
bd4d17b3a1 Drop QtScript dependency
QtScript is not used anywhere anymore plus it's dropped in Qt 6.
2021-02-23 07:47:01 +00:00
David Faure
abab1660aa Define -DQT_NO_CAST_TO_ASCII and fix compilation 2021-02-19 11:00:27 +02:00
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.
2021-02-10 15:31:43 +00:00
Nicolas Fella
eedb8e44ea Use imported target for Threads 2021-02-09 20:32:29 +01:00
Nicolas Fella
a110231f68 Use imported target for QtGui private headers
It's nicer
2021-02-09 19:59:51 +01:00
Laurent Montel
3c63750f6e GIT_SILENT: don't use deprecated cmake variable 2021-02-08 20:19:33 +01:00
Nicolas Fella
99947c8bd8 Use versionless Qt cmake target
This makes it easier to build against both Qt5 and Qt6

GIT_SILENT
2021-01-30 17:18:21 +01:00
Laurent Montel
88b6076b2f GIT_SILENT: dont use deprecated cmake variable 2021-01-29 11:34:52 +01:00
David Edmundson
ca81be6635 Fix the systemd wayland boot
Plasma-workspace currently starts kwin_wayland before afterwards
continuing to spawn the full session, through whatever mechanism.

We ultimately want to just have systemd manage everything all at once,
but this was not realised in time for 5.21 due to a problem of
propogating environment variables.

By removing this file we go to a working state with the option enabled,
and can build on it for the next release.

BUG: 432189
2021-01-27 13:47:56 +00:00
Jonathan Riddell
f47ae2c0c5 Update version number for 5.21.80
GIT_SILENT
2021-01-21 13:38:08 +00:00
Jonathan Riddell
6f51a9cc8f Update kf5 version requirement to 5.78
GIT_SILENT
2021-01-21 12:28:31 +00:00
Jonathan Riddell
a0c7f997d4 Update version number for 5.20.90
GIT_SILENT
2021-01-21 12:07:20 +00:00
Vlad Zahorodnii
907480037a cmake: Don't search for Qt5Sensors 2021-01-15 23:30:25 +02:00
Vlad Zahorodnii
15d6be5c0c cmake: Drop Qt5::Sensors dependency
QOrientationSensor is no longer used by kwin.
2021-01-15 23:27:32 +02:00
Vlad Zahorodnii
19461f4413 cmake: Don't list linked libraries in variables
If a non-existing variable is used, no warning will be printed.
2021-01-15 23:18:20 +02:00
David Edmundson
85d04cf60d Add ftrace markers
This logs to a tracefs filesystem which can be viewed in tools such as
gpuvis to see precise timings of activities in relation to other trace
markers in X or graphic drivers.

This patch is loosely based on D23114. Though modified with thread
safety, support for string building, and a RAII pattern for durations.
Ultimately that expanded it somewhat.
2021-01-14 09:31:59 +00:00
Vlad Zahorodnii
5bf421ef83 cmake: Specify min version for wayland-protocols 2021-01-07 09:50:55 +00:00
Vlad Zahorodnii
5302094f30 cmake: Link against imported Xinput target 2021-01-07 09:50:24 +00:00
Vlad Zahorodnii
b67f743795 cmake: Drop libkwin's unused Xlib dependencies 2021-01-07 09:50:24 +00:00
Vlad Zahorodnii
ad5f8c5c59 Introduce RenderJournal
Currently, we estimate the expected render time purely based on the
latency policy.

The problem with doing so is that the real render time might be larger,
this can result in frame drops.

In order to avoid frame drops, we need to take into account previous
render times while estimating the next render time. For now, we just
measure how long it takes to record rendering commands on the CPU.

In the future, we might want consider using OpenGL timer queries for
measuring the real render time, but for now, it's good enough.
2021-01-06 16:59:29 +00:00
Vlad Zahorodnii
b8a70e62d5 Introduce RenderLoop
At the moment, our frame scheduling infrastructure is still heavily
based on Xinerama-style rendering. Specifically, we assume that painting
is driven by a single timer, etc.

This change introduces a new type - RenderLoop. Its main purpose is to
drive compositing on a specific output, or in case of X11, on the
overlay window.

With RenderLoop, compositing is synchronized to vblank events. It
exposes the last and the next estimated presentation timestamp. The
expected presentation timestamp can be used by effects to ensure that
animations are synchronized with the upcoming vblank event.

On Wayland, every outputs has its own render loop. On X11, per screen
rendering is not possible, therefore the platform exposes the render
loop for the overlay window. Ideally, the Scene has to expose the
RenderLoop, but as the first step towards better compositing scheduling
it's good as is for the time being.

The RenderLoop tries to minimize the latency by delaying compositing as
close as possible to the next vblank event. One tricky thing about it is
that if compositing is too close to the next vblank event, animations
may become a little bit choppy. However, increasing the latency reduces
the choppiness.

Given that, there is no any "silver bullet" solution for the choppiness
issue, a new option has been added in the Compositing KCM to specify the
amount of latency. By default, it's "Medium," but if a user is not
satisfied with the upstream default, they can tweak it.
2021-01-06 16:59:29 +00:00
Nate Graham
3800181ac2 Revert "cmake: Remove redundant include_directories()"
This reverts commit 9b1ea1c7f7.

This breaks compilation; apparently the include is not implicit and is
thus needed after all.
2021-01-05 19:29:15 -07:00
Vlad Zahorodnii
26b249061e cmake: Remove FindUDev.cmake
It's in extra-cmake-modules now.
2021-01-05 23:08:47 +02:00
Vlad Zahorodnii
9b1ea1c7f7 cmake: Remove redundant include_directories()
libkwin is linked against imported XKB::XKB target. Thus the
include_directories() is redundant.
2021-01-05 22:58:04 +02:00
Vlad Zahorodnii
7e5c16989e Drop hwcomposer backend
Plasma Mobile announced that they plan to drop support for Halium
devices, see the announcement blog post [1] for the reasons that led to
such a decision.

But just to summarize, here are some of the key points from the post:

 * Some of our team members no longer have access to reference LG Nexus
   5X device anymore
 * After KDE Neon switched to using Ubuntu 20.04 we no longer are
   updating the rootfs for halium devices
 * After several important architecture changes in upstream KWin, the
   hwcomposer backend might be broken and we have no way of verifying it

If the community members are interested in reviving the hwcomposer
backend,

  * it pretty much needs rewrite/re-thinking given differences of hwc1
    and hwc2 API for hwcomposer part of it, see also [2]
  * It also needs removal of Android 5 based libhardware API as we don't
    think code can be kept sane with 3 different levels of ifdefs
  * This backend needs better way of fixing difference between
    CAF/non-CAF devices then just recompiling with different headers,
    maybe env vars?
  * This backend does not support various things like transformation/
    rotation etc, and is not exactly feature complete as the DRM backend

[1] https://www.plasma-mobile.org/2020/12/14/plasma-mobile-technical-debt.html
[2] 83f563c339
2021-01-05 17:38:36 +00:00
Vlad Zahorodnii
ccfaf1a1d6 cmake: Rework how tabbox is conditionally compiled into libkwin
In modern CMake code, it is highly advised to avoid using variables. One
should instead try to use targets and properties more extensively.
2020-12-31 11:00:27 +00:00
Vlad Zahorodnii
9af78c0e7f cmake: Rework how activities support is compiled into libkwin
In modern CMake code, it is highly advised to avoid using variables. One
should instead try to use targets and properties more extensively.
2020-12-31 11:00:27 +00:00
Vlad Zahorodnii
d16c15301f cmake: Rework Findepoxy.cmake
This makes Findepoxy.cmake more upstreamable and easier to use.
2020-12-31 10:52:03 +00:00
Vlad Zahorodnii
79ca5ccd26 Merge OutputScreens into Screens
Since all platforms have been ported to AbstractOutput, OutputScreens
can be merged into Screens. This simplifies the class hierarchy.
2020-12-17 13:36:30 +00:00
Vlad Zahorodnii
64ad9a61d8 Introduce ColorManager component
This change introduces a new component - ColorManager that is
responsible for color management stuff.

At the moment, it's very naive. It is useful only for updating gamma
ramps. But in the future, it will be extended with more CMS-related
features.

The ColorManager depends on lcms2 library. This is an optional
dependency. If lcms2 is not installed, the color manager won't be built.

This also fixes the issue where colord and nightcolor overwrite each
other's gamma ramps. With this change, the ColorManager will resolve the
conflict between two.
2020-12-13 23:53:33 +02:00
Vlad Zahorodnii
b06fb6b060 Drop redundant find_package(Qt5Multimedia)
We need the multimedia component only to play preview videos in a KCM.

The find_package(Qt5Multimedia) is not needed because we already check
if Qt5Multimedia QML module is present using ecm_find_qmlmodule().

The main motivation behind this change is to work around constant build
failures caused by buggy config file of the Qt5::Multimedia component.
2020-12-13 16:22:35 +02:00
Aleix Pol
2c6bfdf0b8 --warning
Set -DLIBINPUT_HAS_TOTEM per file rather than per target so that all
targets that build it have the define.
This particular file is also used by some tests and this fixes the
warning that this ifdef resolves at once for all targets.
2020-12-11 23:59:19 +00:00
Vlad Zahorodnii
6b2e6cfd53 Prevent EGL headers from including Xlib headers
One of the annoying things about EGL headers is that they include
platform headers by default, e.g. on X11, it's Xlib.h, etc.

The problem with Xlib.h is that it uses the define compiler directive to
declare constants and those constants have very generic names, e.g.
'None', which typically conflict with enums, etc.

In order to work around bad things coming from Xlib.h, we include
fixx11.h file that contains some workarounds to redefine some Xlib's
types.

There's a flag or rather two flags (EGL_NO_PLATFORM_SPECIFIC_TYPES and
EGL_NO_X11) that are cross-vendor and they can be used to prevent EGL
headers from including platform specific headers, such as Xlib.h [1]

The benefit of setting those two flags is that you can simply include
EGL/egl.h or epoxy/egl.h and the world won't explode due to Xlib.h

MESA_EGL_NO_X11_HEADERS is set to support older versions of Mesa.

[1] https://github.com/KhronosGroup/EGL-Registry/pull/111
2020-12-10 11:15:06 +02:00
Vlad Zahorodnii
bdfb946267 Convert Night Color into a plugin
Night Color adjusts the color temperature based on the current time in
your location. It's not a generic color correction module per se.

We need a central component that can be used by both night color and
colord integration to tweak gamma ramps and which will be able to
resolve conflicts between the two. The Night Color manager cannot be
such a thing because of its very specific usecase.

This change converts Night Color into a plugin to prepare some space for
such a component.

The tricky part is that the dbus api of Night Color has "ColorCorrect"
in its name. I'm afraid we cannot do that much about it without breaking
API compatibility.
2020-11-27 18:55:01 +00:00
Vlad Zahorodnii
8f6edea521 Turn krunner integration into a plugin
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.
2020-11-25 09:34:25 +00:00
Vlad Zahorodnii
f037a69f1c Introduce colord integration
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.
2020-11-24 17:51:32 +02:00
Vlad Zahorodnii
c766e5da6d Introduce infrastructure for compositor extensions
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.
2020-11-24 15:50:33 +00:00
Vlad Zahorodnii
70393eec6f Consistently name some KF5 integration plugins 2020-11-23 16:44:42 +00:00
Vlad Zahorodnii
0dd2f787ae wayland: Link statically against KIdleTime integration plugin
The main motivation behind this change is to improve startup time. The
Poller class was renamed to avoid potential name conflicts in the future.
2020-11-23 16:44:42 +00:00
Vlad Zahorodnii
f3a902911a wayland: Link statically KWindowSystem integration plugin
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.
2020-11-23 16:44:41 +00:00
Vlad Zahorodnii
49e0b84d84 wayland: Link statically KGlobalAccel integration plugin
Without the KGlobalAccel integration plugin, Wayland experience will be
negatively affected. Therefore it makes little sense to load it at run-
time.
2020-11-23 16:44:41 +00:00
David Edmundson
5e60e64a5d Bundle QPA plugin directly
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.
2020-11-22 17:52:14 +00:00
Benjamin Port
cf4335ca62 Add windows runner
Move windows runner from plasma-workspace to kwin (convert it to dbus runner)

This will allow to interract with windows on wayland too
2020-10-30 10:30:53 +00:00
Vlad Zahorodnii
9c20df5030 screencast: Use fences to avoid stalling the graphics pipeline
Currently, we use glFinish() to ensure that stream consumers don't see
corrupted or rather incomplete buffers. This is a serious issue because
glFinish() not only prevents the gpu from processing new GL commands,
but it also blocks the compositor.

This change addresses the blocking issue by using native fences. With
the proposed change, after finishing recording a frame, a fence is
inserted in the command stream. When the native fence is signaled, the
pending pipewire buffer will be enqueued.

If the EGL_ANDROID_native_fence_sync extension is not supported, we'll
fall back to using glFinish().
2020-10-19 14:23:06 +00:00
Benjamin Port
4acea54272 KCM: Adapt to KCMUtils change 2020-10-15 08:45:52 +00:00
Benjamin Port
7546af6b4c KCM KWin Decoration: Add module data
depends on https://invent.kde.org/frameworks/kcmutils/-/merge_requests/19
2020-10-07 12:29:02 +02:00
Bhushan Shah
474d0344ca autotests: rename to testInputMethod
Relevant class got renamed, also update the test name

Related: plasma/kwin!302
2020-09-30 16:04:49 +05:30
Bhushan Shah
222b558b04 virtualkeyboard: rename class to InputMethod
VirtualKeyboard class does not implement the relevant VirtualKeyboard
protocol but rather implements the InputMethod protcol and can in theory
be used by other input method like e.g. ibus.

Make class name consistent with what it does to avoid confusion in
future.

For now only rename of main class is done and dbus service is kept as-is
to provide retro-compatibility, when input method protocol is
implemented fully, we can think of what to do wrt the dbus interface
later when we fully implement zwp_input_method_unstable_v1 protocol.
2020-09-29 20:55:24 +05:30
Carson Black
02b1e11758 Bump up minimum C++ version to C++17 2020-09-28 16:08:52 +00:00
Bhushan Shah
fd917b4e00 Update version number for 5.20.80
GIT_SILENT
2020-09-21 16:37:41 +05:30
Bhushan Shah
c5a90a158c Update version number for 5.19.90
GIT_SILENT
2020-09-17 15:05:23 +05:30
Bhushan Shah
8ae28df622 Update qt5 version requirement to 5.15.0
GIT_SILENT
2020-09-17 10:32:13 +05:30
Bhushan Shah
b416e204ee Update kf5 version requirement to 5.74
GIT_SILENT
2020-09-17 10:32:13 +05:30
Laurent Montel
07763229eb Remove explicit ECM_KDE_MODULE_DIR 2020-09-16 20:55:36 +02:00
Vlad Zahorodnii
7e9bec6fd7 Use consistent naming pattern for wayland shell integrations
This change intends to fix a minor inconsistency regarding how shell
integration classes are named.
2020-09-04 16:51:25 +03:00
Vlad Zahorodnii
88829de9dd wayland: Refactor creation of input panel clients
This change introduces a shell integration class for input panel
surfaces. This effectively breaks the direct dependency between our
virtual keyboard component in kwin and the input_panel protocol,
which means that an input method server could use the layer-shell
protocol instead of the input_panel protocol.
2020-09-04 13:08:34 +00:00
Vlad Zahorodnii
d3cca65d39 Implement the layer-shell v1 protocol
The layer-shell protocol allows wayland clients to create surfaces that
can be used for building desktop environment components such as panels,
notifications, etc.

The support for the plasma-shell protocol will be dropped once plasma in
all its entirety is ported to the layer-shell protocol.
2020-09-03 18:11:44 +00:00
Vlad Zahorodnii
848f7f3177 Revert "plugins/drm: Link against Wayland::Server"
This reverts commit efb9e0edb2.

libwayland-server is now in the link interface of kwayland-server.
2020-09-02 19:31:29 +03:00
Vlad Zahorodnii
efb9e0edb2 plugins/drm: Link against Wayland::Server
We need to link against Wayland::Server because the EGL Streams protocol
wrapper uses wl_array in its public API.
2020-09-02 16:10:25 +00:00
Vlad Zahorodnii
bfcf312e37 Drop unused libwayland-cursor dependency
KWin doesn't need libwayland-cursor since cb7a9456c0.
2020-09-02 14:37:27 +03:00
Marco Martin
97f4712f29 Fix size restore upon keyboard close in XdgSurfaceClient
in XdgSurfaceClient setFrameGeometry is async,
so we can't rely on it having the final value immediately.
make setVirtualKeyboardGeometry a virtual.
in the implementation on setVirtualKeyboardGeometry
use requestedFrameGeometry() instead of frameGeometry()
2020-09-01 08:58:46 +00:00
Aleix Pol
7aabd45df9 Integrate input-method-unstable-v1 2020-08-18 10:55:21 +00:00
Vlad Zahorodnii
5aef9da884 Lower message severity for KWIN_XWL
When the Xwayland process crashes, we will print a warning message, but
that warning message won't show up anywhere in the terminal because the
current message severity for KWIN_XWL is way too high.

This patch lowers the message severity for the KWIN_XWL logging category
so warning messages can be seen from the terminal.
2020-08-05 08:48:00 +00:00
David Edmundson
405841caf2 Install service files for kwin 2020-07-30 15:02:08 +01:00
Vlad Zahorodnii
2103b999e7 screencast: Address minor issues 2020-07-28 18:38:49 +00:00
Aleix Pol
9438a2e1b1 Disable screencasting if there's no pipewire 0.3
Hopefully fixes the CI
2020-07-23 23:33:30 +02:00
Aleix Pol
38eb72efe3 screencasting: integrate zkde_screencast_unstable_v1
Includes a PipeWire implementation that will send the relevant streams
to the processes that need them.
2020-07-23 13:14:22 +02:00
Vlad Zahorodnii
cb7a9456c0 [wayland] Rework Xcursor theme loading code
Currently in order to load an Xcursor theme, kwin uses libwayland api,
which looks really awkward because of the way how the compositor talks
to itself via the internal connection.

The main motivation behind this change is to limit the usage of kwayland
client api in kwin.
2020-06-18 07:14:58 +00:00
Adriaan de Groot
fcba278094 Handle differences in paths for Linux vs FreeBSD
- The name of tty devices is different; put detection into
  the CMakeLists and pass that as a define when building
  virtual_terminal.cpp -- this means no ifdeffery for the path.
- The name of dri devices is different; FreeBSD just has one.
2020-06-05 12:41:28 +02:00
Tobias Berner
33aff4fcd0 Add Findepoll.cmake
- On FreeBSD epoll.h if provided through a library (from a port, epoll-shim)
  that emulates the Linux behavior. Make a CMake module for it to hide
  differences in systems behind a module.
- Find epoll on FreeBSD and link to it

Now on FreeBSD, tries to compile virtual_terminal.cpp, which will fail because
that needs more patches.
2020-06-05 12:41:24 +02:00
Adriaan de Groot
0dce25ba0f Consolidate target_link_libraries() calls
There's no reason I can find for the various calls to
target_link_libraries to be separate, separated by export headers
2020-06-05 12:40:43 +02:00
Vlad Zahorodnii
df9e36ee68 [wayland] Destroy XdgToplevelClient and XdgPopupClient on unmap
There are several ways to handle unmapping of a wl_surface. The first
one is to destroy the associated AbstractClient instance. The second one
is to transition the AbstractClient in a special state.

The problem with the second approach is that it makes animations such as
fade out more difficult to handle since effects in kwin are geared more
towards the first approach (destroying AbstractClient).
2020-06-01 15:13:03 +03:00
Vlad Zahorodnii
31ea780d79 [wayland] Rework xdg-shell implementation
Summary:
This change splits the XdgShellClient class to better match existing
abstractions in the xdg-shell protocol and fix a few issues related to
sending configure events.

In the new client classes, configure events are handled differently.
Instead of blocking configure events, we try to send them as late as
possible. Delaying configure events will let us merge changeMaximize()
for X11 clients and Wayland clients and it also fixes the bug where
we don't send the final configure event when user has finished resizing
a window.

Given that configure events are not sent immediately, XdgSurfaceClient
keeps the last requested frame geometry and the last requested client
geometry.

This patch doesn't intend to fix all issues in kwin's implementation of
the xdg-shell protocol. For example, we still handle surface unmapping
very poorly.

Test Plan: Tests pass.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D27861
2020-06-01 15:12:59 +03:00
Vlad Zahorodnii
c1ea0412a4 [effects/zoom] Implement focus tracking with QAccessibilityClient
Currently, the focus tracking functionality in the zoom effect does not
work because it relies on kaccessibleapp, which is dead. Luckily for us,
there is a library called libqaccessibilityclient that provides a way
to monitor focus changes.

BUG: 421234
2020-06-01 10:43:59 +03:00
Jonathan Riddell
1080069496 Update version number for 5.19.80
GIT_SILENT
2020-05-15 16:50:46 +01:00
Jonathan Riddell
d7687ce277 Update version number for 5.18.90
GIT_SILENT
2020-05-14 11:20:29 +01:00
Vlad Zahorodnii
9bfcfb7f74 [scene] Rebuild window quads when sub-surface tree changes
Sub-surface contribute to the window quads cache. So, we must re-build
it, if any sub-surface has been changed.

Differential Revision: https://phabricator.kde.org/D29131
2020-05-04 15:36:40 +03:00
Aleix Pol
3a9d7a6e9d Port KWin to KWaylandServer
Summary: Away from KWayland::Server and KF5WaylandServer.

Test Plan: Builds, ran nested session

Reviewers: #kwin, #plasma, #frameworks, davidedmundson, zzag

Reviewed By: #kwin, #plasma, davidedmundson, zzag

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29278
2020-04-30 12:56:08 +02:00
Vlad Zahorodnii
76af96bcc9 [x11] Disable synchronized resizing for Xwayland < 1.21
In case Xwayland does not use multiple buffers, the currently attached
buffer is going to be destroyed if the frame window is resized. It may
render the previous and the current window pixmap invalid and thus result
in visual artifacts when an X11 client is being interactively resized.

In order to avoid the visual artifacts, this change disables support for
synchronized resizing for X11 clients if the version of Xwayland is less
than the version in which Xwayland started using multiple buffers, i.e.
1.21.

Differential Revision: https://phabricator.kde.org/D29250
2020-04-29 16:37:31 +03:00
Vlad Zahorodnii
a9d2bad007 [x11] Enable synchronized resizing for Xwayland clients
Given that we now query the current X11 time stamp on Wayland, we can
enable synchronized resizing for Xwayland clients.

Differential Revision: https://phabricator.kde.org/D29250
2020-04-29 16:37:23 +03:00
Nate Graham
f9faa94ccc [kcmkwin/kwinrules] Port placeholder message to Kirigami.PlaceholderMessage
Summary: Depends on D29152

Test Plan:
{F8256396}

{F8257685}

Reviewers: iasensio, #kwin, zzag

Reviewed By: iasensio, #kwin, zzag

Subscribers: kwin

Tags: #kwin

Maniphest Tasks: T13021

Differential Revision: https://phabricator.kde.org/D29141
2020-04-24 08:30:07 -06:00
Jonathan Riddell
08a21ae7b6 bump to require Qt 5.14 2020-04-02 15:22:36 +01:00
Aleix Pol
da2d896257 Fix for older cmake versions
Summary: Recent changes prevented it to build on KDE Neon.

Test Plan: Built it on Neon

Reviewers: #kwin, bshah, davidedmundson

Reviewed By: #kwin, bshah, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D28511
2020-04-02 13:20:03 +02:00
Aleix Pol
dbac4bce7e Reduce the amount of objects that are compiled several times
Summary:
We build some objects several times which makes it uncomfortable to develop KWin
since every time we modify something a lot of things get rebuilt. This should
help a bit although it doesn't solve all the problems.

Test Plan: Builds, tests pass

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: davidedmundson, zzag, anthonyfieroni, iasensio, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D28445
2020-04-02 00:41:55 +02:00
Aleix Pol
e0052cedcb Implement the tablet wayland protocol in kwin
Summary:
Uses the tablet classes introduced in kwayland.
Depends on D26858

Test Plan:
Scratched my tablet with a magic stick and it did things depending on the pressure.
https://youtu.be/GGx0TlNJlzs

Reviewers: #kwin, #plasma, zzag, davidedmundson

Reviewed By: #kwin, #plasma, zzag, davidedmundson

Subscribers: davidedmundson, zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D26859
2020-03-20 03:05:41 +01:00
Méven Car
d571457bbe KCM/Kwinoptions: Port title bar and window actions tabs UI and conf to KConfigXT
Summary: Depends on D27463

Reviewers: crossi, bport, ervin, #kwin, zzag

Reviewed By: ervin, #kwin, zzag

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D27477
2020-03-19 12:40:01 +01:00
Daniel Vrátil
9bd91e66cd
fix: make hwdata truly a runtime dependency
Summary: Followup to comments in D10041

Reviewers: #plasma, ngraham, davidedmundson, zzag

Reviewed By: #plasma, ngraham, davidedmundson, zzag

Subscribers: iasensio, wstephenson, davidedmundson, zzag, ngraham, kwin, cgiboudeaux

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D27729
2020-03-17 15:39:17 +01:00
Aleix Pol
54c6acadf2 Allow building with Qt 5.12 2020-03-17 15:32:20 +01:00
Aleix Pol
cca0e15b45 Fix compiler warnings
Summary: No need to keep them around for no reason.

Test Plan: Tested the plugins I thought could be affected. Have been using it for a couple of days without problems

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D28062
2020-03-17 15:07:52 +01:00
Henri Chain
7c1c9d8164 Port kwinrules kcm to kconfigxt
Reviewers: meven, crossi, bport, ervin, #kwin

Subscribers: iasensio, ognarb, zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D27682
2020-03-16 13:21:43 +01:00
Roman Gilg
2c66e1f690 Remove orientation sensor
Summary:
This functionality will instead be implemented in KScreen such that manual and
automatic output rotation can be used and configured through a single UI in
unison together.

Test Plan: Compiles.

Reviewers: #kwin, davidedmundson, zzag

Reviewed By: #kwin, zzag

Subscribers: kwin, bshah, davidedmundson, zzag

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D26036
2020-02-29 09:59:30 +05:30
Daniel Vrátil
33a1777a5a
Decode full monitor vendor name from EDID using hwdata
Test Plan:
KScreen now shows "Dell Inc." instead of DEL and
"Eizo Nano Corporation" instead of ENC in output names, which
matches closer to what's written on my monitors.

Reviewers: graesslin, davidedmundson, #plasma

Reviewed By: davidedmundson, #plasma

Subscribers: apol, feverfew, ngraham, davidedmundson, mart, kwin, sebas

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D10041
2020-02-26 12:37:11 +01:00
Heiko Becker
7d8a7e701b Merge remote-tracking branch 'origin/Plasma/5.18' 2020-02-08 14:12:47 +01:00
Heiko Becker
6d8f3732c1 Require kdecoration >= 5.18.0
Summary:
To successfully build kwin needs 13e6459a3baeebe6a7b594efd995b88f6dd7524e
in kdecoration. Otherwise it fails with: "previewclient.h:93:11: error:
'QSize KDecoration2::Preview::PreviewClient::size() const' marked
'override', but does not override QSize size() const override;"
So this is not a new requirement but just an update to the build system
to reflect the actual requirements.

Test Plan: Builds fine with the newly required version

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D27242
2020-02-08 13:38:22 +01:00
Jonathan Riddell
e70b30d572 Update version number for 5.18.0
GIT_SILENT
2020-02-06 12:52:26 +00:00
Vlad Zahorodnii
03ae441e23 Change project name to "KWin"
Summary: It's not "KWIN" nor "kWin" nor "kWIN" nor "kwin"

Test Plan: Qt Creator displays "KWin" with correct capitalization.

Reviewers: #kwin, meven

Reviewed By: meven

Subscribers: apol, meven, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D26500
2020-01-25 03:05:02 +02:00
David Edmundson
996e840172 Drop kdeinit linking
Summary:
This wasn't used on startup (ksmserver calls KProcess)
Nor for the rules dialog (kwin invokes it with QProcess)

We may as well simplify the code and drop the dependency

See also T12140

Test Plan:
Restarted
Opened the rules dialog

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D26835
2020-01-22 12:46:10 +00:00
Jonathan Riddell
632d2182c3 Update version number for 5.18.80
GIT_SILENT
2020-01-16 13:14:38 +00:00
Jonathan Riddell
c7967e25c3 Update version number for 5.17.90
GIT_SILENT
2020-01-16 12:00:23 +00:00
Jonathan Riddell
5e6266903a KF5_MIN_VERSION for plasma 5.18 is KF5 5.66.0 2020-01-16 11:31:50 +00:00
Vlad Zahorodnii
fbfd1ac705 Split geometry topic file
Test Plan: Compiles.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D26644
2020-01-16 12:22:21 +02:00
Vlad Zahorodnii
e728460ac6 [nightcolor] Use a dedicated class for detection of system clock changes
Summary:
The ClockSkewNotifier provides a convenient way for monitoring system
clock changes. One of the key ideas was to hide platform details from
users of the class. This allows us to add a QTimer fallback path for
operating systems that don't provide anything to detect system clock
changes.

In long term, I would like to move the new class to Frameworks.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D25962
2020-01-07 17:12:14 +02:00
Aleix Pol
f5a73b87e3 Initial support for tablets on Wayland
Summary:
This includes support for them on libinput and turns it into fake
pointer actions.
This doesn't implement zwp_tablet, this will have to happen in an
iteration later.

Test Plan:
Been playing around with it, see video.
https://www.youtube.com/watch?v=GF1WbO8FVvU

Reviewers: #plasma, #kwin, romangg

Reviewed By: #plasma, #kwin, romangg

Subscribers: zzag, davidedmundson, romangg, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D25663
2019-12-10 21:56:31 +01:00
Vlad Zahorodnii
30c14d6e43 Merge manage.cpp with x11client.cpp
Test Plan: Compiles.

Reviewers: #kwin, romangg

Reviewed By: #kwin, romangg

Subscribers: kwin

Tags: #kwin

Maniphest Tasks: T12312

Differential Revision: https://phabricator.kde.org/D25712
2019-12-03 17:52:58 +02:00
Yuri Chornoivan
84244a7cf6 Use URL with transport encryption 2019-11-26 19:39:20 +02:00
David Edmundson
34bfc49189 adjust cmake include order 2019-11-05 10:53:13 +00:00
David Edmundson
0369011c23 Add KDEClangFormat cmake support
Summary:
This allows devs to run: "make clang-format" and format all files easily
using the preset KDE clang format style

This patch adds support so devs can easily test the intended formatting
now, it doesn't change the code yet.

Doing an initial run to commit everything will happen later.

Test Plan:
Ran script
git diff was full of amazingly cleaned code

See D25134
2019-11-04 23:44:34 +00:00
David Edmundson
ec610fd7ed Port one of session management connections state to a custom API
Summary:
Currently kwin opens a second ICE connection to ksmserver in order to
tell the state of kwin's whether we're logging out and saving clients or
not.

This requires that kwin launches after ksmserver to have the connection
which is a dependency I want to break.

Practically this code is already ksmserver specific as it relies on some
custom code that sends the first saveState request to kwin first.

Instead we can replace it with a bespoke IPC over DBus and siplify the
code both end. This will allow several other future enhancements that we
want with regards to handling the session state, as well as make an
effort platform agnostic session management, as well as cleaning up some
complex code.

Ksmserver calls into kwin, rather than having kwin watch ksmserver state
to allow us make sure it's race free.

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: romangg, zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24862
2019-11-01 17:14:42 +00:00
Roman Gilg
affd444507 Merge branch 'Plasma/5.17' 2019-10-29 12:12:02 +01:00
Roman Gilg
7459aabcac Dmabuf recovery on EGL reset
Summary:
The EGL platform might go away at any time through reconfiguration or because
of a graphic error. KWin then resets the graphics. The dmabuf implementation
must respect that and recover from a graphics reset by recreating all EGL
images for existing buffer.

This assumes that we won't change our graphics API mid-session and that
supported plane and modifier configuration stays constant.

In practise we remember all current dmabufs in a single map and only remove
them if the client did destroy the resource.

BUG: 411980
CCBUG: 413403
FIXED-IN: 5.17.2

Test Plan: Applied screenedge configuration without crash.

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: fvogt, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24954
2019-10-29 12:10:15 +01:00
Jonathan Riddell
7c58a1dc94 Update version number for 5.17.1
GIT_SILENT
2019-10-22 15:39:47 +01:00
Jonathan Riddell
549517293f Update version number for 5.17.0
GIT_SILENT
2019-10-10 12:57:14 +01:00
Jonathan Riddell
9854b9bee5 Update version number for 5.17.80
GIT_SILENT
2019-10-10 12:45:18 +01:00
Jonathan Riddell
27d72437cf Update version number for 5.17.0
GIT_SILENT
2019-10-10 12:40:12 +01:00
Vlad Zahorodnii
ffcbe24e2b Rename Client to X11Client
Summary:
Currently each managed X11 client is represented with an instance of
Client class, however the name of that class is very generic and the
only reason why it's called that way is because historically kwin
was created as an x11 window manager, so "Client" was a sensible choice.

With introduction of wayland support, things had changed and therefore
Client needs to be renamed to X11Client in order to better reflect what
that class stands for.

Renaming of Client to X11Client was agreed upon during the last KWin
sprint.

Test Plan: Compiles, the test suite is still green.

Reviewers: #kwin, romangg

Reviewed By: #kwin, romangg

Subscribers: romangg, davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24184
2019-09-25 21:11:37 +03:00
Vlad Zagorodniy
168ea98845 Rename ShellClient to XdgShellClient
Summary:
Rename ShellClient to XdgShellClient in order to reflect that it
represents only xdg-shell clients.

Test Plan: Compiles, tests still pass.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D23589
2019-09-23 17:28:56 +03:00
Jonathan Riddell
fdf98d6c19 Update version number for 5.17.80
GIT_SILENT
2019-09-19 15:29:30 +01:00
Jonathan Riddell
48691c406e Update version number for 5.16.90
GIT_SILENT
2019-09-19 10:04:51 +01:00
Vlad Zahorodnii
09b47b5250 Undo some recent cmake changes
Unfortunately linking can be very fragile so let's not break things.
2019-09-18 13:50:52 +03:00
Vlad Zahorodnii
dcf91d4321 Cleanup style in CMakeLists.txt files
We have lots of inconsistency at the moment in CMakeLists.txt files. Most
of it is due to kwin being a very old project. This change hopefully fixes
all of it.
2019-09-17 16:03:05 +03:00
Vlad Zahorodnii
c8aa258eba Keep things sorted alphabetically in CMakeLists.txt
Summary:
Currently component names and filenames are partially sorted. This makes adding
new items and finding existing items more difficult.

Test Plan: Compiles.

Reviewers: #kwin, gladhorn

Reviewed By: #kwin, gladhorn

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24018
2019-09-17 11:43:26 +03:00
Frederik Gladhorn
b64e67ce7c Remove disabled TabGroup feature
Summary:
This has been commented out since 2014, I doubt it will come back.
This is a big amount of code, maintenance will be easier without it.

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: romangg, graesslin, kwin

Tags: #kwin, #documentation

Differential Revision: https://phabricator.kde.org/D23069
2019-09-14 10:58:48 +02:00
Nate Graham
0f17d9ebf2 [kcmkwin/kwineffects] Use new Kirigami ListSectionHeader component
Summary:
This allows all the section headers to always have the same look and feel and be
adjusted in just one place.

Depends on D23049

Test Plan: {F7181776}

Reviewers: #vdg, kwin, GB_2, #kwin

Reviewed By: #vdg, GB_2

Tags: #kwin

Maniphest Tasks: T10384

Differential Revision: https://phabricator.kde.org/D23055
2019-09-07 20:31:51 -06:00
Vlad Zagorodniy
8af2fa73dc Run clang-tidy with modernize-use-override check
Summary:
Currently code base of kwin can be viewed as two pieces. One is very
ancient, and the other one is more modern, which uses new C++ features.

The main problem with the ancient code is that it was written before
C++11 era. So, no override or final keywords, lambdas, etc.

Quite recently, KDE compiler settings were changed to show a warning if
a virtual method has missing override keyword. As you might have already
guessed, this fired back at us because of that ancient code. We had
about 500 new compiler warnings.

A "solution" was proposed to that problem - disable -Wno-suggest-override
and the other similar warning for clang. It's hard to call a solution
because those warnings are disabled not only for the old code, but also
for new. This is not what we want!

The main argument for not actually fixing the problem was that git
history will be screwed as well because of human factor. While good git
history is a very important thing, we should not go crazy about it and
block every change that somehow alters git history. git blame allows to
specify starting revision for a reason.

The other argument (human factor) can be easily solved by using tools
such as clang-tidy. clang-tidy is a clang-based linter for C++. It can
be used for various things, e.g. fixing coding style(e.g. add missing
braces to if statements, readability-braces-around-statements check),
or in our case add missing override keywords.

Test Plan: Compiles.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, apol, romangg, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D22371
2019-07-22 20:03:22 +03:00
Kai Uwe Broulik
ea97928426 Merge branch 'Plasma/5.16' 2019-07-09 11:15:20 +02:00
Igor Kovalenko
8dba9bfd43 Fix check for SCHED_RESET_ON_FORK feature in clean build
Configuration macro HAVE_SCHED_RESET_ON_FORK is not reflecting availability of SCHED_RESET_ON_FORK
in config-kwin.h because that feature is detected after file is already generated.

Fix this by moving config-kwin.h generation after feature detection.

Differential Revision: https://phabricator.kde.org/D22337
2019-07-09 11:14:37 +02:00
Jonathan Riddell
137b3fbf26 Update version number for 5.16.2
GIT_SILENT
2019-06-25 12:15:02 +01:00
David Edmundson
3604aaf74c Close screen grabbing effect when screensaver starts
Summary:
The screenlock fails on X11 if it can't grab the keyboard.

We can't nicely solve the generic case. We can solve the common case of
a kwin effect being active.

It's not critical, arguably not even desirable to have these effects
persist after the screen is locked through an external trigger. We can
just close the effect early.

Key grabs have to be relased early before the close animation completes
so that the locker doesn't have a race based on animation times.

It's not ideal, but no worse than the current state for not much work.

BUG: 234153

Test Plan:
locked screen on a timer
opened various effects

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: ngraham, zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D20890
2019-06-23 18:00:47 +02:00
Jonathan Riddell
105ae7bb7f Update version number for 5.16.1
GIT_SILENT
2019-06-18 10:37:27 +01:00
Roman Gilg
1a11abc821 [platforms/x11/standalone] Port to AbstractOutput
Summary:
Represent outputs in the X11 session via AbstractOutput. For that we
move all Wayland specific parts of AbstractOutput into a new subclass
AbstractWaylandOutput and let the outputs of our Wayland backends inherit
from there.

This should allow us to get rid of the Screens class later on.

Test Plan: Manually in X session.

Reviewers: #kwin, zzag, davidedmundson

Reviewed By: #kwin, zzag, davidedmundson

Subscribers: ngraham, zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D19208
2019-06-13 11:39:25 +02:00
Jonathan Riddell
97532b3b1f Update version number for 5.16.0
GIT_SILENT
2019-06-06 12:03:01 +01:00
Jonathan Riddell
b00f1fccce Update version number for 5.16.80
GIT_SILENT
2019-05-16 14:17:35 +01:00
Jonathan Riddell
7c1a7c35f3 Update version number for 5.15.90
GIT_SILENT
2019-05-16 11:00:42 +01:00
Jonathan Riddell
0c67056708 bump Qt version to 5.12 as agreed at start of cycle 2019-05-16 10:13:14 +01:00
Harald Sitter
988ca97c96 Update kf5 version requirement to 5.58.0
GIT_SILENT
2019-05-09 15:09:32 +02:00
David Edmundson
aa11e4f777 Avoid duplicating screensaver interface definition file
Summary:
Kwin has a mandatory dependency on kscreenlocker, we can use the
screensaver interface definition installed from there.

Test Plan: Compiles

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D20764
2019-04-25 00:45:21 +01:00
Erik Kurzinger
c898f96df3 [platforms/drm] EGLStream DRM Backend Initial Implementation
Summary:
This is the initial implementation of a DRM backend based on the EGLDevice,
EGLOutput, and EGLStream extensions, supporting NVIDIA graphics hardware using
their proprietary driver. The new backend will be used if the environment
variable KWIN_DRM_USE_EGL_STREAMS is set. On initialization, it will attempt to
create an EGLDevice based on the DRM device currently in use and create
EGLOutputs and EGLStreams for any attached displays. These are used to control
presentation of the final composited frame. Additionally, it will register the
wl_eglstream_controller Wayland interface so that native EGL windows created by
clients can be attached to an EGLStream allowing buffer contents to be shared
with the compositor as a GL texture.

At this time there are two known bugs in the NVIDIA driver's EGL implementation
affecting desktop functionality. The first can result in tooltip windows drawn
by plasmashell to contain incorrect contents. The second prevents KWayland from
being able to query the format of EGLStream-backed buffers which interferes
with the blur effect. Fixes for both of these are currently in development and
should appear in an upcoming NVIDIA driver release.

Additionally, hardware cursors are currently not supported with this backend.
Enabling them causes the desktop to intermittently hang for several seconds.
This is also likely a bug in the NVIDIA DRM-KMS implementation but the root
cause is still under investigation.

Test Plan:
On a system with an NVIDIA graphics card running a recent release of their
proprietary driver

    * Ensure the nvidia_drm kernel module is loaded with the option "modeset=1"
      ("# cat /sys/module/nvidia_drm/parameters/modeset" should print "Y")
    * Ensure EGL external platform support is installed
      https://github.com/NVIDIA/eglexternalplatform
    * Ensure KWin was build with the CMake option
      KWIN_BUILD_EGL_STREAM_BACKEND=ON (this is the default)
    * Start a plasma wayland session with the environment variable
      KWIN_DRM_USE_EGL_STREAMS set
    * Ensure output from KWin OpenGL initialization indicates the NVIDIA EGL
      driver is in use (as opposed to Mesa / llvmpipe).
    * Desktop should be fully functional and perform smoothly.

Reviewers: #kwin, romangg, davidedmundson

Reviewed By: #kwin, romangg, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D18570
2019-04-15 07:26:22 -07:00
Volker Krause
008143c9db Update URLs to use https
Summary: Largely done automatically using the tools from D19996.

Reviewers: yurchor, zzag

Reviewed By: yurchor, zzag

Subscribers: zzag, yurchor, kwin, kde-doc-english

Tags: #kwin, #documentation

Differential Revision: https://phabricator.kde.org/D20017
2019-03-25 19:26:23 +01:00
Vlad Zagorodniy
b106579d0f Move package structure plugins to plugins dir
Summary:
Package structure plugins are not that special so move them to
the corresponding directory.

Test Plan: Compiles.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D18685
2019-03-11 10:57:13 +02:00
Martin Flöser
9b922f8833 Split out a dedicated InternalClient class
Summary:
Most of the functionality which is special to internal clients is moved
from ShellClient to InternalClient. As KWin's qpa is still bound to the
Wayland protocol InternalClient inherits from ShellClient. Due to that
some aspects in ShellClient are "weird". ShellClient still detects
whether it's an internal client and uses the variable m_internal to
capture the state. This is required as we cannot use the isInternal
method. Most of m_internal usage is in init which is called from
constructor of ShellClient. Thus it's not possible to call into virtual
methods of InternalClient.

Also some of the code is duplicated and some methods are temporarily
marked as virtual.

The next step will be to remove ShmBuffer for internal windows which
should decouple the two implementations further with the long term goal
of having InternalClient inherit AbstractClient directly.

Test Plan:
Run nested KWin, triggered outline (OpenGL case) and debug console (shm case).
InternalWindow unit test still passes.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D18569
2019-02-21 18:51:25 +01:00
Roman Gilg
548978bfe1 [xwl] Drag and drop between Xwayland and Wayland native clients
Summary:
Building upon the generic X Selection support this patch establishes another
selection class representing the XDND selection and provides interfaces
to communicate drags originating from Xwayland windows to the Wayland
server KWin and drags originating from Wayland native drags to Xwayland.

For Wayland native drags KWin will claim the XDND selection as owner and
will simply translate all relevant events to the XDND protocol and receive
alike messages by X clients.

When an X client claims the XDND selection KWin is notified via the X protocol
and it decides if it allows the X drag to transcend into the Wayland protocol.
If this is the case the mouse position is tracked and on entering a Wayland
native window a proxy X Window is mapped to the top of the window stack. This
proxy window acts as a drag destination for the drag origin window and again
X messages will be translated into respective Wayland protocol calls. If the
cursor leaves the Wayland window geometry before a drop is registered, the
proxy window is unmapped, what triggers a subsequent drag leave event.

In both directions the necessary core integration is minimal. There is a single
call to be done in the drag and drop event filter through the Xwayland
interface class.

From my tests this patch facilitates drags between any Qt/KDE apps. What needs
extra care are the browsers, which use target formats, that are not directly
compatible with the Wayland protocol's MIME representation. For Chromium an
additional integration step must be done in order to provide it with a net
window stack containing the proxy window.

Test Plan: Manually. Auto tests planned.

Reviewers: #kwin

Subscribers: zzag, kwin, alexde

Tags: #kwin

Maniphest Tasks: T4611

Differential Revision: https://phabricator.kde.org/D15627
2019-02-19 13:09:18 +01:00
Roman Gilg
ad1bcbecc7 [xwl] Add Xwayland interface class
Summary: Adds an interface class to access Xwayland members from within KWin core.

Reviewers: #kwin, davidedmundson, zzag

Subscribers: zzag, davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D15419
2019-02-19 12:59:11 +01:00
Roman Gilg
6e08fb2fa5 [xwl] Generic X selections translation mechanism with Clipboard support
Summary:
In this patch an infrastructure is created to represent generic X selections
in a Wayland session and use them for data transfers between Xwayland windows
and Wayland native clients.

The central manager is the DataBridge class, in which Selection objects can be
created. This is hard-coded and such a Selection object persists until the end
of the session, so no arbitrary selections can be created on the fly. For now
the X Clipboard selection is supported, whose corresponding mechanism in the
Wayland protocol is just called Selection.

A Selection object listens for selection owner changes on the X side and for
similar events into the Wayland server interfaces. If a data provider is
available a selection source object is created by the Selection object. In case
data is requested on the other side, a data transfer is initialized by creating
a Transfer object. A Selection keeps track of all transfers and makes sure that
they are destroyed when they are finished or in case they idle because of
misbehaving clients.

The Clipboard class translates the X Clipboard via a proxy window. Selection
changes on the Wayland side are listened to through a new signal on the active
KWayland seat interface.

The previously used X clipboard syncer helper is disabled. The clipboard sync
autotest is changed to the new mechanism.

BUG: 394765
BUG: 395313

Test Plan: Manually and clipboard sync autotest.

Reviewers: #kwin

Subscribers: zzag, graesslin, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D15061
2019-02-19 12:24:27 +01:00
Roman Gilg
050cf0451e [xwl] Move Xwayland parts into separate class
Summary:
The Xwayland code path is moved from ApplicationWayland to a dedicated class
Xwayland in a new top-level directory xwl.

This is a direct preparation step for generic support of Xwayland Selections.

On a longer timescale this should also allow us to further separate Wayland
native functionality from Xwayland to allow us at one point to build KWin's
Wayland binary optionally without X dependencies. Another long term goal, that
becomes possible through this separation is to recover from Xwayland crashes.

Test Plan: Manually and auto tests

Reviewers: #kwin, davidedmundson

Subscribers: davidedmundson, zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D15020
2019-02-19 12:10:46 +01:00
Albert Astals Cid
76c5371b57 Link to AuthCore instead of Auth
Summary: it's a smaller library and provides everything we need

Test Plan: Compiles

Reviewers: apol

Reviewed By: apol

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D19061
2019-02-16 10:20:28 +01:00
David Faure
1b316b6b69 Merge branch 'Plasma/5.15' 2019-02-12 08:56:17 +01:00
David Faure
48971e0848 Enable -DQT_NO_URL_CAST_FROM_STRING and fix compilation 2019-02-12 08:54:53 +01:00
Vlad Zagorodniy
be8729105f Move lanczos filter away from KWin core
Summary:
Lanczos filter shouldn't be in KWin core because it's quite specific about
rendering backend.

Test Plan: Windows in the desktop grid look normal.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: mart, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D18774
2019-02-07 18:03:34 +02:00
Jonathan Riddell
5a750c3667 Update version number for 5.15.0
GIT_SILENT
2019-02-07 11:01:16 +00:00
Vlad Zagorodniy
b06c1ea5a4 Move icons to data dir
Summary: We don't need them in the toplevel directory.

Test Plan: Compiles.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D18771
2019-02-06 01:19:54 +02:00
David Edmundson
d4fce7a3ad Separate clang and gcc compiler workarounds for kwin override policy 2019-01-24 16:51:09 +00:00
David Edmundson
a088a7b1a4 Apply -Wno-inconsistent-missing-override for all compilers
Summary:
Default CXX flags are out of our control. Whether they're set by the
compiler or the user or ECM.

We currently disable for clang. This patch also disables this warning
for other compilers.

This might not be anyone's first preference, but we're at an impasse
there.

Test Plan: Compiled

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D18488
2019-01-24 16:28:27 +00:00
Heiko Becker
ad5700b812 Merge remote-tracking branch 'origin/Plasma/5.15' 2019-01-18 14:49:43 +01:00
Heiko Becker
79eeea6b58 [build] Search for kirigami as a runtime dependency
Test Plan: cmake lists kirigami as a found dependency

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D18359
2019-01-18 14:48:08 +01:00
Jonathan Riddell
962fce229e Update version number for 5.15.80
GIT_SILENT
2019-01-17 12:45:34 +00:00
Jonathan Riddell
c308565424 Update version number for 5.14.90
GIT_SILENT
2019-01-17 10:51:25 +00:00
Jonathan Riddell
05109e4b39 bump KF5 dependency to required 5.54 as agreed at start of Plasma 5.15 cycle 2019-01-17 10:42:27 +00:00
Volker Krause
3bb07ef12d Bring FindFontconfig.cmake up to ECM standards
Summary:
This is a preparation step to move this to ECM (or possibly CMake),
which makes sense now that qtbase is using this too (for Qt6).

Reviewers: #build_system, cgiboudeaux

Reviewed By: cgiboudeaux

Subscribers: cgiboudeaux, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D17547
2018-12-18 18:11:11 +01:00
Martin Flöser
070b46f455 Hide mouse cursor when interacting with touch screen
Summary:
On touch events the mouse cursor gets hidden, on next mouse event the
mouse cursor is shown again. This IMHO significantly improves the system
interaction if touch is the primary user interface.

Test Plan: Test case added and ctest passes

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D17280
2018-12-13 18:55:46 +01:00
David Edmundson
5da8b4c78a Explicitly link and disable kcrash on kwin_wayland
Summary:
Kwin tried to not use kcrash by not linking against it.

KIO now links against KCrash as we link against KIO we indirectly link
against KCrash and thus now link and launch kcrash on wayland. This
breaks coredump.

Arguably it should be fixed in KIO, but it's non-trivial.

The advantage of this approach is it allows us to enable drkonqi for
nested mode in the future, or make a non-gui drkonqi that just saves
logs.

Test Plan: Compiles

Reviewers: #kwin, romangg

Reviewed By: #kwin, romangg

Subscribers: zzag, romangg, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16834
2018-11-12 09:59:57 +00:00
Frederik Gladhorn
66986d4afd Make QPA think the tabbox is the active window
Summary:
Without pretendingn to activate the Window, Qt will not send
the right signals for accessibility, thus screen readers not working.

Reviewers: kwin, davidedmundson

Reviewed By: davidedmundson

Subscribers: graesslin, davidedmundson

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16664
2018-11-05 18:21:57 +01:00
David Edmundson
7e8facc3fd [wayland] Use the new plasma virtual desktop protocol
Summary:
implement virtual desktop support for Wayland.
use the new virtual desktop protocol from D12820
The VirtualDesktopManager class needed some big change in order
to accomodate it, which is where most changes are.
Other than that, it's mostly connections to wire up
VirtualDesktopsManager and VirtualDesktopsManagement(the wayland protocol impl)

Depends on D12820
Other notable detail, is the client visibility updated to reflect the presence
of the client in the plasmavirtualdesktop.
(and the unSetDesktop concept)

Test Plan: used a bit a plasma session together with D12820, D13748 and D13746

Reviewers: #plasma, #kwin, graesslin, davidedmundson

Reviewed By: #plasma, #kwin, davidedmundson

Subscribers: hein, zzag, davidedmundson, kwin

Tags: #kwin

Maniphest Tasks: T4457

Differential Revision: https://phabricator.kde.org/D13887
2018-11-01 16:35:29 +01:00
Jonathan Riddell
263100b0c2 Update version number for 5.14.80
GIT_SILENT
2018-10-04 12:39:02 +01:00
Jonathan Riddell
232d2ae24d Update version number for 5.14.0
GIT_SILENT
2018-10-04 12:13:35 +01:00
Jonathan Riddell
9ebb7978de Update version number for 5.14.80
GIT_SILENT
2018-09-13 18:23:58 +01:00
Jonathan Riddell
84cd9cfc43 Update version number for 5.13.90
GIT_SILENT
2018-09-13 17:33:33 +01:00
Jonathan Riddell
f92d806343 QT_MIN_VERSIONS is Qt 5.11 for Plasma 5.14. Agreed at kickoff meeting. Set everywhere for clearity and consistency. 2018-09-03 13:34:39 +01:00
Roman Gilg
3482378278 Introduce OutputScreens class
Summary:
Lift high-level properties into new Screens child class for platform plugins
using the Output class.

Directly make DrmScreens a child class of OutputScreens.

Test Plan: Manually and auto tests with 94%.

Reviewers: #kwin

Differential Revision: https://phabricator.kde.org/D11782
2018-08-31 11:53:23 +02:00