aboutsummaryrefslogtreecommitdiff
path: root/src/Toolbar.cc
diff options
context:
space:
mode:
authorMathias Gumz <akira at fluxbox dot org>2011-02-24 10:21:16 (GMT)
committerMathias Gumz <akira at fluxbox dot org>2011-02-24 10:21:16 (GMT)
commitf0ffaf890f65d9902ba23e2cd019de5ddba071c5 (patch)
treeecfbba4c6b1f60f5f3d259c8d9e2ef77ec261d54 /src/Toolbar.cc
parent49623390b623bcf4851e5cdd972e4c37d5103ecf (diff)
downloadfluxbox-f0ffaf890f65d9902ba23e2cd019de5ddba071c5.zip
fluxbox-f0ffaf890f65d9902ba23e2cd019de5ddba071c5.tar.bz2
moved Menu placement into ScreenPlacement::placeAndShowMenu()
Diffstat (limited to 'src/Toolbar.cc')
-rw-r--r--src/Toolbar.cc20
1 files changed, 4 insertions, 16 deletions
diff --git a/src/Toolbar.cc b/src/Toolbar.cc
index 896268f..cb1a956 100644
--- a/src/Toolbar.cc
+++ b/src/Toolbar.cc
@@ -33,6 +33,7 @@
33#include "fluxbox.hh" 33#include "fluxbox.hh"
34#include "Keys.hh" 34#include "Keys.hh"
35#include "Screen.hh" 35#include "Screen.hh"
36#include "ScreenPlacement.hh"
36#include "WindowCmd.hh" 37#include "WindowCmd.hh"
37 38
38#include "Strut.hh" 39#include "Strut.hh"
@@ -520,22 +521,9 @@ void Toolbar::buttonPressEvent(XButtonEvent &be) {
520 if (be.button != 3) 521 if (be.button != 3)
521 return; 522 return;
522 523
523 int head = screen().getHead(be.x_root, be.y_root); 524 screen()
524 int borderw = menu().fbwindow().borderWidth(); 525 .placementStrategy()
525 pair<int, int> m = screen().clampToHead(head, 526 .placeAndShowMenu(menu(), be.x_root, be.y_root, false);
526 be.x_root - (menu().width() / 2),
527 be.y_root - (menu().titleWindow().height() / 2),
528 menu().width() + 2*borderw,
529 menu().height() + 2*borderw);
530
531 menu().setScreen(screen().getHeadX(head),
532 screen().getHeadY(head),
533 screen().getHeadWidth(head),
534 screen().getHeadHeight(head));
535 menu().move(m.first, m.second);
536 menu().show();
537 menu().grabInputFocus();
538
539} 527}
540 528
541void Toolbar::enterNotifyEvent(XCrossingEvent &ce) { 529void Toolbar::enterNotifyEvent(XCrossingEvent &ce) {