Commit graph

12510 commits

Author SHA1 Message Date
Martin Gräßlin
027a7a1646 [kdecoration2] Decoration::shadow returns QSharedPointer
Adjust all components to use the QSharedPointer. Aurorae obviously has
to create a QSharedPointer, Shadow holds a QSharedPointer for the
DecorationShadow (advantage: is kept when the Decoration is destroyed),
and the KCM needs to add a property on PreviewItem to get access to the
Shadow. It's no longer a Q_PROPERTY on Decoration and we cannot re-add
it as a dynamic property (cannot be read from QML side).
2014-12-01 09:40:24 +01:00
Martin Gräßlin
6bdd0e96f6 [kdecoration] Decoration::client returns a QWeakPointer
In aurorae a wrapper property is added.
2014-11-28 16:28:39 +01:00
Martin Gräßlin
d1bf38e92c [kdecoration2] Detect double clicks on the decoration title bar
No longer handled by the Decoration.
2014-11-28 14:50:21 +01:00
Martin Gräßlin
0efa9d9c73 [kdecoration2] Decoration does not provide titleBarWheelEvent any more
Instead KWin needs to determine by itself whether it should act on the
wheel event. The Decoration will set it to accepted if it handled it.
2014-11-28 14:08:13 +01:00
Martin Gräßlin
0cc86656c9 DecorationButtonType::QuickHelp -> DecorationButtonType::ContextHelp 2014-11-28 11:27:31 +01:00
Martin Gräßlin
211834edcc [kdecoration] ::paint uses QRect instead of QRegion 2014-11-28 10:26:23 +01:00
Martin Gräßlin
f103cd0bea DecorationShadow elements are QRects 2014-11-12 09:06:03 +01:00
Martin Gräßlin
b337a0b52e DecorationShadow uses QRect to set element sizes 2014-11-11 17:02:15 +01:00
Martin Gräßlin
1afc355759 DecorationShadow uses QMargins for padding 2014-11-11 15:18:35 +01:00
Martin Gräßlin
faa78e187e Rename DecoratedClient::borderingScreenEdges to adjacentScreenEdges 2014-11-11 14:33:31 +01:00
Martin Gräßlin
99545da109 [aurorae] s/requestMaximize/requestToggleMaximization/g 2014-11-11 13:20:15 +01:00
Martin Gräßlin
dc85ab14f8 Decoration::windowFrameSection renamed to ::sectionUnderMouse 2014-11-11 13:17:50 +01:00
Martin Gräßlin
0f76516d01 [aurorae] Decoration::titleRect renamed to ::titleBar 2014-11-11 11:55:20 +01:00
Martin Gräßlin
8cf402f185 Decoration::extendedBorders renamed to ::resizeOnlyBorders 2014-11-11 11:33:02 +01:00
Martin Gräßlin
1c90ca9087 [aurorae] Decoration sets borders using QMargins 2014-11-11 10:49:10 +01:00
Martin Gräßlin
2fdafbb133 s/requestMaximize/requestToggleMaximization/g 2014-11-11 09:53:54 +01:00
Martin Gräßlin
cb9cbae36e Decoration::paint takes the repaint region 2014-11-11 09:39:45 +01:00
Hugo Pereira Da Costa
931c43b6c4 added missing .data() to make connect/disconnect compile 2014-11-04 10:37:39 +01:00
Frank Osterfeld
4dc2ad22d7 Add libepoxy's include directory 2014-11-04 10:31:03 +01:00
Martin Gräßlin
062d071fc5 [kwindecoration] Add a PreviewButtonItem to the declarative plugin
Allows to create a DecorationButton and renders a preview for it.
Very basic, doesn't forward mouse events, etc.
2014-11-03 16:12:54 +01:00
Martin Gräßlin
8dd0a8163f [kcmkwin/kwindecoration] Import a new decoration configuration module
Following features are supported:
* finds all plugins
** finds all themes for a theme-engine plugin
* renders previews for the plugin/themes
* loads currently used plugin/theme
* saves selected plugin/theme
* triggers config reload in KWin

