Commit Graph

47 Commits (d1c3b2a2612a26f1d944f0ac70174b4b331b2485)

Author SHA1 Message Date
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 17381dcf05 Use upstream FindLibinput
It exists since 3.14
2021-03-04 13:27:53 +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 ed88cbfb65 cmake: Remove FindFontconfig.cmake
It's in extra-cmake-modules now.
2021-01-06 11:21:03 +02: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 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 c324cd1464 Remove Findepoxy.cmake
It's in extra-cmake-modules now.
2021-01-04 08:32:04 +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 810186222b cmake: Fix a typo in Findlcms2 2020-12-29 19:54:10 +02:00
Vlad Zahorodnii c7fb0160ac Remove COPYING-CMAKE-SCRIPTS
All find modules contain license information, which renders
COPYING-CMAKE-SCRIPTS redundant.

The reason why we have this file in the first place is purely
historical. Back in the kde-workspace repo days, not all find
modules contained the license under which they're distributed.
2020-12-15 19:52:21 +00:00
Vlad Zahorodnii f04fa44f34 Fix license info in Findlcms2.cmake 2020-11-25 13:30:24 +02: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 1fb9f6f13a Switch to SPDX license markers
The main advantage of SPDX license identifiers over the traditional
license headers is that it's more difficult to overlook inappropriate
licenses for kwin, for example GPL 3. We also don't have to copy a
lot of boilerplate text.

In order to create this change, I ran licensedigger -r -c from the
toplevel source directory.
2020-08-07 19:57:56 +00: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
Aleix Pol 1b7fd0db3f Properly include private Qt5 targets
Summary: Qt is already providing the cmake files to load them, we just need to load them properly.

Test Plan: Builds and runs

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29763
2020-05-15 12:24:23 +02: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
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
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
Volker Krause d920b323bd Follow ECM documentation style
Summary: In preparation for upstreaming to ECM, as qtbase needs this as well.

Reviewers: apol

Reviewed By: apol

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D18944
2019-02-12 11:56:21 +01: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
Frederik Gladhorn 503661579f Remove unused FindQt5PlatformSupport.cmake
Summary: This file was required for Qt 5.8. We require 5.11 as minimum version.

Test Plan: Grepped for the file being used in other cmake code, rebuilt KWin without it.

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: kwin, zzag

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16654
2018-11-04 17:01:49 +01:00
Luca Beltrame ce2705d71f
Revert "Search in default path before calling pkg-config"
Build system changes can be potentially breaking and so must be reviewed
prior to commit. In addition, there is no explanation for this change.

Simon, you might want to submit your patches to Phabricator for review
prior to landing them.

CCMAIL: sdepiets@gmail.com

This reverts commit 4f4f3295f2.
2018-09-06 09:34:26 +02:00
Simon Depiets 4f4f3295f2 Search in default path before calling pkg-config 2018-09-06 13:45:26 +08:00
Martin Flöser d4ba05a22f [autotests] Add tests for DRM platform plugin
Summary:
The addition of the test infrastructure is motivated by the regressions
caused by adding mode switching and transformation support.
A contributing factor to these regression is the fact that the DRM
platform does not have any tests. It is difficult to test this code as
it needs to work with hardware, thus we cannot use the real DRM library.
Instead we need to use mocking.

This change sets up some first basic tests with the help of a mockDrm
library. In order to better test the code as units the Drm classes are
slightly refactored. Most importantly the dependency to DrmBackend is
removed wherever possible and replaced by a simple int fd which is mostly
the only element used by the classes.

This first test introduces basic testing of a DrmObject. It is intended
to extend this to at least also test DrmPlane as a central piece of our
Drm platform plugin. This will also extend the tests of DrmObject.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D8776
2017-11-21 19:27:33 +01:00
Martin Flöser 7c8003f7f6 Use real-time scheduling policy for kwin_wayland
Summary:
The base idea behind this change is to keep the system responsive no
matter what other processes do. All input and rendering needs to go
through the windowing system, so keeping it responsive is important.

Currently KWin competes with all other processes for resources and this
can render the system unusable. Consider some processes running amok. In
this case the user might not be able to easily close the applications as
KWin does not get the cpu time to perform the input tasks requested by
the user.

Or in the case of playing a demanding game it is important that KWin
gets scheduled to forward the pointer input events. The user doesn't
want that the game (or another process) wins against the windowing
sytem.

