diff --git a/client.cpp b/client.cpp index e01626ab16..080cb1cd63 100644 --- a/client.cpp +++ b/client.cpp @@ -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; diff --git a/workspace.cpp b/workspace.cpp index 6e936b592b..15fbbed6c0 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -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; }