From 11497973ad0972d222bb9b5544c511b0033e4310 Mon Sep 17 00:00:00 2001 From: David Maciejak Date: Sun, 18 May 2014 00:28:43 +0800 Subject: [PATCH] src/winmenu.c: updated prepare_menu_position did some change as prepare_menu_position never updated x and y values Acked-by: Christophe CURIS --- src/winmenu.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/winmenu.c b/src/winmenu.c index 5fa48867..d8b3f4f3 100644 --- a/src/winmenu.c +++ b/src/winmenu.c @@ -729,16 +729,16 @@ static WMenu *open_window_menu_core(WWindow *wwin) return menu; } -static void prepare_menu_position(WMenu *menu, int x, int y) +static void prepare_menu_position(WMenu *menu, int *x, int *y) { WMRect rect; rect = wGetRectForHead(menu->frame->screen_ptr, wGetHeadForPointerLocation(menu->frame->screen_ptr)); - if (x < rect.pos.x - menu->frame->core->width / 2) - x = rect.pos.x - menu->frame->core->width / 2; - if (y < rect.pos.y) - y = rect.pos.y; + if (*x < rect.pos.x - menu->frame->core->width / 2) + *x = rect.pos.x - menu->frame->core->width / 2; + if (*y < rect.pos.y) + *y = rect.pos.y; } void OpenWindowMenu(WWindow *wwin, int x, int y, int keyboard) @@ -757,7 +757,7 @@ void OpenWindowMenu(WWindow *wwin, int x, int y, int keyboard) x = wwin->frame_x; /* Common menu position */ - prepare_menu_position(menu, x, y); + prepare_menu_position(menu, &x, &y); if (!wwin->flags.internal_window) wMenuMapAt(menu, x, y, keyboard); @@ -781,7 +781,7 @@ void OpenWindowMenu2(WWindow *wwin, int x, int y, int keyboard) x -= menu->frame->core->width / 2; /* Common menu position */ - prepare_menu_position(menu, x, y); + prepare_menu_position(menu, &x, &y); if (!wwin->flags.internal_window) wMenuMapAt(menu, x, y, keyboard); -- 2.11.4.GIT