From 6201286cdfebfb3d4aab42d85cf53b94a3c95c5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Sun, 10 Apr 2016 21:59:24 +0200 Subject: 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. --- src/FbCommands.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/FbCommands.cc b/src/FbCommands.cc index 3201fc3..89b8eaf 100644 --- a/src/FbCommands.cc +++ b/src/FbCommands.cc @@ -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(screen.maxTop(head)) || + y > static_cast(screen.maxBottom(head)) || + x < static_cast(screen.maxLeft(head)) || + x > static_cast(screen.maxRight(head)); + + screen.placementStrategy().placeAndShowMenu(menu, x, y, mouseInStrut); } } -- cgit v0.11.2