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
oxygenexceptionlistwidget: better check index validity in "edit" method. Also update buttons status after removing items, since
apparently selectionChanged signal is not sent by Qt.
CCBUG: 309388
Disable animations till the decoration is completel loaded. This
ensures that the buttons do not flicker because of the animation from
black to their respective color.
A component has the advantage that the width property can depend from
other properties. This does not work with the previous on the fly
construction as the width does not update when the referenced property
changes.
This build option is added to make it easier to build just KWin without
kde-workspace. This is a common requirement by developers wanting to
contribute to KWin and only want to build KWin but use everything else
from their normal distribution.
Building KWin standalone is very often difficult due to Oxygen. If the
library has changed it is not possible to build just KWin without also
building the workspace libs and if you do so you run into ABI problems
when trying to start KWin - either the decoration or the style is
crashing due to not matching libraries.
To circumvent this common issue for new developers this build option
is introduced to just exclude the Oxygen window decoration and defaulting
to Plastik.
Of course by default this option is turned ON, so that the Oxygen
decoration gets build. By default there is no change at all.
REVIEW: 106303
In the maximized state the enabled borders were still enabled causing
the actual borders to be still shown. In addition the padding is not
adjusted to be 0. This is done in the C++ part is it does not make any
sense to have shadows being thrown to another screen for a maximized
window.
REVIEW: 106576
BUG: 307365
FIXED-IN: 4.9.2
using color.rgba() for an invalid color corresponds to solid black, which in turns conflicts with the cache
value for such color. We use "transparent black" instead.
CCBUG: 304868
using color.rgba() for an invalid color corresponds to solid black, which in turns conflicts with the cache
value for such color. We use "transparent black" instead.
CCBUG: 304868
Adding a KConfigXT xml file and an ui file to configure the QML
variant of Plastik.
Currently supported options:
* title alignment
* title shadow
* animation of buttons
Missing option:
* colored borders
For each theme the setting can be enabled individually with the
default being enabled by default. It is completely handled
inside the MenuButton QML component so each QML theme benefits
from the option automatically, too.
BUG: 301327
FIXED-IN: 4.10
REVIEW: 106160
The Plastik decoration buttons are provided by a declarative
extension plugin as the canvas drawing API would be needed to
draw these buttons. This should be changed with Qt 5.
But it's also a nice example to show how a QML based decoration
can have an extension in C++.
When the decoration is reset a signal is emitted that the config
might have changed which the decoration can connect to for
reloading its configuration. For this an invokable method is
added to Aurorae allowing to read a config value which just
returns the QVariant.
Proper support for border sizes are added by providing the enum
in DecorationOptions, so that QML themes can use the enum values
to decide which border size to use.
The kcm is adjusted to also support these config mechanisms and
to properly load and save the border sizes for QML based themes.
On change of theme recreate all decorations and create a new
declarative engine and component which is basically a re-init
of the Factory.
There are too many differences between themes - especially when
switching between an old SVG based Aurorae and a new QML based
Aurorae theme.
The generic QML components from Aurorae are split out into an
own declarative plugin. In addition two new helper classes are
added to this plugin:
* A ColorHelper to map a few function of KColorSheme and making
it possible to actually work with colors in QML. The need
emerged from trying to port Plastik to QML which makes strong
use of color shading.
* A DecorationOptions class which is a wrapper around KWin's
KDecorationOptions but in a more useable way for QML. The
various options are provided as properties and the value of
the properties changes automatically depending on whether the
decoration is active or inactive.
Aurorae itself is not yet adjusted to these changes, but it
should also be adjusted as some of the options are currently
exported in the factory and the factory is injected into the
Aurorae QML decoration.
The result of maximizing a window might be the decoration
going away. Because of that we need to delay the handling of
maximize and title bar double click by one cycle as had been
done for other close operations in 0fea5325
BUG: 304870
FIXED-IN: 4.9.1
REVIEW: 105961
Accepting the mouse events breaks moving the window by dragging
the title bar. The reason is that it eats the mouse event and
by that never reaches KWin core to perform the movement.
Other mouse buttons need to be accepted for handling the window
operations. Also we need to listen in general to left mouse
button for the double click operation.
BUG: 304249
FIXED-IN: 4.9.1
REVIEW: 105784
Unfortunately QtQuick 1 does not provide a way to receive Wheel
events. But the window decoration needs to pass wheel events on
the titlebar to KWin core.
In order to process also Wheel Events in Aurorae an event
filter is installed on the widget and in case the mouse positon
is on the title bar the titlebarMouseWheelOperation is invoked.
BUG: 304248
FIXED-IN: 4.9.1
REVIEW: 105801
This is an issue we already had in the past with Aurorae. When
closing a window the graphics scene crashes because the deco
gets destroyed before the code in the graphics scene finished
the execution.
With the port to QML this seemed to be fixed unless as it turns
out it throws an XIO error on closing:
fatal IO error 11 (Resource temporarily unavailable) on X server ":0"
This can be triggered using glxgears. Closing glxgears would
reliable crash Aurorae. To circumvent this issue we have to
delay the close by one event cycle using QMetaObject's
invokeMethod with a Qt::QueuedConnection.
This has also to be done in the useractions menu as the menu
is still open when the window closes causing the same problem
inside Aurorae.
BUG: 303450
FIXED-IN: 4.9.0
Reviewed-By: Thomas Lüking
According to Nuno it's much better to define the animations in
a Behavior element as that is together with the element which
gets animated.
Also he recommends to not use states but just property binding
for the properties which are animated in the Behavior.
And I must admit that this produces cleaner code, though the
conditions are now scattered all over the source code and not
nicely put together in one state section. Let's just hope I got
the logic right.
Well seems like it is useful to go to a QML training, at least
it made me aware of my State definitions are not good and then
talking to Nuno and giving a try to his recommendations.
REVIEW: 105426
Option is called "CloseFromMenuButton"
It is false by default.
To turn it on, add
CloseFromMenuButton=true
in [Windeco] section of $HOME/.kde4/share/config/oxygenrc.
Note that it results in poor usability of the menu button, if enabled.
CCBUG: 301237
Static getters for each default value added which are used in
ctor to initialize the class members and in the load for
readEntry's default value.
REVIEW: 104994
The unescaped tags are interpreted as HTML by Aurorae decorations
and the KWin killer. Escaping the tags ensures that the text is not
rendered incorrectly.
BUG: 293657
FIXED-IN: 4.9.0
REVIEW: 104989
The general idea is: single click opens menu, double click closes
the window. The problem is that the when the menu is opened after
the single click, the menu will eat the second click. So double
click will not work.
This commit brings back the workaround from Aurorae2. The clicked
event is not used at all, but we start a timer on the press event
with the doubleClickInterval. If no double click appears during the
interval we open the menu, if there is a double click we close the
window.
The downside of this approach is that there is a slight delay between
clicking the menu button and the menu appearing. For that the right
click behavior is unchanged. That is right clicking opens the menu
instantly and double click to close it, is broken.
Buttons are exported as a global "options" in the factory.
Additionally the theme's buttons are also exported. The thme decided
based on the custom button positions property which one to use.
In the kcm the button options are also exported.
Each decoration gets a graphicsview and scene instead and a declarative
item is created for each decoration.
There's probably still room for improvments. E.g. never render the
scene onto the widget but directly into the textures?
Switches to the explicit maximized decoration element and animates
the button groups and caption.
Legacy support for just the centered element is still missing. Unsure
if it should be added or if it makes sense to break compatibility here.