Commit graph

378 commits

Author SHA1 Message Date
Martin Gräßlin
5ea990a740 Export global pointer shortcuts to effect system and use it for cube
Used in cube effect as an example with hard coded ctrl+alt+left click.

BUG: 163121
2014-03-19 14:14:56 +01:00
Martin Gräßlin
b57885a1bf Add registerGlobalShortcut method to kwineffects
Implemented in KWin core to forward to new global shortcut system. This
method should be extended/changed once we go to Qt5/KF5 to make the usage
easier (no more KAction).

Each global shortcut in the effects makes use of this new method.
2014-03-19 14:14:56 +01:00
Martin Gräßlin
6baf794f88 InputRedirection for keyboard events
Major new functionality is xkbcommon support. InputRedirection holds an
instance to a small wrapper class which has the xkb context, keymap and
state. The keymap is initialied from the file descriptor we get from the
Wayland backend.

InputRedirection uses this to translate the keycodes into keysymbols and
to QString and to track the modifiers as provided by the
Qt::KeybordModifiers flags.

This provides us enough information for internal usage (e.g. pass through
effects if they have "grabbed" the keyboard).

If KWin doesn't filter out the key events, it passes them on to the
currently active Client respectively an unmanaged on top of the stack.
This needs still some improvement (not each unmanaged should get the
event). The Client/Unmnaged still uses xtest extension to send the key
events to the window. So keylogging is still possible.
2014-03-18 09:00:50 +01:00
Martin Gräßlin
92761e9e30 [kwin] Fix ifdefs for Wayland
With the switch to FindWayland from ECM WAYLAND_FOUND was no longer set
thus the ifdef didn't work. Now we use HAVE_WAYLAND and HAVE_WAYLAND_EGL.
2014-03-18 09:00:49 +01:00
Martin Gräßlin
9f22a99887 Install cursor from Effects mouse interception to Wayland surface
Unfortunately this is extremely platform specific with code for X11 and
Wayland. But at the moment it doesn't make much sense to abstract as
Effects are the only case where a fullscreen low level input area is
used.

A small problem is also that the mouse cursor doesn't get restored and
is changed when the X11 cursor changes. This will be fixed once we start
to properly track the cursor of the individual X windows.
2014-03-18 09:00:49 +01:00
Martin Gräßlin
6619faa6ac Pass pointer events through the effect system
InputRedirection forwards pointer events (currently motion, press and
release) through the EffectsHandlerImpl for the case that an effect has
intercepted pointer events.

If the KWin operation mode is not X11 only, the window for intercepting
the mouse events is no longer created.
2014-03-18 09:00:49 +01:00
Aleix Pol
c72e519d9c Remove KDE/ prefix in include directories
It's unneeded and deprecated since KF5.
2014-03-17 16:24:10 +01:00
Martin Gräßlin
e3271ec2e1 [kwin] Add isEffectSupported method to Effects DBus interface
EffectsHandlerImpl::isEffectsSupported performs the check whether the
effect with the given name is supported by the current compositor.

The check is the following:
* if effect is already loaded, it is supported
* if the effect cannot be found, it is not supported
* if it's a scripted effect, it's always supported
* if it's a built-in effect, we ask BuiltInEffects::supported
* for all other effects we resolve the library and the supported
  method

The idea behind providing this functionality in the DBus interface is
to allow filtering in the effects KCM for the effects which are
supported by the current compositor.

In addition a areEffectsSupported method is added which takes a
list of names and returns a list of bools.

REVIEW: 116665
2014-03-12 08:39:40 +01:00
Martin Gräßlin
6b1f0b1fca [kwin] Introduce Screens::size and Screens::geometry
Screens provides a size which is constructed from the size of
the bounding geometry of all screens and provides an overload taking
an int to return the size of a specified screen. For geometry() a new
ovload is added without an argument, which is just a convenient wrapper
for QRect(QPoint(0, 0), size()).

Both new methods are exported to effects and scripting as new
properties there called virtualScreenSize and virtualScreenGeometry.

The (virtual) size gets cached in screens and is updated whenever the
count or geometry changes.

Construction of Screens is slightly changed by moving the init code
from ctor into a virtual method init(). Reason is that we ended in
a loop with accessing the singleton pointer before it was set.

