Commit Graph

306 Commits (e18bb1006a4686896a09268827c1c85b50555280)

Author SHA1 Message Date
Martin Gräßlin 1617deabb8 Introduce the beginning of an InputRedirection class
So far this new class is not yet doing much. The WaylandBackend forwards
the received pointer events to this InputRedirection class. From there
signals are emitted to inform internal areas about the changes first.

The events are currently forwarded to X through the xtest extension. This
will be removed in future. Input will be forwarded directly to the
surface which wants it (no matter whether X11 or Wayland).
2014-03-18 09:00:49 +01:00
Martin Gräßlin 22fe6a2857 [kwin] Provide composited outline as QML instead of hand drawn FrameSvg
In order to get all our UI being written in QML, the Outline for
compositing is ported to QtQuick. It creates a QQmlContext and
QQmlComponent and loads the (currently hardcoded) qml file. The context
gets to properties exported: outline. The outline property allows the qml
to get the geometry it should use. The QQmlEngine is used from Scripting
thus all general scripting properties are exported (e.g. workspace).

The qml script is expected to create a QQuickWindow as it's root item
and style it.

The qml file is stored in a new qml subdirectory. The idea is that each
of the qml types we have gets an own directory there and for each
implementation there should be a further subdirectory.

Thus we have outline/plasma/ with outline being the type and plasma
being the implementation. But at the moment the script location is still
hardcoded.

REVIEW: 116123
2014-03-10 09:16:16 +01:00
Martin Gräßlin c7d986c7fe [kwin] Remove the legacy OpenGL 1 compositing backend
KWin already has a de facto OpenGL 2 dependency through QML. Combined
with the fact that the OpenGL 1 backend is basically unmaintained and
also unused, it's better to remove it for the new major release.

This change includes:
 * Removal of cmake option KWIN_BUILD_OPENGL_1_COMPOSITING
 * Removal of KWIN_HAVE_OPENGL_1 compile option and all code
   ifdef'ed with it (partially removal of if-else constructs)
 * Removal of CompositingType::OpenGL1Compositing (flags are kept
   as a core flag should get introduced)
 * Driver recommendation for OpenGL1Compositing changed to XRender
   (should be evaluated whether the drivers can provide GL2)
 * Removal of configuration option "GLLegacy"
 * Removal of fooMatrix function in kwinglutils
 * Removal of ARBBlurShader
 * Removal of legacy code path in GLVertexBuffer
 * Removal of GLShaderManager::disable
 * if-blocks with ShaderManager::instance()->isValid() removed

REVIEW: 116042
2014-03-10 08:59:11 +01:00
Martin Gräßlin f77fe3ebd9 [kwin] Install all DBus interfaces 2014-03-07 14:46:11 +01:00
Martin Gräßlin 4dff7888e3 [kwin] Drop build option to build without scripting
Scripting has proved it's point of being useful so it's time to turn it
into a mandatory part of KWin.

Also I start to use features provided by Scripting in more and more
parts of KWin core (e.g. sharing QQmlEngine) which makes it in the
long to complicated to have a build option and ifdefs for it.

REVIEW: 116587
2014-03-04 08:19:55 +01:00
Martin Gräßlin d8ca2403a1 [kwin] Drop the KWIN_MOBILE_EFFECTS build option
It's no longer needed as there won't be a KWin version specific to
Plasma Active. We want to have runtime adjustments of all parts in
the next version of Plasma.

REVIEW: 116563
2014-03-03 15:22:09 +01:00
Martin Gräßlin 7060386b22 Generate a KDecorationsConfig.cmake and install it
This simplifies building a decoration plugin. Now one can do:

find_package(KDecorations REQUIRED NO_MODULE)

to find the decorations library.