The disadvantage is that KWin always wins against other processes with
real time scheduling. This could result in KWin running amok stalling
the system. On the other hand this is no change to the current situation
as if KWin runs amok the sytem is unusable.

The change uses libcap to set CAP_SYS_NICE on kwin_wayland executable.
KWin_wayland on start sets the scheduling policy to SCHED_RR with the
lowest possible priority. Thus any other SCHED_RR process will win
against KWin. So real time processes are not affected by this change!

After adjusting the scheduling (which requires CAP_SYS_NICE) KWin drops
this capability again.

Test Plan:
Verified that KWin adjusts the scheduler, that it is not passed
to child processes, that the capability gets dropped and not passed to
child processes.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7757
2017-09-29 20:23:57 +02:00
Takahiro Hashimoto 052fa2e4ee [plugins/qpa] support use of modularized qtplatformsupport from Qt 5.8
REVIEW: 129268
2016-10-28 21:12:48 +09:00
Bhushan Shah def8421d67 Don't look out for libis
We no longer use it
Reviewed-by: mgraesslin
2016-05-30 12:45:38 +05:30
Martin Gräßlin 48ec13a881 Check for Xwayland as RUNTIME dependency
Make distro's life easier by pointing out that kwin_wayland requires
Xwayland.
2016-02-03 15:49:05 +01:00
Jan Kundrát 7c8adeff9e Fix build with Qt 5.6
A recent change [1] led to Qt5PlatformSupport.pc not being installed
anymore. Pkg-config was only used for finding the paths, and the actual
include flags and library names were hardcoded in KWin's
FindQt5PlatformSupport.cmake anyway, so let's just focus on finding
Qt5Gui, the module which provides this Qt5PlatformSupport library, and
work from there.

Thanks to Hrvoje Senjan (shumski) for pointing me towards the upstream
Gerrit change.

[1] https://codereview.qt-project.org/140954/

REVIEW: 126234
2015-12-03 18:28:10 +01:00
Martin Gräßlin 03231942bb Bind building of glx support on whether epoxy has a glx header
So far it was bound to whether we build for GLES. But this is
semantically wrong. It might be possible that even on desktop gl
epoxy is built without GLX support, thus we need to reflect this.

This change ensures that epoxy/glx.h is only included if available,
that relevant code is bound to it and that checks are in place to
enforce EGL if not build with glx support.

In addtion the glxbackend.cpp is now only included in the build set
if available.
2015-11-03 09:29:31 +01:00
Martin Gräßlin 66e27b69bb [backends/hwcomposer] Drop dependency on hybrissync library
No longer used and not needed.
2015-10-14 14:33:49 +02:00
Martin Graesslin 425e703dff Drop Android input handling
Libinput does work on libhybris enabled devices. There is no need to
use Android's input stack. This simplifies our code a lot and increases
sharing with normal Linux systems.

What's tricky is to convince the system to use libinput through with our
logind helper. Logind fails to open the files for us if we start KWin
over either ssh or adb shell. We need to get it into a proper session, so
only a kwin started through a helper like simplelogin will be able to use
libinput.

REVIEW: 125608
2015-10-14 08:13:37 +02:00
Martin Gräßlin f280d36f8d [cmake] Let's try PKG_Qt5PlatformSupport_INCLUDEDIR instead of PKG_Qt5PlatformSupport_INCLUDE_DIRS
The one contains a set of paths which might be the reason why e.g on the
CI the include dir cannot be constructed. Let's see what will happen....

CCBUG: 351776
2015-08-27 09:35:51 +02:00
Martin Gräßlin 26b3569a0b [wayland] Add a QPA plugin for kwin_wayland
This introduces an own QPA plugin for KWin. QtWayland's plugin is not
a good solution for KWin as QtWayland is meant for Wayland clients and
not for a Wayland server. Given that it makes more sense to have a very
minimal QPA plugin which supports the use cases we actually have.

With our own QPA plugin we should be able to improve the following
areas:
* no need to create Wayland server before QApplication
* Qt::BypassWindowManagerHint can be supported
* no workaround for creating OpenGL context in main thread
* sharing OpenGL context with Qt
* OpenGL context for Qt on libhybris backend