REVIEW: 116114
2014-03-05 13:03:33 +01:00
Martin Gräßlin
4dff7888e3 [kwin] Drop build option to build without scripting
Scripting has proved it's point of being useful so it's time to turn it
into a mandatory part of KWin.

Also I start to use features provided by Scripting in more and more
parts of KWin core (e.g. sharing QQmlEngine) which makes it in the
long to complicated to have a build option and ifdefs for it.

REVIEW: 116587
2014-03-04 08:19:55 +01:00
Martin Gräßlin
f9dfb11144 [kwin] Drop EffectsHandlerImpl::displayWidth and EffectsHandlerImpl::displayHeight
Unused code.
2014-02-27 12:02:51 +01:00
Martin Gräßlin
29af52fbf1 Keep KWin responsive while loading all effects
Loading all effects during startup can take some time[1] and during
that time the screen is frozen as the loading blocks the compositor.

This change doesn't load effects directly but puts them into a queue.
The loading is controlled by invoking the dequeue through a queued
connection. Thus we get a firing compositing timer in between and can
ensure that a frame is rendered when needed and also react to X events
during the loading.

[1] On my high-end system the set of effects I use take about 200 msec
    to load.

REVIEW: 115297
2014-01-28 07:41:57 +01:00
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
3c30b43fe9 Merge branch 'KDE/4.11'
Conflicts:
	kcontrol/randr/krandrtray.desktop
	kcontrol/randr/module/randrmonitor.desktop
	kcontrol/randr/randr.desktop
	kcontrol/screensaver/screensaver.desktop
	kcontrol/smartcard/smartcard.desktop
	kcontrol/workspaceoptions/workspaceoptions.desktop
	kdm/kcm/background/patterns/fish.desktop
	kdm/kcm/background/patterns/night-rock.desktop
	kdm/kcm/background/patterns/pavement.desktop
	kdm/kcm/background/patterns/rattan.desktop
	kdm/kcm/background/patterns/stonewall2.desktop
	kdm/kcm/background/programs/xearth.desktop
	kdm/kcm/background/programs/xglobe.desktop
	kdm/kcm/background/programs/xplanet.desktop
	kdm/kcm/kcmkdm_actions.actions
	kdm/kcm/kdm.desktop
	kdm/kfrontend/pics/stripes.png.desktop
	kdm/kfrontend/sessions/9wm.desktop
	kdm/kfrontend/sessions/aewm++.desktop
	kdm/kfrontend/sessions/aewm.desktop
	kdm/kfrontend/sessions/afterstep.desktop
	kdm/kfrontend/sessions/amaterus.desktop
	kdm/kfrontend/sessions/amiwm.desktop
	kdm/kfrontend/sessions/asclassic.desktop
	kdm/kfrontend/sessions/awesome.desktop
	kdm/kfrontend/sessions/blackbox.desktop
	kdm/kfrontend/sessions/cde.desktop
	kdm/kfrontend/sessions/ctwm.desktop
	kdm/kfrontend/sessions/cwwm.desktop
	kdm/kfrontend/sessions/e16.desktop
	kdm/kfrontend/sessions/enlightenment.desktop
	kdm/kfrontend/sessions/evilwm.desktop
	kdm/kfrontend/sessions/fluxbox.desktop
	kdm/kfrontend/sessions/flwm.desktop
	kdm/kfrontend/sessions/fvwm.desktop
	kdm/kfrontend/sessions/fvwm95.desktop
	kdm/kfrontend/sessions/gnome.desktop
	kdm/kfrontend/sessions/golem.desktop
	kdm/kfrontend/sessions/icewm.desktop
	kdm/kfrontend/sessions/ion.desktop
	kdm/kfrontend/sessions/kde-plasma-safe.desktop.cmake
	kdm/kfrontend/sessions/kde-plasma.desktop.cmake
	kdm/kfrontend/sessions/larswm.desktop
	kdm/kfrontend/sessions/lwm.desktop
	kdm/kfrontend/sessions/lxde.desktop
	kdm/kfrontend/sessions/matchbox.desktop
	kdm/kfrontend/sessions/metacity.desktop
	kdm/kfrontend/sessions/mwm.desktop
	kdm/kfrontend/sessions/olvwm.desktop
	kdm/kfrontend/sessions/olwm.desktop
	kdm/kfrontend/sessions/openbox.desktop
	kdm/kfrontend/sessions/oroborus.desktop
	kdm/kfrontend/sessions/phluid.desktop
	kdm/kfrontend/sessions/pwm.desktop
	kdm/kfrontend/sessions/qvwm.desktop
	kdm/kfrontend/sessions/ratpoison.desktop
	kdm/kfrontend/sessions/sapphire.desktop
	kdm/kfrontend/sessions/sawfish.desktop
	kdm/kfrontend/sessions/twm.desktop
	kdm/kfrontend/sessions/ude.desktop
	kdm/kfrontend/sessions/vtwm.desktop
	kdm/kfrontend/sessions/w9wm.desktop
	kdm/kfrontend/sessions/waimea.desktop
	kdm/kfrontend/sessions/wm2.desktop
	kdm/kfrontend/sessions/wmaker.desktop
	kdm/kfrontend/sessions/xfce.desktop
	kdm/kfrontend/sessions/xfce4.desktop
	kdm/kfrontend/themes/circles/KdmGreeterTheme.desktop
	kdm/kfrontend/themes/elarun/KdmGreeterTheme.desktop
	kscreensaver/kblank_screensaver/kblank.desktop
	kscreensaver/krandom_screensaver/krandom.desktop
	kscreensaver/libkscreensaver/screensaver.desktop
	kwin/kcmkwin/kwincompositing/kwincompositing.desktop
	kwin/tabbox/qml/clients/text/metadata.desktop
	kwin/tabbox/qml/clients/window_strip/metadata.desktop
	libs/kephal/service/kephal.desktop
	libs/plasmagenericshell/widgetsexplorer/package/metadata.desktop
	plasma/desktop/applets/kickoff/simpleapplet/plasma-applet-simplelauncher.desktop
	plasma/desktop/applets/pager/package/metadata.desktop
	plasma/desktop/applets/pager/plasma-pager-default.desktop
	plasma/desktop/applets/tasks/plasma-tasks-default.desktop
	plasma/desktop/applets/trash/plasma-applet-trash.desktop
	plasma/desktop/applets/window-list/metadata.desktop
	plasma/desktop/containments/desktop/package/metadata.desktop
	plasma/desktop/containments/panel/plasma-containment-panel.desktop
	plasma/desktop/shell/activitymanager/package/metadata.desktop
	plasma/desktop/shell/data/layouts/org.kde.plasma-desktop.SaL/metadata.desktop
	plasma/desktop/shell/data/layouts/org.kde.plasma-desktop.findWidgets/metadata.desktop
	plasma/desktop/shell/data/layouts/org.kde.plasma-desktop.photoActivity/metadata.desktop
	plasma/desktop/shell/data/plasma-desktop.desktop
	plasma/desktop/shell/data/plasma-desktop.notifyrc
	plasma/desktop/toolboxes/plasma-toolbox-desktoptoolbox.desktop
	plasma/generic/animators/default/plasma-animator-default.desktop
	plasma/generic/applets/batterymonitor/metadata.desktop
	plasma/generic/applets/calendar/plasma-applet-calendar.desktop
	plasma/generic/applets/systemtray/package/contents/ui/IconsList.qml
	plasma/generic/applets/systemtray/package/contents/ui/StatusNotifierItem.qml
	plasma/generic/applets/systemtray/package/contents/ui/main.qml
	plasma/generic/dataengines/metadata/plasma-engine-metadata.desktop
	plasma/generic/dataengines/nowplaying/plasma-dataengine-nowplaying.desktop
	plasma/generic/runners/nepomuksearch/plasma-runner-nepomuksearch.desktop
	plasma/generic/wallpapers/image/plasma-wallpaper-image.desktop
	plasma/netbook/applets/currentappcontrol/plasma-applet-currentappcontrol.desktop
	plasma/netbook/applets/searchbox/plasma-applet-searchbox.desktop
	plasma/netbook/containments/netpanel/plasma-containment-netpanel.desktop
	plasma/netbook/containments/sal/plasma-containment-sal.desktop
	plasma/netbook/containments/sal/plasma-sal-menu.desktop
	plasma/netbook/containments/sal/services/plasma-sal-bookmarks.desktop
	plasma/netbook/containments/sal/services/plasma-sal-contacts.desktop
	plasma/netbook/containments/sal/services/plasma-sal-development.desktop
	plasma/netbook/containments/sal/services/plasma-sal-games.desktop
	plasma/netbook/containments/sal/services/plasma-sal-graphics.desktop
	plasma/netbook/containments/sal/services/plasma-sal-internet.desktop
	plasma/netbook/containments/sal/services/plasma-sal-multimedia.desktop
	plasma/netbook/containments/sal/services/plasma-sal-office.desktop
	plasma/netbook/containments/sal/services/plasma-sal-system.desktop
	plasma/netbook/containments/sal/services/plasma-sal-utility.desktop
	plasma/netbook/dataengines/searchlaunch/plasma-engine-searchlaunch.desktop
	plasma/netbook/desktoptheme/air-netbook/metadata.desktop
	plasma/netbook/shell/data/layouts/org.kde.plasma-netbook.defaultPage/metadata.desktop
	plasma/netbook/shell/data/layouts/org.kde.plasma-netbook.defaultPanel/metadata.desktop
	plasma/netbook/shell/data/layouts/org.kde.plasma-netbook.defaultSal/metadata.desktop
	plasma/netbook/shell/data/layouts/plasma-layout-org.kde.plasma-netbook.defaultPage.desktop
	plasma/netbook/shell/data/layouts/plasma-layout-org.kde.plasma-netbook.defaultPanel.desktop
	plasma/netbook/shell/data/layouts/plasma-layout-org.kde.plasma-netbook.defaultSal.desktop
	plasma/netbook/shell/nettoolbox/plasma-toolbox-nettoolbox.desktop
