Commit Graph

254 Commits (16998db2746d8d7aab7c7361545dd8df227e12e0)

Author SHA1 Message Date
Fredrik Höglund 010b3c94de Merge branch 'KDE/4.10'
Conflicts:
	kwin/lanczosfilter.cpp
2013-03-21 17:13:34 +01:00
Fredrik Höglund cd93f3c486 kwin/cube: Fix the panel shadow being clipped out
The shadow was being clipped out while the slide animation was running.
2013-03-21 16:43:45 +01:00
Martin Gräßlin 98a04893a6 Use mgraesslin@kde.org for my mail address in Copyright and AboutData 2013-03-12 13:17:53 +01:00
Martin Gräßlin 0ccc060218 Include KGlobal were needed
With KF5 some includes which used to include KGlobal, e.g. KStandardDirs
do no longer include KGlobal. So if we use KGlobal we should include it.
2013-03-07 13:59:15 +01:00
Martin Gräßlin 60c42b7a34 s/KLocale/KLocalizedString/g
Many headers included KLocale to use i18n and co. But those methods are
defined in KLocalizedString and not in KLocale.

With KF5 klocale.h does no longer include KLocalizedString causing lots
of compile errors.
2013-03-07 13:59:15 +01:00
Martin Gräßlin b01f5684c5 Remove not needed includes from kwineffect header files
Only include what's actually needed in the headers. This causes of course
some additional needed includes in some implementation files.
2013-03-06 10:23:09 +01:00
Martin Gräßlin c3423b15e7 Add method to EffectsHandler to define the cursor for an input window
Convenience method to replace XDefineCursor used in the effects.

REVIEW: 109039
2013-02-25 13:35:19 +01:00
Martin Gräßlin beb00478e1 Only start animating in cube slide on window move if core uses switch desktop on edge
For this new KWinOptions are exposed to query whether core uses switch on
desktop on move or always.

BUG: 299901
FIXED-IN: 4.11
REVIEW: 108671
2013-02-07 10:10:25 +01:00
Martin Gräßlin 7a7f9d1a34 Change the way how screen edges interact with Effects/Scripts
The main difference is that the activation of an edge is no longer
broadcasted to all effects and scripts, but instead a passed in slot of
the Effect/Script is invoked.

For this the EffectsHandler API is changed to take the Effect as an
argument to (un)reserveElectricBorder. As callback slot the existing
borderActivated is used.

In addition the ScreenEdge monitors the object for beeing destroyed and
unregisters the the edge automatically. This removes the need from the
Effect to call unregister in the dtor.

BUG: 309695
FIXED-IN: 4.11
2013-02-07 09:46:52 +01:00
Script Kiddy 2ea65eb18e SVN_SILENT made messages (.desktop file) 2013-01-26 13:21:28 +01:00
Script Kiddy 7d821f3814 SVN_SILENT made messages (.desktop file) 2013-01-26 09:04:17 +01:00
Script Kiddy a2c44c29f4 SVN_SILENT made messages (.desktop file) 2013-01-08 22:37:02 +01:00
Script Kiddy 6e267063d8 SVN_SILENT made messages (.desktop file) 2013-01-08 17:21:50 +01:00
Albert Astals Cid dec63fb987 Merge remote-tracking branch 'origin/KDE/4.10' 2013-01-07 11:04:39 +01:00
Script Kiddy c6d91ac7eb SVN_SILENT made messages (.desktop file) 2013-01-07 08:11:48 +01:00
Martin Gräßlin 533d57da60 Mark most ctors as explicit as reported by Krazy2 checker 2013-01-02 18:35:46 +01:00
Script Kiddy 12f341712c SVN_SILENT made messages (.desktop file) 2012-12-24 09:05:36 +01:00
Script Kiddy d7316b9fcb SVN_SILENT made messages (.desktop file) 2012-12-23 08:01:50 +01:00
Martin Gräßlin 876b427dfb Fix some C++11 narrowing conversation warnings
Thanks to Jurica Vukadin for providing the patch.

REVIEW: 106994
2012-11-26 10:27:02 +01:00
Martin Gräßlin 18cccad806 Introduce a templated animationTime overload for the KConfigXT case
This method can be used to get the animationTime in case a configuration
class generated through KConfigXT is used. In general the configuration
stores the magic value 0 for a property "duration". This magic value
indicates that a hard-coded default value should be used.

So the common logic to test the stored value for 0 and then either pass
the stored value or the default value to animationTime is encapsulated
in this method in a generic way.

A MyEffect can use it in the following way:
animationTime<MyEffectConfig>(200);

BUG: 310646
FIXED-IN: 4.10
REVIEW: 107460
2012-11-25 20:19:31 +01:00
Martin Gräßlin 2ba5e1d6ad Remove unused variable in CubeEffect::loadShader
--warnings
2012-11-21 14:44:45 +01:00
Martin Gräßlin 99411ce7b1 Merge CubeEffect::loadConfig with reconfigure
Only called from inside reconfigure and reconfigure does nothing else
than calling loadConfig.
2012-11-21 14:42:21 +01:00
Martin Gräßlin cf5de22586 Introduce a build option KWIN_BUILD_OPENGL_1_COMPOSITING
If the build option is enabled KWIN_HAVE_OPENGL_1 is passed as a compile
flag when build against OpenGL.

