Add new role, so that fullscreen effects can enforce blurring of windows they know to be translucent and on a fixed position.
Used in cube animation for all sticky windows and in desktop grid for the add/remove desktops window. svn path=/trunk/KDE/kdebase/workspace/; revision=1137489
This commit is contained in:
parent
8be6c90be9
commit
633d80001f
4 changed files with 25 additions and 4 deletions
|
@ -220,7 +220,9 @@ void BlurEffect::drawWindow(EffectWindow *w, int mask, QRegion region, WindowPai
|
|||
bool valid = target->valid() && shader->isValid();
|
||||
|
||||
QRegion shape;
|
||||
if (!effects->activeFullScreenEffect() && hasAlpha && !w->isDesktop() && !transformed)
|
||||
const QVariant forceBlur = w->data( WindowForceBlurRole );
|
||||
if ((!effects->activeFullScreenEffect() || (forceBlur.isValid() && forceBlur.toBool() ))
|
||||
&& hasAlpha && !w->isDesktop() && !transformed)
|
||||
shape = blurRegion(w).translated(w->geometry().topLeft()) & screen;
|
||||
|
||||
if (valid && !shape.isEmpty() && region.intersects(shape.boundingRect()))
|
||||
|
|
|
@ -204,15 +204,18 @@ void CubeSlideEffect::prePaintWindow( EffectWindow* w, WindowPrePaintData& data
|
|||
QRect rect = effects->clientArea( FullArea, effects->activeScreen(), painting_desktop );
|
||||
if( dontSlidePanels && w->isDock())
|
||||
{
|
||||
w->setData( WindowForceBlurRole, QVariant( true ) );
|
||||
panels.insert( w );
|
||||
}
|
||||
if( !w->isManaged() )
|
||||
{
|
||||
w->setData( WindowForceBlurRole, QVariant( true ) );
|
||||
stickyWindows.insert( w );
|
||||
}
|
||||
else if( dontSlideStickyWindows && !w->isDock() &&
|
||||
!w->isDesktop() && w->isOnAllDesktops())
|
||||
{
|
||||
w->setData( WindowForceBlurRole, QVariant( true ) );
|
||||
stickyWindows.insert( w );
|
||||
}
|
||||
if( w->isOnDesktop( painting_desktop ) )
|
||||
|
@ -453,6 +456,12 @@ void CubeSlideEffect::postPaintScreen()
|
|||
timeLine.setCurveShape( TimeLine::LinearCurve );
|
||||
if( slideRotations.empty() )
|
||||
{
|
||||
foreach( EffectWindow* w, panels )
|
||||
w->setData( WindowForceBlurRole, QVariant( false ) );
|
||||
foreach( EffectWindow* w, stickyWindows )
|
||||
w->setData( WindowForceBlurRole, QVariant( false ) );
|
||||
stickyWindows.clear();
|
||||
panels.clear();
|
||||
effects->setActiveFullScreenEffect( 0 );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,6 +38,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include <QtGui/QPainter>
|
||||
#include <QtGui/QGraphicsLinearLayout>
|
||||
#include <Plasma/PushButton>
|
||||
#include <Plasma/WindowEffects>
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
@ -166,12 +167,19 @@ void DesktopGridEffect::paintScreen( int mask, QRegion region, ScreenPaintData&
|
|||
it != m_desktopButtonsViews.end(); ++it )
|
||||
{
|
||||
if( !it.value() )
|
||||
it.value() = effects->findWindow( it.key()->winId() );
|
||||
{
|
||||
EffectWindow *view = effects->findWindow( it.key()->winId() );
|
||||
if( view )
|
||||
{
|
||||
view->setData( WindowForceBlurRole, QVariant( true ) );
|
||||
it.value() = view;
|
||||
}
|
||||
}
|
||||
if( it.value() )
|
||||
{
|
||||
WindowPaintData d( it.value() );
|
||||
d.opacity *= timeline.value();
|
||||
effects->drawWindow( it.value(), PAINT_WINDOW_TRANSFORMED | PAINT_WINDOW_TRANSLUCENT,
|
||||
effects->drawWindow( it.value(), PAINT_WINDOW_TRANSLUCENT,
|
||||
infiniteRegion(), d );
|
||||
}
|
||||
}
|
||||
|
@ -1544,6 +1552,7 @@ DesktopButtonsView::DesktopButtonsView( QWidget* parent )
|
|||
qreal width = form->size().width() + left + right;
|
||||
qreal height = form->size().height() + top + bottom;
|
||||
m_frame->resizeFrame( QSizeF( width, height ) );
|
||||
Plasma::WindowEffects::enableBlurBehind( winId(), true, m_frame->mask() );
|
||||
form->setPos( left, top );
|
||||
scene->setSceneRect( QRectF( QPointF( 0, 0 ), QSizeF( width, height ) ) );
|
||||
setScene( scene );
|
||||
|
|
|
@ -192,7 +192,8 @@ enum DataRole
|
|||
WindowAddedGrabRole = 1,
|
||||
WindowClosedGrabRole,
|
||||
WindowMinimizedGrabRole,
|
||||
WindowUnminimizedGrabRole
|
||||
WindowUnminimizedGrabRole,
|
||||
WindowForceBlurRole ///< For fullscreen effects to enforce blurring of windows
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue