Commit graph

55 commits

Author SHA1 Message Date
Aleix Pol
d8fea66396 Add missing include 2014-03-18 18:24:44 +01:00
Martin Gräßlin
5e1dc24bf7 [kwin/libkdecoration] Drop unused include from kdecoration.h 2014-03-18 14:36:07 +01:00
Martin Gräßlin
f74df28450 [kwin] Use KPluginTrader and json metadata to find KDecorations
* A KDecoration needs to include json metadata
* A KDecoration needs to be installed to kwin/kdecorations
* Aurorae and Oxygen adjusted
* kcmdeco locates all decorations through the KPluginTrader
* libkdecoration uses KPluginTrader to find the plugin
* config plugins also need to include json metadata with
  X-KDE-PluginInfo-Name being the same as the decoration
* config plugins need to get installed to kwin/kdecorations/config
* kcmdeco locates the config plugin for a deco through the name
  and KPluginTrader

REVIEW: 116765
2014-03-17 07:41:14 +01:00
Martin Gräßlin
aee20b4a5a Hide the OnAllDesktops button if there is only one virtual desktop
In KCommonDecoration the OnAllDesktops button gets hidden or shown
depending on the number of desktops. For that KDecoration is extended
by a new property which delegates to the bridge to return whether
onAllDesktops is available. In KWin Core this is implemented using
the number of desktops.

FEATURE: 321611
FIXED-IN: 5.0.0
REVIEW: 116076
2014-03-05 13:02:32 +01:00
Martin Gräßlin
b3d3c45149 Use KPluginLoader to load our decoration plugins
This simplifies the plugin loading. Decorations just have to use
K_PLUGIN_FACTORY to specify how the KDecorationFactory needs to be
created. The KWIN_DECORATION macro is adjusted to generate the
boiler plate code, but it now needs to specify the name for the
pluginfactory and the KDecorationFactory.

This also transits the decoration abi version check to use
K_EXPORT_PLUGIN_VERSION which also simplifies the loading.

As a result the complete canLoad handling in DecorationPlugins is
removed.

REVIEW: 115930
2014-03-03 13:55:52 +01:00
Jacob Logan
199ed87c61 [libkdecorations] Generate an export header
REVIEW: 114247
2013-12-05 10:00:46 +01:00
Martin Gräßlin
23a510c0b5 [kdecorations] Add a ::palette() to the decoration API
The ::palette() in KDecoration and KCommonDecoration returns the
QPalette the decoration should use for the decorated window. The
call delegates into the bridge and KWin core might provide a special
QPalette for a given Client depending on the _KDE_NET_WM_COLOR_SCHEME
property.
2013-11-25 09:44:23 +01:00
Martin Gräßlin
b73d90cf78 [kdecorations] Introduce an enum for decoration buttons instead of characters
A new enum is introduced which defines all the buttons known to KWin.
The defaultTitleButton methods return a list of DecorationButtons instead
of a string which needs to be parsed by the decoration. The same for the
actual title buttons. The reading/storing of the buttons is unchanged,
that is the same characters are used and mapped to the button types.
2013-11-14 09:41:52 +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
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
9aeebb179f Move static KDecorationOptions* to KDecorationOptions
No idea why it was in KDecoration in the first place, but creation
and deletion is done in KDecorationOptions. So it clearly belongs
there.
2013-09-12 09:27:39 +02:00
Martin Gräßlin
f0e8f5ee64 Move factory to d-ptr class KDecorationPrivate 2013-09-12 09:27:39 +02:00
Martin Gräßlin
7c1a7f46d8 Move QWidget* data member to d-ptr class KDecorationPrivate 2013-09-12 09:27:39 +02:00
Martin Gräßlin
0aa9594608 Move bridge into d-ptr class KDecorationPrivate 2013-09-12 09:27:39 +02:00
Martin Gräßlin
014910ffe5 Un-inline methods in k(common)decoration headers
Makes Krazy more happy and allows us to change the implementation.
E.g. the one in KCommonDecoration should use a d-ptr.
2013-09-12 09:27:39 +02:00
Martin Gräßlin
8d4e2a630f Drop no longer needed emitKeepAbove/BelowChanged from KDecoration
Not called from anywhere and marked as remove Qt5.
2013-09-12 09:27:39 +02:00
Martin Gräßlin
c5e60a7ce8 Add properties for keepAbove/Below to KDecoration
For consistency two new changed signals are introduced without any
argument and the old signals are marked as deprecated.
2013-09-12 09:27:39 +02:00
Martin Gräßlin
7aadeaa310 Add maximized property and changed signal to KDecoration
Replaces the pure virtual method which the Decoration had to
implement. Instead the Decoration can now connect to the signal.

For KCommonDecoration there is no change at all except that the
invoked method is turned into a slot.

The property is of type bool and maps to isMaximized and not to
maximizeMode.
2013-09-12 09:27:39 +02:00
Martin Gräßlin
c918f40a77 Introduce a convenience method isMaximized in KDecoration
Returns true in case of fully maximized, false otherwise. By that
it ignores the horizontal and vertical modes.
2013-09-12 09:27:39 +02:00
Martin Gräßlin
22e4476777 Add icon property and changed signal to KDecoration
Replaces the pure virtual method which the Decoration had to
implement. Instead the Decoration can now connect to the signal.

For KCommonDecoration there is no change at all except that the
invoked method is turned into a slot.
2013-09-12 09:27:39 +02:00
Martin Gräßlin
63bb36e2ad Add shade property and changed signal to KDecoration
Replaces the pure virtual method which the Decoration had to
implement. Instead the Decoration can now connect to the signal.

For KCommonDecoration there is no change at all except that the
invoked method is turned into a slot.
2013-09-12 09:27:39 +02:00
Martin Gräßlin
fd64a29f72 Add desktop property and changed signal to KDecoration
Replaces the pure virtual method which the Decoration had to
implement. Instead the Decoration can now connect to the signal.

For KCommonDecoration there is no change at all except that the
invoked method is turned into a slot.

Also isOnAllDesktop property is added using the same changed
signal as desktop property.
2013-09-12 09:27:39 +02:00
Martin Gräßlin
29bce13e9f Add caption property and changed signal to KDecoration
Replaces the pure virtual method which the Decoration had to
implement. Instead the Decoration can now connect to the signal.

For KCommonDecoration there is no change at all except that the
invoked method is turned into a slot
2013-09-12 09:27:39 +02:00
Martin Gräßlin
e1c4512ccc Add active property and changed signal to KDecoration
Replaces the pure virtual method which the Decoration had to
implement. Instead the Decoration can now connect to the signal.

For KCommonDecoration there is no change at all except that the
invoked method is turned into a slot.
2013-09-12 09:27:39 +02:00
Martin Gräßlin
70aafe08b5 Drop the KDecorationDefines::Settings* enum
No longer needed as the reset method is gone.
2013-09-12 09:27:38 +02:00
Martin Gräßlin
d10a31750e Drop reset method from K(Common)Decoration
For the only remaining update flag a dedicated signal is added to
KDecoration.
2013-09-12 09:27:38 +02:00
Martin Gräßlin
d29b9bf03a Introduce a compositingChanged signal in KDecorationOptions
Connected from a signal in DecorationPlugins in KWin core replacing
the previous reset method.
2013-09-12 09:27:38 +02:00
Martin Gräßlin
d403bfcadb Make KDecorationOptions::updateSettings protected
Only called from KWin::Options, so no need to have it public.
2013-09-12 09:27:38 +02:00
Martin Gräßlin
ad85c6bc99 Introduce changed signals in KDecorationOptions
For this KDecorationOptions becomes a QObject. The changed flags from
updateSettings are removed. Instead the method just emits the proper
changed signals.

