Fix fullscreen with mouse focus policies, fix ##62208 and fix properly

##69238.

svn path=/trunk/kdebase/kwin/; revision=281049
This commit is contained in:
Luboš Luňák 2004-01-19 14:42:52 +00:00
parent 455e128802
commit 43d67778b8
2 changed files with 19 additions and 7 deletions

View file

@ -197,10 +197,23 @@ void Workspace::propagateClients( bool propagate_new_clients )
doesn't accept focus it's excluded. doesn't accept focus it's excluded.
*/ */
// TODO misleading name for this method // TODO misleading name for this method
Client* Workspace::topClientOnDesktop( int desktop ) const Client* Workspace::topClientOnDesktop( int desktop, bool unconstrained ) const
{ {
// TODO Q_ASSERT( block_stacking_updates == 0 ); // TODO Q_ASSERT( block_stacking_updates == 0 );
for ( ClientList::ConstIterator it = stacking_order.fromLast(); it != stacking_order.end(); --it) ClientList::ConstIterator begin, end;
if( !unconstrained )
{
begin = stacking_order.fromLast();
end = stacking_order.end();
}
else
{
begin = unconstrained_stacking_order.fromLast();
end = unconstrained_stacking_order.end();
}
for( ClientList::ConstIterator it = begin;
it != end;
--it )
{ {
if ( (*it)->isOnDesktop( desktop ) && !(*it)->isSpecialWindow() if ( (*it)->isOnDesktop( desktop ) && !(*it)->isSpecialWindow()
&& (*it)->isShown( false ) && (*it)->wantsTabFocus()) && (*it)->isShown( false ) && (*it)->wantsTabFocus())
@ -663,10 +676,9 @@ Layer Client::belongsToLayer() const
return DockLayer; return DockLayer;
if( isTopMenu()) if( isTopMenu())
return DockLayer; return DockLayer;
// TODO this feature doesn't work very well with mouse focus policies - window A gets focus in, and is // only raise fullscreen above docks if it's the topmost window in unconstrained stacking order,
// raised, but if meanwhile B gets focus in, A is lowered below B again, then the focus in for A // i.e. the window set to be topmost by the user
// is processed, A is raised above B, but meanwhile B's focus in is processed ... bool raise_special_active_windows = ( workspace()->topClientOnDesktop( desktop(), true ) == this );
bool raise_special_active_windows = options->focusPolicy == Options::ClickToFocus; // || options->autoRaise );
if( isDialog() && workspace()->activeClient() == this && raise_special_active_windows ) if( isDialog() && workspace()->activeClient() == this && raise_special_active_windows )
return ActiveLayer; return ActiveLayer;
if( keepAbove()) if( keepAbove())

View file

@ -172,7 +172,7 @@ class Workspace : public QObject, public KWinInterface, public KDecorationDefine
ClientList ensureStackingOrder( const ClientList& clients ) const; ClientList ensureStackingOrder( const ClientList& clients ) const;
Client* topClientOnDesktop( int desktop ) const; Client* topClientOnDesktop( int desktop, bool unconstrained = false ) const;
Client* findDesktop( bool topmost, int desktop ) const; Client* findDesktop( bool topmost, int desktop ) const;
void sendClientToDesktop( Client* c, int desktop, bool dont_activate ); void sendClientToDesktop( Client* c, int desktop, bool dont_activate );