2014-01-22 14:24:02 +01:00
Martin Gräßlin
91c420ada0 [kwin] Fix possible crash in desktopPresenceChanged
It's possible that the Client does not have an effect window when
the desktop presence changes. This results in a crash.

Unit test which triggered the crash on
https://git.reviewboard.kde.org/r/115190/

REVIEW: 115214
2014-01-22 14:17:48 +01:00
Thomas Lübking
4bb88df714 Merge branch 'KDE/4.11' 2014-01-14 22:51:24 +01:00
Thomas Lübking
c378bf4f7c emit desktopPresenceChanged from Client:setDesktop
and forward it to scripted effects

CCBUG: 326903
REVIEW: 114080
2014-01-14 22:23:49 +01:00
Martin Klapetek
81f563d610 Fix an assert on KWin shutdown
Reviewed-by: Martin Gräßlin
2014-01-12 23:04:06 +01:00
Martin Gräßlin
dec41bbad8 Make Scene's QPainter available to effects
Effects can access the QPainter used by SceneQPainter to directly render
into the back buffer.

Obviously only available in Compositing Type QPainterCompositing.
2014-01-09 13:29:40 +01:00
Martin Gräßlin
5d3d8834ab Pass creation of Scene::EffectFrame to the Scene
Instead of having the EffectFrameImpl check the compositor type and do
the decision which Scene::EffectFrame to create, a pure virtual method
in Scene is called which returns the specific Scene::EffectFrame.
2014-01-07 15:34:19 +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
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
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
Martin Gräßlin
0ad6811684 [kwin] Fix crash in tear-down of EffectsHandlerImpl
Adding a simplified logic to unload all effects directly in the
dtor. Looks like Qt didn't like our double traversal over the list
any more and was causing double deletions.
2013-11-13 10:03:58 +01:00
Martin Gräßlin
be3a0cf4ca Fix reading of window properties from effects
That's what you get for changing code you cannot properly test. The
calculation was completely messed up. Now reads the correct byte size
for the byte array. In addition the usages in the effects are improved
to cast the data into the proper uint32_t values instead of the more
generic long. After all if the format is 32, the length is 32 and not
a long.
2013-09-25 09:12:31 +02:00
Martin Gräßlin
cf6d6e0515 Re-enable threaded query for effects
KConfig should be thread safe in KF5.
2013-09-24 14:32:21 +02:00
Martin Gräßlin
cebb4b86b5 Use new for-loop instead of foreach in kwin/effects.cpp
kdevelop was causing parsing errors, so I had to do it ;-)
2013-09-24 14:31:35 +02:00
Martin Gräßlin
969e6b85e7 Merge branch 'master' into frameworks-scratch
Conflicts:
	CMakeLists.txt
	kwin/client.cpp
	kwin/effects/highlightwindow/highlightwindow.cpp
	kwin/libkwineffects/kwingltexture.cpp
	kwin/libkwineffects/kwinxrenderutils.cpp
	kwin/scene_opengl.cpp
	kwin/workspace.cpp
	plasma/desktop/applets/kickoff/CMakeLists.txt
	plasma/desktop/applets/taskmanager/package/contents/code/tools.js
	plasma/desktop/applets/taskmanager/package/contents/ui/Task.qml
	plasma/desktop/applets/taskmanager/package/contents/ui/main.qml
	plasma/desktop/applets/taskmanager/package/metadata.desktop
	plasma/desktop/applets/taskmanager/plugin/textlabel.h
	plasma/desktop/applets/tasks/CMakeLists.txt
	plasma/desktop/applets/tasks/package/metadata.desktop
	plasma/desktop/applets/tasks/tasks.cpp
	plasma/desktop/toolboxes/plasma-toolbox-desktoptoolbox.desktop
	plasma/generic/applets/activitybar/activitybar.cpp
	plasma/generic/wallpapers/color/plasma-wallpaper-color.desktop
	plasma/generic/wallpapers/image/plasma-wallpaper-image.desktop
