fix bug for sending visibility event 90/163290/1 accepted/tizen/4.0/unified/20171209.075408 submit/tizen_4.0/20171208.093639
authorDoyoun Kang <doyoun.kang@samsung.com>
Fri, 8 Dec 2017 08:28:39 +0000 (17:28 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Fri, 8 Dec 2017 08:28:43 +0000 (17:28 +0900)
There was a bug that the window which was waiting for rendering got the visibility
event sometimes as below.
"pre-unobscured -> fully-obscured -> unobscured"
For this, application's state changed to resume, pause, resume.
So, we fixed code not to send fully-obscured event when it is waiting for rendering.

However, the fully-obscured event is sent when the lcd is turned off.

Change-Id: Ifc400dfc3314407d6fe54b83f64cd40abcfb7eee

src/bin/e_client.c
src/bin/e_client.h
src/bin/e_policy_visibility.c
src/bin/e_policy_wl.c

index ecea840ed58b84f2b58d33264e7e45c14b347c3a..4931cd366127ba2152ece68b7eee5233143a746d 100644 (file)
@@ -2998,6 +2998,7 @@ _e_client_visibility_zone_calculate(E_Zone *zone, Eina_Bool check_focus)
    Eina_Bool is_above_rot_pending = EINA_FALSE;
    Eina_Bool is_launching_effect = EINA_FALSE;
    Eina_Bool is_vis_on_skip = EINA_FALSE;
+   Eina_Bool is_display_off = EINA_FALSE;
 
    int x = 0, y = 0, w = 0, h = 0;
    const int edge = 1;
@@ -3025,6 +3026,7 @@ _e_client_visibility_zone_calculate(E_Zone *zone, Eina_Bool check_focus)
      }
    else
      {
+        is_display_off = EINA_TRUE;
         _e_client_hook_call(E_CLIENT_HOOK_CAL_VISIBILITY_DISPLAY_OFF, NULL);
      }
 
@@ -3045,6 +3047,15 @@ _e_client_visibility_zone_calculate(E_Zone *zone, Eina_Bool check_focus)
         /* TODO: need to check whether window intersects with entire screen, not zone. */
         /* if (!E_INTERSECTS(ec->x, ec->y, ec->w, ec->h, zone->x, zone->y, zone->w, zone->h)) continue; */
 
+        if (is_display_off)
+          {
+             if ((ec->visibility.obscured == E_VISIBILITY_FULLY_OBSCURED) &&
+                 (ec->visibility.last_sent_type != E_VISIBILITY_FULLY_OBSCURED))
+               {
+                  ec->visibility.changed = 1;
+               }
+           }
+
         if (!e_config->calc_vis_without_effect)
           {
              if ((e_comp_object_is_animating(ec->frame)) ||
@@ -3834,6 +3845,7 @@ e_client_new(E_Pixmap *cp, int first_map, int internal)
    ec->visibility.opaque = -1;
    ec->visibility.changed = 0;
    ec->visibility.skip = 0;
+   ec->visibility.last_sent_type = E_VISIBILITY_UNKNOWN;
 
    ec->transform.zoom = 1.0;
    ec->transform.angle = 0.0;
index 5628c988606dee301ce7e4661ac1340d41ad58e9..748f8d0de7dfc46e222213673a1fc0040f2585d0 100644 (file)
@@ -706,6 +706,7 @@ struct E_Client
       unsigned char changed : 1;
       Eina_Bool skip : 1;
       Eina_Bool force_obscured : 1;
+      int last_sent_type;
    } visibility;
 
    struct
index 6c9fc9d6a48b36b13cf4b43881a2220fb42ab8ac..0efb0795ef75c45ff9fcae41e7a00daf642512f6 100644 (file)
@@ -1135,7 +1135,6 @@ _e_vis_client_add_uniconify_render_pending(E_Vis_Client *vc, E_Vis_Job_Type type
      {
         ELOGF("POL", "SEND pre-unobscured visibility event", ec->pixmap, ec);
         _e_vis_client_send_pre_visibility_event(ec);
-        ec->visibility.changed = 1;
      }
 
    _e_vis_client_prepare_foreground_signal_emit(vc);
index d86a9687c3d2e2b990010a533cbd83a4fef1f73f..95b070ac86dcec35a52faa046c40bf525ce55505 100644 (file)
@@ -1099,6 +1099,8 @@ e_policy_wl_visibility_send(E_Client *ec, int vis)
    int sent_vis = E_VISIBILITY_UNKNOWN;
 
    EINA_SAFETY_ON_TRUE_RETURN(vis == E_VISIBILITY_UNKNOWN);
+   if (ec && (ec->visibility.last_sent_type == vis))
+     return;
 
    win = e_client_util_win_get(ec);
 
@@ -1126,14 +1128,20 @@ e_policy_wl_visibility_send(E_Client *ec, int vis)
                if (vis == E_VISIBILITY_PRE_UNOBSCURED)
                  {
                     if (ver >= 5)
-                      tizen_visibility_send_changed(res_tzvis, vis, 0);
+                      {
+                         ec->visibility.last_sent_type = vis;
+                         tizen_visibility_send_changed(res_tzvis, vis, 0);
+                      }
                     else
                       sent_vis = -2;
                  }
                else
                  {
                     if ((vis >= E_VISIBILITY_UNOBSCURED) && (vis <= E_VISIBILITY_FULLY_OBSCURED))
-                      tizen_visibility_send_notify(res_tzvis, vis);
+                      {
+                         ec->visibility.last_sent_type = vis;
+                         tizen_visibility_send_notify(res_tzvis, vis);
+                      }
                     else
                       sent_vis = -3;
                  }