From 487f30a4ece617b769c670498c6ef83d92e36915 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Thu, 25 Jul 2002 20:08:09 +0000 Subject: [PATCH] Some fixes for the NET::TopMenu/NET::Menu hack. svn path=/trunk/kdebase/kwin/; revision=168742 --- client.cpp | 8 +------- workspace.cpp | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 11 deletions(-) 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; }