aboutsummaryrefslogtreecommitdiff
path: root/src/fluxbox.cc
diff options
context:
space:
mode:
authorrathnor <rathnor>2003-10-06 09:55:36 (GMT)
committerrathnor <rathnor>2003-10-06 09:55:36 (GMT)
commit29a69a69c1a2f51d6fb790534a0da8683ee24eb9 (patch)
treef8bfad0fedfd125933f2f9b2734e1706ef794dc0 /src/fluxbox.cc
parente5dd3d2e85b55931003583ede06fec57c2caaa95 (diff)
downloadfluxbox_pavel-29a69a69c1a2f51d6fb790534a0da8683ee24eb9.zip
fluxbox_pavel-29a69a69c1a2f51d6fb790534a0da8683ee24eb9.tar.bz2
minor menu positioning tweaks
Diffstat (limited to 'src/fluxbox.cc')
-rw-r--r--src/fluxbox.cc23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/fluxbox.cc b/src/fluxbox.cc
index bc985a7..957ea15 100644
--- a/src/fluxbox.cc
+++ b/src/fluxbox.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: fluxbox.cc,v 1.196 2003/10/05 07:19:38 rathnor Exp $ 25// $Id: fluxbox.cc,v 1.197 2003/10/06 09:55:36 rathnor Exp $
26 26
27#include "fluxbox.hh" 27#include "fluxbox.hh"
28 28
@@ -989,16 +989,16 @@ void Fluxbox::handleButtonEvent(XButtonEvent &be) {
989 989
990 if (mx + screen->getWorkspacemenu()->width() > 990 if (mx + screen->getWorkspacemenu()->width() >
991 screen->width()) { 991 screen->width()) {
992 mx = screen->width() - 992 mx = screen->width()-1 -
993 screen->getWorkspacemenu()->width() - 993 screen->getWorkspacemenu()->width() -
994 screen->getWorkspacemenu()->fbwindow().borderWidth(); 994 2*screen->getWorkspacemenu()->fbwindow().borderWidth();
995 } 995 }
996 996
997 if (my + screen->getWorkspacemenu()->height() > 997 if (my + screen->getWorkspacemenu()->height() >
998 screen->height()) { 998 screen->height()) {
999 my = screen->height() - 999 my = screen->height()-1 -
1000 screen->getWorkspacemenu()->height() - 1000 screen->getWorkspacemenu()->height() -
1001 screen->getWorkspacemenu()->fbwindow().borderWidth(); 1001 2*screen->getWorkspacemenu()->fbwindow().borderWidth();
1002 } 1002 }
1003 screen->getWorkspacemenu()->move(mx, my); 1003 screen->getWorkspacemenu()->move(mx, my);
1004 1004
@@ -1007,27 +1007,28 @@ void Fluxbox::handleButtonEvent(XButtonEvent &be) {
1007 screen->getWorkspacemenu()->show(); 1007 screen->getWorkspacemenu()->show();
1008 } 1008 }
1009 } else if (be.button == 3) { 1009 } else if (be.button == 3) {
1010 //calculate placement of workspace menu 1010 //calculate placement of root menu
1011 //and show/hide it 1011 //and show/hide it
1012 int mx = be.x_root - 1012 int mx = be.x_root -
1013 (screen->getRootmenu()->width() / 2); 1013 (screen->getRootmenu()->width() / 2);
1014 int my = be.y_root - 1014 int my = be.y_root -
1015 (screen->getRootmenu()->titleHeight() / 2); 1015 (screen->getRootmenu()->titleHeight() / 2);
1016 int borderw = screen->getRootmenu()->fbwindow().borderWidth();
1016 1017
1017 if (mx < 0) mx = 0; 1018 if (mx < 0) mx = 0;
1018 if (my < 0) my = 0; 1019 if (my < 0) my = 0;
1019 1020
1020 if (mx + screen->getRootmenu()->width() > screen->width()) { 1021 if (mx + screen->getRootmenu()->width() + 2*borderw > screen->width()) {
1021 mx = screen->width() - 1022 mx = screen->width() -
1022 screen->getRootmenu()->width() - 1023 screen->getRootmenu()->width() -
1023 screen->getRootmenu()->fbwindow().borderWidth(); 1024 2*borderw;
1024 } 1025 }
1025 1026
1026 if (my + screen->getRootmenu()->height() > 1027 if (my + screen->getRootmenu()->height() + 2*borderw >
1027 screen->height()) { 1028 screen->height()) {
1028 my = screen->height() - 1029 my = screen->height() -
1029 screen->getRootmenu()->height() - 1030 screen->getRootmenu()->height() -
1030 screen->getRootmenu()->fbwindow().borderWidth(); 1031 2*borderw;
1031 } 1032 }
1032 screen->getRootmenu()->move(mx, my); 1033 screen->getRootmenu()->move(mx, my);
1033 1034