Fix Adding App Group Feature 78/240878/1
authorHwankyu Jhun <h.jhun@samsung.com>
Wed, 12 Aug 2020 09:39:36 +0000 (18:39 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Wed, 12 Aug 2020 09:41:58 +0000 (18:41 +0900)
- Changes the condition of if statement to check whether the position is
a negative value or not.

Change-Id: I6ace6dad19e9df972188c31f21fa55d0dd9ef59c
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
modules/ui-core/src/app_group.c

index 9df0aa119689a533661a026c72b3850d91b64dc6..edd059ea4eb28e2f474786a4f027413bfc38131f 100644 (file)
@@ -801,7 +801,7 @@ static int __app_group_get_nth(app_group_h group, int wid)
                iter = g_list_next(iter);
        }
 
-       return 0;
+       return -1;
 }
 
 static struct app_group_context_s *__app_group_add(
@@ -816,7 +816,7 @@ static struct app_group_context_s *__app_group_add(
        app_group_h group;
        app_group_node_h node;
        GList *found;
-       int pos = 0;
+       int pos = -1;
 
        if (!id || !leader_id) {
                LOGE("Invalid parameter");
@@ -867,7 +867,7 @@ static struct app_group_context_s *__app_group_add(
        if (before_wid > 0)
                pos = __app_group_get_nth(group, before_wid);
 
-       if (pos != 0)
+       if (pos != -1)
                group->list = g_list_insert(group->list, ctx, pos);
        else
                group->list = g_list_append(group->list, ctx);