Prevent multiple fullscreen effects from becoming active at the same time as discussed
on kwin ml svn path=/trunk/KDE/kdebase/workspace/; revision=731717
This commit is contained in:
parent
e063744820
commit
bb9ff25ec4
5 changed files with 34 additions and 0 deletions
15
effects.cpp
15
effects.cpp
|
@ -39,6 +39,7 @@ namespace KWin
|
|||
EffectsHandlerImpl::EffectsHandlerImpl(CompositingType type)
|
||||
: EffectsHandler(type)
|
||||
, keyboard_grab_effect( NULL )
|
||||
, fullscreen_effect( 0 )
|
||||
{
|
||||
reconfigure();
|
||||
}
|
||||
|
@ -258,6 +259,16 @@ void EffectsHandlerImpl::tabBoxUpdated()
|
|||
ep.second->tabBoxUpdated();
|
||||
}
|
||||
|
||||
void EffectsHandlerImpl::setActiveFullScreenEffect( Effect* e )
|
||||
{
|
||||
fullscreen_effect = e;
|
||||
}
|
||||
|
||||
Effect* EffectsHandlerImpl::activeFullScreenEffect() const
|
||||
{
|
||||
return fullscreen_effect;
|
||||
}
|
||||
|
||||
bool EffectsHandlerImpl::borderActivated( ElectricBorder border )
|
||||
{
|
||||
bool ret = false;
|
||||
|
@ -723,6 +734,10 @@ void EffectsHandlerImpl::unloadEffect( const QString& name )
|
|||
if ( it.value().first == name )
|
||||
{
|
||||
kDebug( 1212 ) << "EffectsHandler::unloadEffect : Unloading Effect : " << name;
|
||||
if( activeFullScreenEffect() == it.value().second )
|
||||
{
|
||||
setActiveFullScreenEffect( 0 );
|
||||
}
|
||||
delete it.value().second;
|
||||
effect_order.erase(it);
|
||||
effectsChanged();
|
||||
|
|
|
@ -66,6 +66,9 @@ class EffectsHandlerImpl : public EffectsHandler
|
|||
virtual int currentTabBoxDesktop() const;
|
||||
virtual EffectWindow* currentTabBoxWindow() const;
|
||||
|
||||
virtual void setActiveFullScreenEffect( Effect* e );
|
||||
virtual Effect* activeFullScreenEffect() const;
|
||||
|
||||
virtual void pushRenderTarget(GLRenderTarget* target);
|
||||
virtual GLRenderTarget* popRenderTarget();
|
||||
|
||||
|
@ -125,6 +128,7 @@ class EffectsHandlerImpl : public EffectsHandler
|
|||
|
||||
Effect* keyboard_grab_effect;
|
||||
QStack<GLRenderTarget*> render_targets;
|
||||
Effect* fullscreen_effect;
|
||||
ToplevelList elevated_windows;
|
||||
QMultiMap< int, EffectPair > effect_order;
|
||||
};
|
||||
|
|
|
@ -350,6 +350,8 @@ EffectWindow* DesktopGridEffect::windowAt( const QPoint& pos, QRect* rect ) cons
|
|||
|
||||
void DesktopGridEffect::desktopChanged( int old )
|
||||
{
|
||||
if( effects->activeFullScreenEffect() && effects->activeFullScreenEffect() != this )
|
||||
return;
|
||||
if( activated )
|
||||
setActive( false );
|
||||
else
|
||||
|
@ -430,6 +432,8 @@ void DesktopGridEffect::toggle()
|
|||
|
||||
void DesktopGridEffect::setActive( bool active )
|
||||
{
|
||||
if( effects->activeFullScreenEffect() && effects->activeFullScreenEffect() != this )
|
||||
return;
|
||||
if( activated == active )
|
||||
return;
|
||||
activated = active;
|
||||
|
@ -443,6 +447,7 @@ void DesktopGridEffect::setup()
|
|||
keyboard_grab = effects->grabKeyboard( this );
|
||||
input = effects->createInputWindow( this, 0, 0, displayWidth(), displayHeight(),
|
||||
Qt::PointingHandCursor );
|
||||
effects->setActiveFullScreenEffect( this );
|
||||
hover_desktop = effects->currentDesktop();
|
||||
}
|
||||
|
||||
|
@ -455,6 +460,7 @@ void DesktopGridEffect::finish()
|
|||
effects->setElevatedWindow( window_move, false );
|
||||
window_move = NULL;
|
||||
effects->destroyInputWindow( input );
|
||||
effects->setActiveFullScreenEffect( 0 );
|
||||
effects->addRepaintFull(); // to get rid of hover
|
||||
}
|
||||
|
||||
|
|
|
@ -286,6 +286,8 @@ void PresentWindowsEffect::windowClosed( EffectWindow* w )
|
|||
|
||||
void PresentWindowsEffect::setActive(bool active)
|
||||
{
|
||||
if( effects->activeFullScreenEffect() && effects->activeFullScreenEffect() != this )
|
||||
return;
|
||||
if( mActivated == active )
|
||||
return;
|
||||
mActivated = active;
|
||||
|
@ -326,6 +328,7 @@ void PresentWindowsEffect::effectActivated()
|
|||
// Create temporary input window to catch mouse events
|
||||
mInput = effects->createFullScreenInputWindow( this, Qt::PointingHandCursor );
|
||||
hasKeyboardGrab = effects->grabKeyboard( this );
|
||||
effects->setActiveFullScreenEffect( this );
|
||||
}
|
||||
|
||||
void PresentWindowsEffect::effectTerminated()
|
||||
|
@ -335,6 +338,7 @@ void PresentWindowsEffect::effectTerminated()
|
|||
if( hasKeyboardGrab )
|
||||
effects->ungrabKeyboard();
|
||||
hasKeyboardGrab = false;
|
||||
effects->setActiveFullScreenEffect( 0 );
|
||||
}
|
||||
|
||||
void PresentWindowsEffect::rearrangeWindows()
|
||||
|
@ -731,6 +735,8 @@ bool PresentWindowsEffect::canRearrangeClosest(EffectWindowList windowlist)
|
|||
|
||||
bool PresentWindowsEffect::borderActivated( ElectricBorder border )
|
||||
{
|
||||
if( effects->activeFullScreenEffect() && effects->activeFullScreenEffect() != this )
|
||||
return false;
|
||||
if( border == borderActivate && !mActivated )
|
||||
{
|
||||
toggleActive();
|
||||
|
|
|
@ -229,6 +229,9 @@ class KWIN_EXPORT EffectsHandler
|
|||
virtual int currentTabBoxDesktop() const = 0;
|
||||
virtual EffectWindow* currentTabBoxWindow() const = 0;
|
||||
|
||||
virtual void setActiveFullScreenEffect( Effect* e ) = 0;
|
||||
virtual Effect* activeFullScreenEffect() const = 0;
|
||||
|
||||
virtual void pushRenderTarget(GLRenderTarget* target) = 0;
|
||||
virtual GLRenderTarget* popRenderTarget() = 0;
|
||||
|
||||
|
|
Loading…
Reference in a new issue