diff --git a/client.cpp b/client.cpp index 5614a62c0e..03647989b2 100644 --- a/client.cpp +++ b/client.cpp @@ -420,14 +420,7 @@ void Client::getWmNormalHints() */ void Client::fetchName() { - char* name = 0; - QString s; - if ( XFetchName( qt_xdisplay(), win, &name ) && name ) { - s = QString::fromLatin1( name ); - XFree( name ); - } - if ( s.isEmpty() ) - s = i18n("unnamed"); + QString s = KWM::title( win ); if ( s != caption() ) { setCaption( "" ); diff --git a/workspace.cpp b/workspace.cpp index 6edae7ccd1..3b0d09664a 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -51,12 +51,7 @@ int Shape::shapeEvent() Client* Workspace::clientFactory( Workspace *ws, WId w ) { // hack TODO hints - char* name = 0; - QString s; - if ( XFetchName( qt_xdisplay(), (Window) w, &name ) && name ) { - s = QString::fromLatin1( name ); - XFree( name ); - } + QString s = KWM::title( w ); if ( s == "THE DESKTOP" ) { XLowerWindow( qt_xdisplay(), w ); Client * c = new NoBorderClient( ws, w); @@ -1236,12 +1231,7 @@ void Workspace::deskCleanup(CleanupType ct) { QValueList::Iterator it(clients.fromLast()); for (; it != clients.begin(); --it) { - QString s; - char *name = 0; - if ( XFetchName( qt_xdisplay(), (*it)->window(), &name ) && name ) { - s = QString::fromLatin1( name ); - XFree( name ); - } + QString s = KWM::title( (*it)->window() ); if (s == "Kicker" || s == "THE DESKTOP") continue;