all repos — fluxbox @ 29a69a69c1a2f51d6fb790534a0da8683ee24eb9

custom fork of the fluxbox windowmanager

minor menu positioning tweaks
rathnor rathnor
commit

29a69a69c1a2f51d6fb790534a0da8683ee24eb9

parent

e5dd3d2e85b55931003583ede06fec57c2caaa95

2 files changed, 18 insertions(+), 17 deletions(-)

jump to
M src/FbTk/Menu.ccsrc/FbTk/Menu.cc

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Menu.cc,v 1.38 2003/09/07 14:57:49 rathnor Exp $ +// $Id: Menu.cc,v 1.39 2003/10/06 09:55:36 rathnor Exp $ //use GNU extensions #ifndef _GNU_SOURCE

@@ -1231,18 +1231,18 @@ return;

menu.x_shift = menu.x, menu.y_shift = menu.y; if (menu.x + menu.width > m_screen_width) { - menu.x_shift = m_screen_width - menu.width - m_border_width; + menu.x_shift = m_screen_width - menu.width - 2*m_border_width; shifted = true; } else if (menu.x < 0) { - menu.x_shift = -m_border_width; + menu.x_shift = 0; //-m_border_width; shifted = true; } - if (menu.y + menu.height > m_screen_height) { - menu.y_shift = m_screen_height - menu.height - m_border_width; + if (menu.y + menu.height + 2*m_border_width > m_screen_height) { + menu.y_shift = m_screen_height - menu.height - 2*m_border_width; shifted = true; } else if (menu.y + (signed) menu.title_h < 0) { - menu.y_shift = -m_border_width;; + menu.y_shift = 0; // -m_border_width;; shifted = true; }
M src/fluxbox.ccsrc/fluxbox.cc

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: fluxbox.cc,v 1.196 2003/10/05 07:19:38 rathnor Exp $ +// $Id: fluxbox.cc,v 1.197 2003/10/06 09:55:36 rathnor Exp $ #include "fluxbox.hh"

@@ -989,16 +989,16 @@ if (my < 0) my = 0;

if (mx + screen->getWorkspacemenu()->width() > screen->width()) { - mx = screen->width() - + mx = screen->width()-1 - screen->getWorkspacemenu()->width() - - screen->getWorkspacemenu()->fbwindow().borderWidth(); + 2*screen->getWorkspacemenu()->fbwindow().borderWidth(); } if (my + screen->getWorkspacemenu()->height() > screen->height()) { - my = screen->height() - + my = screen->height()-1 - screen->getWorkspacemenu()->height() - - screen->getWorkspacemenu()->fbwindow().borderWidth(); + 2*screen->getWorkspacemenu()->fbwindow().borderWidth(); } screen->getWorkspacemenu()->move(mx, my);

@@ -1007,27 +1007,28 @@ screen->getWorkspacemenu()->removeParent();

screen->getWorkspacemenu()->show(); } } else if (be.button == 3) { - //calculate placement of workspace menu + //calculate placement of root menu //and show/hide it int mx = be.x_root - (screen->getRootmenu()->width() / 2); int my = be.y_root - (screen->getRootmenu()->titleHeight() / 2); + int borderw = screen->getRootmenu()->fbwindow().borderWidth(); if (mx < 0) mx = 0; if (my < 0) my = 0; - - if (mx + screen->getRootmenu()->width() > screen->width()) { + + if (mx + screen->getRootmenu()->width() + 2*borderw > screen->width()) { mx = screen->width() - screen->getRootmenu()->width() - - screen->getRootmenu()->fbwindow().borderWidth(); + 2*borderw; } - if (my + screen->getRootmenu()->height() > + if (my + screen->getRootmenu()->height() + 2*borderw > screen->height()) { my = screen->height() - screen->getRootmenu()->height() - - screen->getRootmenu()->fbwindow().borderWidth(); + 2*borderw; } screen->getRootmenu()->move(mx, my);