do not accept empty captions, use unnamed instead.

svn path=/trunk/kdebase/kwin/; revision=35366
This commit is contained in:
Matthias Ettrich 1999-11-28 20:58:58 +00:00
parent 82b0710065
commit b529c9226f

View file

@ -1,3 +1,4 @@
#include <klocale.h>
#include <qapplication.h> #include <qapplication.h>
#include <qcursor.h> #include <qcursor.h>
#include <qbitmap.h> #include <qbitmap.h>
@ -407,26 +408,30 @@ void Client::getWmNormalHints()
void Client::fetchName() void Client::fetchName()
{ {
char* name = 0; char* name = 0;
QString s;
if ( XFetchName( qt_xdisplay(), win, &name ) && name ) { if ( XFetchName( qt_xdisplay(), win, &name ) && name ) {
QString s = QString::fromLatin1( name ); s = QString::fromLatin1( name );
if ( s != caption() ) {
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() );
}
XFree( name ); XFree( name );
} }
if ( s.isEmpty() )
s = i18n("unnamed");
if ( s != caption() ) {
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() );
}
} }
/*! /*!