Instead of looping over every quad for every grid cell and checking
for possible intersections, loop over the quads once and compute
the top left corner of the first intersecting grid cell. Then loop over
all the intersecting cells from that point and create the sub quads.
This new algorithm also preserves the order of the quads in the
original list.
NOBODY should use org.kde.kded5 but instead directly the service
register by its own modulem, but for now let's just switch to .kded5
so we can get this running fast.
There is a check in Client::buttonReleaseEvent() for the state of the
mouse buttons compared to the button masks for button 1, 2, 3 (X11
button indices).
The check was:
if ((state & (Button1Mask & Button2Mask & Button3Mask)) == 0) { ... }
<=> if (state & 0 == 0) <=> if (true)
This change assumes what the check was supposed to be and fixes the problem. The correct fix was proposed by Thomas.
REVIEW: 113359
Only needs:
* Qt5::DBus for the communication with color correction
* Qt5::X11Extras for access to XCB, pulls in needed Qt5::Gui
* XCB component XCB for xcb calls in kwinglobals.h
It's basically a run of the port-cmake.sh script in here, mostly the changes
are the following:
- Using KF5::* targets
- Using the proper macros, following recent developments in frameworks
Defines the DecorationButton type in DecorationOptions (needs to be
re-defined due to QML limitations) and exports the buttons as a
QList<int> property (again QML limitations).
All QML files are switched from string to the new enum type.
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.
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.
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.
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.
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.
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.
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.
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!
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.
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.