Commit graph

11326 commits

Author SHA1 Message Date
Martin Gräßlin
5012f9e83a [oxygen] Drop redefining the default decoration buttons
There is no difference between Oxygen and default KDecoration, so
it's not needed. It's also conceptionally wrong: decorations should
not be able to change the global default.
2013-11-14 09:41:52 +01:00
Martin Gräßlin
47857bb9f3 [oxygen] Use new update mechanism of KDecoration in the Button
This allows to have the button animations working in the preview.

Needs to change the reference to Client to non-const.
2013-11-14 09:41:52 +01:00
Martin Gräßlin
f03104ac17 [kcmdeco] Connect PreviewItem to factory's recreateDeco signal 2013-11-14 09:41:52 +01:00
Martin Gräßlin
3ea18be574 [kcmdeco] Move KDecorationPreviewOptions into the Model
We need to have it around and not in the Preview widget to be able
to update the options when the buttons change.
2013-11-14 09:41:52 +01:00
Martin Gräßlin
aab6037c4a [kcmdeco] KIcon -> QIcon::fromTheme 2013-11-14 09:41:52 +01:00
Martin Gräßlin
b150d9ddc1 [kcmdeco] Clean up includes 2013-11-14 09:41:52 +01:00
Martin Gräßlin
a98dbd7460 [kcmdeco] Drop the old preview code
All the rendering to QPixmap code in the Model and the Preview is
deleted as it's no longer used.

The model still has the plugin for the border size functionality.
This probably needs a change in the API to make it completely bound
to the decoration and not a global thing.
2013-11-14 09:41:52 +01:00
Martin Gräßlin
1674824e79 [kcmdeco] Introduce a new PreviewItem for rendering QWidget based decos in QML
Using a QQuickPaintedItem for the rendering. The item gets the library
name from the model and loads the decoration with its own decoration
plugin. Thus each preview has its own plugin which eliminates the need to
constantly recreate the decoration as it is done with the preview.

Having a QQuickItem gives new possibilities. The item accepts hover
events and forwards them as enter and leave events to the widgets inside
the decoration. By that the mouse interaction of e.g. Oxygen is still
functional. If the decoration uses the new update approach the bridge is
forwarding the updates to the item and triggering a repaint so we even
have animations in the preview although the widget is never shown.
2013-11-14 09:41:52 +01:00
Martin Gräßlin
612709d9d3 [aurorae] Use QWindow based API instead of wrapping in a QWidget
Works quite decently already, but some things do not work properly yet,
e.g. doubleclick on decoration is not noticed.
2013-11-14 09:41:51 +01:00
Martin Gräßlin
54bbbff2bf [decorations] Cancel move/resize on titlebar double click 2013-11-14 09:41:51 +01:00
Martin Gräßlin
695697ebbd [decorations] Allow Client to use QWindow based decorations
Shared implementation using the delegating methods in KDecoration
which uses either QWindow or QWidget where possible.
2013-11-14 09:41:51 +01:00
Martin Gräßlin
f8b9b98345 [decorations] Allow decorations to use a QWindow instead of QWidget
A setMainWindow() method is added which behaves similar to
setMainWidget(). In addition a few convenient methods are added which
can be used by KWin core to show/hide the decoration without caring
whether the decoration uses a QWindow or QWidget.
2013-11-14 09:41:51 +01:00
Martin Gräßlin
8ecb69cd8c [decorations] Add a KDecoration::window() returning the QWindow
KWin core can access the QWindow of the decoration instead of the
QWidget. This is a preparation step to allow QWidget based window
decorations without any QWidgets at all.