REVIEW: 116013
2014-02-27 11:25:54 +01:00
Martin Gräßlin f48aca47a5 [kwin] Use ui-file for ShortcutDialog
At the same time switching to QKeySequenceEdit for capturing the
shortcut. This allows to get rid of xmlgui.
2014-02-27 10:18:37 +01:00
Martin Gräßlin 95ab9d05aa [kwin] Remove dependency on KF5Declarative
It's a runtime dependency as PlasmaCore pulls it in automatically,
so we don't it as all the QML we currently ship uses PlasmaCore.
2014-02-26 08:30:52 +01:00
Martin Gräßlin 4586767db8 [kwin] Use imported targets for all XCB libs
Requires 04f78489265b6e52cabd2980dfc417abeee3a695 from ECM
2014-02-25 15:48:39 +01:00
Martin Gräßlin b49b631851 Use new components based FindWayland from ECM
This allows us to better control which features are available.

Requires 6277f5d8acbca3704d3e9ebbdee908537cd7b6eb in ECM.
2014-02-25 14:46:24 +01:00
Martin Gräßlin 2c7d702b5a [kwin] Use FindEgl for finding egl instead of FindOpenGLES
Requires a2ada35b5c768e8efe9b51a41f84ec6e18ea805c from ECM!
2014-02-25 13:50:10 +01:00
Hrvoje Senjan 814ff851b4 Use correct Activities, they are now a proper framework 2014-02-13 20:06:33 +01:00
Martin Gräßlin 9414d8f7f1 [kwin] Re-enable KActivities support
* KWin lists the activities in the Alt+F3 menu
* Kcmrules though looks wrong
2014-02-03 13:40:47 +01:00
Martin Gräßlin ae3cbca5f6 [kwin] Add a test application for testing size increment
The test application can verify that KWin correctly interprets the
WM_NORMAL_HINTS as described in ICCCM section 4.1.2.3 for the
combination of min size, base size and size increment.

