aboutsummaryrefslogtreecommitdiff
path: root/src/Toolbar.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2004-09-11 13:33:07 (GMT)
committerfluxgen <fluxgen>2004-09-11 13:33:07 (GMT)
commit37757769634c836895d205b0a5149ffffaae9bfb (patch)
tree0b61e2fe2c81474bbd8472e8b777eed61e769858 /src/Toolbar.cc
parentad63de0281bc32180b8f4e70f2570fbae4a0487a (diff)
downloadfluxbox-37757769634c836895d205b0a5149ffffaae9bfb.zip
fluxbox-37757769634c836895d205b0a5149ffffaae9bfb.tar.bz2
head specific strut, patch from Mathieu De Zutter
Diffstat (limited to 'src/Toolbar.cc')
-rw-r--r--src/Toolbar.cc33
1 files changed, 16 insertions, 17 deletions
diff --git a/src/Toolbar.cc b/src/Toolbar.cc
index 2c19518..d35e872 100644
--- a/src/Toolbar.cc
+++ b/src/Toolbar.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Toolbar.cc,v 1.152 2004/08/31 19:38:42 akir Exp $ 25// $Id: Toolbar.cc,v 1.153 2004/09/11 13:33:07 fluxgen Exp $
26 26
27#include "Toolbar.hh" 27#include "Toolbar.hh"
28 28
@@ -328,7 +328,7 @@ void Toolbar::updateStrut() {
328 left = width(); 328 left = width();
329 break; 329 break;
330 }; 330 };
331 m_strut = screen().requestStrut(left, right, top, bottom); 331 m_strut = screen().requestStrut(getOnHead(), left, right, top, bottom);
332 screen().updateAvailableWorkspaceArea(); 332 screen().updateAvailableWorkspaceArea();
333} 333}
334 334
@@ -485,22 +485,21 @@ void Toolbar::buttonPressEvent(XButtonEvent &be) {
485 screen().hideMenus(); 485 screen().hideMenus();
486 486
487 if (! menu().isVisible()) { 487 if (! menu().isVisible()) {
488 int x, y;
489 488
490 x = be.x_root - (menu().width() / 2); 489 int head = screen().getHead(be.x_root, be.y_root);
491 y = be.y_root - (menu().height() / 2); 490 int borderw = menu().fbwindow().borderWidth();
492 491 pair<int, int> m = screen().clampToHead( head,
493 if (x < 0) 492 be.x_root - (menu().width() / 2),
494 x = 0; 493 be.y_root - (menu().titleWindow().height() / 2),
495 else if (x + menu().width() > screen().width()) 494 menu().width() + 2*borderw,
496 x = screen().width() - menu().width(); 495 menu().height() + 2*borderw);
497 496
498 if (y < 0) 497 menu().setScreen(
499 y = 0; 498 screen().getHeadX(head),
500 else if (y + menu().height() > screen().height()) 499 screen().getHeadY(head),
501 y = screen().height() - menu().height(); 500 screen().getHeadWidth(head),
502 501 screen().getHeadHeight(head));
503 menu().move(x, y); 502 menu().move(m.first, m.second);
504 menu().show(); 503 menu().show();
505 menu().grabInputFocus(); 504 menu().grabInputFocus();
506 } else 505 } else