2013-09-24 11:28:38 +02:00
Martin Gräßlin
5cf871d827 Port readWindowProperty in effects.cpp to XCB 2013-09-11 08:38:10 +02:00
Martin Gräßlin
592ea89b01 Port all remaining XDeleteProperty calls to XCB 2013-09-10 15:30:10 +02:00
Thomas Lübking
0dcdcf48eb copy and paste timebomb
bug as old as kwin compositing ....
BUG: 323688
FIXED-IN: 4.11.2
REVIEW: 112436
2013-09-08 23:43:45 +02:00
Martin Gräßlin
139201a2e2 KGlobal::config() -> KSharedConfig::openConfig()
KWin Core says good bye to KGlobal. We will not miss the threading
issues.
2013-09-04 16:11:40 +02:00
Martin Gräßlin
57905c0cc2 And we got rid of KDebug
Usages of kBacktrace got dropped.
2013-09-02 13:14:39 +02:00
Anselmo L. S. Melo
bef5b71898 Porting effects to Qt5/KF5: QStandardPaths
REVIEW: 111977
2013-08-13 17:56:04 -03:00
Martin Gräßlin
9291b18cee Merge branch 'master' into frameworks-scratch
Conflicts:
	CMakeLists.txt
	kwin/effects.cpp
	kwin/effects/logout/logout.cpp
	kwin/effects/presentwindows/main.qml
	kwin/effects/presentwindows/presentwindows.cpp
	kwin/effects/presentwindows/presentwindows.h
	kwin/effects/zoom/zoom_config.cpp
	kwin/libkwineffects/kwinglutils_funcs.cpp
	kwin/libkwineffects/kwinxrenderutils.cpp
	kwin/nvidiahack.cpp
	kwin/xcbutils.h
	plasma/desktop/containments/desktop/plasma-containment-desktop.desktop
	plasma/generic/wallpapers/image/image.cpp
	plasma/generic/wallpapers/image/plasma-wallpaper-image.desktop