Introduces an optional dependency to xcb-icccm library. It's optional
as the last time we tried to use it build.kde.org didn't like it at
all. Thus it should be possible to disable building this test app if
the dependency is not found.
2014-01-30 15:28:12 +01:00
Martin Gräßlin 04716ae5e3 [kwin] Rename tests subdirectories to autotests
Follows the naming schemes in frameworks and opens up the possibility
to include test applications for KWin in the tests subdirectory.
2014-01-30 11:01:59 +01:00
Martin Gräßlin 76efe517a7 Turn built-in effects into a library kwin links against
As all effects have always been compiled into the same .so file it's
questionable whether resolving the effects through a library is useful
at all. By linking against the built-in effects we gain the following
advantages:
* don't have to load/unload the KLibrary
* don't have to resolve the create, supported and enabled functions
* no version check required
* no dependency resolving (effects don't use it)
* remove the KWIN_EFFECT macros from the effects

All the effects are now registered in an effects_builtins file which
maps the name to a factory method and supported or enabled by default
methods.

During loading the effects we first check whether there is a built-in
effect by the given name and make a shortcut to create it through that.
If that's not possible the normal plugin loading is used.

Completely unscientific testing [1] showed an improvement of almost 10
msec during loading all the effects I use.

[1] QElapsedTimer around the loading code, start kwin five times, take
average.

REVIEW: 115073
2014-01-24 14:13:59 +01:00
Martin Gräßlin b7f3f582e3 [kwin] Re-enable build of kwin_update_default_rules
Currently using KDE4Support, needs more proper porting. Tool works,
installs the kwin rule.
2014-01-16 21:35:18 +01:00
Hrvoje Senjan 188cb4343c Bump KWin's kdeinit # to 5/Don't set KWin's kdeinit # manually
REVIEW: 115003
2014-01-13 21:05:33 +01:00
Martin Gräßlin 0c559c163d New QPainter based compositor called SceneQPainter
This compositor uses only the QPainter API to perform rendering. The
window's X Pixmap is mapped to a QImage using XShm. As rendering backend
a QImage is used.

The new compositing type "QPainterCompositing" is introduced. Effects
need to be adjusted to explicitly check the compositing type and no
longer assume the compositing type is XRender if it's not OpenGL.

This compositor can be selected with using "Q" as the value for
KWIN_COMPOSE env variable or setting the config value to "QPainter".
The GUI is not yet adjusted to select this compositor.

The QPainter scene provides currently the following features:
* 2D transformations (translation and scalation)
* opacity modifications
* rendering of decorations (new PaintRedirector sub class)
* rendering of shadows
* rendering of effect frames
* rendering to a Wayland surface

The following features are currently not provided:
* saturation changes
* brightness changes
* 3D transformations
* rendering to X Overlay window
* offscreen rendering (e.g. needed for screen shot effect)
* custom rendering in the effects to the current back buffer
2014-01-09 13:29:40 +01:00
Martin Gräßlin f4ee319c6a Move XShm helper class to xcbutils
That way it can be used also in other parts of KWin.
2014-01-08 09:22:40 +01:00
Martin Gräßlin baf477ac00 Split out non-EGL functionality of WaylandBackend into own source files
The functionality to create the connection to a Wayland compositor and
creating a fullscreen surface is moved into wayland_backend.(h|cpp). The
wl_egl_window for the surface is moved into the EglWaylandBackend to have
the actual WaylandBackend free from Egl. This will allow in future to
implement other compositing backends for Wayland which do not use egl.
This means that egl is no longer a build requirement for the wayland
related functionality.
2014-01-08 09:22:40 +01:00
Martin Gräßlin 144003a0aa [kwin] Generate dbus interface for Appmenu
Generated code > hand written code.
2014-01-07 14:06:56 +01:00
Martin Gräßlin d536532f66 [kwin/tabbox] Use a QmlComponent instead of a QQuickView for TabBox
By not using a QQuickView it becomes possible to just use a
PlasmaCore.Dialog or a Quick.Window in the TabBox qml and thus it's
possible to simplify the qml code.

To support this a new SwitcherItem is introduced and exported to QML.
It's a simple QObject providing all the properties which used to be
exported to the root context. A declarative TabBox is expected to
use one of these items. The C++ side finds the Switcher and for that
supports the case that the SwitcherItem is the rootItem or a child
item.

A declarative TabBox has also to create a QQuickWindow, e.g. a
PlasmaCore.Dialog. The visibility of that window should be controlled
through the visible property on the SwitcherItem. The underlying C++
implementation assumes that a TabBox only uses one window (it needs to
get destroyed once it's hidden and included in highlight windows).

Thanks to this change it's no longer needed to reload the TabBox
whenever it gets shown or the alternative TabBox gets shown. Instead
the same QML script can get reused. Other created switchers are ignored
as the visible property won't be changed to true.
2013-12-12 09:37:29 +01:00
Martin Klapetek 54bc491c46 Port to KF5 renaming changes 2013-12-11 21:41:47 +01:00
Martin Gräßlin c063978591 Adjust to new KGlobalAccel framework 2013-12-10 07:38:54 +01:00
Martin Gräßlin fc21f99df6 [kwin] Remove the image provider for the TabBox
No longer needed as we have the icon passed to QML.

A nice side-effect: we don't need KIconThemes in KWin any more.
2013-12-06 16:26:21 +01:00
Martin Gräßlin a192734ac9 [kwin] Good bye KDE4Support 2013-12-06 10:33:45 +01:00
Martin Gräßlin e92d02ab61 [kwin] Remove include of kdemacros.h from kwinglobals
Instead we generate an export header for kdeinit_kwin and use it
to declare the KWIN_EXPORT. With this change our libs don't include
any KDE4Support headers any more. One step closer to no KDE4Support.
2013-12-06 08:37:16 +01:00
Jacob Logan 199ed87c61 [libkdecorations] Generate an export header
REVIEW: 114247
2013-12-05 10:00:46 +01:00
Aleix Pol 94f31606e6 CMake macros porting
kconfig_add_kcfg_files
qt5_add_dbus_adaptor
qt5_generate_dbus_interface
2013-11-27 16:11:14 +01:00
Martin Gräßlin 29926f3caf [kwin] Drop check for KDE_PLATFORM_PROFILE 2013-11-25 13:59:45 +01:00
Aleix Pol 7b110f0671 Improve CMake usage
It's basically a run of the port-cmake.sh script in here, mostly the changes
are the following:
- Using KF5::* targets
- Using the proper macros, following recent developments in frameworks
2013-11-15 13:37:47 +01:00
Martin Gräßlin c32ec9b32b [kwin] Work around broken xcb_sync_create_alarm
The xcb sync protocol is incorrectly defined (see [1]) which results in
xcb_sync_create_alarm not creating a valid alarm. To work around this
issue we only create the alarm without setting the int64 values. For
those we use the XLib XSyncChangeAlarm call after we verified that the
alarm got created. This unfortunately reintroduces linking against
libxext. But at least resizing works again.

[1] http://lists.freedesktop.org/archives/xcb/2013-June/008375.html
2013-11-11 11:36:26 +01:00
Martin Gräßlin 324aae916a [kwin] Drop testapp for detecting whether direct rendering works on glx
The main purpose of the opengl testapp was to set the environment
variable LIBGL_ALWAYS_INDIRECT if direct rendering is not supported
before glx gets initialized.

With Qt5 we may no longer set this environment variable. QtQuick
requires direct rendering. On IvyBridge QtQuick is crashing if the
variable is set. Thus we are no longer allowed to set it and thus the
complete test becomes pointless.

The test app basically whitelisted most drivers anyway, the only
drivers which were problematic are the proprietary Catalyst drivers.
It that's still a problem we can also disable OpenGL compositing on
those drivers through the recommendation in the GLPlatform.

This also means that the KWIN_DIRECT_GL variable is no longer useful.
2013-11-05 14:48:40 +01:00
David Edmundson 59e3d0e099 kde4_install_icons -> ecm_install_icons
REVIEW: 113600
2013-11-04 13:24:41 +01:00
Aurélien Gâteau 05b6de1002 ${KDE4Support_LIBRARIES} => KF5::KDE4Support
Fixes a few link errors
2013-10-29 13:00:46 +01:00
Sebastian Kügler b68867463e Change KF5::plasma to KF5::Plasma
Library name has changed in plasma-framework to bring it in line with
KF5:CamelCasing naming.
2013-10-16 01:36:56 +02:00
Martin Gräßlin e3618e8796 [kwin] Follow Qt's OpenGL choice for KWin
As KWin indirectly uses Qt's OpenGL through QtQuick we need to ensure
to not mix OpenGL and OpenGLES. So we have to built KWin only against
OpenGL if Qt is built against OpenGL and we have to built KWin only
against GLESv2 if Qt is built against GLESv2.

This means the kwin_gles binary is no more. There is only kwin which
either links GL or GLESv2.
2013-10-14 09:04:03 +02:00
Sebastian Kügler 1c3e540507 kde4_add_kdeinit_executable becomes kf5_add_kdeinit_executable 2013-10-08 01:00:27 +02:00
Sebastian Kügler bfe710dce7 KF5::KDeclarative 2013-10-04 22:21:22 +02:00
Martin Gräßlin a63ca0c311 Fix linking and includes
Seems like there were some changes, we need more explicit linking.
2013-10-02 15:23:56 +02:00
Martin Gräßlin 5d185a9adc Welcome back to kcmkwin - so far only desktop
Note to people compiling from source: it's only the default of the
cmake variable which got changed. You have to delete the variable
from the cache to get this change.
2013-09-27 13:45:25 +02:00
Sebastian Kügler a1641efdf1 Remove kdeqt5staging
Reviewed-by: Martin
2013-09-11 13:57:41 +02:00
Martin Gräßlin caad13ff95 Use new components based Find XCB 2013-09-09 06:03:35 +02:00
Martin Gräßlin 489addf901 Add default debug area to KWin main CMakeLists 2013-09-02 10:34:00 +02:00
Martin Gräßlin a536e07488 Use kdeqt5staging for QCommandLineParser
Makes it also compile with not latest Qt.
2013-08-29 16:22:30 +02:00
Martin Gräßlin fb111be903 Use Qt5::Script in linker definition of KWin core
Missed that one in the other commit.
2013-08-20 10:49:33 +02:00
Martin Gräßlin e21225fa47 Use XCB Shape instead of XLib Shape in KWin core 2013-08-20 09:48:14 +02:00
Martin Gräßlin 84a2f3020b Use Qt5:: in target link libraries in KWin 2013-08-20 09:14:24 +02:00