diff --git a/client.cpp b/client.cpp index b7567408db..b2f9f8010d 100644 --- a/client.cpp +++ b/client.cpp @@ -889,7 +889,7 @@ bool Client::manage( bool isMapped, bool doNotShow, bool isInitial ) unsigned long usertime = 0; if ( !isTransient() && !session && ac && !ac->isDesktop() && - ac->resourceClass() != resourceClass() && + !resourceMatch( ac, this ) && ( usertime = userTime() ) > 0 && ac->userTime() > usertime ) { workspace()->stackClientUnderActive( this ); show(); @@ -950,6 +950,13 @@ unsigned long Client::userTime() return result; } +bool Client::resourceMatch( Client* c1, Client* c2 ) +{ + if( qstrncmp( c1->resourceClass(), "XV", 2 ) == 0 && c1->resourceName() == "xv" ) // xv :( + return qstrncmp( c2->resourceClass(), "XV", 2 ) == 0 && c2->resourceName() == "xv"; + return c1->resourceClass() == c2->resourceClass(); +} + /*! Gets the client's normal WM hints and reconfigures itself respectively. */ diff --git a/client.h b/client.h index ead89f1a5d..696a5dfae4 100644 --- a/client.h +++ b/client.h @@ -288,6 +288,7 @@ private: QSize sizeForWindowSize( const QSize&, bool ignore_height = FALSE ) const; void getWmNormalHints(); void fetchName(); + static bool resourceMatch( Client* c1, Client* c2 ); unsigned long userTime();