KWin core makes already use of this new accessor to get the window Id
which is also on QWidgets provided through the QWindow.
2013-11-14 09:41:50 +01:00
Martin Gräßlin
d6bf62eb3e [kdecorations] Drop initialParentWidget()
No longer needed for creating the preview and not set in our main
bridge. Thus it can go and we just use NULL as the parent widget.
2013-11-14 09:41:50 +01:00
Martin Gräßlin
98549449d6 [aurorae] Implement new render method in Aurorae
Improves the situation a little bit: schedules updates without
rendering to the QWidget, but still fbo -> QImage in each frame.
2013-11-14 09:41:50 +01:00
Martin Gräßlin
51ee2e86d1 [kdecorations] Introduce new way to schedule updates in composited case
The PaintRedirector calls the new method KDecoration::render and passes
it's PaintDevice and the region to update to it. A decoration can
implement this method and provide an optimized implementation for the
painting which does not go through the deco's QWidget at all. In addition
the decoration can invoke an update() slot which will schedule a repaint
in the PaintRedirector and thus completely replaces the need for
intercepting paint events on the QWidget and also allows to add QWindow
based decorations in future.
2013-11-14 09:41:50 +01:00
Martin Gräßlin
1deea69170 [paintredirector] Pass KDecoration to PaintRedirector
Gives us more power in the future.
2013-11-14 09:41:50 +01:00
Martin Gräßlin
acd0015c6e [paintredirector] Remove dead code 2013-11-14 09:41:50 +01:00
Martin Gräßlin
f8acfbf2a0 [aurorae] Connect PlastikButton to options::colorChanged signal
Fixes incorrect button color. DecorationOptions and PlastikButton are
both connected to decoration.active and the button gets invoked first,
thus the titleBarColor is still for the previous state. This was fun!
2013-11-14 09:41:50 +01:00
Martin Gräßlin
dd6598c1ff [aurorae] Hack to get Aurorae work with compositing
This is a temporary solution! A proper solution needs changes in
libkdecoration and paint redirector.

The hack redirects the rendering into an FBO. After each rendering we
get a QImage from the FBO and store that in a buffer. As we unfortunately
do not know what changed, we schedule a complete update on the deco's
widget. Once we get the paint event we just render the buffer on the
widget. And thus we have copied the content to a place where it
integrates with the paint redirector.

As already written, this is a horrible hack and I'm not proud about it.
There are just too many copies involved.

So how to improve?
* deco should be able to just provide a QImage to the PaintRedirector
  without the paint to the QWidget.
* only do the FBO -> QImage step if it is needed by the compositor, that
  is compress the events
* for OpenGL compositing it would be totally awesome if we could just
  make the contexts sharing so that we can just reuse the texture from
  the FBO directly.
2013-11-14 09:41:50 +01:00
Martin Gräßlin
93c2eea528 [aurorae] Use QtQuick2 instead of QtDeclarative
Major transition to render using QtQuick 2. This means the actual
rendering needs a QQuickWindow which we embed into a QWidget container.
Not an optimal solution, deco API should offer to operate on QWindow.

