Commit Graph

467 Commits (65ba0111fe7c45b945c9bf661f1f13d4ec97ac5e)

Author SHA1 Message Date
Martin Gräßlin ca14073b54 Port scripted effect loading from KService to KPackage
Advantage: no more ksycoca cache for loading scripted effects.
2015-07-06 16:50:33 +02:00
Martin Gräßlin a4ca6f196e [wayland] kwin_wayland is no longer a kdeinit_executable
kdeinit_executable doesn't make sense in the case of kwin_wayland as
start_kdeinit_wrapper will be executed after kwin_wayland thus the
framework doesn't work.
2015-07-06 09:57:30 +02:00
Martin Gräßlin 3041a7c32d [wayland] Add a plugin for kglobalaccel
The KGlobalAccelD which gets created by KWin needs a plugin for the
platform specific parts. This change introduces such a plugin. It's
linked against kwin so that it can integrate with the core.

On enable the plugin registers itself in the InputRedirection and
GlobalShortcutsManager checks the plugin whether a shortcut got
triggered.

As the loading of the plugin must happen after InputRedirection is
fully created a dedicated init method is added to InputRedirection.

REVIEW: 124187
2015-07-02 13:42:29 +02:00
Martin Gräßlin 8461344ce1 [wayland] Create a KGlobalAccelD during startup
We need to grab the DBusInterface before anything interacts with
org.kde.kglobalaccel to prevent kglobalaccel5 from starting.
2015-07-02 13:22:23 +02:00
Martin Gräßlin 6c0c513874 Require XCB 1.10
We need XCB 1.10 for sync to work. Sync was optional with a version check
to make it work on build.kde.org. The CI system supports XCB 1.10 now, so
it's better to have it as a mandatory requirement.
2015-06-04 18:39:04 +02:00
Martin Gräßlin 8a9bbf7ca3 XCB::CURSOR becomes a required dependency
It was only optional because build.kde.org did not provide it when the
dependency got introduced.
2015-06-04 17:50:29 +02:00
Martin Gräßlin 3f94a2afc7 [wayland] Ensure QWindowSystemInterface::sendWindowSystemEvents gets called in EventDispatcher
KWin used the wrong event dispatcher: QEventDispatcherUNIX insted of
QUnixEventDispatcherQPA. This caused QWindow related events never to
be send to their destination. Which is one of the reasons why KWin's
own windows are not shown at all.

As we cannot easily use QUnixEventDispatcherQPA we do the same as
that class. Inherit from QEventDispatcherUNIX and call into
QWindowSystemInterface::sendWindowSystemEvents.
2015-05-18 15:31:40 +02:00
Thomas Lübking f79cdc6b33 fix building w/o EGL better
"!VARIABLE" does not what you think
CMake syntax is weird ;-)

http://www.cmake.org/cmake/help/v3.0/command/if.html#command:if
http://www.cmake.org/pipermail/cmake/2011-November/047239.html
2015-05-15 23:55:28 +02:00
Martin Gräßlin a0c45a68b8 Disable GBM if we build without EGL support 2015-05-12 10:03:00 +02:00
Martin Gräßlin af134dbbda Fix build
Some day I will understand CMake syntax. Promised!
2015-05-08 13:19:04 +02:00
Martin Gräßlin 0f54da9dde Introduce an AbstractClient base class for Client (and ShellClient)
The idea for this base class is to provide access to all elements which
make up a managed "Client" being it X11 or Wayland. They share a lot,
like they have a caption, they can be minimized, etc. etc.

Of course it would have also been possible to derive a new class from
Client, but that looks like the more difficult task as Client is very
X11 specific.

So far only a very small interface is extracted with pure-virtual
methods. This is going to change by moving the functionality up into
the AbstractClient.

The interface extracted so far is inspired by the usage of FocusChain
and users of FocusChain.
2015-05-08 12:43:44 +02:00
Martin Gräßlin d60c377890 [wayland] Introduce a ShellClient
The ShellClient is a Toplevel subclass for a
KWayland::Server::ShellSurfaceInterface. It gets created when a new
ShellSurfaceInterface is created and destoryed when it gets unmapped.