This compile flag is meant to replace the KWIN_HAVE_OPENGLES. So far code
has been ifdefed for special behavior of OpenGL ES 2.0 and to remove
fixed functionality calls which are not available in OpenGL ES 2.0.

With this build flag the fixed functionality calls which are only used in
the OpenGL1 Compositor can be removed and keeping the KWIN_HAVE_OPENGLES
for the real differences between OpenGL 2.x and OpenGL ES 2.0.

E.g. a call like glColor4f should be in an
glColor4f(1.0, 1.0, 1.0, 1.0);

while a call like glPolygonMode should be in an
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);

Building for OpenGL ES 2.0 of course implies that KWIN_HAVE_OPENGL_1 is
not defined.
2012-10-25 11:34:12 +02:00
Martin Gräßlin c2a4f81927 Introduce a helper class to automatically push/pop Shaders
The ShaderBinder class can be used for the case that a block of code
should be executed with a given Shader being bound. This is useful for
all the cases where there is a if-block for OpenGL2 execution with a
Shader being pushed in the first line to the ShaderManager and popped in
the last line of the block. With the helper this can be simplified to:

ShaderBinder binder(myCustomShader);

or

ShaderBinder binder(ShaderManager::GenericShader);

The ctor of ShaderBinder pushes the given Shader to the stack and once
the helper goes out of scope it will be popped again from the stack.

In addition the helper can take care of OpenGL 1 compositing, that is it
just does nothing. So it can also be used where there is a shared OpenGL1
and OpenGL2 code path where the Shader should only be pushed in OpenGL2.
This basically removes all the checks for the compositing type before
pushing/popping a Shader to the stack.

REVIEW: 106521
2012-09-29 15:33:57 +02:00
Martin Gräßlin f9a2ecbf33 Do not use ShaderManager::isValid to check for OpenGL2 compositing
The main usage of ShaderManager::isValid was to have OpenGL2 specific
code pathes. Now we have an actual OpenGL2Compositing type and we know
that the ShaderManager is valid if we have this compositing type and we
know that it is not valid on OpenGL1Compositing. This gives us a much
better check and allows us to use the isValid method just for where we
want to check whether the shaders compiled successfully.

In addition some effects require OpenGL2, so we do not need to check
again that the ShaderManager is valid. Such usages are removed.
2012-09-29 15:33:57 +02:00
Martin Gräßlin 6d2dfe06e7 Introduce dedicated OpenGL1 and OpenGL2 compositing types
The CompositingType enum turns into flags and two new values are
introduced: OpenGL1Compositing and OpenGL2Compositing.

Those new values are or-ed to OpenGLCompositing so that a simple check
for the flag OpenGLCompositing works in case of one of those two new
values. To make the generic check for OpenGL compositing easier a method
in EffectsHandler is introduced to just check for this.

The scenes now return either OpenGL1Compositing or OpenGL2Compositing
depending on which Scene implementation. None returns OpenGLCompositing.
2012-09-29 15:33:57 +02:00
Francesco Cecconi 062f5ff66b Use KConfigXT in Cube/CubeSlide effect
REVIEW: 106403
2012-09-14 10:39:27 +02:00
Martin Gräßlin 90365e27d0 Merge branch 'KDE/4.9'
Conflicts:
	khotkeys/data/kde32b1.khotkeys
	kinfocenter/Modules/opengl/opengl.desktop
	kwin/tabbox/tests/CMakeLists.txt
	plasma/generic/applets/system-monitor/plasma-applet-sm_hdd_activity.desktop
2012-08-17 17:59:49 +02:00
Martin Gräßlin 23f2de009b Effects can provide support information through properties
The supportInformation is extended to also read the properties
on all effects. In addition each effect can be queried just for
itself through D-Bus, e.g.:
qdbus org.kde.kwin /KWin supportInformationForEffect kwin4_effect_blur

All effects are extended to provide their configured and read
settings through properties. In some cases also important
runtime information is exposed.

REVIEW: 105977
BUG: 305338
FIXED-IN: 4.9.1
2012-08-17 17:49:49 +02:00
Thomas Lübking 53534f7966 Merge branch 'KDE/4.9'
Conflicts:
	plasma/generic/applets/batterymonitor/metadata.desktop
	plasma/generic/applets/lock_logout/metadata.desktop
2012-08-11 22:13:59 +02:00
Thomas Lübking 860c7679dc check desktopNameFrame pointer in cube effect
REVIEW: 105840
BUG: 304340
FIXED-IN: 4.9.1
2012-08-11 21:41:04 +02:00
Martin Gräßlin c7262e8bd3 Getter/setters for opacity, saturation and brightness in WindowPaintData
The public member variables for opacity, saturation and brightness
are removed in favor for getter and setters. The variables are
moved into a private class. Those are now qreal instead of double.

