flat_navi: fix wrong movement to previous line
authorLukasz Stanislawski <l.stanislaws@samsung.com>
Mon, 8 Dec 2014 16:58:37 +0000 (17:58 +0100)
committerLukasz Stanislawski <l.stanislaws@samsung.com>
Mon, 8 Dec 2014 17:08:46 +0000 (18:08 +0100)
include/flat_navi.h
src/flat_navi.c

index ba02146..0b4af28 100644 (file)
@@ -42,7 +42,7 @@ void flat_navi_context_free(FlatNaviContext *ctx);
  * @return AtspiAccessible* pointer to current object
  *
  * @note If current element is last in line function advances to
- * next line.
+ * next line to first element.
  * @note If current element is last in last line, function returns NULL
  */
 AtspiAccessible *flat_navi_context_next(FlatNaviContext *ctx);
@@ -56,7 +56,7 @@ AtspiAccessible *flat_navi_context_next(FlatNaviContext *ctx);
  * @return AtspiAccessible* pointer to current object
  *
  * @note If current element is first in line function advances to
- * previous line.
+ * previous line to last element.
  * @note If current element is first in first line, function returns NULL
  */
 AtspiAccessible *flat_navi_context_prev(FlatNaviContext *ctx);
index eea75ce..0720556 100644 (file)
@@ -233,7 +233,9 @@ debug(FlatNaviContext *ctx)
           {
              char *name = atspi_accessible_get_name(obj, NULL);
              char *role = atspi_accessible_get_role_name(obj, NULL);
-             DEBUG("%d %s %s, ", i++, name, role);
+             const ObjectCache *oc = object_cache_get(obj);
+             DEBUG("%d %s %s, (%d %d %d %d)", i++, name, role,
+                   oc->bounds->x, oc->bounds->y, oc->bounds->width, oc->bounds->height);
              if (name) g_free(name);
              if (role) g_free(role);
           }
@@ -318,7 +320,11 @@ AtspiAccessible *flat_navi_context_prev(FlatNaviContext *ctx)
    if (new)
      ctx->current = new;
    else
-     return flat_navi_context_line_prev(ctx);
+     {
+        if (!flat_navi_context_line_prev(ctx))
+          return NULL;
+        ctx->current = eina_list_last(eina_list_data_get(ctx->current_line));
+     }
 
    return eina_list_data_get(ctx->current);
 }