This should allow better handling in the Factories.
2013-09-12 09:27:38 +02:00
Martin Gräßlin
c2fdc66cee Remove pure virtual updateSettings from DecorationOptions
Not really needed as it's only invoked from inside KWin core to the
Options class.
2013-09-12 09:27:38 +02:00
Martin Gräßlin
a90072d753 Merge KDecorationUnstable into KDecoration
Also KCommonDecorationUnstable is merged into KCommonDecoration.
2013-09-12 09:27:38 +02:00
Martin Gräßlin
afcf6dbc41 Remove deprecated functionality from libkdecorations 2013-09-12 09:27:37 +02:00
Martin Gräßlin
c2e0c13b7b Delay performWindowOperation to next event cycle in UserActionsMenu
In case that the window operation results in destroying the window
decoration we need to have the menu closed before the deco gets
destroyed. Otherwise Qt crashes.
2013-08-19 12:15:42 +02:00
Hugo Pereira Da Costa
62ca3fcbe1 Qt::WFlags -> Qt::WindowFlags
REVIEW: 111933
2013-08-07 13:53:11 +02:00
Martin Gräßlin
4022de7075 Use signal/slots instead of deep function calls into decoration
For all the decoration updates called from Client into the decoration we
also have a signal being emitted. So turning the pure virtual public
functions into slots means we can just connect our existing signals and
get rid off the deep function calls.

The keepAbove/Below signals are changed to take a boolean argument as
needed by KDecoration and a few emitted signals are moved to a better
fitting location.

REVIEW: 110335
2013-05-07 16:53:58 +02:00
Thomas Lübking
6fb5353cab remove moveResizeMaximized option
REVIEW: 103948
BUG: 91703
BUG: 299245
FIXED-IN: 4.11

- The setting is ignored, the decoration always gets a "true" for it
- moving a maximized window requires breaking a "strong" snap (1/16 of screen height - unless you use quick maximization)
- all snapping is done towards the client, not the frame
- QuickTileMode is exported to the decoration (just as the maximizeMode) so that it can fix the bordersize alongside that.
2013-03-24 22:26:48 +01:00
Martin Gräßlin
e107910b30 KDecorationBridge becomes private again
With 4933f08ae49328e36e2654434d28917310882ee5 the KDecorationBridge
interface became public to allow Compiz to easily implement the class.

From a KWin perspective this change did not make much sense. The Bridge
is meant to be the interface towards KWin. It is an internal interface
and exporting it doesn't change the fact that it is internal.

The change got introduced in a time when it was still common to use
Compiz in the kde-workspaces. This has changed. None of the top ten
distributions on distrowatch are shipping the integration parts of Compiz
in an up to date version. Most distros are still on Compiz 0.8, which
requires manual patching to keep up with changes in the decoration API.
Distros on Compiz 0.9 are not shipping the KDE integration - this
includes Ubuntu.

Given this development it is no longer justified to have additional work
on KWin side and because of that the API which should be internal is
marked as internal again.

In case Compiz is still interested in providing the kde-window-decorator
the header file can easily be pulled from our repository. In addition
this patch includes a method
int decoration_bridge_version()
which returns the current bridge API version. Kde-window-decorator can
resolve this method and verify that the version is not higher than what
is supported. The version number is provided in kdecoration.h by the
define KWIN_DECORATION_BRIDGE_API_VERSION. We will increate the version
number once per release in case the bridge changed. 4.11 will have the
version number 1.

This change in behavior has been discussed and agreed in [1].

The change also unexports KDecorationBridgeUnstable. This class should
have never been exported, it was incorrect and the parent class had not
been exported anyway. This is just a note to indicate that it is not an
ABI break and there is no reason to increase the so number.

[1] http://lists.kde.org/?l=kwin&m=136335502805911&w=2

CCMAIL: compiz@lists.freedesktop.org
CCMAIL: dev@lists.compiz.org

REVIEW: 109536
2013-03-22 09:09:48 +01:00
Martin Gräßlin
ab88d8e3b0 Include kwinglobals in kdecoration.h for KWIN_EXPORT
No need to define it twice in KWin.
2013-03-07 13:59:16 +01:00
Martin Gräßlin
32b6ef42b9 Strip module path from all Qt #include <>
Done with:
fixqt4headers.pl --strip-modules

