Commit graph

2590 commits

Author SHA1 Message Date
Martin Gräßlin
76efe517a7 Turn built-in effects into a library kwin links against
As all effects have always been compiled into the same .so file it's
questionable whether resolving the effects through a library is useful
at all. By linking against the built-in effects we gain the following
advantages:
* don't have to load/unload the KLibrary
* don't have to resolve the create, supported and enabled functions
* no version check required
* no dependency resolving (effects don't use it)
* remove the KWIN_EFFECT macros from the effects

All the effects are now registered in an effects_builtins file which
maps the name to a factory method and supported or enabled by default
methods.

During loading the effects we first check whether there is a built-in
effect by the given name and make a shortcut to create it through that.
If that's not possible the normal plugin loading is used.

Completely unscientific testing [1] showed an improvement of almost 10
msec during loading all the effects I use.

[1] QElapsedTimer around the loading code, start kwin five times, take
average.

REVIEW: 115073
2014-01-24 14:13:59 +01:00
Martin Gräßlin
daf0772c35 [kwin/backgroundcontrast] Fix shader on GLSL 1.10 code path
We need to use the varying_in/out variables, the code was a little
bit too modern.

At the same time remove the identity matrix and replace it by mat4(1.0).

Note: the shader should probably go into glsl files as they are not
really generated.
2014-01-23 15:44:12 +01:00
Marco Martin
f2acaa2826 remove connect to nonexisting signal
slotWindowDeleted is not here anymore
2014-01-23 15:18:45 +01:00
Marco Martin
b7ded05596 fade out the effect if the window opacity is < 1 2014-01-23 14:47:49 +01:00
Marco Martin
65c3c4c1b4 remove paintEffectFrame implementation, add a FIXME 2014-01-23 14:47:49 +01:00
Marco Martin
3d9ddb0cf2 correctly take the matrix of floats
* use the atom, not XA_cardinal
* we never do this effect behind the decoration
2014-01-23 14:47:22 +01:00
Marco Martin
210f7d3eff reintroduce prepaintscreen
* work also without blur enabled
* try to pass only the 3 color parameters
2014-01-23 14:47:01 +01:00
Marco Martin
dabafc4988 simplify: remove prepaintwindow/screen
* update effect name
* remove unused variable
2014-01-23 14:46:13 +01:00
Marco Martin
4f2d2e469d no subclass for the shader
* get rid of the strength property
* this effect doesn't have config
2014-01-23 14:45:40 +01:00
Marco Martin
4036f179fc one single pass, get rid of cached version
* this effect is way cheaper than blur, don't cache it
* use its own atom
* also pass the matrix in the x property
* remove remnants of the cache
* do just a single pass
* get rid of config ui remnants
2014-01-23 14:44:49 +01:00
Marco Martin
3a4eb9a093 stub for the background contrast effect
* a copy of the blur shader to become a copy of the background contrast effect
* contrastshader actually doing the light modification
* don't expand/shrink the area
2014-01-23 14:44:00 +01:00
Martin Gräßlin
7a380fa343 Reduce timeout of startupfeedback to a sensible default
It's 2014 and we don't have to wait half a minute for an application
to start. In fact we mostly get false positives due to applications
not handling correctly startup notifications for already running
instances (e.g. click on link in email).

So let's reduce to a default which doesn't look like a broken setup.

REVIEW: 115046
2014-01-20 17:08:03 +01:00
l10n daemon script
22a5e1109f SVN_SILENT made messages (.desktop file) 2014-01-19 04:06:03 +00:00
Thomas Lübking
4bb88df714 Merge branch 'KDE/4.11' 2014-01-14 22:51:24 +01:00
Thomas Lübking
fac85516ad bind desktopPresenceChanged in scripted effects
translucency and dialogparent

BUG: 326903
FIXED-IN: 4.11.6
REVIEW: 114083
2014-01-14 22:24:09 +01:00
Martin Gräßlin
81ef314bdd SnapHelper effect supports QPainter compositing 2014-01-09 13:29:40 +01:00
Martin Gräßlin
0fdd7d3f7d Resize effect supports QPainter compositing 2014-01-09 13:29:40 +01:00
Martin Gräßlin
9cecbc0135 MouseMark effect supports QPainter compositor 2014-01-09 13:29:40 +01:00
Martin Gräßlin
2dc14be640 MouseClick Animation effect supports QPainter Compositor 2014-01-09 13:29:40 +01:00
Martin Gräßlin
57eb00977b ScreenEdge helper effect supports QPainter Compositing 2014-01-09 13:29:40 +01:00
Martin Gräßlin
16a82e5fa9 TrackMouse effect supports QPainter compositing 2014-01-09 13:29:40 +01:00
Martin Gräßlin
3776160bb7 ShowPaint effect supports QPainter Compositing 2014-01-09 13:29:40 +01:00
Martin Gräßlin
79358541ea ShowFPS effect supports QPainter Compositing 2014-01-09 13:29:40 +01:00
Christophe Giboudeaux
705173e1bb kdeclarative.h is not needed there 2014-01-02 19:20:42 +01:00
Martin Gräßlin
a4943bc0e3 [kwin/effects] Add links to effect videos
Videos for the following effects are added:
* Dim Inactive
* Dim Screen for Administration Mode
* Invert
* Looking Glass
* Magnifier
* Mouse Click
* Track Mouse
* Zoom

Link for Present Windows video fixed.
2013-12-22 15:23:48 +01:00
Martin Gräßlin
c06bf53dde [kwin/effects] Add video url to Cover- and FlipSwitch 2013-12-15 14:27:49 +01:00
Martin Gräßlin
4c08cf093c [kwin/effects] Add links to effect videos
For the following effects:
* cube
* cubeslide
* desktopgrid
* fade desktop
* magic lamp
* maximize
* minimize
* present windows
* slide
* wobbly windows
2013-12-13 09:58:31 +01:00
Martin Klapetek
54bc491c46 Port to KF5 renaming changes 2013-12-11 21:41:47 +01:00
Martin Gräßlin
73054577df [libkwineffects] Add a signal for screen count changed
Used in PresentWindows effect instead of QDesktopWidget.
2013-12-10 12:20:43 +01:00
Martin Gräßlin
145f0c096f [kwin/effects] Do not use KActionCollections for the global shortcuts
Most effects had a "collection" for one action. We don't need the
action collection, all it was used for is setting the object name.

With the removal of KActionCollection the effects do not need to link
XmlGui any more, though the dependency is still pulled in through
plasma.
2013-12-10 11:45:33 +01:00
Martin Gräßlin
c063978591 Adjust to new KGlobalAccel framework 2013-12-10 07:38:54 +01:00
l10n daemon script
d5e439aae0 SVN_SILENT made messages (.desktop file) 2013-12-08 06:36:10 +00:00
l10n daemon script
1bd3f7cb5c SVN_SILENT made messages (.desktop file) 2013-12-07 03:44:53 +00:00
Martin Gräßlin
2372e02752 [kwin] Use a QIcon in Client for the icons instead of Pixmaps
Client used to have dedicated methods for different icon sizes instead
of combining all pixmaps into one QIcon. This resulted in various parts
of KWin having different access to the icons:
* effects only got one pixmap of size 32x32
* decorations only got the 16x16 and 32x32 pixmaps combined into a QIcon
* tabbox could request all icon sizes, but only as pixmap

Now all sizes are available in one QIcon allowing to easily access the
best fitting icon in a given UI.
2013-12-06 14:41:23 +01:00
Martin Gräßlin
bad6b31a1c [kwin] effects no longer need to link KDE4Support 2013-12-06 07:51:30 +01:00
Martin Gräßlin
81edc75207 [kwin] Add a URL property to the kwineffects 2013-12-03 10:27:20 +01:00
l10n daemon script
5d61c2d942 SVN_SILENT made messages (.desktop file) 2013-12-03 07:11:43 +00:00
Jacob Logan
ac72e9fb73 Changed debug statements in kwin/effects from qDebug() to qCDebug(KWINEFFECTS)
A new .cpp file is added containing the declaration of the logging
category and compiled into the effects lib.

REVIEW: 114194
2013-11-29 08:47:56 +01:00
Aleix Pol
c7556d6992 kde4_add_plugin -> add_library(MODULE) 2013-11-27 16:11:14 +01:00
Aleix Pol
94f31606e6 CMake macros porting
kconfig_add_kcfg_files
qt5_add_dbus_adaptor
qt5_generate_dbus_interface
2013-11-27 16:11:14 +01:00
Thomas Lübking
26febda4a0 Merge branch 'KDE/4.11'
Conflicts:
	ksmserver/screenlocker/greeter/greeterapp.cpp
	ksmserver/screenlocker/greeter/greeterapp.h
	ksmserver/screenlocker/greeter/themes/org.kde.passworddialog/contents/ui/main.qml
	kwin/libkwineffects/kwineffects.cpp
	kwin/useractions.cpp
	plasma/desktop/applets/window-list/metadata.desktop
	plasma/desktop/containments/panel/plasma-containment-panel.desktop
	plasma/desktop/toolboxes/plasma-toolbox-paneltoolbox.desktop
	plasma/generic/wallpapers/color/plasma-wallpaper-color.desktop
2013-11-24 15:35:17 +01:00
Thomas Lübking
c003baee1e clamp timeline time for highlighted desktop
BUG: 327539
FIXED-IN: 4.11.4
2013-11-24 14:30:20 +01:00
l10n daemon script
1885a90393 SVN_SILENT made messages (.desktop file) 2013-11-24 06:42:15 +00:00
l10n daemon script
8484628fd0 SVN_SILENT made messages (.desktop file) 2013-11-24 04:09:32 +00:00
Martin Gräßlin
b7be3cb621 Better handling for making the compositing OpenGL context current
With QtQuick2 it's possible that the scene graph rendering context either
lives in an own thread or uses the main GUI thread. In the latter case
it's the same thread as our compositing OpenGL context lives in. This
means our basic assumption that between two rendering passes the context
stays current does not hold.

The code already ensured that before we start a rendering pass the
context is made current, but there are many more possible cases. If we
use OpenGL in areas not triggered by the rendering loop but in response
to other events the context needs to be made current. This includes the
loading and unloading of effects (some effects use OpenGL in the static
effect check, in the ctor and dtor), background loading of texture data,
lazy loading after first usage invoked by shortcut, etc. etc.

To properly handle these cases new methods are added to EffectsHandler
to make the compositing OpenGL context current. These calls delegate down
into the scene. On non-OpenGL scenes they are noop, but on OpenGL they go
into the backend and make the context current. In addition they ensure
that Qt doesn't think that it's QOpenGLContext is current by calling
doneCurrent() on the QOpenGLContext::currentContext(). This unfortunately
causes an additional call to makeCurrent with a null context, but there
is no other way to tell Qt - it doesn't notice when a different context
is made current with low level API calls. In the multi-threaded
architecture this doesn't matter as ::currentContext() returns null.

A short evaluation showed that a transition to QOpenGLContext doesn't
seem feasible. Qt only supports either GLX or EGL while KWin supports
both and when entering the transition phase for Wayland, it would become
extremely tricky if our native platform is X11, but we want a Wayland
EGL context. A future solution might be to have a "KWin-QPA plugin" which
uses either xcb or Wayland and hides everything from Qt.

The API documentation is extended to describe when the effects-framework
ensures that an OpenGL context is current. The effects are changed to
make the context current in cases where it's not guaranteed. This has
been done by looking for creation or deletion of GLTextures and Shaders.
If there are other OpenGL usages outside the rendering loop, ctor/dtor
this needs to be changed, too.
2013-11-23 10:54:41 +01:00
l10n daemon script
4abba66bf0 SVN_SILENT made messages (.desktop file) 2013-11-23 06:30:36 +00:00
l10n daemon script
551988ebd4 SVN_SILENT made messages (.desktop file) 2013-11-23 03:52:00 +00:00
Raul Fernandes
697180dda0 Avoids unnecessary searchs for info of the window
We already have the info variable. Why search for it again?
Patch reviewed in https://git.reviewboard.kde.org/r/113872/
2013-11-19 09:49:17 -02:00
Martin Gräßlin
9aca68cef1 [kwin/effects] Do not link Qt::Quick for the config modules
Not used.
2013-11-19 12:20:21 +01:00
Martin Gräßlin
ce674ed509 [kwin] Window -> xcb_window_t or WId 2013-11-18 13:57:46 +01:00