Workaround for stupid xv not setting WM_CLASS correctly.

svn path=/trunk/kdebase/kwin/; revision=185132
icc-effect-5.14.5
Luboš Luňák 2002-10-22 11:57:43 +00:00
parent b95c6d8443
commit 9711f8b576
2 changed files with 9 additions and 1 deletions

View File

@ -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.
*/

View File

@ -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();