diff --git a/src/client.c b/src/client.c index 8f0a8ef..adb6c10 100644 --- a/src/client.c +++ b/src/client.c @@ -435,8 +435,8 @@ client_manage(Window w, XWindowAttributes *wa) * screen, else place the client in it */ if(screen_get_with_geo(mx, my) != selscreen) { - mx += sgeo[selscreen].x - BORDH; - my += sgeo[selscreen].y - TBARH - INFOBARH; + mx += spgeo[selscreen].x; + my += spgeo[selscreen].y; } } c->ogeo.x = c->geo.x = mx; diff --git a/src/event.c b/src/event.c index afb07d4..cd67f35 100644 --- a/src/event.c +++ b/src/event.c @@ -114,10 +114,10 @@ buttonpress(XButtonEvent *ev) { if(conf.layout_system && (ev->button == Button1 || ev->button == Button3)) /* True -> menu */ { - y = (sgeo[selscreen].y - (BORDH + TBARH)) + infobar[selscreen].layout_button->geo.y; + y = spgeo[selscreen].y + infobar[selscreen].layout_button->geo.y; x = infobar[selscreen].layout_button->geo.x + (sgeo[selscreen].x - BORDH); - if(infobar[selscreen].geo.y != sgeo[selscreen].y - (INFOBARH + TBARH)) + if(infobar[selscreen].geo.y != spgeo[selscreen].y) y = infobar[selscreen].geo.y - (INFOBARH * menulayout.nitem) - SHADH; menu_draw(menulayout, x, y); diff --git a/src/layout.c b/src/layout.c index 6c77164..872cd75 100644 --- a/src/layout.c +++ b/src/layout.c @@ -543,20 +543,11 @@ mirror(int screen, Bool horizontal) /* Next y/x position */ if(i >= nmaster - 1) { - if(horizontal) - { - if(i == nmaster || i == nmaster - 1) - cgeo.x = sg.x; - else - cgeo.x = nextg[isp].x + nextg[isp].width + BORDH * 2; - } + + if(i == nmaster || i == nmaster - 1) + cgeo.x = (horizontal) ? sg.x : nextg[isp].y + nextg[isp].height + BORDH + TBARH; else - { - if(i == nmaster || i == nmaster - 1) - cgeo.y = sg.y; - else - cgeo.y = nextg[isp].y + nextg[isp].height + BORDH + TBARH; - } + cgeo.y = (horizontal) ? nextg[isp].x + nextg[isp].width + BORDH * 2 : sg.y; } else if (i <= nmaster - 1) { diff --git a/src/screen.c b/src/screen.c index e0f8421..6507695 100644 --- a/src/screen.c +++ b/src/screen.c @@ -104,20 +104,11 @@ int screen_get_with_geo(int x, int y) { int i, r = 0; - int barpos = tags[selscreen][seltag[selscreen]].barpos; - int yh; for(i = 0; i < screen_count(); ++i) - { - if(barpos == IB_Hide || barpos == IB_Bottom) - yh = (sgeo[i].y - TBARH); - else - yh = (sgeo[i].y - INFOBARH - TBARH); - - if((x >= sgeo[i].x && x < sgeo[i].x + sgeo[i].width) - && y >= yh && y < yh + (sgeo[i].height + INFOBARH + TBARH)) + if((x >= spgeo[i].x && x < spgeo[i].x + spgeo[i].width) + && y >= spgeo[i].y && y < spgeo[i].y + spgeo[i].height) r = i; - } return r; }