The plugin supports so far the following features:
* creating a QPlatformWindow using KWayland::Client (ShellSurface)
* creating a QPlatformBackingStore using a ShmPool
* creating a QPlatformOpenGLContext with Wayland::EGL
* or creating a QPlatformOpenGLContext which shares with KWin's scene
* creating a QPlatformScreen for each KWayland::Client::Output
* QPlatformNativeInterface compatible to QtWayland
2015-08-25 14:33:50 +02:00
Martin Graesslin 6a66d84f5c [backends/hwcomper] Initial support for input handling
Unfortunately on libhybris enabled systems libinput doesn't work, thus
the backend needs to handle input events which can be read from hybris.
So far the backend only handles touch events properly, though some
aspects look wrong. E.g. motion gives only for one touch contact point.
Unfortunately the documentation is quite weak, so there might be
something important missing.
2015-05-09 16:22:27 +02:00
Martin Graesslin e12400a675 Add a hwcomposer backend based on libhybris
This backend interacts with libhybris to create a hwcomposer which is
used for creating the egl context and surface. The initial version of
this backend is based on test_hwcomposer.cpp provided by libhybris.

Please note that using the hwcomposer backend requires a newer libepoxy,
the latest stable release is not able to bring up OpenGLES, so one needs
a master build of libepoxy.

Notes on licensing:
libhybris is Apache 2.0 licensed, which is not compatile with GPLv2.
But it is compatible with GPLv3. Thus the source files in the hwcomposer
backend are licensed GPLv3+ and not GPLv2+ as the rest of KWin. If one
uses KWin without the hwcomposer backend (which is obviously the default)
the licence doesn't change. But if the hwcomposer backend is used the
overall license of KWin changes to GPLv3+.
2015-05-08 10:28:52 +02:00
Martin Gräßlin 877c33fe7d Initial implementation of EglGbmBackend
Uses EGL_MESA_platform_gbm to get an EglDisplay from a gbm_device.
The DrmBackend can provide a DrmBuffer for a gbm_surface and present
it.

Unfortunately buffer age seems to be slightly broken and we still have
artefacts.
2015-04-24 12:03:19 +02:00
Martin Gräßlin c759551340 [wayland] Add a basic drm/kms backend
Introduces a new (optional) dependency: libdrm.

The DrmBackend currently supports finding the first connected output.
It can create shared memory buffers which are used by SceneQPainter to
do double buffered rendering.

There is still lots to do, the following things are not yet working:
* multiple outputs
* page flip
* OpenGL (through gbm)
* restoring mode setting to start value
2015-04-24 12:03:19 +02:00
Jonathan Riddell 6d31775ee8 replace reference to licence with the bsd licence as the reference often goes missing 2015-04-23 16:10:00 +02:00
Martin Gräßlin 706e22a12b Do not find OpenGL or OpenGLES
As we use epoxy we don't need them any more. KWin compiles, links and
runs just fine without ever trying to find OpenGL or OpenGLES.

BUG: 340170
FIXED-IN: 5.2.0
2014-10-21 08:33:51 +02:00
Martin Gräßlin c4bb3d11fc Initial support for libinput
Libinput is an optional dependency for getting low level input events.
As opening the input devices requires root privs this is rather
pointless in the current state. But there is a small added test app which
can be executed with root privs to demonstrate the functionality. To
properly get input events we need a wrapper like it's used in weston.

So far the following is setup:
* opening devices found by udev
* forwarding keyboard events to InputRedirection
* forwarding pointer button events to InputRedirection
* forwarding pointer axis events to InputRedirection
* signals emitted for pointer motion events

Pointer motion events need some further work as they are provided
as delta events. We need to track that and map them properly.

Also missing are touch events due to me not having a touch screen.
It should be fairly simple to setup the touch events, though.

Also hotplugging of devices is not yet implemented.
2014-10-20 14:51:24 +02:00
Fredrik Höglund 828a455fae Add Findepoxy.cmake 2014-07-14 12:04:37 +02:00
Martin Gräßlin e4be4082a0 Require xkbcommon 0.4.1
That's the version required in Qt 5.3 and causing issues if there's a
mismatch in versions.

CCBUG: 333459
2014-04-28 12:07:28 +02:00
David Faure 924b8b5a9e Fix compilation on OpenSuSE 13.1 which puts xkbcommon.h in /usr/include/pkg/libxkbcommon/xkbcommon/ 2014-03-29 09:32:06 +01:00
Martin Gräßlin 56c35d0600 [kwin] Copy required FindModules to kwin
Required for standalone build, removes the hack to include the modules
from kde-workspace.
2014-03-26 14:37:36 +01:00