For non-composited the decoration gets rendered but for composited
rendering the paint redirector is broken. There are no paint events on
the main QWidget to intercept and thus the redirection doesn't work.
2013-11-14 09:41:50 +01:00
Martin Gräßlin
d1afcc7cb2 [aurorae] Whether animations are supported only depends on compositing
Test for raster graphics system doesn't make any sense in QtQuick2 world.
2013-11-14 09:41:50 +01:00
Martin Gräßlin
736a0c5611 [aurorae] Fix locating of theme configuration file 2013-11-14 09:41:50 +01:00
l10n daemon script
b6990c5fb7 SVN_SILENT made messages (.desktop file) 2013-11-14 04:04:38 +00:00
Martin Gräßlin
b6f9bd988b [kwin] Do not filter out button release events for moving clients
The QWidget of the window decoration is otherwise still thinking that
the button is pressed and waits for a release. Thus the next click on
the decoration doesn't trigger the move mode.
2013-11-13 14:40:57 +01:00
Martin Gräßlin
0056302652 [kwin] updateXTime before establishing grab for move resize mode
Grabbing the pointer failed causing unrestricted move resize to
operate incorrectly (position didn't update).
2013-11-13 11:28:05 +01:00
Martin Gräßlin
d5104cd4b5 [kwin] Start kcmshell5 to configure KWin 2013-11-13 11:12:27 +01:00
Martin Gräßlin
62ae322e70 [kwin/tabbox] Re-add dependency to kdeclarative 2013-11-13 10:59:38 +01:00
Martin Gräßlin
85e3a00f27 [kwin] Fix crash checking in startup
Need to do it before we start to claim the manager selection.
2013-11-13 10:23:45 +01:00
Aurélien Gâteau
47c12347ea Fix clean build
libkdecorations is part of kde-workspace so calling find_library() cannot
work on a clean build since it has not been installed yet. CMake knows
about it anyway since its part of kde-workspace, so it can use it without
finding it.

CCMAIL: hugo@oxygen-icons.org
2013-11-13 10:11:40 +01:00
Martin Gräßlin
0ad6811684 [kwin] Fix crash in tear-down of EffectsHandlerImpl
Adding a simplified logic to unload all effects directly in the
dtor. Looks like Qt didn't like our double traversal over the list
any more and was causing double deletions.
2013-11-13 10:03:58 +01:00
Martin Gräßlin
6a1cadc0a7 [kwin] update x time before trying to establish/release tabbox grab
Failed with invalid time error when using kglobalaccel5.
2013-11-13 09:25:47 +01:00
l10n daemon script
4edf01bd62 SVN_SILENT made messages (.desktop file) 2013-11-13 03:59:37 +00:00
Hugo Pereira Da Costa
caa660fdb8 use add_library instead of kde4_add_plugin
reduced KF5 dependencies.
2013-11-13 17:32:14 +01:00
Hugo Pereira Da Costa
242dcb87d3 removed lib from config plugin libraries
consistently added MODULE to relevant add_library calls.
2013-11-13 17:32:14 +01:00
l10n daemon script
ac7dba9a59 SVN_SILENT made messages (.desktop file) 2013-11-12 04:02:42 +00:00
Hugo Pereira Da Costa
eaa1930975 use Helper::ScopedPointer instead of QScopedPointer for simplification. 2013-11-12 00:54:26 +01:00
Hugo Pereira Da Costa
33363908c1 ensures xcb_reply_t deallocation using QScopedPointer 2013-11-12 00:54:25 +01:00
Hugo Pereira Da Costa
bdd1cfd7b8 QLatin1String -> QStringLiteral 2013-11-12 00:52:29 +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
l10n daemon script
478486d46b SVN_SILENT made messages (.desktop file) 2013-11-11 04:02:51 +00:00
David Faure
57ff76150e Fix cmake warnings due to LINK_INTERFACE_LIBRARIES, use PUBLIC/PRIVATE instead. 2013-11-10 20:45:23 +01:00
l10n daemon script
71e40e7c60 SVN_SILENT made messages (.desktop file) 2013-11-10 04:15:39 +00:00
l10n daemon script
2292546afa SVN_SILENT made messages (.desktop file) 2013-11-09 03:56:22 +00:00
Marco Martin
a82aa1d630 Merge branch 'mart/sidebarTabbox' 2013-11-08 11:01:10 +01:00
Marco Martin
2d66e7c8a0 fix keyboard navigation 2013-11-08 10:01:24 +01:00
Martin Gräßlin
fb936a7082 [appmenu] Change dbus connection information for kappmenu
Need to change it anyway due to kded becoming kded5 and following
the suggestion by afiestas directly renaming to not use the kded
service.

Service: org.kde.kappmenu
Path: /KAppMenu
2013-11-08 09:30:08 +01:00
Martin Gräßlin
c277419554 Set location of Dialog to Floating to prevent slide animation 2013-11-07 14:29:44 +01:00
Martin Gräßlin
17553e5a1f Work around problem of restored QQuickWindows not being visible
A declarative KWin script needs to register the QQuickWindows it is
using in the KWin object. This method ensures that the QQuickWindow
will destroy the platfrom window once it gets hidden. So the next
time the QQuickWindow is shown a new platform window is created.

As can be seen in the OSD this is not really nice, therefore a
KWin.Dialog should be created which takes care of these steps.
2013-11-07 14:10:35 +01:00
Martin Gräßlin
d7a3a497d1 Adjust DesktopChangeOSD to QtQuick 2.0
The OSD does not yet work properly, though. It exposes the problem
that the window is broken once it got hidden.
2013-11-07 10:35:26 +01:00