Commit Graph

637 Commits (7746b3304e91ea8d6c9ba7829328d14bce18de43)

Author SHA1 Message Date
Vlad Zagorodniy 4299b81f65 [effects] Drop the Scale in effect
Summary:
It's superseded by the new scale effect(D13461).

Existing users of this effect will be migrated to the new scale effect.

Depends on D13461

Reviewers: #kwin, #plasma, #vdg, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D13462
2018-08-12 10:58:07 +03:00
René J.V. Bertin df802d49a1 Require KDecoration >= 5.13.0 .
Differential Revision: https://phabricator.kde.org/D14320
2018-07-24 13:58:10 +02:00
Vlad Zagorodniy 54b69bec44 Honor BUILD_TESTING
Test Plan:
* Passed `BUILD_TESTING=OFF` option to cmake, no tests have been built;
* Didn't pass `BUILD_TESTING` option, all tests have been built.

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D13163
2018-05-31 12:06:55 +03:00
Jonathan Riddell e868f9c50e Update version number for 5.13.80
GIT_SILENT
2018-05-18 15:56:08 +01:00
Jonathan Riddell 0550fc383c Update version number for 5.13.90
GIT_SILENT
2018-05-18 15:46:13 +01:00
Jonathan Riddell d4a825a9cc Update version number for 5.14.80
GIT_SILENT
2018-05-18 14:03:19 +01:00
Jonathan Riddell 57178b2b98 Update version number for 5.12.90
GIT_SILENT
2018-05-18 10:41:36 +01:00
Martin Flöser bbf00fdd98 Require libinput and udev
Summary:
The main reason for not having it as a mandatory dependency was that BSD
doesn't support it. But as I learned recently it is available on our CI
system. So BSDs have support now.

Even more it showed that the code doesn't compile if the dependency is
missing. And there's one thing I hate: broken build configuration
options.

So let's make UDEV and libinput a required dependency and get rid of the
problems.

Test Plan: Compiles

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D10057
2018-02-04 15:00:42 +01:00
Martin Flöser 4cc1d7a245 Require libinput version 1.9
Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D9930
2018-01-21 11:15:41 +01:00
Jonathan Riddell a3d43459ec Update version number for 5.12.80
GIT_SILENT
2018-01-15 14:51:12 +00:00
Jonathan Riddell 9b74583565 Update version number for 5.11.95
GIT_SILENT
2018-01-15 13:10:31 +00:00
Martin Flöser 0d0a9ebe9a Require frameworks 5.42 2018-01-13 16:17:46 +01:00
Marco Martin 1be5256b1b A basic TabletModeManager
Summary:
depends from D9521

listens to switch events and updates the tablet mode status
which is exposed to dbus in the org.kde.KWin.TabletModeManager
interface

Test Plan:
as hardware support is limited, testing of clients
so far is done by the setter in the dbus property,
which should be removed from the final version.
It has been tested to successfully work on a Thinkpad.

Reviewers: #plasma, #kwin, graesslin

Reviewed By: #plasma, #kwin, graesslin

Subscribers: graesslin, davidedmundson, plasma-devel, kwin, #kwin

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D9764
2018-01-11 13:11:00 +01:00
Bhushan Shah 913d6cca47 Fix cmake call
VERSION_GREATER_EQUAL is not available for cmake version we depend on
2018-01-05 20:20:07 +05:30
Martin Flöser ac2f41c86d [libinput] Add support for switch devices and events
Summary:
This change adds support for the switch devices introduces with libinput
1.7 (lid) and 1.9 (tablet mode). So far it's not yet used internally in
KWin, but only exposed through the Device and Events.

As KWin currently only requires libinput 1.5 and we are rather late in
the release cycle the new functionality is ifdef'ed. The requirement
will be raised once master is 5.13. It is already available on
build.kde.org, but e.g. Neon only has 1.6.

The switch events are interesting as they report whether the lid is
closed (might be interesting for e.g. powerdevil) and whether a
convertible is in tablet mode (supported for e.g. Lenovo Yogas with
recent kernel). This can be used by KWin internally to enable/disable
the virtual keyboard. And can be exposed globally to switch to Plasma
Mobile shell in future.

Test Plan:
Only through test case as my Lenovo Yoga uses Neon which has a
too old libinput

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D9516
2018-01-04 18:05:44 +01:00
Martin Flöser e0b1a5715b Add DBus interface to OrientationSensor and a persistent configuration
Summary:
The initial state for user enabled is now read from config. In addition
a DBus interface is provided exporting this property. This allows
KScreen to determine whether automatic screen rotation is available and
whether the user has it enabled or not.

