From: "Rodolfo García Peñas (kix)" <k...@kix.es>

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.
---
 src/menu.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/menu.c b/src/menu.c
index b770d4c..696daa0 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -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)
-- 
1.7.10.4


-- 
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.

Reply via email to