keep cmd menus off struts when the mouse is in it

the mouse is likely the trigger, so the popup would cover the
trigger item.
The present behavior of the iconbar suggests such behavior is
desired.
This commit is contained in:
Thomas Lübking 2016-04-10 21:59:24 +02:00 committed by Mathias Gumz
parent b9ed1c16de
commit 6201286cdf

View file

@ -82,8 +82,13 @@ void showMenu(BScreen &screen, FbTk::Menu &menu) {
screen.rootWindow().window(), &ignored.w, &ignored.w,
&x, &y, &ignored.i, &ignored.i, &ignored.ui);
screen.placementStrategy()
.placeAndShowMenu(menu, x, y, false);
int head = screen.getHead(x, y);
const bool mouseInStrut = y < static_cast<signed>(screen.maxTop(head)) ||
y > static_cast<signed>(screen.maxBottom(head)) ||
x < static_cast<signed>(screen.maxLeft(head)) ||
x > static_cast<signed>(screen.maxRight(head));
screen.placementStrategy().placeAndShowMenu(menu, x, y, mouseInStrut);
}
}