diff options
author | markt <markt> | 2007-12-11 19:29:00 (GMT) |
---|---|---|
committer | markt <markt> | 2007-12-11 19:29:00 (GMT) |
commit | 474e2017454d3c6492eb9f428aee039d36d76e05 (patch) | |
tree | cae44371e3dc31d1cb3aafdd2fbf83a26527e540 /src/Toolbar.cc | |
parent | 38877987c43857f79481bedeb036380b32019a0f (diff) | |
download | fluxbox-474e2017454d3c6492eb9f428aee039d36d76e05.zip fluxbox-474e2017454d3c6492eb9f428aee039d36d76e05.tar.bz2 |
only allow one open menu at a time
Diffstat (limited to 'src/Toolbar.cc')
-rw-r--r-- | src/Toolbar.cc | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/src/Toolbar.cc b/src/Toolbar.cc index f67311c..55ae1d3 100644 --- a/src/Toolbar.cc +++ b/src/Toolbar.cc | |||
@@ -534,27 +534,21 @@ void Toolbar::buttonPressEvent(XButtonEvent &be) { | |||
534 | if (be.button != 3) | 534 | if (be.button != 3) |
535 | return; | 535 | return; |
536 | 536 | ||
537 | screen().hideMenus(); | 537 | int head = screen().getHead(be.x_root, be.y_root); |
538 | 538 | int borderw = menu().fbwindow().borderWidth(); | |
539 | if (! menu().isVisible()) { | 539 | pair<int, int> m = screen().clampToHead(head, |
540 | 540 | be.x_root - (menu().width() / 2), | |
541 | int head = screen().getHead(be.x_root, be.y_root); | 541 | be.y_root - (menu().titleWindow().height() / 2), |
542 | int borderw = menu().fbwindow().borderWidth(); | 542 | menu().width() + 2*borderw, |
543 | pair<int, int> m = screen().clampToHead(head, | 543 | menu().height() + 2*borderw); |
544 | be.x_root - (menu().width() / 2), | 544 | |
545 | be.y_root - (menu().titleWindow().height() / 2), | 545 | menu().setScreen(screen().getHeadX(head), |
546 | menu().width() + 2*borderw, | 546 | screen().getHeadY(head), |
547 | menu().height() + 2*borderw); | 547 | screen().getHeadWidth(head), |
548 | 548 | screen().getHeadHeight(head)); | |
549 | menu().setScreen(screen().getHeadX(head), | 549 | menu().move(m.first, m.second); |
550 | screen().getHeadY(head), | 550 | menu().show(); |
551 | screen().getHeadWidth(head), | 551 | menu().grabInputFocus(); |
552 | screen().getHeadHeight(head)); | ||
553 | menu().move(m.first, m.second); | ||
554 | menu().show(); | ||
555 | menu().grabInputFocus(); | ||
556 | } else | ||
557 | menu().hide(); | ||
558 | 552 | ||
559 | } | 553 | } |
560 | 554 | ||