Drop hack for NET::Menu means NET::TopMenu

KDE has not supported the TopMenu in any 4.x release and most of the
TopMenu related code has already been dropped from KWin. It is extremely
unlikely that there is still a window around which would need this
specific check. And even if there were such a check it would be broken.

So let's just remove this hack which means less checks in one of the
hottest code pathes of KWin.

CCBUG: 306383
This commit is contained in:
Martin Gräßlin 2012-09-06 08:02:41 +02:00
parent 2cf35aa21a
commit a38e87afea

View file

@ -173,14 +173,6 @@ NET::WindowType Toplevel::windowType(bool direct, int supported_types) const
info->setWindowType(wt); // force hint change
}
// hacks here
if (wt == NET::Menu && cl != NULL) {
// 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
&& abs(width() - workspace()->clientArea(FullArea, cl).width()) < 10)
wt = NET::TopMenu;
}
// TODO change this to rule
const char* const oo_prefix = "openoffice.org"; // QByteArray has no startsWith()
// oo_prefix is lowercase, because resourceClass() is forced to be lowercase