Some fixes for the NET::TopMenu/NET::Menu hack.

svn path=/trunk/kdebase/kwin/; revision=168742
This commit is contained in:
Luboš Luňák 2002-07-25 20:08:09 +00:00
parent a815fc2f6e
commit 487f30a4ec
2 changed files with 13 additions and 11 deletions

View file

@ -2930,22 +2930,16 @@ void Client::activateLayout()
layout()->activate();
}
NET::WindowType Client::windowType() const
{
NET::WindowType wt = info->windowType();
if ( wt == NET::Unknown )
wt = NET::Normal;
if ( wt == NET::Menu ) {
Window dummy1;
int x, y;
unsigned int width, height, dummy2, dummy3;
XGetGeometry( qt_xdisplay(), window(), &dummy1, &x, &y, &width, &height,
&dummy2, &dummy3 );
// ugly hack to support the times when NET::Menu meant NET::TopMenu
// if it's as wide as the screen, not very high and has its upper-left
// corner a bit above the screen's upper-left cornet, it's a topmenu
if( x == 0 && y < 0 && y > -10 && height < 100 && int(width) == geometry().width())
if( x() == 0 && y() < 0 && y() > -10 && height() < 100 && width() == workspace()->geometry().width())
wt = NET::TopMenu;
}
return wt;

View file

@ -241,7 +241,11 @@ Client* Workspace::clientFactory( WId w )
}
case NET::TopMenu:
return new NoBorderClient( this, w );
{
Client* c = new NoBorderClient( this, w );
c->setStaysOnTop( true );
return c;
}
case NET::Override:
return new NoBorderClient( this, w);
@ -256,11 +260,15 @@ Client* Workspace::clientFactory( WId w )
// ugly hack to support the times when NET::Menu meant NET::TopMenu
// if it's as wide as the screen, not very high and has its upper-left
// corner a bit above the screen's upper-left cornet, it's a topmenu
if( x == 0 && y < 0 && y > -10 && height < 100 && int(width) == geometry().width())
return new NoBorderClient( this, w );
// fall through
if( x == 0 && y < 0 && y > -10 && height < 100 && int(width) == geometry().width()) {
Client* c = new NoBorderClient( this, w);
c->setStaysOnTop( true );
return c;
}
break;
}
case NET::Tool:
break;
default:
break;
}