e_policy: fix bug for sending visibility event 88/183188/1
authorDoyoun Kang <doyoun.kang@samsung.com>
Fri, 29 Jun 2018 11:04:21 +0000 (20:04 +0900)
committerDoyoun Kang <doyoun.kang@samsung.com>
Tue, 3 Jul 2018 07:42:26 +0000 (16:42 +0900)
There was a bug that the window didn't get fully-obscured event when it was
iconified by visibility after getting pre-unobscured event.
So, app's state remained to "resume" not "pause".

This patch sends unobscured and fully-obscured event to the iconified window
to change its state correctly.

Change-Id: I43a3b66ab71b204854d2e19f2aa23d3551f3ba10

src/bin/e_policy.c

index 53925bb2048ec6f8c8b3d3f9c9949aafb9b56c50..2d180757166fc0c9bd5b1ca654e8b3e440845e7a 100644 (file)
@@ -898,6 +898,12 @@ _e_policy_cb_hook_client_visibility(void *d EINA_UNUSED, E_Client *ec)
                {
                   if (!E_CONTAINS(ec->zone->x, ec->zone->y, ec->zone->w, ec->zone->h, ec->x, ec->y, ec->w, ec->h))
                     {
+                       if (ec->visibility.last_sent_type == E_VISIBILITY_PRE_UNOBSCURED)
+                         {
+                            ELOGF("POL_VIS", "SEND unobscured/fully-obscured visibility event because iconify visibility", ec->pixmap, ec);
+                            e_policy_wl_visibility_send(ec, E_VISIBILITY_UNOBSCURED);
+                            e_policy_wl_visibility_send(ec, E_VISIBILITY_FULLY_OBSCURED);
+                         }
                        e_policy_client_iconify_by_visibility(ec);
                        return;
                     }
@@ -935,6 +941,12 @@ _e_policy_cb_hook_client_visibility(void *d EINA_UNUSED, E_Client *ec)
                     }
                   else
                     {
+                       if (ec->visibility.last_sent_type == E_VISIBILITY_PRE_UNOBSCURED)
+                         {
+                            ELOGF("POL_VIS", "SEND unobscured/fully-obscured visibility event because iconify visibility", ec->pixmap, ec);
+                            e_policy_wl_visibility_send(ec, E_VISIBILITY_UNOBSCURED);
+                            e_policy_wl_visibility_send(ec, E_VISIBILITY_FULLY_OBSCURED);
+                         }
                        e_policy_client_iconify_by_visibility(ec);
                     }
                }