Something I forgot for #44268 - show the shortcut in the titlebar.

svn path=/trunk/kdebase/kwin/; revision=387104
This commit is contained in:
Luboš Luňák 2005-02-07 15:17:26 +00:00
parent 240fc84c05
commit bdd2665a29
3 changed files with 10 additions and 2 deletions

View file

@ -1278,13 +1278,14 @@ void Client::setCaption( const QString& s, bool force )
QString machine_suffix;
if( wmClientMachine( false ) != "localhost" && !isLocalMachine( wmClientMachine( false )))
machine_suffix = " <@" + wmClientMachine( true ) + ">";
cap_suffix = machine_suffix;
QString shortcut_suffix = !shortcut().isNull() ? ( " {" + shortcut().toString() + "}" ) : "";
cap_suffix = machine_suffix + shortcut_suffix;
if ( ( !isSpecialWindow() || isToolbar()) && workspace()->findClient( FetchNameInternalPredicate( this )))
{
int i = 2;
do
{
cap_suffix = machine_suffix + " <" + QString::number(i) + ">";
cap_suffix = machine_suffix + " <" + QString::number(i) + ">" + shortcut_suffix;
i++;
} while ( workspace()->findClient( FetchNameInternalPredicate( this )));
info->setVisibleName( caption().utf8() );
@ -1304,6 +1305,11 @@ void Client::setCaption( const QString& s, bool force )
}
}
void Client::updateCaption()
{
setCaption( cap_normal, true );
}
void Client::fetchIconicName()
{
QString s;

View file

@ -235,6 +235,7 @@ class Client : public QObject, public KDecorationDefines
void virtualDesktopChange();
QString caption( bool full = true ) const;
void updateCaption();
void keyPressEvent( uint key_code ); // FRAME ??
void updateMouseGrab();

View file

@ -1015,6 +1015,7 @@ void Client::setShortcutInternal( const KShortcut& cut )
if( _shortcut == cut )
return;
_shortcut = cut;
updateCaption();
workspace()->clientShortcutUpdated( this );
}