Commit Graph

12604 Commits (afcc8337de60c243748de9b595e2799593ffbc23)

Author SHA1 Message Date
Fredrik Höglund afcc8337de Add support for generating shaders at runtime
This adds new API in ShaderManager that makes it possible to request a
shader based on a set of traits. ShaderManager generates these shaders
on demand and caches them in a hash table.
2014-12-04 19:19:22 +01:00
Martin Gräßlin 623ac3faa3 [kcmkwin/deco] Fix defaults for border size and close window double click 2014-12-04 17:41:57 +01:00
Martin Gräßlin 6b7fd5b9bc [kcmkwin/deco] Only specify QStringLiteral("Normal") once 2014-12-04 17:41:18 +01:00
Martin Gräßlin dc9437e59a [kcmkwin/deco] Add a filter and a QSortFilterProxyModel 2014-12-04 17:35:08 +01:00
Martin Gräßlin 39f9581d4f Bring back configuration options for Decorations
* Border Sizes
* Close menu double click

Both are added to the Settings and exposed in the decoration kcm.
As it started to no longer scale the kcm uses a ui file.

Still missing:
* buttons
* custom decoration configuration
* GHNS
* search
2014-12-04 16:28:06 +01:00
Martin Gräßlin b5a626c2d7 Introduce a texture cache for DecorationShadows in SceneOpenGLShadow
The DecorationShadow supports the concept of sharing shadows between
multiple Decorations and this is supported by our Shadow class. But
still the created GLTextures were not shared.

This change introduces a sharing mechanismn for all GLTextures created
for a DecorationShadow. Thus if two decorations share the same
DecorationShadow they will also share the same GLTexture.
2014-12-04 10:36:19 +01:00
Fredrik Höglund 90dfb3ca8b Grow the persistently mapped VBO as needed
Reallocate the buffer when the average frame size is greater than half
the size of the buffer.
2014-12-03 19:50:59 +01:00
Fredrik Höglund 4b3fabbfc9 Add support for GL_ARB_buffer_storage
Use a persistently mapped buffer object for the vertex streaming buffer
when GL_ARB_buffer_storage is supported.
2014-12-03 19:50:59 +01:00
Martin Gräßlin ca27bc09c5 [aurorae] Use QQuickRenderControl if compiled against Qt 5.4
QQuickRenderControl brings a few advantages for the usage in Aurorae:
* can create an offscreen window
* eliminate the need for mutex as we control the rendering
* control the tear down of the QML scene (no more crashes in Qt)

In future we can further improve this, by sharing the context, so
that we can use the FBO texture directly. But this first needs
some more work in KWin core.

As we don't hard depend on Qt 5.4 yet it's using ifdefs. Once we have
Qt 5.4 the old code will be removed.
2014-12-03 16:22:15 +01:00
Martin Gräßlin f78ff8eaa5 Do not emit DecorationSettings::alphaChannelSupportedChanged on tear down
The Compositor is destroyed before the Client and Decorations are
destroyed on shutdown. This meant the Decorations reacted needlessly
on the alpha channel supported. E.g. Aurorae recreated the Decoration
and most likely crashed in Qt.

With this change the signal gets disconnected and the Decorations
just don't do anything.
2014-12-03 13:10:35 +01:00
Martin Gräßlin c815775a0e [aurorae] Better specify y value of titleBar
It uses the borderBottom now to have at least an as large resize
border as at the bottom. This still needs improvement.
2014-12-03 12:09:24 +01:00
Martin Gräßlin 13dcafab42 Delay decoration repaint to end of event cycle on create
When a Client gets created the ::createDecoration method is invoked
from ::manage which is called before the Client is added to the
ClientList in Workspace. Thus processing the update fails in the
DecorationBridge as it cannot find the Client.

By delaying to the end of the event cycle we can be sure that the
Client is completely managed and that the scheduled repaint doesn't
fail.

This fixes the missing repaint when a Client starts as inactive.
2014-12-03 08:28:41 +01:00
Martin Gräßlin ac664d8455 Delete libkdecorations
Not used anywhere in kwin any more.
2014-12-02 15:29:21 +01:00
Martin Gräßlin 63695e6fc3 Remove unused imports 2014-12-02 15:26:42 +01:00
Martin Gräßlin 0646c58fe2 [kcmkwin/kwindecoration] Exclude buttons.cpp and configdialog.cpp from build
With that we should not have anything pulling in kdecoration.h
2014-12-02 15:21:15 +01:00
Martin Gräßlin d81e5697bf Ensure that the X11Renderer doesn't render after reparente to Deleted 2014-12-02 14:13:28 +01:00
Martin Gräßlin 4c9744fe8e Drop dependency on kdecoration.h 2014-12-02 13:50:26 +01:00
Martin Gräßlin 3d9a035312 Move MaximizeMode from KDecorationDefines to utils.h
Unfortunately it cannot be a enum defined in Client as client.h
depends on rules.h and with it in Client rules.h would depend on
client.h.
2014-12-02 13:49:08 +01:00
Martin Gräßlin 50019b4a31 Drop kdecoration.h include from placement.cpp 2014-12-02 11:48:51 +01:00
Martin Gräßlin 763a976c39 Drop kdecoration.h include from tabgroup.h 2014-12-02 11:48:13 +01:00
Martin Gräßlin 1747fde18b Toplevel does not inherit from KDecorationDefines any more
As an intermediate step Client inherits from KDecorationDefines.
2014-12-02 11:31:07 +01:00
Martin Gräßlin 6abf115d22 Drop kdecoration.h include from options.h 2014-12-02 11:19:40 +01:00
Martin Gräßlin d4e2f19ef0 Workspace does not need to inherit from KDecorationDefines 2014-12-02 11:17:43 +01:00
Martin Gräßlin fa4332754c Move Position from KDecorationDefines to Client 2014-12-02 11:15:54 +01:00
Martin Gräßlin e38d56b0dd Move QuickTileMode from KDecorationDefines to Client 2014-12-02 10:52:16 +01:00
Martin Gräßlin d4bf3602ce Move WindowOperation enum to Options
With this Options no longer needs to inherit from KDecorationDefines.
2014-12-02 10:41:47 +01:00
Martin Gräßlin b9fb7df15a Do not use KDecorationDefines in Aurorae 2014-12-02 10:31:16 +01:00
Martin Gräßlin f5c305bf64 Do not include kdecoration.h in plastik decoration plugin 2014-12-02 10:15:04 +01:00
Martin Gräßlin 4188736bc4 Stop building libkdecorations
Some defines are still used, so it's not yet deleted.
2014-12-02 09:58:29 +01:00
Martin Gräßlin 93f414a070 Options no longer inherits from KDecorationOptions 2014-12-02 09:51:52 +01:00
Martin Gräßlin cb38028d98 Move maximize button click config to Options
In order to drop dependency on KDecorationOptions.
2014-12-02 09:43:24 +01:00
Martin Gräßlin c2e53b9a2f Merge branch 'kdecorations2'
Conflicts:
	effects.cpp
	paintredirector.cpp
