aboutsummaryrefslogtreecommitdiff
path: root/src/Toolbar.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Toolbar.cc')
-rw-r--r--src/Toolbar.cc36
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