Fixes related to shown shaded windows.
svn path=/trunk/kdebase/kwin/; revision=257726
This commit is contained in:
parent
7f30475e40
commit
d45a853dd4
7 changed files with 31 additions and 32 deletions
|
@ -316,7 +316,7 @@ void Workspace::requestFocus( Client* c, bool force )
|
|||
requestFocus( modal, force );
|
||||
return;
|
||||
}
|
||||
if ( c->isShown() )
|
||||
if ( c->isShown( false ) )
|
||||
{
|
||||
c->takeFocus( force, Allowed );
|
||||
should_get_focus.append( c );
|
||||
|
@ -368,7 +368,7 @@ void Workspace::clientHidden( Client* c )
|
|||
it != focus_chain.end();
|
||||
--it )
|
||||
{
|
||||
if( !(*it)->isShown() || !(*it)->isOnCurrentDesktop())
|
||||
if( !(*it)->isShown( false ) || !(*it)->isOnCurrentDesktop())
|
||||
continue;
|
||||
if( mainwindows.contains( *it ))
|
||||
{
|
||||
|
|
16
client.cpp
16
client.cpp
|
@ -486,7 +486,7 @@ void Client::hideClient( bool hide )
|
|||
setSkipTaskbar( original_skip_taskbar, false );
|
||||
if( isOnCurrentDesktop())
|
||||
{
|
||||
if( isShown())
|
||||
if( isShown( false ))
|
||||
setMappingState( NormalState );
|
||||
rawShow(); // is either visible or shaded
|
||||
}
|
||||
|
@ -507,7 +507,7 @@ bool Client::isMinimizable() const
|
|||
for( ClientList::ConstIterator it = mainclients.begin();
|
||||
it != mainclients.end();
|
||||
++it )
|
||||
if( (*it)->isShown())
|
||||
if( (*it)->isShown( true ))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -548,7 +548,7 @@ void Client::unminimize()
|
|||
{
|
||||
if( mainClients().isEmpty())
|
||||
animateMinimizeOrUnminimize( FALSE );
|
||||
if( isShown())
|
||||
if( isShown( false ))
|
||||
setMappingState( NormalState );
|
||||
rawShow(); // is either visible or shaded
|
||||
}
|
||||
|
@ -697,12 +697,12 @@ void Client::setShade( ShadeMode mode )
|
|||
|
||||
if( shade_mode == ShadeNormal )
|
||||
{
|
||||
if ( isShown() && isOnCurrentDesktop())
|
||||
if ( isShown( true ) && isOnCurrentDesktop())
|
||||
Notify::raise( Notify::ShadeUp );
|
||||
}
|
||||
else if( shade_mode == ShadeNone )
|
||||
{
|
||||
if( isShown() && isOnCurrentDesktop())
|
||||
if( isShown( true ) && isOnCurrentDesktop())
|
||||
Notify::raise( Notify::ShadeDown );
|
||||
}
|
||||
|
||||
|
@ -772,8 +772,8 @@ void Client::setShade( ShadeMode mode )
|
|||
--block_geometry;
|
||||
setGeometry( geometry(), ForceGeometrySet );
|
||||
info->setState( isShade() ? NET::Shaded : 0, NET::Shaded );
|
||||
info->setState( isShown() ? 0 : NET::Hidden, NET::Hidden );
|
||||
setMappingState( isShown() && isOnCurrentDesktop() ? NormalState : IconicState );
|
||||
info->setState( isShown( false ) ? 0 : NET::Hidden, NET::Hidden );
|
||||
setMappingState( isShown( false ) && isOnCurrentDesktop() ? NormalState : IconicState );
|
||||
updateAllowedActions();
|
||||
workspace()->updateMinimizedOfTransients( this );
|
||||
decoration->shadeChange();
|
||||
|
@ -1083,7 +1083,7 @@ void Client::setDesktop( int desktop )
|
|||
info->setDesktop( desktop );
|
||||
if(( was_desk == NET::OnAllDesktops ) != ( desktop == NET::OnAllDesktops ))
|
||||
{ // onAllDesktops changed
|
||||
if ( isShown())
|
||||
if ( isShown( true ))
|
||||
Notify::raise( isOnAllDesktops() ? Notify::OnAllDesktops : Notify::NotOnAllDesktops );
|
||||
workspace()->updateOnAllDesktopsOfTransients( this );
|
||||
}
|
||||
|
|
9
client.h
9
client.h
|
@ -98,9 +98,8 @@ class Client : public QObject, public KDecorationDefines
|
|||
bool isOnAllDesktops() const;
|
||||
void setOnAllDesktops( bool set );
|
||||
|
||||
// !isShade() && !isMinimized() && not hidden, i.e. normally visible on some virtual desktop
|
||||
// SELI this may possibly clash with QWidget::isShown(), as long as Client is a QWidget
|
||||
bool isShown() const;
|
||||
// !isMinimized() && not hidden, i.e. normally visible on some virtual desktop
|
||||
bool isShown( bool shaded_is_shown ) const;
|
||||
|
||||
enum ShadeMode
|
||||
{
|
||||
|
@ -594,9 +593,9 @@ inline bool Client::isOnDesktop( int d ) const
|
|||
}
|
||||
|
||||
inline
|
||||
bool Client::isShown() const
|
||||
bool Client::isShown( bool shaded_is_shown ) const
|
||||
{
|
||||
return !isMinimized() && !isShade() && !hidden;
|
||||
return !isMinimized() && ( !isShade() || shaded_is_shown ) && !hidden;
|
||||
}
|
||||
|
||||
inline
|
||||
|
|
|
@ -190,7 +190,7 @@ Client* Workspace::topClientOnDesktop( int desktop ) const
|
|||
for ( ClientList::ConstIterator it = stacking_order.fromLast(); it != stacking_order.end(); --it)
|
||||
{
|
||||
if ( (*it)->isOnDesktop( desktop ) && !(*it)->isSpecialWindow()
|
||||
&& (*it)->isShown() && (*it)->wantsTabFocus())
|
||||
&& (*it)->isShown( false ) && (*it)->wantsTabFocus())
|
||||
return *it;
|
||||
}
|
||||
return 0;
|
||||
|
@ -204,7 +204,7 @@ Client* Workspace::findDesktop( bool topmost, int desktop ) const
|
|||
for ( ClientList::ConstIterator it = stacking_order.fromLast(); it != stacking_order.end(); --it)
|
||||
{
|
||||
if ( (*it)->isOnDesktop( desktop ) && (*it)->isDesktop()
|
||||
&& (*it)->isShown())
|
||||
&& (*it)->isShown( true ))
|
||||
return *it;
|
||||
}
|
||||
}
|
||||
|
@ -213,7 +213,7 @@ Client* Workspace::findDesktop( bool topmost, int desktop ) const
|
|||
for ( ClientList::ConstIterator it = stacking_order.begin(); it != stacking_order.end(); ++it)
|
||||
{
|
||||
if ( (*it)->isOnDesktop( desktop ) && (*it)->isDesktop()
|
||||
&& (*it)->isShown())
|
||||
&& (*it)->isShown( true ))
|
||||
return *it;
|
||||
}
|
||||
}
|
||||
|
@ -226,7 +226,7 @@ void Workspace::raiseOrLowerClient( Client *c)
|
|||
Client* topmost = NULL;
|
||||
Q_ASSERT( block_stacking_updates == 0 );
|
||||
if ( most_recently_raised && stacking_order.contains( most_recently_raised ) &&
|
||||
most_recently_raised->isShown() && c->isOnCurrentDesktop())
|
||||
most_recently_raised->isShown( true ) && c->isOnCurrentDesktop())
|
||||
topmost = most_recently_raised;
|
||||
else
|
||||
topmost = topClientOnDesktop( c->isOnAllDesktops() ? currentDesktop() : c->desktop());
|
||||
|
|
|
@ -323,7 +323,7 @@ bool Client::manage( Window w, bool isMapped )
|
|||
for( ClientList::ConstIterator it = mainclients.begin();
|
||||
it != mainclients.end();
|
||||
++it )
|
||||
if( (*it)->isShown())
|
||||
if( (*it)->isShown( true ))
|
||||
init_minimize = false; // SELI even e.g. for NET::Utility?
|
||||
}
|
||||
|
||||
|
@ -430,7 +430,7 @@ bool Client::manage( Window w, bool isMapped )
|
|||
|
||||
user_time = readUserTimeMapTimestamp( asn_valid ? &asn_data : NULL, session );
|
||||
|
||||
if ( isShown() && !doNotShow )
|
||||
if ( isShown( true ) && !doNotShow )
|
||||
{
|
||||
if( isDialog())
|
||||
Notify::raise( Notify::TransNew );
|
||||
|
|
|
@ -157,7 +157,7 @@ void Placement::placeSmart(Client* c)
|
|||
for(l = m_WorkspacePtr->stackingOrder().begin(); l != m_WorkspacePtr->stackingOrder().end() ; ++l)
|
||||
{
|
||||
if((*l)->isOnDesktop(desktop) &&
|
||||
(*l)->isShown() && (*l) != c)
|
||||
(*l)->isShown( false ) && (*l) != c)
|
||||
{
|
||||
|
||||
xl = (*l)->x(); yt = (*l)->y();
|
||||
|
@ -214,7 +214,7 @@ void Placement::placeSmart(Client* c)
|
|||
{
|
||||
|
||||
if ((*l)->isOnDesktop(desktop) &&
|
||||
(*l)->isShown() && (*l) != c)
|
||||
(*l)->isShown( false ) && (*l) != c)
|
||||
{
|
||||
|
||||
xl = (*l)->x(); yt = (*l)->y();
|
||||
|
@ -248,7 +248,7 @@ void Placement::placeSmart(Client* c)
|
|||
for(l = m_WorkspacePtr->stackingOrder().begin(); l != m_WorkspacePtr->stackingOrder().end() ; ++l)
|
||||
{
|
||||
if((*l)->isOnDesktop(desktop) &&
|
||||
(*l) != c && c->isShown())
|
||||
(*l) != c && c->isShown( false ))
|
||||
{
|
||||
|
||||
xl = (*l)->x(); yt = (*l)->y();
|
||||
|
@ -582,7 +582,7 @@ int Workspace::packPositionLeft( const Client* cl, int oldx, bool left_edge ) co
|
|||
it != clients.end();
|
||||
++it)
|
||||
{
|
||||
if( !(*it)->isShown() || !(*it)->isOnDesktop( active_client->desktop()))
|
||||
if( !(*it)->isShown( false ) || !(*it)->isOnDesktop( active_client->desktop()))
|
||||
continue;
|
||||
int x = left_edge ? (*it)->geometry().right() + 1 : (*it)->geometry().left() - 1;
|
||||
if( x > newx && x < oldx
|
||||
|
@ -605,7 +605,7 @@ int Workspace::packPositionRight( const Client* cl, int oldx, bool right_edge )
|
|||
it != clients.end();
|
||||
++it)
|
||||
{
|
||||
if( !(*it)->isShown() || !(*it)->isOnDesktop( cl->desktop()))
|
||||
if( !(*it)->isShown( false ) || !(*it)->isOnDesktop( cl->desktop()))
|
||||
continue;
|
||||
int x = right_edge ? (*it)->geometry().left() - 1 : (*it)->geometry().right() + 1;
|
||||
if( x < newx && x > oldx
|
||||
|
@ -628,7 +628,7 @@ int Workspace::packPositionUp( const Client* cl, int oldy, bool top_edge ) const
|
|||
it != clients.end();
|
||||
++it)
|
||||
{
|
||||
if( !(*it)->isShown() || !(*it)->isOnDesktop( cl->desktop()))
|
||||
if( !(*it)->isShown( false ) || !(*it)->isOnDesktop( cl->desktop()))
|
||||
continue;
|
||||
int y = top_edge ? (*it)->geometry().bottom() + 1 : (*it)->geometry().top() - 1;
|
||||
if( y > newy && y < oldy
|
||||
|
@ -651,7 +651,7 @@ int Workspace::packPositionDown( const Client* cl, int oldy, bool bottom_edge )
|
|||
it != clients.end();
|
||||
++it)
|
||||
{
|
||||
if( !(*it)->isShown() || !(*it)->isOnDesktop( cl->desktop()))
|
||||
if( !(*it)->isShown( false ) || !(*it)->isOnDesktop( cl->desktop()))
|
||||
continue;
|
||||
int y = bottom_edge ? (*it)->geometry().top() - 1 : (*it)->geometry().bottom() + 1;
|
||||
if( y < newy && y > oldy
|
||||
|
|
|
@ -960,7 +960,7 @@ bool Workspace::setCurrentDesktop( int new_desktop )
|
|||
{
|
||||
// Search in focus chain
|
||||
|
||||
if ( focus_chain.contains( active_client ) && active_client->isShown()
|
||||
if ( focus_chain.contains( active_client ) && active_client->isShown( true )
|
||||
&& active_client->isOnCurrentDesktop())
|
||||
{
|
||||
c = active_client; // the requestFocus below will fail, as the client is already active
|
||||
|
@ -970,7 +970,7 @@ bool Workspace::setCurrentDesktop( int new_desktop )
|
|||
{
|
||||
for( ClientList::ConstIterator it = focus_chain.fromLast(); it != focus_chain.end(); --it)
|
||||
{
|
||||
if ( (*it)->isShown() && !(*it)->isOnAllDesktops() && (*it)->isOnCurrentDesktop())
|
||||
if ( (*it)->isShown( false ) && !(*it)->isOnAllDesktops() && (*it)->isOnCurrentDesktop())
|
||||
{
|
||||
c = *it;
|
||||
break;
|
||||
|
@ -982,7 +982,7 @@ bool Workspace::setCurrentDesktop( int new_desktop )
|
|||
{
|
||||
for( ClientList::ConstIterator it = focus_chain.fromLast(); it != focus_chain.end(); --it)
|
||||
{
|
||||
if ( (*it)->isShown() && (*it)->isOnCurrentDesktop())
|
||||
if ( (*it)->isShown( false ) && (*it)->isOnCurrentDesktop())
|
||||
{
|
||||
c = *it;
|
||||
break;
|
||||
|
@ -994,7 +994,7 @@ bool Workspace::setCurrentDesktop( int new_desktop )
|
|||
//if "unreasonable focus policy"
|
||||
// and active_client is on_all_desktops and under mouse (hence == old_active_client),
|
||||
// conserve focus (thanks to Volker Schatz <V.Schatz at thphys.uni-heidelberg.de>)
|
||||
else if( active_client && active_client->isShown() && active_client->isOnCurrentDesktop())
|
||||
else if( active_client && active_client->isShown( true ) && active_client->isOnCurrentDesktop())
|
||||
c= active_client;
|
||||
|
||||
if( c != active_client )
|
||||
|
|
Loading…
Reference in a new issue