Furthermore KScreen can change the property and this gets stored into
the configuration. Thus KScreen can offer a user interface to
enable/disable automatic screen rotation as well as enabling/disabling
the manual rotation based on the current user settings.

Test Plan:
Not yet tested, coded on the system which doesn't have an
orientation sensor

Reviewers: #kwin, #plasma, sebas, davidedmundson

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D8738
2017-12-26 22:02:47 +01:00
Roman Gilg 82d2860469 [colorcorrection] Night Color - blue light filter at nighttime
With Wayland KWin needs to provide certain services, which were provided
before that by the Xserver. One of these is gamma correction, which includes
the - by many people beloved - functionality to reduce the blue light at
nighttime. This patch provides the KWin part of that. It is self contained,
but in the end will work in tandem with a lib in Plasma Workspace and a KCM
in Plasma Desktop, which can be used to configure Night Color.

* Three modi:
** Automatic: The location and sun timings are determined automatically
   (location data updates will be provided by the workspace)
** Location: The sun timings are determined by fixed location data
** Timings: The sun timings are set manually by the user
* Color temperature value changes are smoothly applied:
** Configuration changes, which lead to other current values are changed
   in a quick way over a few seconds
** Changes on sunrise and sunset are applied slowly over the course of few
   minutes till several hours depending on the configuration
* The current color value is set immediately at startup or after suspend
  phases and VT switches. There is no flickering.
* All configuration is done via a DBus interface, changed values are tested
  on correctness and applied atomically
* Self contained mechanism, speaks directly to the hardware by setting the
  gamma ramps on the CRTC
* Currently working on DRM backend, extensible to other platform backends in
  the future
* The code is written in a way to make the classes later easily extendable to
  also provide normal color correction, as it's currently done by KGamma on X

Test Plan:
Manually with the workspace parts and added integration tests in KWin using
the virtual backend.

BUG:371494

Reviewers: #kwin, graesslin

Subscribers: kwin, plasma-devel, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D5928
2017-12-11 10:58:40 +01:00
Martin Flöser fe9664fd84 Use the new ECMQMLModules to specify all of KWin's runtime dependencies
Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7273
2017-12-03 18:03:34 +01:00
Martin Flöser ff2e883469 Add support for new IdleInhibition protocol
Summary:
A small helper class is added which manages inhibiting idle for the
ShellClients. So far only very basic functionality is added. That is
only the inhibition on the Surface is followed. It is not yet checked
whether the ShellClient is visible at all. That needs some changes in
ShellClient.

BUG: 385956
FIXED-IN: 5.12

Test Plan: New test case passes

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D8856
2017-11-30 21:51:36 +01:00
Martin Flöser 1c61e61119 [autotests] Support new way to run the tests without need to install
Summary:
KWin was quite good in ensuring that you don't need to install by
passing paths to the tests. The new way is much nicer, so code is
adjusted for the new way. Also if we require a newer ECM in future we
need to support the new way.

No guarantee that the tests don't pick something up from the system env,
that needs more testing.

References: https://community.kde.org/Guidelines_and_HOWTOs/Making_apps_run_uninstalled

Test Plan: The tests which loaded helpers pass

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7543
2017-11-21 20:34:52 +01:00
Martin Flöser 9df1744830 Support automatic screen rotation based on orientation sensor
Summary:
This change introduces an OrientationSensor class which wraps a
QOrientationSensor. The OrientationSensor is hold by Screens and gets
enabled if Screens knows about an internal (e.g. LVDS) display which
supports rotation. In addition the OrientationSensor holds an KSni to
enable/disable the automatic rotation support.

The drm platform plugin is adjusted to make use of the OrientationSensor.
The API is defined in a way that this can also be implemented on other
platforms supporting rotation. Most important are hwcomposer and X11
standalone. The latter should be straight forward as rotation is provided
through XRandR. The former needs addition for rotation support first.

Test Plan: Rotated my Yoga 12

Reviewers: #kwin, #plasma, sebas

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D8699
2017-11-08 17:44:38 +01:00
David Edmundson e7b183f886 Load QtQuick settings
Summary:
Loads settings on whether QtQuick uses GL or software rendering

Aurorae needed a fix. The rest "just works" with up-to-date plasma framework.

