[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdebase/workspace/kwin
From: Martin Gräßlin <ubuntu () martin-graesslin ! com>
Date: 2009-10-30 14:22:34
Message-ID: 1256912554.570049.13934.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 1042711 by graesslin:
Adding the missing pieces for a nice and fast letterbox resizing as a replacement for \
the drawbound resizing. Perhaps we should not display the totally ugly drawbound when \
we have an active resize effect.
CCBUG: 208770
CCBUG: 152638
M +6 -0 effects.cpp
M +1 -0 effects.h
M +12 -2 effects/resize/resize.cpp
M +2 -0 effects/resize/resize.h
M +3 -0 geometry.cpp
M +4 -0 lib/kwineffects.cpp
M +3 -1 lib/kwineffects.h
--- trunk/KDE/kdebase/workspace/kwin/effects.cpp #1042710:1042711
@@ -208,6 +208,12 @@
ep.second->windowUserMovedResized( c, first, last );
}
+void EffectsHandlerImpl::windowMoveResizeGeometryUpdate( EffectWindow* c, const \
QRect& geometry ) + {
+ foreach( const EffectPair &ep, loaded_effects )
+ ep.second->windowMoveResizeGeometryUpdate( c, geometry );
+ }
+
void EffectsHandlerImpl::windowOpacityChanged( EffectWindow* c, double old_opacity )
{
if (!c)
--- trunk/KDE/kdebase/workspace/kwin/effects.h #1042710:1042711
@@ -139,6 +139,7 @@
// internal (used by kwin core or compositing code)
void startPaint();
void windowUserMovedResized( EffectWindow* c, bool first, bool last );
+ void windowMoveResizeGeometryUpdate( EffectWindow* c, const QRect& geometry \
); void windowOpacityChanged( EffectWindow* c, double old_opacity );
void windowAdded( EffectWindow* c );
void windowClosed( EffectWindow* c );
--- trunk/KDE/kdebase/workspace/kwin/effects/resize/resize.cpp #1042710:1042711
@@ -60,8 +60,8 @@
effects->paintWindow( w, mask, region, data );
if( m_active && w == m_resizeWindow )
{
- QRegion intersection = m_originalWindowRect.intersected( w->geometry() );
- QRegion paintRegion = m_originalWindowRect.united( w->geometry() \
).subtracted( intersection ); + QRegion intersection = \
m_originalWindowRect.intersected( m_currentGeometry ); + QRegion paintRegion = \
m_originalWindowRect.united( m_currentGeometry ).subtracted( intersection ); float \
alpha = 0.8f;
QColor color = KColorScheme( QPalette::Normal, KColorScheme::Selection \
).background().color();
@@ -113,6 +113,7 @@
m_active = true;
m_resizeWindow = w;
m_originalWindowRect = w->geometry();
+ m_currentGeometry = w->geometry();
w->addRepaintFull();
}
if( m_active && w == m_resizeWindow && last )
@@ -123,4 +124,13 @@
}
}
+void ResizeEffect::windowMoveResizeGeometryUpdate( EffectWindow* c, const QRect& \
geometry ) + {
+ if( m_active && c == m_resizeWindow )
+ {
+ m_currentGeometry = geometry;
+ effects->addRepaintFull();
+ }
+ }
+
} // namespace
--- trunk/KDE/kdebase/workspace/kwin/effects/resize/resize.h #1042710:1042711
@@ -35,11 +35,13 @@
virtual void prePaintScreen( ScreenPrePaintData& data, int time );
virtual void paintWindow( EffectWindow* w, int mask, QRegion region, \
WindowPaintData& data );
virtual void windowUserMovedResized( EffectWindow *w, bool first, bool last \
); + virtual void windowMoveResizeGeometryUpdate(EffectWindow* c, const QRect& \
geometry);
private:
bool m_active;
EffectWindow* m_resizeWindow;
QRegion m_originalWindowRect;
+ QRect m_currentGeometry;
};
}
--- trunk/KDE/kdebase/workspace/kwin/geometry.cpp #1042710:1042711
@@ -3209,7 +3209,10 @@
drawbound( moveResizeGeom ); // they overlap; the paint event will come \
after this,
} // so the geometry tip will be painted above \
the outline if( effects )
+ {
+ static_cast<EffectsHandlerImpl*>(effects)->windowMoveResizeGeometryUpdate( \
effectWindow(), moveResizeGeom );
static_cast<EffectsHandlerImpl*>(effects)->windowUserMovedResized( \
effectWindow(), false, false ); + }
}
void Client::syncTimeout()
--- trunk/KDE/kdebase/workspace/kwin/lib/kwineffects.cpp #1042710:1042711
@@ -123,6 +123,10 @@
{
}
+void Effect::windowMoveResizeGeometryUpdate( EffectWindow* , const QRect& )
+ {
+ }
+
void Effect::windowOpacityChanged( EffectWindow*, double )
{
}
--- trunk/KDE/kdebase/workspace/kwin/lib/kwineffects.h #1042710:1042711
@@ -170,7 +170,7 @@
#define KWIN_EFFECT_API_MAKE_VERSION( major, minor ) (( major ) << 8 | ( minor ))
#define KWIN_EFFECT_API_VERSION_MAJOR 0
-#define KWIN_EFFECT_API_VERSION_MINOR 105
+#define KWIN_EFFECT_API_VERSION_MINOR 106
#define KWIN_EFFECT_API_VERSION KWIN_EFFECT_API_MAKE_VERSION( \
KWIN_EFFECT_API_VERSION_MAJOR, KWIN_EFFECT_API_VERSION_MINOR )
@@ -384,6 +384,8 @@
/** called when moved/resized or once after it's finished */
virtual void windowUserMovedResized( EffectWindow* c, bool first, bool last \
); + /** called when the geometry changed during moving/resizing. */
+ virtual void windowMoveResizeGeometryUpdate( EffectWindow* c, const QRect& \
geometry );
virtual void windowOpacityChanged( EffectWindow* c, double old_opacity );
virtual void windowAdded( EffectWindow* c );
virtual void windowClosed( EffectWindow* c );
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic