Raise electric border windows when an effect mouse input window is

created to allow effects to be toggled by active screen edges.

svn path=/trunk/KDE/kdebase/workspace/; revision=922121
icc-effect-5.14.5
Lucas Murray 2009-02-06 14:21:20 +00:00
parent a1c82cd52b
commit 81ffa5aec9
6 changed files with 44 additions and 24 deletions

View File

@ -665,6 +665,11 @@ Window EffectsHandlerImpl::createInputWindow( Effect* e, int x, int y, int w, in
XDefineCursor( display(), win, cursor.handle());
XMapWindow( display(), win );
input_windows.append( qMakePair( e, win ));
// Raise electric border windows above the input windows
// so they can still be triggered.
Workspace::self()->raiseElectricBorderWindows();
return win;
}
@ -740,6 +745,9 @@ void EffectsHandlerImpl::checkInputWindowStacking()
XRaiseWindow( display(), wins[ 0 ] );
XRestackWindows( display(), wins, pos );
delete[] wins;
// Raise electric border windows above the input windows
// so they can still be triggered. TODO: Do both at once.
Workspace::self()->raiseElectricBorderWindows();
}
QPoint EffectsHandlerImpl::cursorPos() const

View File

@ -1506,15 +1506,13 @@ void CubeEffect::paintWindow( EffectWindow* w, int mask, QRegion region, WindowP
bool CubeEffect::borderActivated( ElectricBorder border )
{
if( effects->activeFullScreenEffect() && effects->activeFullScreenEffect() != this )
if( border != borderActivate )
return false;
if( border == borderActivate && !activated )
{
kDebug(1212) << "border activated";
toggle();
if( effects->activeFullScreenEffect() && effects->activeFullScreenEffect() != this )
return true;
}
return false;
kDebug(1212) << "border activated";
toggle();
return true;
}
void CubeEffect::toggle()

View File

@ -406,14 +406,12 @@ void DesktopGridEffect::grabbedKeyboardEvent( QKeyEvent* e )
bool DesktopGridEffect::borderActivated( ElectricBorder border )
{
if( effects->activeFullScreenEffect() && effects->activeFullScreenEffect() != this )
if( border != borderActivate )
return false;
if( border == borderActivate && !activated )
{
toggle();
if( effects->activeFullScreenEffect() && effects->activeFullScreenEffect() != this )
return true;
}
return false;
toggle();
return true;
}
//-----------------------------------------------------------------------------

View File

@ -290,19 +290,15 @@ void PresentWindowsEffect::windowDeleted( EffectWindow *w )
bool PresentWindowsEffect::borderActivated( ElectricBorder border )
{
if( effects->activeFullScreenEffect() && effects->activeFullScreenEffect() != this )
if( border != m_borderActivate && border != m_borderActivateAll )
return false;
if( border == m_borderActivate && !m_activated )
{
if( effects->activeFullScreenEffect() && effects->activeFullScreenEffect() != this )
return true;
if( border == m_borderActivate )
toggleActive();
return true;
}
if( border == m_borderActivateAll && !m_activated )
{
else
toggleActiveAllDesktops();
return true;
}
return false;
return true;
}
void PresentWindowsEffect::windowInputMouseEvent( Window w, QEvent *e )

View File

@ -219,7 +219,25 @@ void Workspace::propagateClients( bool propagate_new_clients )
// Make the cached stacking order invalid here, in case we need the new stacking order before we get
// the matching event, due to X being asynchronous.
x_stacking_dirty = true;
x_stacking_dirty = true;
}
/**
* Raise electric border windows to the real top of the screen. We only need
* to do this if an effect input window is active.
*/
void Workspace::raiseElectricBorderWindows()
{
Window* windows = new Window[ 8 ]; // There are up to 8 borders
int pos = 0;
for( int i = 0; i < ELECTRIC_COUNT; ++i )
if( electric_windows[ i ] != None )
windows[ pos++ ] = electric_windows[ i ];
if( !pos )
return; // No borders at all
XRaiseWindow( display(), windows[ 0 ] );
XRestackWindows( display(), windows, pos );
delete [] windows;
}

View File

@ -361,6 +361,8 @@ class Workspace : public QObject, public KDecorationDefines
void startMousePolling();
void stopMousePolling();
void raiseElectricBorderWindows();
public slots:
void addRepaintFull();
void refresh();