Following features are currently not supported:
* Search
* Plugin configuration
* GHNS
* Button configuration
2014-10-31 07:53:04 +01:00
Martin Gräßlin
fcec334b3c [kdecoration] Adjust to change that DecorationBridge is no longer a singleton
* Aurorae needs to pass QVariantList args to parent Decoration
* DecorationBridge implementation needs to be a KWIN_SINGLETON
* DecorationBridge needs to be passed with args to created Decoration
2014-10-30 09:01:06 +01:00
Martin Gräßlin
69c3233ead [kdecoration2] DecorationSettings takes DecorationBridge in ctor 2014-10-29 16:51:31 +01:00
Martin Gräßlin
a7bcb70980 [kdecoration2] Adjust to DecortionSettings no longer being a singleton 2014-10-29 16:11:20 +01:00
Martin Gräßlin
8f87e18b79 [decorations] Add support for runtime switching of decoration plugins 2014-10-28 11:53:56 +01:00
Martin Gräßlin
7353bf4c28 [shadow] Needs to keep a QPointer to the DecorationShadow
The DecorationShadow might be deleted at any time, so we better
keep track of it properly.
2014-10-28 11:01:43 +01:00
Martin Gräßlin
17103c49a1 [aurorae] Add a ThemeFinder
The idea behind the ThemeFinder is to expose a way for a configuration
module to find all themes. The API is not yet finalized, thus it's just
a QObject with a Q_PROPERTY themes of type QVariantMap with key being
the user visible name and value being the internal theme name.
The ThemeFinder will have to be moved to KDecoration library.

The json metadata provides a "themeListKeyword" which is used as the
keyword to the KPluginFactory.
2014-10-28 09:57:38 +01:00
Martin Gräßlin
f94b4bec0b [aurorae] Set drawBackground property to false on visual parent
Small hint for the previewer that it shouldn't draw the background.
2014-10-28 08:17:46 +01:00
Martin Gräßlin
0778434f85 [aurorae] Add a dummy Shadow for the configuration mode 2014-10-28 08:16:53 +01:00
Martin Gräßlin
47484384ad [aurorae] Support DecorationShadow
DecorationShadow is supported through using the padding values. The
window becomes larger by the padding and gets positioned accordingly.
This requires to translate all mouse events.

The DecorationShadow is just using the complete image, which is kind of
a memory waste, but at least the SVG based Aurorae doesn't provide us
better information (might be added, but would probably need changes in
the theme).

For switching back to non-compositing we recreate the QuickWindow. It's
not fortunate, but as long as we do not yet have the render control it's
needed.
2014-10-27 12:45:05 +01:00
Martin Gräßlin
16afb24426 [aurorae] QQuickWindow needs to be a QPointer instead of a ScopedPointer
Lifetime is bound to the foreign QWindow of the decoration. Thus if that
gets destroyed our pointer becomes invalid and we need to track that.
2014-10-27 12:43:39 +01:00
Martin Gräßlin
5c3cd6f4bc Initial port of Aurorae to KDecoration2
The port to KDecoration2 means quite some changes in the way how Aurorae
works. First of all: the theme to load is passed to the Deocoration ctor
and not searched for by Aurorae itself.

The rendering mechanismn didn't change significantly yet. It's still
rendering to an FBO and passing the image on. This needs some further
work as KDecoration2 does not support the padding any more. So all
themes using shadow are currently broken.

Another big change is the way how the rendering scene is constructed
and used. KDecoration2 doesn't want the the Decoration to be a native
window. But for being able to render a QtQuick scene at all we need a
QQuickWindow. Thus it creates a window parented to the decoration id,
but not accepting any input event. Input is nowadays controlled from
the outside: events are passed into the Decoration, so we don't want
the QtQuick window intercepting events.

In case of non-composited the normal FBO mechanism doesn't work and
Aurorae just renders to the QQuickWindow directly. This could use
some optimization in the decoration renderer in KWin core to not even
try to perform the normal rendering. On the other hand it's probably
too much a hassle for the use case.

The rendering architecture might hopefully be improved with Qt 5.4
and the new QQuickRenderControl class.

The QQuickWindow also exposes a problem for preview in the
kdecoration-viewer and the future KCM: we don't want a different
window, but best would be to get to the QML scene directly. A small
hack is added to have the previewers set a "visualParent" which Aurorae
uses to parent the QML scene to without the need to create a
QQuickWindow.
2014-10-24 13:48:31 +02:00
Martin Gräßlin
6a580d2b90 Support themes in decoration loading
A decoration plugin can indicate that it supports themes. For this
the decoration plugin needs to specify in the org.kde.kdecoration2
group of the JSON meta data the following:

