Bug fix about scrolling wrong location. The main point is to use the UPDATED geometry of the child object, but the geometry has yet to be calculated and is queued for calculation later.

Firstly, for efficiency, we add a Job to calculate the whole canvas. Jobs implicitly coallate work per event loop.
Calcuation of object can be a reasonably intensive set of work.
In the job callback we calculate the whole canvas with evas_smart_objects_calculate() to ensure that all objects have the correct geometry at this point.
Reviewed by Raster.


SVN revision: 65509
This commit is contained in:
Jaehwan Kim 2011-11-22 06:37:30 +00:00
parent f95054a2f4
commit 546d5e51e5
2 changed files with 20 additions and 1 deletions

View File

@ -27,6 +27,7 @@ struct _Widget_Data
Evas_Coord auto_x, auto_y; // desired delta
Evas_Coord x, y; // current delta
} delta;
Ecore_Job *show_region_job;
};
/* Enum to identify conformant swallow parts */
@ -67,6 +68,7 @@ static void _conformant_move_resize_event_cb(void *data,
Evas_Object *obj,
void *event_info);
static void _sizing_eval(Evas_Object *obj);
static void _show_region_job(void *data);
static Eina_Bool _prop_change(void *data, int type, void *event);
static void _changed_size_hints(void *data, Evas *e,
Evas_Object *obj,
@ -89,6 +91,7 @@ _del_hook(Evas_Object *obj)
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
if (wd->show_region_job) ecore_job_del(wd->show_region_job);
free(wd);
}
@ -446,7 +449,6 @@ static void
_content_resize_event_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj
__UNUSED__, void *event_info __UNUSED__)
{
Evas_Object *focus_obj;
Evas_Object *conformant = (Evas_Object *)data;
Widget_Data *wd = elm_widget_data_get(conformant);
@ -455,6 +457,19 @@ _content_resize_event_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj
if (wd->vkb_state == ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF) return;
#endif
if (wd->show_region_job) ecore_job_del(wd->show_region_job);
wd->show_region_job = ecore_job_add(_show_region_job, conformant);
}
static void
_show_region_job(void *data)
{
Evas_Object *focus_obj;
Evas_Object *conformant = (Evas_Object *)data;
Widget_Data *wd = elm_widget_data_get(conformant);
if (!wd) return;
focus_obj = elm_widget_focused_object_get(conformant);
if (focus_obj)
{
@ -467,6 +482,8 @@ _content_resize_event_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj
elm_widget_show_region_set(focus_obj, x, y, w, h, EINA_TRUE);
}
wd->show_region_job = NULL;
}
#ifdef HAVE_ELEMENTARY_X

View File

@ -2098,6 +2098,8 @@ elm_widget_show_region_set(Evas_Object *obj,
Evas_Object *parent_obj, *child_obj;
Evas_Coord px, py, cx, cy;
evas_smart_objects_calculate(evas_object_evas_get(obj));
API_ENTRY return;
if (!forceshow && (x == sd->rx) && (y == sd->ry)
&& (w == sd->rw) && (h == sd->rh)) return;