2014-12-02 08:38:10 +01:00
Martin Gräßlin 106e595709 DecorationSettings provides QVector for decorationButtons 2014-12-01 11:53:44 +01:00
Martin Gräßlin 40ce3e4ce3 [autotests] Give Xephyr more time to startup
The test is flaky during the wait for Xephyr. Giving it more time should
hopefully make it more reliable.

The better way would be to switch to the command line argument
-displayfd pipeFd

unfortunately the Xephyr on the CI system does not yet support this
command line argument.
2014-12-01 10:53:40 +01:00
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
Thomas Lübking 50cbe810f5 don't access array to check whether ptr is nullptr
Also unify with the below check whether array[0] is 0
(Was same condition and same branch)

BUG: 341010
2014-11-27 20:01:10 +01:00
Thomas Lübking 7747a38189 step into the focus chain at the beginning
if the index is 0, we close the circle, but if the
index is -1 (invalid) we're "somewhere" and step
into the focus chain - reasonably at the beginning

BUG: 340594
REVIEW: 121024
2014-11-27 20:01:10 +01:00
Thomas Lübking b26ef9302a don't restore unrestorable window sizes on Q'unmax
BUG: 340600
REVIEW: 121022
2014-11-27 20:01:10 +01:00
Thomas Lübking ec8f7e1fac ensure disjunct screenedges on overlapping screens
If two or more screens overlap (partially or fully)
we must not create double edges since kwin would
trigger both - since they've the same actions bound
(for sure) the action will called twice (so either
eg. toggle or skip one VD etc.)

BUG: 338381
REVIEW: 120060
2014-11-27 20:01:10 +01:00
Martin Gräßlin 66df3eefdf Cleanup: reduce usage of QDesktopWidget 2014-11-27 09:32:43 +01:00
Martin Gräßlin bf4ba54647 Remove displayWidth and displayHeight from the compositor
Instead of getting size from displayWidth() and displayHeight() use
the information we have from Screens. This means there is only one
place to have the information and by that we can ensure that all
components use the same data to rely on. displayWidth/displayHeight
seem to provide the wrong information when unplugging an output
without disabling the output. This results in rendering artefacts.
But KWin::Screens has the correct information available.
2014-11-27 09:00:19 +01:00
Martin Gräßlin cc98c5d9c7 Use screens()->geometry() in Workspace::desktopResized
It used to get the individual screen geometries from QDesktopWidget.
We don't need to go through QDesktopWidget any more as Screens
contains all the information we need in a more reliable way.
2014-11-27 09:00:19 +01:00
Martin Gräßlin 2eb876743c [screens] Replace DesktopWidgetScreens by XRandRScreens
A new implementation of the Screens interface is added which uses XRandR
directly instead of relying on QDesktopWidget. The implementation is
provided in a new implementation file screens_xrandr.cpp.

XRandRScreens comes with a unit test. Unfortunately it's rather difficult
to provide a proper unit test against XRandR. Xvfb (which is obviously
used on the CI system) doesn't provide the XRandR extension. Also on a
"normal" developer system one would not want to just execute the test as
the results are not predictable (number of available outputs?) and the
test would mess up the setup resulting in nobody wanting to execute the
test.

As a solution to both problems the unit test starts Xephyr as a nested
X server. This allows to have at least some limited tests against XRandR.
Nevertheless there are a few things which I was not able to test:
* multiple outputs
* no output at all

The nested X Server approach makes the interaction rather complex. Qt
opens it's connection against the main X Server thus QX11Info provides
a wrong connection and also KWin::connection() which is heavily used by
xcbutils and thus all the RandR wrappers have the wrong connection. To
circumvent this problem the test is GUILESS. In case it would call into
any code using QX11Info, it would probably either runtime fail or crash.

REVIEW: 117614
2014-11-27 09:00:19 +01:00
Martin Gräßlin 6d64113ed4 Do not include utils.h in xcbutils.h
Only needed for ScopedCPointer which can be defined in both utils and
xcbutils.h.

Not having utils.h in xcbutils.h makes it easier to have unit tests use
xcbutils.h as it removes the dependencies.
2014-11-27 09:00:19 +01:00
Fredrik Höglund 9d01ed16be Remove GLTexturePrivate::bind()/unbind()
These virtual methods are not reimplemented anywhere.
2014-11-26 22:01:54 +01:00