themes: true,
defaultTheme: "nameofDefaultTheme"

If the themes key/value pair is present and set to true KWin will
read the entry "theme" in the [org.kde.kdecoration2] group with the
value of defaultTheme as the default value.

The read value (if there is one) is passed to the created decoration
in the QVariantList. The QVariantList contains a QVariantMap as first
entry and the theme name is passed for key "theme".
2014-10-24 13:05:41 +02:00
Martin Gräßlin
7e8cce212d A mouse release event doesn't have the triggered button in Qt::MouseButtons 2014-10-23 16:49:21 +02:00
Martin Gräßlin
a104d9dc62 Call ::init() on created KDecoration2::Decoration 2014-10-23 10:59:00 +02:00
Martin Gräßlin
447fed7e37 Adjust DecoratedClientImpl to changes in DecoratedClientPrivate 2014-10-23 10:56:43 +02:00
Martin Gräßlin
c23b3ac0d8 Drop usage of DecoratedClient::handle in DecorationBridge::update
We can find the Client for the Decoration without needing to go by
the handle.
2014-10-21 08:03:23 +02:00
Martin Gräßlin
21dca7ac14 Keep a QPointer<DecoratedClientImpl> in Client
This allows to remove the internal access to the DecoratedClientPrivate
in the KDecoration API.
2014-10-21 07:46:44 +02:00
Martin Gräßlin
c0c57d7076 KDecoration2::DecorationBridge uses std::unique_ptr 2014-10-20 17:42:50 +02:00
Martin Gräßlin
e32da9d9e0 Merge branch 'master' into kdecorations2
Conflicts:
	CMakeLists.txt
	paintredirector.cpp
	scene_opengl.h
	scene_qpainter.h
	scene_xrender.h
2014-10-20 16:04:52 +02:00
Martin Gräßlin
015c59d9fd Fix build if there is no libinput 2014-10-20 15:01:12 +02:00
Martin Gräßlin
da5ee2ba93 Add sanity checks before updating pointer position and on screen changes
We don't want the cursor to leave the visible area, so better check that
the cursor doesn't leave it. And when the screens changes better check
that the cursor is still on a visible screen. If not: put it back to the
center of the closest screen.
2014-10-20 14:51:24 +02:00
Martin Gräßlin
ff87c989ba Center initial pointer position on screen in libinput mode 2014-10-20 14:51:24 +02:00
Martin Gräßlin
2a6cd5010a Set a default cursor when creating the WaylandCursor 2014-10-20 14:51:24 +02:00
Martin Gräßlin
f545eeb087 Connect pointer events from libinput 2014-10-20 14:51:24 +02:00
Martin Gräßlin
96d6a55ea8 Do not create a WaylandSeat if we use libinput 2014-10-20 14:51:24 +02:00
Martin Gräßlin
15a1a5b70f Add command line option to enable libinput support
kwin_wayland gains a new command line option to enable libinput support.
This is needed as logind blanks the VT when the session controller
releases the control. So a nested compositor can seriously affect the
primary session. Thus it needs a dedicated command line switch to
enable it.

By default libinput support is disabled for kwin_x11 and can be enabled
for kwin_wayland in case KWin is compiled with libinput support.
2014-10-20 14:51:24 +02:00
Martin Gräßlin
6a032e78b7 Suspend/Resume libinput when logind session Active changes
LogindIntegration starts monitoring the Active property on the session
and emits a signal when the state changes. The LibInput::Connection
connects to this signal during the setup and uses it to suspend/resume
the libinput context.
2014-10-20 14:51:24 +02:00
Martin Gräßlin
a918591fef Use Logind to open/close devices needed by libinput
With libinput we have the problem that we need to have privileges to
open the device files. In order to not need wrappers or suid bits, we
use logind. This means that kwin_wayland has to be the session controler.

A LogindIntegration is added to connect to logind and wrap the dbus
calls. This is based on the logind integration done for ksld in
ksmserver. The LogindIntegration is started by Workspace and the
InputRedirection tries to become the session controller and starts the
libinput integration only after this succeeded.
2014-10-20 14:51:24 +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