Test Plan:
Alt tabbed
Showed an OSD
Grepped kwin's QML for any custom shaders.
(which is the only part that doesn't work here)

Reviewers: #plasma, graesslin

Reviewed By: #plasma, graesslin

Subscribers: graesslin, plasma-devel, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D8040
2017-11-01 15:51:21 +00:00
Martin Flöser a5b17b2228 Require Qt 5.9
Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D8331
2017-10-31 12:45:21 +01:00
Martin Flöser 8c2b2faf9d Add DBus protocol to virtual keyboard
Summary:
This change adds a DBus API to query whether the virtual keyboard is
currently enabled and provides DBus methods to request that the virtual
keyboard gets enabled/disabled. This is useful for e.g. providing a
Plasmoid or for convertables where the tablet mode needs to be enabled.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D8166
2017-10-19 17:59:19 +02:00
Martin Flöser 7ef8409157 Move X11-only specific part of EffectsHandlerImpl to x11 platform plugin
Summary:
The Platform API is extended by a call to create the EffectsHandler. In
X11 standalone Platform a new EffectsHandlerImplX11 is added which
contains the X11 only parts of the EffectsHandler, such as grabbing the
X keyboard and the X11 mouse interception window.

The EffectsHandlerImpl gains some virtual methods for the parts which
are now done in the X11 specific implementation. In return we get rid of
lots of if-else structures checking for the operation mode.

Test Plan: Only compile tested.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7955
2017-10-16 16:54:17 +02:00
Martin Flöser f448691f54 Correct installation of kwin_wayland when DESTDIR and libcap are used together
Based on patch for kinit: D8064.
2017-10-10 19:54:07 +02:00
Martin Flöser 65fcde7426 Honor DESTDIR env variable in setcap command 2017-10-04 18:33:55 +02:00
Martin Flöser 8ae37c420b Move SceneOpenGL into a dedicated plugin
Summary:
Unfortunately a rather large change which required more refactoring than
initially expected. The main problem was that some parts needed to go
into platformsupport so that the platform plugins can link them. Due to
the rather monolithic nature of scene_opengl.h a few changes were
required:
* SceneOpenGL::Texture -> SceneOpenGLTexture
* SceneOpenGL::TexturePrivate -> SceneOpenGLTexturePrivate
* texture based code into dedicated files
* SwapProfiler code into dedicated files
* SwapProfiler only used in x11 variants
* Safety checks for OpenGL scene moved into the new plugin
* signal declared in SceneOpenGL moved to Scene, so that we don't need
to include SceneOpenGL in composite

Test Plan: Nested OpenGL compositor works

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7740
2017-09-30 13:12:10 +02:00
Martin Flöser cea7a189c8 Create a dedicated X11EventFilter for the events used by RootInfo
Summary:
Splitting out the handling from events.cpp and moves it into a
dedicated class created together with RootInfo.

Test Plan:
Test case for NET window move which goes through this
code path still passes.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7808
2017-09-30 12:57:21 +02: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
Martin Flöser 0ed609590b Add a dedicated X11EventFilter for forwarding property events to the effect system
Summary:
So far both Workspace and Toplevel emitted signals for every property
notify event on the root window and the respective Toplevel windows. The
signals were only used in EffectsHandlerImpl to forward to the effect
system in case the property which changed is registered by an effect.

This change introduces a dedicated event filter for this which is only
created in EffectsHandlerImpl in case an X11 connection is available. It
supports a restart of the X11 system.

The signals used so far are removed from Workspace and Toplevel.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7853
2017-09-25 20:36:45 +02:00
Martin Flöser 551a6246a8 Move XRenderUtils init/cleanup into X11 standalone platform
Summary:
Only needed for kwin_x11 variant (required for the non-composited
Outline). As that's nowadays in the x11 platform, we can move the
complete XRenderUtils support into the platform. Thus KWin core does
no longer require to link it.

Test Plan: Compiles

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7760
2017-09-22 15:20:55 +02:00
Martin Flöser 0c6fdeef2d Split out the X11 mouse event filtering for EffectsHandlerImpl
Summary:
This change introduces a dedicated X11EventFilter for the mouse
interception on X11. The filter gets created together with the start
of mouse interception and destroyed again when the mouse interception
ends. Thus we don't need to check for each event like it was the case
so far.

Unfortunately the existing methods cannot be removed (yet) as they are
still used by TabBox. Needs investigation whether this is actually
needed.

Test Plan: Xephyr+kwin_x11+Present Windows

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7842
2017-09-16 08:03:48 +02:00
Jonathan Riddell c623db087a Update version number for 5.11.90
GIT_SILENT
2017-09-14 11:48:53 +01:00
Jonathan Riddell 48b6001ec4 Update version number for 5.10.95
GIT_SILENT
2017-09-13 22:41:12 +01:00
Heiko Becker 10381b10f8 CMake 3.1 is the actually required version
Summary:
CXX_STANDARD is only available since 3.1.
$ git show 913394af2: cmTarget: Add CXX_STANDARD and CXX_EXTENSION...
$ git tag --contains 913394af2 | head -n: v3.1.0

3.1 also has CMakePackageConfigHelpers (available since 3.0),
allowing to drop ECMPackageConfigHelpers (it actually fixes a CMake
warning when requiring >=3.0).

Furthermore move cmake_minimum_required(VERSION 3.1 FATAL_ERROR) to
the top of CMakeLists.txt like suggested by CMake's documentation.

Test Plan: cmake .. & ninja

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7784
2017-09-12 19:04:10 +02:00
Martin Flöser 535b107969 Move QPainter compositor into plugin
This change is similar to D7232 and moves the scene_qpainter into a
dedicated plugin. Compared to the XRender case it's more complicated as
the platform plugins need to implement a platform specific backend.

The base implementation for this part used to be in scene_qpainter. As
the idea is to completly move it away from KWin core it would be point
less to still have the backend definition in KWin core, but it cannot
be in the scene plugin as otherwise all platforms need to link the
plugin.

To solve this a new platformsupport subdirectory is added which contains
the scene platform backend as a static library. For the OpenGL scene such
a static library will also be required.

Test Plan: SceneQPainter test still passes, nested compositor still works

Reviewers: #kwin, #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D7259
2017-09-01 17:44:49 +02:00
Martin Flöser 054d923411 Move SceneXRender into a plugin
Summary:
First step for loading the compositor Scenes through plugins. The general
idea is that we currently needlessly pull in all the Scenes although only
one will be used.

E.g. on X11 we pull in QPainter, although they are not compatible. On
Wayland we pull in XRender although they are not compatible.

Furthermore our current Scene creation strategy is not really fault
tolerant and can create situations where we don't get a compositor. E.g
on fbdev backend the default settings won't work as it does not support
OpenGL.

Long term I want to tackle those conceptional problems together:
we try to load all plugins supported by the current platform till we have
a scene which works. Thus on Wayland we don't end up in a situation where
we don't have a working compositor because the configuration is bad.

To make this possible the switch statement in the Scene needs to go and
needs to be replaced by a for loop iterating over all the available
scenes on the platform. If we go there it makes sense to replace it
directly with a plugin based approach.

So this is a change which tackles the problem by first introducing the
plugin loading. The xrender based scene (as it's the most simple one)
is moved into a plugin. It is first tried to find a scene plugin and only
if there is none the existing code is used.

Test Plan: Tested all scenes

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7232
2017-09-01 17:42:28 +02:00
Martin Flöser 9c74be1256 [tabBox] Move X11 specific event filtering into a dedicated event filter
Summary:
This ensures that the X11 specific events are only read on X11 but not
on Wayland. Also moves quite some X11 specific code out of TabBox.

Test Plan: Compile checked, currently on Wayland, so no way to test.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7395
2017-09-01 16:58:14 +02:00
Martin Flöser bd5f5e0915 Move X11 movingClient handling into a dedicated X11EventFilter
Summary:
Splits out the X11 specific window movement handling so that it's not
used in the Wayland case at runtime. As a nice side effect it
un-spaghetties the X11 event handler.

Test Plan:
Run nested KWin on Xephyr and nested KWin/Wayland to verify
that move/resize of X11 windows is still working

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7374
2017-09-01 16:57:43 +02:00
Martin Flöser 1cc38c929a Move updateXTime into the X11 standalone platform
Summary:
KWin::updateXTime only delegates into the platform API where the method
is a no-op. The actual implementation is moved into the X11 standalone
platform as it uses QX11Info which is non functional except on the X11
standalone platform.

This change exposes a problem with timestamp handling: on Wayland the
X11 timestamp does not get updated at all, causing e.g. window sync not
work correctly (c.f. bug 374881). We cannot implement the updating in the
same way as QX11Info/Qt xcb platform does it as that would introduce a
blocking roundtrip to XWayland which is dangerous.

As a side-effect this change removes linking to Qt5::X11Extras in kwin
core as it's no longer needed.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7515
2017-08-24 20:49:49 +02:00
Martin Flöser c87230c3a5 Use xcb-icccm to read the name property
Summary:
The KWindowSystem call which we used doesn't work on Wayland as it's only
implemented in the xcb variant and cannot be made available for Wayland
in an easy way as it is still XLib based.

This change turns the optional XCB-ICCCM dependency in a required one
and thus can use the functionality provided by said library to implement
what KWindowSystem provided.

BUG: 382789

Test Plan: New test case which failed with old code

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7046
2017-08-21 17:58:52 +02:00
Martin Flöser 36a3189863 Create a dedicated X11EventFilter for recognizing first user interaction
Summary:
Workspace monitors the X11 events to detect when the user first
interacts with the system. This is only required on X11 for activating
the same client from previous session. So far this was spread over many
parts in the long event switch statement. To make this more contained a
dedicated event filter is introduced which also gets deleted again once
the first user interaction got recognized.

Test Plan: Compiles

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7371
2017-08-19 10:14:53 +02:00
Martin Gräßlin ca84a81e0d Check for include file before configuring config-kwin.h 2017-07-31 17:34:37 +02:00
Martin Gräßlin bc003c0228 Add cmake check whether sys/sysmacros.h exists
Unfortunately 9ada8baca6 failed to compile
on FreeBSD due to the header not existing. So we need to check the
existance and properly guard with ifdef.
2017-07-30 21:30:33 +02:00
Martin Flöser 719d09d0cd -Wno-inconsistent-missing-override on Clang
This is a totally stupid warning for an older code base such as KWin. It
generates hundreds of warnings as on legacy code no method uses override.
The output is totally spammed, so it's better to disable it.

This will hopefully also prevent that someone tries to fix it again by
changing all of KWin - which we don't want.
2017-07-28 07:00:56 +02:00
Tobias C. Berner a512f54924 Hide the Linux specific parts behind check for headers
Summary:
Only build
  * `virtual_terminal.cpp` in the presence of `linux/vt.h`
  * `fbdev`-backend in the precense of `linux/fb.h`

Test Plan:

Reviewers: #kwin, #freebsd, graesslin, bcooksley

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D6847
2017-07-24 16:19:27 +02:00
Martin Flöser ea5d611de1 Require C++14
Summary:
KWin already used C++14 constructs in a conditional way. This doesn't
make much sense today, it's better to just require C++14.

For KWin only gcc and clang are currently compilers of relevance. Gcc
supports C++14 since version 5 and defaults to C++14 since 6.1 [1].
Clang supports C++14 since version 3.4 [2].

An overview of compiler support in various distributions:
* Debian stable (stretch): gcc 6.3, clang 3.8
* Debian oldstable (jessie): 4.9, clang 3.5
* Ubuntu 17.04: gcc 6.1, clang 3.8
* Ubuntu 16.04: gcc 5.3, clang 3.8
* openSUSE Tumbleweed: gcc 7.1, clang 4.0
* openSUSE Leap 42.3: gcc ?, clang ? [3]
* FreeBSD: clang >= 34 in ports
* Slackware 14.2: gcc 5.3

This overview shows that every distro out there has at least one
supported compiler which can still compile KWin with this change.

[1] https://gcc.gnu.org/projects/cxx-status.html#cxx14
[2] https://clang.llvm.org/cxx_status
[3] Sorry I fail to understand openSUSE's package repository.
    It seems that there is gcc 7 available, but gcc package is 4.8

Test Plan: Compiles on my neon system

Reviewers: #plasma

Subscribers: plasma-devel, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D6634
2017-07-17 16:53:18 +02:00
Martin Flöser 3f4995fb9b Refactor the specification of OpenGL context attributes
Summary:
The current way to specify the OpenGL context attributes does no longer
scale as can be seen in D6344. There are too many different context
attribute sets and with every addition we grow lots of copied code. The
chances to introduce errors in that code which is difficult to debug are
very high. As can be seen in the glx backend which defines major 1,
minor 2, but it should be major 2, minor 1.

This change reworks this code by creating a builder class which contains
only an abstract definition of what needs to be in the attributes.
E.g. the version, whether it's robust and so on.

Now we can just have a list of possible attributes in a well described
way:
    auto builder;
    builder.setVersion(3, 1);
    builder.setRobust(true);

All possible builders are added to a list and operated on in a for loop
which tries to creat a context. Once it succeeded it breaks the list.
In addition a debug statement is added which prints out the set of
options which went into the context.

So far this is only done for EGL, GLX can follow once D6344 is merged.

Test Plan: New unit test added, kwin_wayland OpenGL tests run and verified

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D6396
2017-06-26 22:13:47 +02:00
Jonathan Riddell 7dabf22300 bump version number again 2017-06-12 11:13:05 +01:00