2013-08-07 10:10:06 +02:00
Martin Gräßlin
c47702294a Fix incorrect button press event processing in checkInputWindowEvent
Incorrect porting by merging ButtonPress and ButtonRelease into one
function.

This fixes the broken mouse button event handling in e.g. DesktopGrid
effect.
2013-08-06 12:19:20 +02:00
Martin Gräßlin
36429c0010 Fix loading of scripted effects
Port to QStandardPaths was incorrect - well it was a guess which I
couldn't test...
2013-08-01 08:04:31 +02:00
Martin Gräßlin
485f0a3e06 Process mouse events
Button Press/Release do no longer fall through to motion notify as
there is no shared mouse event in xcb. Also the methods in Effects and
TabBox are adjusted to process only button press/release or motion
notify.

ScreenEdges are no longer checked for button press/release. They don't
interact on button press/release so there is no need to check it.
2013-07-29 08:58:05 +02:00
Martin Gräßlin
1e0600bbc7 Port to new KDesktopFile constructor
I do not know whether that's the correct new way to locate the desktop
file for our service.
2013-07-24 09:58:41 +02:00
Martin Gräßlin
330d40f425 Fix no cast to/from ASCII intrduced issues
* "" needs to be wrapped in QStringLiteral
* QString::fromUtf8 needed for const char* and QByteArray
* QByteArray::constData() needed to get to the const char*
2013-07-24 09:58:33 +02:00
Martin Gräßlin
11dd05425e Plasma::Theme does no longer provide a global static theme
Need to hold a pointer instead.
2013-07-24 09:47:02 +02:00
Martin Gräßlin
93e2ce4bfd Use QVector instead of QList for the list of active effects
We only append to the list, so the advantage of insertion into QList
does not matter.