So far the usage is still rather limited. The ShellClient is opened
at position (0/0). While it's possible to pass pointer events to it,
it's not yet possible to activate it, so no keyboard focus.
2015-05-08 12:43:44 +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 2a8d7664b3 Properly add define for gles
Otherwise some parts still include epoxy/glx.h.
2015-05-07 14:11:30 +02:00
Martin Gräßlin 2220ae44c4 Create a plugin for each of the wayland backends
Each of the backends becomes a plugin. This allows kwin_wayland to load
the requested plugin and kwin itself doesn't need to link all the
libraries needed. E.g. libdrm is no longer linked if running kwin_x11.
Also this allows to create backends for the non-standard EGL platforms
(examples could be raspberrypi or Android devices).
2015-05-06 10:31:39 +02:00
Martin Gräßlin 8ff394a020 [wayland] Dedicate logging category for each of the backends 2015-05-05 17:47:03 +02:00
Martin Gräßlin d80984beab [wayland] Move X11WindowedQPainterBackend into backends/x11 2015-05-05 15:23:53 +02:00
Martin Gräßlin f7bf7cb7ba [wayland] Move WaylandQPainterBackend into backends/wayland 2015-05-05 15:13:36 +02:00
Martin Gräßlin df6221ae4a [wayland] Move FramebufferQPainterBackend into backends/fbdev 2015-05-05 15:07:01 +02:00
Martin Gräßlin 06d8206192 [wayland] Move DrmQPainterBackend into backends/drm 2015-05-05 13:32:33 +02:00
Martin Gräßlin 72db1e63a3 [wayland] Move backend implementations into a backends/<name> directory
The aim is to be able to create a plugin for each of the backends.
The following directories are created:
* backends/drm
* backends/fbdev
* backends/wayland
* backends/x11
2015-05-05 13:05:37 +02:00
Martin Gräßlin 300a576d32 [wayland] Split out WaylandCursorTheme into own header/implementation
It's used by both the WaylandBackend and AbstractBackend. By splitting
it out the AbstractBackend doesn't need to depend on an implementation.
2015-05-05 13:05:04 +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
Martin Gräßlin e6b076df9c Move Udev into an own header and implementation
For a DRM backend we also need Udev, so don't bundle with libinput.
2015-04-24 12:03:19 +02:00
Jonathan Riddell a6b8756cf1 Update version number for 5.3.90 2015-04-09 16:30:33 +02:00
Jonathan Riddell d2c488ea44 Update version number for 5.2.95 2015-04-09 12:30:09 +02:00
Martin Gräßlin de3788c094 [wayland] Add a framebuffer backend
The framebuffer backend currently only supports the QPainter backend
if the format matches RGB32.

It does not yet support any cursors.
2015-04-01 11:05:45 +02:00
Martin Gräßlin f4005c7f74 [wayland] Add initial support for taking over VirtualTerminals
A new Singleton VirtualTerminal is added. It interacts with Logind to
get the VTNr to take over. To get the signal to release and acquire the
VT we use a signalfd with a QSocketNotifier to monitor for signals. The
used signals must be blocked for all threads prior to startup otherwise
they are delivered to secondary threads causing issues.
2015-04-01 11:05:45 +02:00
Martin Gräßlin 00844ffba7 Bind cmake option HAVE_WAYLAND_EGL to KWIN_HAVE_EGL
If we don't have EGL we also do not want Wayland_EGL.
2015-04-01 11:05:45 +02:00
Mika Allan Rauhala 3389c7569f Adapt to KDecoration API changes
Adapt to API changes introduced by b62e8888cd39301e00ad98dfe791fa66676408fb.
It adds DecoratedClient::color(group, role) for getting colors that are
not included in QPalette. Breeze used to read these colors from
kdeglobals, breaking per window color schemes. KWin now handles reading
these colors along with QPalette loading with DecorationPalette.

REVIEW: 122883
2015-03-31 15:26:55 +02:00
Martin Gräßlin b405fda213 Drop support for KAppmenu
We released three versions with it being disabled and it doesn't look
like it will come back any time soon. Also the build was broken at least
since the repo splitting due to incorrect path to dbus xml.

In addition the connection to decorations got dropped already with the
change to kdecoration2. Which means it anyway needs large adjustements
to get the code working again.

