From d3162603952a8a00cdafe390791e4e99d2118dc1 Mon Sep 17 00:00:00 2001 From: Samir SAADA Date: Fri, 29 May 2009 20:39:41 +0200 Subject: [PATCH] Fix menu positioning bug Here I tried to prevent the menu of windows to be displayed in the other side of the screen if the window is half present in the screen horizontally (ie x < 0) a worse problem with menu is that it disappears when the window is half present in the window vertically ie y < 0, that makes it not usable. --- src/menu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/menu.c b/src/menu.c index c6c1837d..5e3e97e3 100644 --- a/src/menu.c +++ b/src/menu.c @@ -1165,8 +1165,8 @@ wMenuMapAt(WMenu *menu, int x, int y, int keyboard) } XMoveWindow(dpy, menu->frame->core->window, x, y); - menu->frame_x = x; - menu->frame_y = y; + menu->frame_x = (x<0) ? 0 : x; + menu->frame_y = (y<0) ? 0 : y; XMapWindow(dpy, menu->frame->core->window); wRaiseFrame(menu->frame->core); menu->flags.mapped = 1;