diff --git a/client.cpp b/client.cpp index 983f2d53cc..d460b1fd33 100644 --- a/client.cpp +++ b/client.cpp @@ -1540,7 +1540,8 @@ NET::WindowType Client::windowType( bool strict, int supported_types ) const && abs( width() - workspace()->clientArea( FullArea, this ).width()) < 10 ) wt = NET::TopMenu; } - const char* const oo_prefix = "OpenOffice.org"; // QCString has no startsWith() + const char* const oo_prefix = "openoffice.org"; // QCString has no startsWith() + // oo_prefix is lowercase, because resourceClass() is forced to be lowercase if( qstrncmp( resourceClass(), oo_prefix, strlen( oo_prefix )) == 0 && wt == NET::Dialog ) wt = NET::Normal; // see bug #66065 if( wt == NET::Unknown ) // this is more or less suggested in NETWM spec diff --git a/client.h b/client.h index 2da3d09a34..d7bc560338 100644 --- a/client.h +++ b/client.h @@ -573,12 +573,12 @@ inline int Client::mappingState() const inline QCString Client::resourceName() const { - return resource_name; + return resource_name; // it is always lowercase } inline QCString Client::resourceClass() const { - return resource_class; + return resource_class; // it is always lowercase } inline diff --git a/group.cpp b/group.cpp index aafa51cb40..81aafb3ac2 100644 --- a/group.cpp +++ b/group.cpp @@ -204,14 +204,15 @@ void Workspace::checkTransients( Window w ) //**************************************** // hacks for broken apps here +// all resource classes are forced to be lowercase bool Client::resourceMatch( const Client* c1, const Client* c2 ) { // xv has "xv" as resource name, and different strings starting with "XV" as resource class - if( qstrncmp( c1->resourceClass(), "XV", 2 ) == 0 && c1->resourceName() == "xv" ) - return qstrncmp( c2->resourceClass(), "XV", 2 ) == 0 && c2->resourceName() == "xv"; + if( qstrncmp( c1->resourceClass(), "xv", 2 ) == 0 && c1->resourceName() == "xv" ) + return qstrncmp( c2->resourceClass(), "xv", 2 ) == 0 && c2->resourceName() == "xv"; // Mozilla has "Mozilla" as resource name, and different strings as resource class - if( c1->resourceName() == "Mozilla" ) - return c2->resourceName() == "Mozilla"; + if( c1->resourceName() == "mozilla" ) + return c2->resourceName() == "mozilla"; return c1->resourceClass() == c2->resourceClass(); } @@ -290,7 +291,7 @@ bool Client::sameAppWindowRoleMatch( const Client* c1, const Client* c2, bool ac || // hacks here // Mozilla has resourceName() and resourceClass() swapped - c1->resourceName() == "Mozilla" && c2->resourceName() == "Mozilla" ) + c1->resourceName() == "mozilla" && c2->resourceName() == "mozilla" ) { if( !active_hack ) // without the active hack for focus stealing prevention, return c1 == c2; // different mainwindows are always different apps diff --git a/manage.cpp b/manage.cpp index 62c6ae82f5..c7f2b7d528 100644 --- a/manage.cpp +++ b/manage.cpp @@ -95,8 +95,10 @@ bool Client::manage( Window w, bool isMapped ) XClassHint classHint; if ( XGetClassHint( qt_xdisplay(), client, &classHint ) ) { - resource_name = classHint.res_name; - resource_class = classHint.res_class; + // Qt3.2 and older had this all lowercase, Qt3.3 capitalized resource class + // force lowercase, so that workarounds listing resource classes still work + resource_name = QCString( classHint.res_name ).lower(); + resource_class = QCString( classHint.res_class ).lower(); XFree( classHint.res_name ); XFree( classHint.res_class ); } diff --git a/options.cpp b/options.cpp index 661a68c2b1..e87124d83b 100644 --- a/options.cpp +++ b/options.cpp @@ -127,6 +127,16 @@ unsigned long Options::updateSettings() ignorePositionClasses = config->readListEntry("IgnorePositionClasses"); ignoreFocusStealingClasses = config->readListEntry("IgnoreFocusStealingClasses"); + // Qt3.2 and older had resource class all lowercase, but Qt3.3 has it capitalized + // therefore Client::resourceClass() forces lowercase, force here lowercase as well + for( QStringList::Iterator it = ignorePositionClasses.begin(); + it != ignorePositionClasses.end(); + ++it ) + (*it) = (*it).lower(); + for( QStringList::Iterator it = ignoreFocusStealingClasses.begin(); + it != ignoreFocusStealingClasses.end(); + ++it ) + (*it) = (*it).lower(); // Mouse bindings config->setGroup( "MouseBindings"); diff --git a/sm.cpp b/sm.cpp index 41d56983e1..d07aac49de 100644 --- a/sm.cpp +++ b/sm.cpp @@ -161,7 +161,7 @@ void Workspace::loadSessionInfo() info->wmCommand = config->readEntry( QString("wmCommand")+n ).latin1(); info->wmClientMachine = config->readEntry( QString("wmClientMachine")+n ).latin1(); info->resourceName = config->readEntry( QString("resourceName")+n ).latin1(); - info->resourceClass = config->readEntry( QString("resourceClass")+n ).latin1(); + info->resourceClass = config->readEntry( QString("resourceClass")+n ).lower().latin1(); info->geometry = config->readRectEntry( QString("geometry")+n ); info->restore = config->readRectEntry( QString("restore")+n ); info->fsrestore = config->readRectEntry( QString("fsrestore")+n ); @@ -195,7 +195,7 @@ void Workspace::loadFakeSessionInfo() fakeSession.append( info ); info->windowRole = config->readEntry( QString("windowRole")+n ).latin1(); info->resourceName = config->readEntry( QString("resourceName")+n ).latin1(); - info->resourceClass = config->readEntry( QString("resourceClass")+n ).latin1(); + info->resourceClass = config->readEntry( QString("resourceClass")+n ).lower().latin1(); info->wmClientMachine = config->readEntry( QString("clientMachine")+n ).latin1(); info->geometry = config->readRectEntry( QString("geometry")+n ); info->restore = config->readRectEntry( QString("restore")+n );