Commit Graph

42 Commits (b2922f6675118e4426dcc2eb373451a4178d4176)

Author SHA1 Message Date
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 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
Lilian A. Moraru 607817eeef Use KConfigXT in FlipSwitch effect
REVIEW: 106401
2012-09-15 11:24:11 +02:00
Ghislain MARY e685e0f6e0 Enable mouse wheel navigation in flipswitch and coverswitch effects
BUG: 244439
FIXED-IN: 4.10
REVIEW: 105040
2012-08-15 20:58:34 +02:00
Martin Gräßlin 5f887c36e3 Merge branch 'KDE/4.9'
Conflicts:
	kwin/effects/flipswitch/flipswitch.cpp
	plasma/generic/applets/batterymonitor/metadata.desktop
2012-08-10 17:02:19 +02:00
Martin Gräßlin 0286540c29 Properly calculate the offset between multiple screens in FlipSwitch
The code assumed that screens border to each other. That is the height
of the one screen is the y position of the other screen.

BUG: 304520
FIXED-IN: 4.9.1
REVIEW: 105958
2012-08-10 16:53:42 +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
Ghislain MARY c66c78f1d2 Key Bindings for Switching between Windows of current Application
Additional TabBox Mode which allows to switch between all open
windows of the current selected application. By default Alt+tilde
is used which is on qwerty just one key above tab. For non-qwerty
layouts the shortcut is unfortunately not convenient.

REVIEW: 104730
FEATURE: 299308
FIXED-IN: 4.9.0
2012-05-10 09:53:10 +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 c16550f728 Use desktop icon for Show Desktop entry in TabBox
For the normal TabBox the TabBoxClient's icon method is
adjusted to use the "user-desktop" icon instead of the
window icon.

For the effects a method to set the caption is extended
to also set the icon on the caption frame.

REVIEW: 104444
2012-04-01 08:06:12 +02:00
Martin Gräßlin 68acc0692f Add Cursor key navigation to Flip- and Cover Switch Effects
FlipSwitch can be navigated with up and down keys as well
as left/right  and CoverSwitch only with left and right
keys while Alt+Tab is used.

REVIEW: 104438
FEATURE: 178595
FIXED-IN: 4.9.0
2012-04-01 07:57:17 +02:00
Martin Gräßlin 96c1046158 Synchronize Show Desktop Wording in TabBox Effects
Use "Show Desktop" for the desktop entry with the same
message as in "normal" TabBox.

FEATURE: 273478
FIXED-IN: 4.9.0
REVIEW: 104436
2012-04-01 07:57:17 +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
Thomas Lübking 85635dd485 fix tabbing
BUG: 290959
BUG: 265160
BUG: 229292
BUG: 238279
BUG: 290758
BUG: 222831
BUG: 278275
BUG: 245747
BUG: 230000

BUG: 253697
BUG: 230570
BUG: 265977
BUG: 225337
BUG: 225339

REVIEW: 103855
2012-02-11 16:30:22 +01:00
Thomas Lübking bf88ec09ac Revert "fix tabbing"
pushed out of branch, not master - leading to absent revision, found hash collision??

This reverts commit 94b2ad7b85801e37e2df4671cdc4f26b6d7e5506.
2012-02-11 16:29:14 +01:00
Thomas Lübking d245035a17 fix tabbing
BUG: 290959
BUG: 265160
BUG: 229292
BUG: 238279
BUG: 290758
BUG: 222831
BUG: 278275
BUG: 245747
BUG: 230000

BUG: 253697
BUG: 230570
BUG: 265977
BUG: 225337
BUG: 225339

REVIEW: 103855
2012-02-11 16:01:41 +01: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
Thomas Lübking 13b420fe7b flipswitch effect, slotWindowClosed - heap data still doesn't wipe itself ;-) 2011-05-11 21:07:34 +02:00
Thomas Lübking b54806fe0f strip QHash::operator[] from flipswitch
BUG: 238334
2011-05-10 21:43:46 +02:00
Thomas Lübking a23e01f0d9 Sanitize special window pointers in flip/coverswitch
CCBUG:253870
2011-04-04 00:04:23 +02:00
Martin Gräßlin f213b7da70 Drop KWin::TimeLine from kwineffects
The KWin::TimeLine class was only a small wrapper around QTimeLine
without adding anything to QTimeLine what is not present in QTimeLine.
The initial idea was to make it possible to provide more curve shapes.
This is now obsoleted by Qt shipping more useful curves with QTimeLine.

So let's clean up a little bit and use QTimeLine directly instead of
the small wrapper.

