1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 20:38:08 +01:00

src/winmenu.c: updated prepare_menu_position

did some change as prepare_menu_position never updated x and y values

Acked-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
David Maciejak
2014-05-18 00:28:43 +08:00
committed by Carlos R. Mafra
parent 9456252d51
commit 11497973ad

View File

@@ -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);