1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-21 05:18:06 +01:00

wGetRectForHead moved to where used

The definition and call for wGetRectForHead is moved inside the
if block where is used. This code adds a WScreen pointer to make
the line shorter.

If menu->frame is NULL, then was NULL before this patch, so this
code doesn't include an error about this.

This patch will used with next patch to move the code inside the
block to an specific function.
This commit is contained in:
Rodolfo García Peñas (kix)
2013-04-03 20:01:47 +02:00
committed by Carlos R. Mafra
parent b9e8bbbdc7
commit 6fe23037ef

View File

@@ -1062,15 +1062,16 @@ static int keyboardMenu(WMenu * menu)
void wMenuMapAt(WMenu * menu, int x, int y, int keyboard)
{
WMRect rect = wGetRectForHead(menu->frame->screen_ptr,
wGetHeadForPointerLocation(menu->frame->screen_ptr));
if (!menu->flags.realized) {
menu->flags.realized = 1;
wMenuRealize(menu);
}
if (!menu->flags.mapped) {
if (wPreferences.wrap_menus) {
WScreen *scr = menu->frame->screen_ptr;
WMRect rect = wGetRectForHead(scr, wGetHeadForPointerLocation(scr));
if (x < rect.pos.x)
x = rect.pos.x;
if (y < rect.pos.y)