Thanks to Milian Wolff to point this out in his Akademy talk [1] and for
pointing me to Marc Mutz blog post [2] discussing this topic and
recommending the usage of QVector over QList.

[1] http://milianw.de/files/apps-on-speed-akademy2013/index.html
[2] http://marcmutz.wordpress.com/effective-qt/containers/

REVIEW: 111597
2013-07-19 16:03:50 +02:00
Martin Gräßlin
13ad458cca Use const_iterators for our Effect iterators
We never modify the list, so we don't need the mutuable iterator. This
ensures that the data doesn't get detached.
2013-07-19 16:03:50 +02:00
Thomas Lübking
5cf328fbec ensure to not add NULL effect windows to stacking
happens during threaded startup and crashes in blur effect
when initially enabled

REVIEW: 111360
2013-07-08 18:53:37 +02:00
Thomas Lübking
3b285ba572 don't query effects threaded
calls sycoca/kconfiggroup...

BUG: 321576
FIXED-IN: 4.11
REVIEW: 111374
2013-07-08 18:53:36 +02:00
Thomas Lübking
a3d502338d delay adding Unmanaged clients by 50ms
This provides some sort of synthetic XSYNC support
for unmanaged clients and allows them to do an initial
update after mapping and before being painted (prevent
flicker)
Also it helps with Unmanaged clients performing quick
map/unmap/map cycles what also seems to induce the black
window issue on the nvidia blob.

CCBUG: 284888
BUG: 319184
FIXED-IN: 4.11
REVIEW: 111292
2013-07-01 21:19:54 +02:00
Thomas Lübking
e717c131bf Hook modalChanged signal for DialogParent script
Eg. gtk+ alters the modality after mapping and
before unmapping the window.
Therfore the former implementation ahd a wrong idea
about the modality until the window was activated and
again had a wrong idea when the dialog closed, keeping
the main client dimmed.

Modality changes at runtime are uncommon but legal and can
happen anytime.

BUG: 321340
FIXED-IN: 4.11
REVIEW: 111154
2013-06-26 12:42:09 +02:00
Martin Gräßlin
b501e07b21 Fix typo: ScopedCPointer instead of QScopedPointer
BUG: 321470
2013-06-21 18:45:19 +02:00
Thomas Lübking
b8439145bd always defer delete of Deleted to next event cycle
BUG: 317765
FIXED-IN: 4.11
REVIEW: 110756
2013-06-05 14:10:59 +02:00
Martin Gräßlin
941c02a60f Introduce cross-fading with previous pixmap
Cross fading with previous pixmap is achieved by referencing the old
window pixmap. WindowPaintData has a cross-fade-factor which interpolates
between 0.0 (completely old pixmap) to 1.0 (completely new pixmap).

If a cross fading factor is set and a previous pixmap is valid this one
is rendered on top of the current pixmap with opacity adjusted. This
results in a smoother fading.

To simplify the setup the AnimationEffect is extended and also takes care
about correctly (un)referencing the previous window pixmap. The maximize
effect is adjusted to make use of this new capabilities.

Unfortunately this setup has a huge problem with the case that the window
decoration gets smaller (e.g. from normal to maximized state). In this
situation it can happen that the old window is rendered with parts outside
the content resulting in video garbage being shown. To prevent this a set
of new WindowQuads is generated with normalized texture coordinates in
the safe area which contains real content.

For OpenGL2Window a PreviousContentLeaf is added which is only set up in
case the crass fading factor is set.

REVIEW: 110578
2013-06-05 08:18:28 +02:00