REVIEW: 109176
2013-03-06 10:26:56 +01:00
Martin Gräßlin
6acae45205 Support for new decoration border sizes BorderNoSides and BorderNone
BorderNoSides is what is known from Oxygen as "No Side Borders". The name
should indicate that there is only a border at the bottom. BorderNone is
a mode with no borders at all.

The new enums are added to KDecoration and the KCM so that all decos can
make use of it.

Aurorae is adjusted to support the new sizes for QML themes (it breaks
the old svg based themes) and Plastik makes use of it, by rendering a
one-pixel border around the window, which illustrates that it's still up
to the decoration to decide how to make use of the setting.

REVIEW: 108164
2013-01-15 15:07:22 +01:00
Thomas Lübking
d6d82b2a08 unlink ExtendedBorderRegion from unstable API
also fix initial mapping state

BUG: 307721
BUG: 308994
FOXED-IN: 4.10
REVIEW: 106715
2012-11-14 21:11:36 +01:00
Cedric Bellegarde
53ae2b91e2 GUI: Kwin appmenu support:
- Add support for application menu button in Kwin
- Add kded appmenu configuration in kcm_style
2012-11-09 13:44:50 +01:00
Martin Gräßlin
9308028fa4 Decoration can announce whether it currently requires an alpha channel
A decoration can provide the AbilityAnnounceAlphaChannel in addition to
AbilityUsesAlphaChannel. If this ability is provided the decoration can
enable/disable the use of the alpha channel through setAlphaEnabled().

The base idea behind this mechanism is to be able to tell the compositor
that currently alpha is not needed. An example is the maximized state in
which the decoration is fully opaque so that there is no need to use the
translucency code path which would render all windows behind the deco.

In addition also the blur effect honors this setting so that behind a
known opaque decoration no blurring is performed.

Oxygen is adjusted to disable translucency in maximized state and Aurorae
is adjusted to allow themes to enable/disable translucency. For Plastik
translucency and with that also blurring is disabled.

REVIEW: 106810
2012-11-09 10:36:43 +01:00
Martin Gräßlin
8bfffed27d Deprecate KDecoration's AbilityColor
Nobody is interested in whether the Abilities are supported.
There is one method in KWin core checking for the colors
supported by the currently loaded decoration:
Workspace::decorationSupportedColors

This method is not called from anywhere inside KWin, but is
part of the D-Bus interface, though nobody in KDE's repository
is calling it [1].

As it is part of public API the Abilities are only deprecated
and scheduled for removal with the next big break.

[1] http://lxr.kde.org/search?filestring=&string=decorationSupportedColors

REVIEW: 105785
2012-09-07 07:33:39 +02:00
Martin Gräßlin
a394fade64 Remove Tiling support from KWin
As discussed on the mailinglist [1] the tiling support is
removed from KWin. The main reasons for this step are:
* it is unmaintained
* it is a mode not used by any of the core KWin team
* original developer said at Akademy 2012 that he is not
  interested in picking up the work again
* tiling has quite some bugs, e.g. multi screen not supported
* is conflicting with other concepts in KWin, e.g. activities

There is ongoing work to get tiling supported through a KWin
script, which is a preferred way as it does not influence the
existing C++ code base.

[1] http://lists.kde.org/?l=kwin&m=133149673110558&w=2
BUG: 303090
FIXED-IN: 4.10
REVIEW: 105546
2012-07-14 11:18:06 +02:00
Thomas Lübking
2c65b718d3 restore stable kdecoration API to 4.8
BUG: 301728
FIXED-IN: 4.9rc2
REVIEW: 105377
2012-07-05 19:43:45 +02:00
Thomas Lübking
e2553bd842 add deco API versioning support
REVIEW: 104978
BUG: 299141
FIXED-IN: 4.9
2012-05-17 23:26:43 +02:00
Thomas Lübking
85635dd485 fix tabbing
BUG: 290959
BUG: 265160
BUG: 229292
BUG: 238279
BUG: 290758
BUG: 222831
BUG: 278275
BUG: 245747
BUG: 230000

BUG: 253697
BUG: 230570
BUG: 265977
BUG: 225337
BUG: 225339

REVIEW: 103855
2012-02-11 16:30:22 +01:00