mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-20 12:58: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:
committed by
Carlos R. Mafra
parent
9456252d51
commit
11497973ad
@@ -729,16 +729,16 @@ static WMenu *open_window_menu_core(WWindow *wwin)
|
|||||||
return menu;
|
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;
|
WMRect rect;
|
||||||
|
|
||||||
rect = wGetRectForHead(menu->frame->screen_ptr,
|
rect = wGetRectForHead(menu->frame->screen_ptr,
|
||||||
wGetHeadForPointerLocation(menu->frame->screen_ptr));
|
wGetHeadForPointerLocation(menu->frame->screen_ptr));
|
||||||
if (x < rect.pos.x - menu->frame->core->width / 2)
|
if (*x < rect.pos.x - menu->frame->core->width / 2)
|
||||||
x = rect.pos.x - menu->frame->core->width / 2;
|
*x = rect.pos.x - menu->frame->core->width / 2;
|
||||||
if (y < rect.pos.y)
|
if (*y < rect.pos.y)
|
||||||
y = rect.pos.y;
|
*y = rect.pos.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenWindowMenu(WWindow *wwin, int x, int y, int keyboard)
|
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;
|
x = wwin->frame_x;
|
||||||
|
|
||||||
/* Common menu position */
|
/* Common menu position */
|
||||||
prepare_menu_position(menu, x, y);
|
prepare_menu_position(menu, &x, &y);
|
||||||
|
|
||||||
if (!wwin->flags.internal_window)
|
if (!wwin->flags.internal_window)
|
||||||
wMenuMapAt(menu, x, y, keyboard);
|
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;
|
x -= menu->frame->core->width / 2;
|
||||||
|
|
||||||
/* Common menu position */
|
/* Common menu position */
|
||||||
prepare_menu_position(menu, x, y);
|
prepare_menu_position(menu, &x, &y);
|
||||||
|
|
||||||
if (!wwin->flags.internal_window)
|
if (!wwin->flags.internal_window)
|
||||||
wMenuMapAt(menu, x, y, keyboard);
|
wMenuMapAt(menu, x, y, keyboard);
|
||||||
|
|||||||
Reference in New Issue
Block a user