unified window captions ( not propagated yet)
svn path=/trunk/kdebase/kwin/; revision=35364
This commit is contained in:
parent
070b0971cc
commit
82b0710065
3 changed files with 27 additions and 1 deletions
13
client.cpp
13
client.cpp
|
@ -410,7 +410,18 @@ void Client::fetchName()
|
|||
if ( XFetchName( qt_xdisplay(), win, &name ) && name ) {
|
||||
QString s = QString::fromLatin1( name );
|
||||
if ( s != caption() ) {
|
||||
setCaption( QString::fromLatin1( name ) );
|
||||
setCaption( "" );
|
||||
if (workspace()->hasCaption( s ) ){
|
||||
int i = 2;
|
||||
QString s2;
|
||||
do {
|
||||
s2 = s + " <" + QString::number(i) + ">";
|
||||
i++;
|
||||
} while (workspace()->hasCaption(s2) );
|
||||
s = s2;
|
||||
}
|
||||
setCaption( s );
|
||||
|
||||
if ( !isWithdrawn() )
|
||||
captionChange( caption() );
|
||||
}
|
||||
|
|
|
@ -775,6 +775,19 @@ void Workspace::iconifyOrDeiconifyTransientsOf( Client* c )
|
|||
}
|
||||
|
||||
|
||||
/*!
|
||||
Returns whether a client with the specified \a caption exists, or not.
|
||||
*/
|
||||
bool Workspace::hasCaption( const QString& caption )
|
||||
{
|
||||
for ( ClientList::ConstIterator it = clients.begin(); it != clients.end(); ++it) {
|
||||
if ( (*it)->caption() == caption )
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
Tries to activate the client by asking X for the input focus. This
|
||||
function does not perform any show, raise or desktop switching. See
|
||||
|
|
|
@ -100,6 +100,8 @@ public:
|
|||
bool iconifyMeansWithdraw( Client* );
|
||||
void iconifyOrDeiconifyTransientsOf( Client* );
|
||||
|
||||
bool hasCaption( const QString& caption );
|
||||
|
||||
public slots:
|
||||
void setCurrentDesktop( int new_desktop );
|
||||
// keybindings
|
||||
|
|
Loading…
Reference in a new issue