aboutsummaryrefslogtreecommitdiff
path: root/src/Window.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/Window.cc
parent49623390b623bcf4851e5cdd972e4c37d5103ecf (diff)
downloadfluxbox-f0ffaf890f65d9902ba23e2cd019de5ddba071c5.zip
fluxbox-f0ffaf890f65d9902ba23e2cd019de5ddba071c5.tar.bz2
moved Menu placement into ScreenPlacement::placeAndShowMenu()
Diffstat (limited to 'src/Window.cc')
-rw-r--r--src/Window.cc26
1 files changed, 5 insertions, 21 deletions
diff --git a/src/Window.cc b/src/Window.cc
index c87180d..51a66df 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -1880,30 +1880,14 @@ bool FluxboxWindow::getState() {
1880} 1880}
1881 1881
1882/** 1882/**
1883 Show the window menu at pos mx, my 1883 Show the window menu at pos x, y
1884*/ 1884*/
1885void FluxboxWindow::showMenu(int menu_x, int menu_y) { 1885void FluxboxWindow::showMenu(int x, int y) {
1886 menu().reloadHelper()->checkReload();
1887
1888 int head = screen().getHead(menu_x, menu_y);
1889
1890 menu().updateMenu(); // recalculate the menu size
1891
1892 // move menu directly under titlebar but not off the screen
1893 if (menu_y < static_cast<signed>(screen().maxTop(head)))
1894 menu_y = screen().maxTop(head);
1895 else if (menu_y + menu().height() >= screen().maxBottom(head))
1896 menu_y = screen().maxBottom(head) - menu().height() - 1 - menu().fbwindow().borderWidth();
1897
1898 if (menu_x < static_cast<signed>(screen().maxLeft(head)))
1899 menu_x = screen().maxLeft(head);
1900 else if (menu_x + static_cast<signed>(menu().width()) >= static_cast<signed>(screen().maxRight(head)))
1901 menu_x = screen().maxRight(head) - menu().width() - 1;
1902 1886
1887 menu().reloadHelper()->checkReload();
1903 FbMenu::setWindow(this); 1888 FbMenu::setWindow(this);
1904 menu().move(menu_x, menu_y); 1889 screen().placementStrategy()
1905 menu().show(); 1890 .placeAndShowMenu(menu(), x, y, true);
1906 menu().grabInputFocus();
1907} 1891}
1908 1892
1909void FluxboxWindow::popupMenu(int x, int y) { 1893void FluxboxWindow::popupMenu(int x, int y) {