[Copy&paste popup] CQ:H0100137759 ctxpopup's position revised by screen size when...
authordeasung.kim <deasung.kim@samsung.com>
Thu, 1 Dec 2011 09:52:28 +0000 (18:52 +0900)
committerdeasung.kim <deasung.kim@samsung.com>
Fri, 2 Dec 2011 08:04:00 +0000 (17:04 +0900)
Change-Id: If94b2f483d20e9e45afb692782f04ab20154cc1d

src/lib/elm_entry.c
src/lib/elm_module_priv.h
src/modules/ctxpopup_copypasteUI/copypaste.c

index e338559..95a8aea 100644 (file)
@@ -3093,6 +3093,7 @@ EAPI void elm_entry_extension_module_data_get(Evas_Object *obj,Elm_Entry_Extensi
    ext_mod->cnpinit = _cnpinit;
    ext_mod->context_menu = wd->context_menu;
    ext_mod->cnp_mode = wd->cnp_mode;
+   ext_mod->viewport_rect = _viewport_region_get(obj);
 }
 
 EAPI void
index 0af8b74..8693834 100644 (file)
@@ -8,7 +8,7 @@ struct _Elm_Entry_Extension_data
 {
        Evas_Object *popup;
        Evas_Object *ent;
-       Evas_Object *viewport_obj;
+       Evas_Coord_Rectangle viewport_rect;
        Eina_List *items;
        cpfunc select;
        cpfunc copy;
index 0831e37..9c587bb 100644 (file)
@@ -44,12 +44,17 @@ _ctxpopup_position(Evas_Object *obj)
      }
    else
      {
-        if (ext_mod->viewport_obj)
+        if (ext_mod->viewport_rect.x != -1 || ext_mod->viewport_rect.y != -1
+            || ext_mod->viewport_rect.w != -1 || ext_mod->viewport_rect.h != -1)
           {
              Evas_Coord vx, vy, vw, vh, x2, y2;
              x2 = x + w;
              y2 = y + h;
-             evas_object_geometry_get(ext_mod->viewport_obj, &vx, &vy, &vw, &vh);
+             vx = ext_mod->viewport_rect.x;
+             vy = ext_mod->viewport_rect.y;
+             vw = ext_mod->viewport_rect.w;
+             vh = ext_mod->viewport_rect.h;
+
              if (x < vx) x = vx;
              if (y < vy) y = vy;
              if (x2 > vx + vw) x2 = vx + vw;
@@ -57,6 +62,20 @@ _ctxpopup_position(Evas_Object *obj)
              w = x2 - x;
              h = y2 - y;
           }
+        else
+          {
+             Evas_Coord sw, sh, x2, y2;
+             x2 = x + w;
+             y2 = y + h;
+             ecore_x_window_size_get(ecore_x_window_root_first_get(), &sw, &sh);
+
+             if (x < 0) x = 0;
+             if (y < 0) y = 0;
+             if (x2 > sw) x2 = sw;
+             if (y2 > sh) y2 = sh;
+             w = x2 - x;
+             h = y2 - y;
+          }
         cx = x + (w / 2);
         cy = y + (h / 2);
         evas_object_move(ext_mod->popup, cx, cy);