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=922121icc-effect-5.14.5
parent
a1c82cd52b
commit
81ffa5aec9
|
@ -665,6 +665,11 @@ Window EffectsHandlerImpl::createInputWindow( Effect* e, int x, int y, int w, in
|
||||||
XDefineCursor( display(), win, cursor.handle());
|
XDefineCursor( display(), win, cursor.handle());
|
||||||
XMapWindow( display(), win );
|
XMapWindow( display(), win );
|
||||||
input_windows.append( qMakePair( e, 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;
|
return win;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -740,6 +745,9 @@ void EffectsHandlerImpl::checkInputWindowStacking()
|
||||||
XRaiseWindow( display(), wins[ 0 ] );
|
XRaiseWindow( display(), wins[ 0 ] );
|
||||||
XRestackWindows( display(), wins, pos );
|
XRestackWindows( display(), wins, pos );
|
||||||
delete[] wins;
|
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
|
QPoint EffectsHandlerImpl::cursorPos() const
|
||||||
|
|
|
@ -1506,16 +1506,14 @@ void CubeEffect::paintWindow( EffectWindow* w, int mask, QRegion region, WindowP
|
||||||
|
|
||||||
bool CubeEffect::borderActivated( ElectricBorder border )
|
bool CubeEffect::borderActivated( ElectricBorder border )
|
||||||
{
|
{
|
||||||
if( effects->activeFullScreenEffect() && effects->activeFullScreenEffect() != this )
|
if( border != borderActivate )
|
||||||
return false;
|
return false;
|
||||||
if( border == borderActivate && !activated )
|
if( effects->activeFullScreenEffect() && effects->activeFullScreenEffect() != this )
|
||||||
{
|
return true;
|
||||||
kDebug(1212) << "border activated";
|
kDebug(1212) << "border activated";
|
||||||
toggle();
|
toggle();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CubeEffect::toggle()
|
void CubeEffect::toggle()
|
||||||
{
|
{
|
||||||
|
|
|
@ -406,15 +406,13 @@ void DesktopGridEffect::grabbedKeyboardEvent( QKeyEvent* e )
|
||||||
|
|
||||||
bool DesktopGridEffect::borderActivated( ElectricBorder border )
|
bool DesktopGridEffect::borderActivated( ElectricBorder border )
|
||||||
{
|
{
|
||||||
if( effects->activeFullScreenEffect() && effects->activeFullScreenEffect() != this )
|
if( border != borderActivate )
|
||||||
return false;
|
return false;
|
||||||
if( border == borderActivate && !activated )
|
if( effects->activeFullScreenEffect() && effects->activeFullScreenEffect() != this )
|
||||||
{
|
return true;
|
||||||
toggle();
|
toggle();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Helper functions
|
// Helper functions
|
||||||
|
|
|
@ -290,20 +290,16 @@ void PresentWindowsEffect::windowDeleted( EffectWindow *w )
|
||||||
|
|
||||||
bool PresentWindowsEffect::borderActivated( ElectricBorder border )
|
bool PresentWindowsEffect::borderActivated( ElectricBorder border )
|
||||||
{
|
{
|
||||||
if( effects->activeFullScreenEffect() && effects->activeFullScreenEffect() != this )
|
if( border != m_borderActivate && border != m_borderActivateAll )
|
||||||
return false;
|
return false;
|
||||||
if( border == m_borderActivate && !m_activated )
|
if( effects->activeFullScreenEffect() && effects->activeFullScreenEffect() != this )
|
||||||
{
|
|
||||||
toggleActive();
|
|
||||||
return true;
|
return true;
|
||||||
}
|
if( border == m_borderActivate )
|
||||||
if( border == m_borderActivateAll && !m_activated )
|
toggleActive();
|
||||||
{
|
else
|
||||||
toggleActiveAllDesktops();
|
toggleActiveAllDesktops();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void PresentWindowsEffect::windowInputMouseEvent( Window w, QEvent *e )
|
void PresentWindowsEffect::windowInputMouseEvent( Window w, QEvent *e )
|
||||||
{
|
{
|
||||||
|
|
18
layers.cpp
18
layers.cpp
|
@ -222,6 +222,24 @@ void Workspace::propagateClients( bool propagate_new_clients )
|
||||||
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Returns topmost visible client. Windows on the dock, the desktop
|
Returns topmost visible client. Windows on the dock, the desktop
|
||||||
|
|
|
@ -361,6 +361,8 @@ class Workspace : public QObject, public KDecorationDefines
|
||||||
void startMousePolling();
|
void startMousePolling();
|
||||||
void stopMousePolling();
|
void stopMousePolling();
|
||||||
|
|
||||||
|
void raiseElectricBorderWindows();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void addRepaintFull();
|
void addRepaintFull();
|
||||||
void refresh();
|
void refresh();
|
||||||
|
|
Loading…
Reference in New Issue