diff options
Diffstat (limited to 'src/Toolbar.cc')
-rw-r--r-- | src/Toolbar.cc | 20 |
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 | ||
541 | void Toolbar::enterNotifyEvent(XCrossingEvent &ce) { | 529 | void Toolbar::enterNotifyEvent(XCrossingEvent &ce) { |