Fix visibility handling 75/148375/1
authorHwankyu Jhun <h.jhun@samsung.com>
Thu, 7 Sep 2017 22:37:42 +0000 (07:37 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Thu, 7 Sep 2017 22:37:42 +0000 (07:37 +0900)
When this patch is applied, the active state of the app is managed in
three ways. It's Unknown(-1), active(1) and inactive(0).

Change-Id: Iacfb031f691df1b7f90d14ad019a416250d2b40b
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/appcore-efl.c

index f154538d129ecff98e60ee8d5af5e97dbf5672c5..f101d43141beac87189b47e328fb66abc2acfd46 100644 (file)
@@ -111,7 +111,7 @@ static const char *_as_name[] = {
        [AS_DYING] = "DYING",
 };
 
-static bool b_active = FALSE;
+static int b_active = -1;
 static bool first_launch = TRUE;
 
 struct win_node {
@@ -858,9 +858,9 @@ static Eina_Bool __hide_cb(void *data, int type, void *event)
        if (__find_win((unsigned int)ev->win)) {
                __delete_win((unsigned int)ev->win);
                bvisibility = __check_visible();
-               if (!bvisibility && b_active == TRUE) {
+               if (!bvisibility && b_active != 0) {
                        _DBG(" Go to Pasue state \n");
-                       b_active = FALSE;
+                       b_active = 0;
                        __do_app(AE_PAUSE, data, NULL);
                }
        }
@@ -899,14 +899,14 @@ static Eina_Bool __visibility_cb(void *data, int type, void *event)
 
        _DBG("bvisibility %d, b_active %d", bvisibility, b_active);
 
-       if (bvisibility && b_active == FALSE) {
+       if (bvisibility && b_active != 1) {
                _DBG(" Go to Resume state\n");
-               b_active = TRUE;
+               b_active = 1;
                __do_app(AE_RESUME, data, NULL);
 
-       } else if (!bvisibility && b_active == TRUE) {
+       } else if (!bvisibility && b_active != 0) {
                _DBG(" Go to Pasue state \n");
-               b_active = FALSE;
+               b_active = 0;
                __do_app(AE_PAUSE, data, NULL);
        } else
                _DBG(" No change state \n");
@@ -925,9 +925,9 @@ static Eina_Bool __pre_visibility_cb(void *data, int type, void *event)
                __update_win((unsigned int)ev->win, 0, false);
                bvisibility = __check_visible();
                _DBG("bvisibility %d, b_active %d", bvisibility, b_active);
-               if (bvisibility && b_active == FALSE) {
+               if (bvisibility && b_active != 1) {
                        _DBG("Go to Resume state\n");
-                       b_active = TRUE;
+                       b_active = 1;
                        __do_app(AE_RESUME, data, NULL);
                }
        }