discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=da5bd16e120c3a54fa57a182debec765e491d2ef

commit da5bd16e120c3a54fa57a182debec765e491d2ef
Author: Mike Blumenkrantz <[email protected]>
Date:   Thu Mar 27 19:47:31 2014 -0400

    greatly improve child dialog placement, FIXME--
    
    fix T980
---
 src/bin/e_client.c | 36 +++++++++++++++++++++++++++++-------
 1 file changed, 29 insertions(+), 7 deletions(-)

diff --git a/src/bin/e_client.c b/src/bin/e_client.c
index f5d0909..9a6c6c9 100644
--- a/src/bin/e_client.c
+++ b/src/bin/e_client.c
@@ -1625,15 +1625,37 @@ _e_client_eval(E_Client *ec)
           }
         if (!ec->placed)
           {
-             /* FIXME: special placement for dialogs etc. etc. etc goes
-              * here */
-             /* FIXME: what if parent is not on this desktop - or zone? */
-             if ((ec->parent) && (ec->parent->visible))
+             if (ec->parent)
                {
-                  if (!E_INSIDE(ec->x, ec->y, ec->parent->x, ec->parent->y, 
ec->parent->w, ec->parent->h))
+                  if (ec->parent->zone != e_zone_current_get(ec->parent->comp))
                     {
-                       ec->x = ec->parent->x + ((ec->parent->w - ec->w) / 2);
-                       ec->y = ec->parent->y + ((ec->parent->h - ec->h) / 2);
+                       e_client_zone_set(ec, ec->parent->zone);
+                       e_zone_useful_geometry_get(ec->zone, &zx, &zy, &zw, 
&zh);
+                    }
+
+                  if (evas_object_visible_get(ec->parent->frame))
+                    {
+                       if ((!E_CONTAINS(ec->x, ec->y, ec->w, ec->h, zx, zy, 
zw, zh)) ||
+                          (!E_CONTAINS(ec->x, ec->y, ec->w, ec->h, 
ec->parent->x, ec->parent->y, ec->parent->w, ec->parent->h)))
+                         {
+                            int x, y;
+
+                            
e_comp_object_util_center_pos_get(ec->parent->frame, &x, &y);
+                            if (E_CONTAINS(x, y, ec->w, ec->h, zx, zy, zw, zh))
+                              ec->x = x, ec->y = y;
+                            else
+                              {
+                                 x = ec->parent->x;
+                                 y = ec->parent->y;
+                                 if (!E_CONTAINS(x, y, ec->w, ec->h, zx, zy, 
zw, zh))
+                                   e_comp_object_util_center(ec->frame);
+                              }
+                            ec->changes.pos = 1;
+                         }
+                    }
+                  else
+                    {
+                       e_comp_object_util_center(ec->frame);
                        ec->changes.pos = 1;
                     }
                   ec->placed = 1;

-- 


Reply via email to