All effects are adjusted to use QTimeLine directly.
2011-03-14 22:50:05 +01:00
Martin Gräßlin 2cf51238a8 kwineffects doesn't use kdecorations 2011-03-13 16:56:25 +01:00
Martin Gräßlin 15757e953a TabBox uses signals to notify the effects
EffectsHandlerImpl just forwards the signals from TabBox. In order
to have a valid pointer to the TabBox, the TabBox is now initialized
before compositing in Workspace.
2011-03-06 12:15:16 +01:00
Martin Gräßlin 0b85768ec5 EffectsHandler emits windowClosed signal
Client and Unmanaged use a signal to notify that they are about to be closed.
The EffectsHandlerImpl is connected to those signals and emits the appropriate
windowClosed signal to which the effects are connected.
2011-02-27 09:25:45 +01:00
Martin Gräßlin ab6f2ba1fd EffectsHandler emits windowAdded signal
All previously existing windowAdded methods are renamed to slotWindowAdded.
EffectsHandlerImpl is connected to Workspace's clientAdded signal, which is
emitted a little bit earlier than the previous direct method call. This might
change behavior.
Another signal is added to Workspace to signal that an unmanaged is added.
2011-02-25 22:06:02 +01:00
Martin Gräßlin b265537962 Drop dependency to libplasma from kwineffects library
Since the EffectFrames have been moved into KWin core nothing in the
Effects lib actually used Plasma. The only remaining method is moved
to core as it's not used in the Effects. The Effects itself still
link against Plasma, so nothing changes for them.

The Plasma includes in the kwineffects header seemed to pull in
quite some additional headers, so the includes in some effects have
to be adjusted (most often KConfigGroup). This should speed up the
compilation of the library and the effects.
2011-02-17 19:38:42 +01:00
Martin Gräßlin 0a7e48f7aa KWin uses kdelibs coding style. 2011-01-31 20:07:03 +01:00
Martin Gräßlin 8d46c978aa FlipSwitch supports MultiScreen with GLES. 2011-01-30 14:12:06 +01:00
Martin Gräßlin 5dfa8becb5 FlipSwitch ported to GLES.
Multi-screen mode not yet included
2011-01-30 14:12:01 +01:00
Martin Gräßlin 1eea0dee70 Show desktop in flip stack when desktop should be shown.
BUG: 260254

svn path=/trunk/KDE/kdebase/workspace/; revision=1207055
2010-12-16 18:51:19 +00:00
Luboš Luňák d467d26530 Do not introduce such generic indentifiers like None or Styled
into KWin's global namespace. Morever None already kind of clashes with X's None.
CCMAIL: kde@martin-graesslin.com


svn path=/trunk/KDE/kdebase/workspace/; revision=1170588
2010-09-01 14:15:06 +00:00
Martin Gräßlin 37be26fdf6 Enable new EffectFrame cross fading in FlipSwitch
svn path=/trunk/KDE/kdebase/workspace/; revision=1160534
2010-08-08 08:32:09 +00:00
Martin Gräßlin b216a23908 Do not recreate text and icon EffectFrame in each rendered frame, but only when it's changed.
svn path=/trunk/KDE/kdebase/workspace/; revision=1160144
2010-08-07 08:14:48 +00:00
Martin Gräßlin e2eebb6503 Refactoring of EffectFrame: EffectFrame becomes an interface just like EffectsHandler and EffectWindow and a concrete EffectFrameImpl in core.
Rendering of the EffectFrame is moved into the scene as Scene::EffectFrame with a concrete implementation in SceneXrender and SceneOpenGL.
A factory method for an EffectFrame is added to the EffectsHandler, which is used by the effects.
Next step: pass the EffectFrame through all effects, so that effects can transform, blur, invert whatever it.

svn path=/trunk/KDE/kdebase/workspace/; revision=1151271
2010-07-18 16:32:37 +00:00
Lucas Murray e5f84879f6 Show inactive tab windows in flip switch.
svn path=/trunk/KDE/kdebase/workspace/; revision=1065326
2009-12-23 02:04:25 +00:00
Lucas Murray 8a8428e41c Less Krazy warnings please.
svn path=/trunk/KDE/kdebase/workspace/; revision=1042572
2009-10-30 06:51:59 +00:00
Martin Gräßlin 76f17e6de1 Here comes the new TabBox. It is a complete rewrite using a MVC approach. Here some highlights:
* Models and Delegates for Clients and Desktops
 * Horizontal, vertical and tabular layout
 * Layout of one item can be configured by an XML definition
 * A desktop item can include a client list
 * An optional second list view showing only the selected item
 * A new KCM "kwintabbox"
 * An alternative TabBox with independent settings and keybindings
 * Optional Highlight Windows effect integration
 * List scrolls instead of removing items
 * Scroll wheel support
 * Cursor key support
 * Middle click on item closes window
BUG: 195745
BUG: 197187
BUG: 201103
FEATURE: 118184
FEATURE: 156723
FEATURE: 177441
FEATURE: 182897
FEATURE: 193882
GUI:

svn path=/trunk/KDE/kdebase/workspace/; revision=1022861
2009-09-13 11:36:45 +00:00
Martin Gräßlin abe5c4ff04 Complete rewrite of flip switch.
* no more usage of OpenGL directly. Only highlevel API (except multiscreen :-()
 * better animations by adjusting the TimeLine's curve shape
 * new configuration options for window positions
 * Usage without tabbox (also supporting electric border)
 * Effect Frame showing the window title
 * many more things I have forgotten to mention
BUG: 187761

svn path=/trunk/KDE/kdebase/workspace/; revision=1000437
2009-07-21 10:18:48 +00:00
Lucas Murray 846496d2c1 Cleaned up the effects/ directory by moving each individual effect into
its own directory, cleaned up the effect config macros and renamed
"MakeTransparent" to "Translucency" so that it matches its visible name.

svn path=/trunk/KDE/kdebase/workspace/; revision=921749
2009-02-05 15:35:38 +00:00