To make usage inside the effects easier a multiply method is added
which multiplies the current value with passed in factor and returns
the new value in a functional programming style.

This commit is the top-most of a patch series to refactor
ScreenPaintData and WindowPaintData. Other related commits are:
* 0811772
* ebdc7ec
* 2c8dd8d
* 7699726
* 68e0201
* 611cb09

REVIEW: 105141
BUG: 303314
FIXED-IN: 4.10
2012-07-19 18:25:48 +02:00
Martin Gräßlin dd067b075b Split out common part of ScreenPaintData and WindowPaintData
New common d-pointered class PaintData is added which cannot
be instantiated.
2012-07-19 18:25:03 +02:00
Martin Gräßlin a2b0d42916 Replace translation by QVector3D in Screen/Window PaintData 2012-07-19 18:25:03 +02:00
Martin Gräßlin 966047ccd2 Replace custom RotationData with QGraphicsRotation 2012-07-19 18:25:03 +02:00
Script Kiddy 953d088b6a SVN_SILENT made messages (.desktop file) 2012-06-12 17:07:51 +02:00
Script Kiddy 62211420c7 SVN_SILENT made messages (.desktop file) 2012-05-28 11:08:19 +02:00
Martin Gräßlin f24103481e Ensure ScreenTransformation matrix is reset after rendering cube
Cube effect modifies the ScreenTransformation matrix. While each
window resets the matrix on a global level it's not reset. That
means if the last rendered window had the screen rotated the
ScreenTransformation keeps the rotation even after the cube
ended. This causes a rotated window in e.g. TaskbarThumbnails.

REVIEW: 104918
CCBUG: 299869
2012-05-22 18:34:11 +02:00
Martin Gräßlin 1379bbaa83 Use enum based setUniform in cube effect
A little bit more safety when setting a uniform value.

REVIEW: 104923
2012-05-22 18:31:14 +02:00
Martin Gräßlin d14cf2da92 Show detailed information why an effect cannot be loaded
Effects can specify their minimum requirements in their
desktop file:
* OpenGL
* OpenGL 2 (GLSL required)
* Shaders (either ARB or OpenGL 2)

The configuration module uses this information in combination
with which backend KWin is currently using. So if e.g. OpenGL
is used and an effect requires OpenGL 2 a detailed error
message can be showed that OpenGL 2 is required.

BUG: 209213
FIXED-IN: 4.9.0
REVIEW: 104847
2012-05-15 18:02:57 +02:00
Martin Gräßlin d05d55b140 Delay creation of EffectFrames till needed
Creating an EffectFrame requires I/O which takes on my system
during testing between 10 and 40 msec. Also it needs a little
bit of memory.

This changes moves out the creation of EffectFrames at Effect
load till the Effect actually needs the EffectFrame. E.g. if a
user does not filter in PresentWindows there is no need to ever
create it.

BoxSwitch effect is ignored as it should be dropped for 4.9.

REVIEW: 104815
2012-05-03 09:10:48 +02:00
Martin Gräßlin 8489ede9aa Move loading of Cube textures into thread
Cube effect loads 0 to 2 textures which has been
performed during configuration. This change delays
loading the textures till cube is activated for the
first time and the loading from file is moved into
a thread.

This means that for a very short time the texture
is not yet visible, but this is not a problem as
the cube animates from fully opaque starting state.
So during the loading the texture would not be
visible anyway.

REVIEW: 104807
2012-05-03 09:07:06 +02:00
Philipp Knechtges 93b2674313 kwin: dropping several gl(Push|Pop)(Attrib|Matrix) calls
This makes kwin in OpenGL2 mode more coherent with kwin_gles.
Despite some fullscreen effects they should now make the same
(pure) OpenGL calls.

REVIEW: 103804
2012-04-19 21:01:46 +02:00
Martin Gräßlin 2007a7eab8 Use namespaced parameters in signals
Required to get scripting bindings working.
2012-03-12 21:37:40 +01:00
Martin Gräßlin 38d760c960 Only push shader when Cube effect is active
This caused situations in which the shader was pushed but never
popped from the stack as for the latter case there was a check
whether the effect is active.

BUG: 280455
2011-09-27 17:42:20 +02:00
Script Kiddy 4cbbf921d4 SVN_SILENT made messages (.desktop file) 2011-09-09 09:21:44 +02:00
Script Kiddy 157f51ce85 SVN_SILENT made messages (.desktop file) 2011-09-08 09:04:13 +02:00
Martin Gräßlin fe4329a252 Only call active effects in the effect chain
Each effect is able to declare itself as currently being active,
that is transforming windows or painting or screen or doing anything
during the current rendered frame.

This change eliminates the hottest path inside KWin identified by
callgrind.

REVIEW: 102449
2011-08-29 07:06:58 +02:00
Script Kiddy c3004ddc7b SVN_SILENT made messages (.desktop file) 2011-08-27 10:03:17 +02:00
Montel Laurent 62c5a5e276 normalize signal/slots 2011-08-17 23:51:55 +02:00