Enlightenment CVS committal

Author  : pfritz
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_popup.c 


Log Message:
even smart-place the popup if there isn't a follow set (usefull for apps that 
use the context menu in a non-ewl app)

===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_popup.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -3 -r1.14 -r1.15
--- ewl_popup.c 1 Apr 2007 21:48:06 -0000       1.14
+++ ewl_popup.c 29 Apr 2007 22:43:38 -0000      1.15
@@ -411,7 +411,6 @@
 static void
 ewl_popup_position_check(Ewl_Popup *p)
 {
-       Ewl_Embed *emb;
        int x = 0, y = 0;
        int desk_w = 0, desk_h = 0;
        int win_x = 0, win_y = 0;
@@ -420,12 +419,18 @@
        DCHECK_PARAM_PTR("p", p);
        DCHECK_TYPE("p", p, EWL_POPUP_TYPE);
        
-       if (!p->follow || p->type == EWL_POPUP_TYPE_NONE)
+       if (p->type == EWL_POPUP_TYPE_NONE)
                DRETURN(DLEVEL_STABLE);
        
-       emb = ewl_embed_widget_find(p->follow);
-       ewl_embed_desktop_size_get(emb, &desk_w, &desk_h);
-       ewl_embed_window_position_get(emb, &win_x, &win_y);
+       if (p->follow) {
+               Ewl_Embed *emb;
+
+               emb = ewl_embed_widget_find(p->follow);
+               ewl_embed_desktop_size_get(emb, &desk_w, &desk_h);
+               ewl_embed_window_position_get(emb, &win_x, &win_y);
+       }
+       else
+               ewl_embed_desktop_size_get(EWL_EMBED(p), &desk_w, &desk_h);
        
        if (p->type == EWL_POPUP_TYPE_MOUSE) {
                x = win_x + p->mouse.x;



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to