Overall it doesn't look like it makes lots of sense to keep the code
around for someone working on it in future. If that happens this change
can be reverted.
2015-03-23 15:56:50 +01:00
Martin Gräßlin 622d333c11 Do not find Wayland::Client
No longer used.
2015-03-23 10:11:57 +01:00
Martin Gräßlin 75d60d4f85 [wayland] Make Wayland::Cursor a proper optional build dep
Only needed in the Wayland backend and can easily be ifdefed there.
2015-03-23 10:10:38 +01:00
Martin Gräßlin dce8e74eb0 Do not find Wayland::Server
Not needed, we have the KWayland wrapper.
2015-03-23 09:18:55 +01:00
Christophe Giboudeaux 0fb0176e4b Don't display anything after showing the found packages. 2015-03-22 22:25:38 +01:00
Martin Gräßlin 5764a087ee Fix build without Wayland (try 2)
Set HAVE_X11_XCB to FALSE if not building with Wayland support.
2015-03-20 16:01:04 +01:00
Martin Gräßlin 9a0fd94013 Introduce AbstractBackend as base class for Wayland and X11Windowed backend
The AbstractBackend registers itself in the WaylandServer allowing
external users to easily get to the backend and not needing to test
manually which backend is used.
2015-03-20 14:41:03 +01:00
Martin Gräßlin dae8eed3a8 Introduce a shared base class for the EGL backends
There's quite some overlap and duplicated code. This AbstractEglBackend
tries to merge the two backends a little bit again.

This also introduces an AbstractEglTexture which supports both X11 and
Wayland "pixmaps" so that EglOnXBackend can support Wayland buffers.
2015-03-20 14:08:54 +01:00
Martin Gräßlin 3cc1032839 [wayland] Create xcb_connection through XLib in windowed mode
Adds optional dependency to X11_XCB and gets used in X11WindowedBackend
to create an XLib Display if dependency is present.

This allows to create an EGL backend for the X11WindowedBackend.
2015-03-20 14:08:54 +01:00
Martin Gräßlin 6bf44b7db4 [wayland] Add an X11 output backend
This new backend allows to start a kwin_wayland server nested on an
X-Server by using a normal X11 window as output. This allows testing
kwin_wayland without needing to start another Wayland server first.

The behavior is triggered by using new command line arguments:
--windowed
--x11-display=<:0>

With optional --width and --height arguments.

In this mode the WaylandBackend is not created at all.

So far the backend is not fully integrated yet and only the QPainter
backend supports this mode.
2015-03-20 14:08:53 +01:00
Martin Gräßlin e886bd7c78 Adjust to newer libinput and require at least 0.10
There was API changes regarding axis event handling.
CCBUG: 342893
2015-03-20 12:42:57 +01:00
Aleix Pol f6db54618b Merge branch 'Plasma/5.2' 2015-03-19 01:15:41 +01:00
Aleix Pol 25f71d1a12 Fix build 2015-03-19 01:15:22 +01:00
Martin Gräßlin 371bd4c24f [wayland] Use Surface::setCursor and ::hideCursor in WaylandBackend
Replaces the low level wayland calls and also means that we no longer
need the Wayland client library. Everything wrapped in KWayland.
2015-03-17 10:20:20 +01:00
Martin Gräßlin 9ca992a329 [wayland] Drop methods on Toplevel to send input events
No longer needed as InputRedirection sends input events directly
through the SeatInterface. In addition this drops the dependency on
xtest.
2015-03-17 10:20:20 +01:00
Martin Gräßlin 7369a2c3a5 [kwin_wayland] Support using platform wayland for the QPA
This reorders the startup sequence quite a bit:
1. Create QAbstractEventDispatcher and install it on QCoreApplication
2. Create Application
3. Start Xwayland, use thread to get when its ready
4. Create xcb connection
5. perform startup

For using the wayland QPA it needs a patch in QtWayland which will be
part of Qt 5.4.2, otherwise it blocks.
2015-03-17 10:20:19 +01:00
Martin Gräßlin 47bdce074e Let the fun begin: start a WaylandServer in kwin_wayland
The WaylandServer is at the moment only used to support starting an
Xwayland. It does not support Wayland clients yet, so don't get
excited.

For Xwayland it's using the trick of creating the Display before the
QApplication is created with manual event dispatching.
2015-03-17 10:08:27 +01:00
Jonathan Riddell 01aae2fa20 add include(ECMOptionalAddSubdirectory) 2015-02-19 17:12:34 +01:00
Jonathan Riddell 325a479e6e add include(ECMOptionalAddSubdirectory) 2015-02-19 17:12:18 +01:00