Skip to content

Commit

Permalink
fix #16
Browse files Browse the repository at this point in the history
  • Loading branch information
phillbush committed Oct 18, 2020
1 parent 1ca0d0d commit ef66710
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions xmenu.c
Original file line number Diff line number Diff line change
Expand Up @@ -628,12 +628,12 @@ setupmenupos(struct Menu *menu)
width = menu->w + config.border_pixels * 2;
height = menu->h + config.border_pixels * 2;
if (menu->parent == NULL) { /* if root menu, calculate in respect to cursor */
if (pflag || (config.posx > mon.x && mon.x + mon.w - config.posx >= width))
if (pflag || (config.posx >= mon.x && mon.x + mon.w - config.posx >= width))
menu->x = config.posx;
else if (config.posx > width)
menu->x = config.posx - width;

if (pflag || (config.posy > mon.y && mon.y + mon.h - config.posy >= height))
if (pflag || (config.posy >= mon.y && mon.y + mon.h - config.posy >= height))
menu->y = config.posy;
else if (mon.y + mon.h > height)
menu->y = mon.y + mon.h - height;
Expand Down

0 comments on commit ef66710

Please sign in to comment.