Commit Graph

332 Commits (b33425baaaf275bf0bb2bb775862c93468461feb)

Author SHA1 Message Date
Àlex Fiestas b33425baaa Move Oxygen kwin decoration to the oxygen folder 2014-03-24 16:43:11 +01:00
Àlex Fiestas f8134f9393 Add a copy of org.freedesktop.ScreenSaver.xml for KWin
Since it is a standard (fd.o) it makes sense to copy the interface
rather than creating a dependency with plasma-workspace which it
actually doesn't since KWin will work with any screensaver using the
freedesktop specification.
2014-03-24 16:30:22 +01:00
Àlex Fiestas 0e9f6888e0 Stop suspending startup from KWin
This commit basically makes KWin stop using suspend-resumeStartup
methods from KSMServer. The idea is to launch things on parallel and
this is doing exactly the contrary.

Reviewed-by: Martin Gräßlin <mgraesslin@kde.org>
2014-03-24 16:01:48 +01:00
Àlex Fiestas 740616fac3 Add conditional to avoid calling summary_view twice 2014-03-21 17:47:50 +01:00
Aleix Pol a9fae41ac0 Install a config file with KWin's dbus interfaces 2014-03-21 16:42:48 +01:00
Aleix Pol 8b8f327458 Explicit OpenGL version checking is not needed anymore 2014-03-21 12:02:58 +01:00
Aleix Pol 7ae2fe422c Move find_package() calls into the respective directories
All should be done except for KF5 and Qt.
I tried to go through all projects and see whether it depended on the
different modules. I would appreciate it very much if the different
maintainers could take a look and see if everything is correct.

CCMAIL: plasma-devel@kde.org
2014-03-20 23:40:40 +01:00
Aleix Pol 7c1538957d Remove the need of having a global HAVE_X11 variable
Use the standard X11_FOUND instead
Also properly set the HAVE_X11 value, since it's checked with #if HAVE_X11
instead of #ifdef.
2014-03-20 18:33:29 +01:00
Martin Gräßlin 5428a15266 [kwin] Fix build if Wayland is found, but xkbcommon is missing
It enabled the Wayland build, but it should be disabled if xkbcommon
is missing.

Thanks to Project Neon for finding this issue.
2014-03-20 12:54:24 +01:00
Martin Gräßlin 24b23dfc01 Beginning of global shortcut handling inside KWin
A new GlobalShortcutsManager is introduced which is responsible for
holding the registered shortcuts and triggering the matching action.

The InputRedirection checks with the GlobalShortcutManager whether a key
press event triggers a global shortcut and stops processing the event in
that case.

At the moment the GlobalShortcutsManager only supports the very basics
for KWin internal usage. External applications can not yet make usage of
the global shortcut system inside KWin.
2014-03-19 14:14:56 +01:00
Martin Gräßlin 82fd9020e4 [kwin] Improve setting HAVE_WAYLAND_EGL
On the CI system that seemed to have been true although
Wayland Client lib was not found.
2014-03-19 11:02:39 +01:00
Martin Gräßlin 8699fe5e5a [kwin/genericscriptedkcm] Generate dbus interface from XML description 2014-03-19 08:10:45 +01:00
Martin Gräßlin c8b4f1e9e2 [kwin] Add hack for finding the ksmserver and screenlocker DBus interface
Uses find_package in standalone build - that's for the future and in
combined build just sets the same variable to hardcoded path in the repo.
2014-03-19 07:56:17 +01:00
Martin Gräßlin 570ce05974 [kwin] Adjust CMakeLists.txt to allow standalone built of KWin
Preparation step before splitting:
* adds project(KWIN)
* lists all KWin dependencies

KWin can be built standalone if cmake is run with:
-DKWIN_BUILD_OXYGEN=OFF
-DKWIN_BUILD_KAPPMENU=OFF

Oxygen because it needs liboxygen - for standalone clients/oxygen needs
to be moved out of KWin.

KAppmenu because it includes the DBus xml file.

