e_policy_wl: added resource destructor for indicator and screensaver_manager 03/98903/1
authorMinJeong Kim <minjjj.kim@samsung.com>
Mon, 21 Nov 2016 06:40:04 +0000 (15:40 +0900)
committerMinJeong Kim <minjjj.kim@samsung.com>
Mon, 21 Nov 2016 06:40:29 +0000 (15:40 +0900)
Change-Id: I1b5301acacbc031c14cdcbb0fd37716094715c7b
Signed-off-by: MinJeong Kim <minjjj.kim@samsung.com>
src/bin/e_policy_wl.c

index 8861181b404ff6e9d57917466aa1c8e2578f910f..62bd1d75e5bd258591b2d1c441314e68bda0e7a0 100644 (file)
@@ -3102,6 +3102,13 @@ _tzsh_srv_iface_cb_region_set(struct wl_client *client, struct wl_resource *res_
      e_service_volume_region_set(type, angle, tzsh_reg->tiler);
 }
 
+static void
+_tzsh_srv_indicator_cb_resource_destroy(struct wl_resource *resource)
+{
+   if (_indicator_srv_res == resource)
+     _indicator_srv_res = NULL;
+}
+
 static void
 _tzsh_srv_indicator_cb_destroy(struct wl_client *client EINA_UNUSED, struct wl_resource *resource)
 {
@@ -3134,7 +3141,8 @@ _tzsh_srv_iface_cb_indicator_get(struct wl_client *client, struct wl_resource *r
      }
    _indicator_srv_res = res;
 
-   wl_resource_set_implementation(res, &_tzsh_srv_indicator_iface, tzsh_srv, NULL);
+   wl_resource_set_implementation(res, &_tzsh_srv_indicator_iface, tzsh_srv,
+                                  _tzsh_srv_indicator_cb_resource_destroy);
 }
 
 static void
@@ -3251,6 +3259,16 @@ _tzsh_srv_iface_cb_scrsaver_get(struct wl_client *client, struct wl_resource *re
    wl_resource_set_implementation(res, &_tzsh_srv_scrsaver_iface, tzsh_srv, NULL);
 }
 
+static void
+_tzsh_srv_scrsaver_mng_cb_resource_destroy(struct wl_resource *resource)
+{
+   if (_scrsaver_mng_res == resource)
+     {
+        _scrsaver_mng_res = NULL;
+        e_screensaver_disable();
+     }
+}
+
 static void
 _tzsh_srv_scrsaver_mng_cb_destroy(struct wl_client *client EINA_UNUSED, struct wl_resource *resource)
 {
@@ -3358,7 +3376,8 @@ _tzsh_srv_iface_cb_scrsaver_mng_get(struct wl_client *client, struct wl_resource
 
    _scrsaver_mng_res = res;
 
-   wl_resource_set_implementation(res, &_tzsh_srv_scrsaver_mng_iface, tzsh_srv, NULL);
+   wl_resource_set_implementation(res, &_tzsh_srv_scrsaver_mng_iface, tzsh_srv,
+                                  _tzsh_srv_scrsaver_mng_cb_resource_destroy);
 }
 
 static void