REVIEW: 116872
2014-03-18 17:42:19 +01:00
Aurélien Gâteau 90498594c2 kwin: add missing library. Fixes build 2014-03-18 16:39:34 +01:00
Aleix Pol 6d3acfc71e Properly point to ksmserver from kwin 2014-03-18 14:22:57 +01:00
Aleix Pol 0283d67998 Move the repositories into plasma-* subdirectories before splitting
Creates two subdirectories: plasma-workspace and plasma-desktop
plasma-workspace contains the modules that should be re-usable between
different form factors. plasma-desktop contains the modules that
are specific to the Desktop.
See http://community.kde.org/Plasma/Tokamak7/split_proposal

Reviewed by Àlex Fiestas
2014-03-18 13:45:23 +01:00
Martin Gräßlin 7382b6d8b1 [kwin] Resolve path to ksmserver dbus interfaces through KWIN_SOURCE_DIR
This is a temporary solution to have less dependencies on
KDEBASE_WORKSPACE_SOURCE_DIR. Once kde-workspace is going to be splitted
this won't work, we need a proper way to find the dbus interfaces
provided by ksmserver.

Note: for appmenu the same problem exists, but doesn't affect us once we
are splitted as we can turn off the usage through a build option. So for
a splitted kde-workspace the appmenu dependency can just be temporarily
be removed.
2014-03-18 12:18:15 +01:00
Martin Gräßlin 9874187099 [kwin] Add a KWIN_SOURCE_DIR to the CMakeLists.txt
This is used to get to KWin's sources instead of
KDEBASE_WORKSPACE_SOURCE_DIR.
2014-03-18 12:08:14 +01:00
Martin Gräßlin dbf2218338 [kwin] kde4_add_ui_files -> qt5_wrap_ui
Less deprecated CMake usage.
2014-03-18 11:06:56 +01:00
Martin Gräßlin 3671b65001 [kwin] Do not depend on KDE4WORKSPACE_VERSION
KWin needs to have its own version. Split preparation.
2014-03-18 10:52:45 +01:00
Martin Gräßlin cb262a2bbb [kwin] Add used features from config-workspace.h to config-kwin.h
Adds HAVE_UNISTD_H and HAVE_MALLOC_H to config-kwin.h and gets used
in main.cpp. With that KWin does no longer need config-workspace.h.
2014-03-18 09:30:40 +01:00
Martin Gräßlin 6baf794f88 InputRedirection for keyboard events
Major new functionality is xkbcommon support. InputRedirection holds an
instance to a small wrapper class which has the xkb context, keymap and
state. The keymap is initialied from the file descriptor we get from the
Wayland backend.

InputRedirection uses this to translate the keycodes into keysymbols and
to QString and to track the modifiers as provided by the
Qt::KeybordModifiers flags.

This provides us enough information for internal usage (e.g. pass through
effects if they have "grabbed" the keyboard).

If KWin doesn't filter out the key events, it passes them on to the
currently active Client respectively an unmanaged on top of the stack.
This needs still some improvement (not each unmanaged should get the
event). The Client/Unmnaged still uses xtest extension to send the key
events to the window. So keylogging is still possible.
2014-03-18 09:00:50 +01:00
Martin Gräßlin 104e89aff2 Require xkbcommon for KWin's Wayland backend
FindXKB.cmake module and if XKB is not found Wayland
support is not enabled.
2014-03-18 09:00:50 +01:00
Martin Gräßlin 92761e9e30 [kwin] Fix ifdefs for Wayland
With the switch to FindWayland from ECM WAYLAND_FOUND was no longer set
thus the ifdef didn't work. Now we use HAVE_WAYLAND and HAVE_WAYLAND_EGL.
2014-03-18 09:00:49 +01:00
Martin Gräßlin f9704ff0df Add support for Wayland Cursor themes
WaylandSeat can install a cursor based on Qt::CursorShape using the
Wayland cursor theme library.
2014-03-18 09:00:49 +01:00
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