Added window_role set API and hook of role change 44/85444/1
authorMinJeong Kim <minjjj.kim@samsung.com>
Thu, 25 Aug 2016 06:28:30 +0000 (15:28 +0900)
committerMinJeong Kim <minjjj.kim@samsung.com>
Thu, 25 Aug 2016 06:36:22 +0000 (15:36 +0900)
Change-Id: Ide27225e6a5c8695384b86d2119fe0e491163dbf

src/bin/e_client.c
src/bin/e_client.h
src/bin/e_comp_wl_input.c
src/bin/e_policy_wl.c
src/bin/services/e_service_cbhm.c
src/bin/services/e_service_indicator.c
src/bin/services/e_service_lockscreen.c
src/bin/services/e_service_quickpanel.c

index 47b663d..cd48379 100644 (file)
@@ -97,6 +97,7 @@ static Eina_Inlist *_e_client_hooks[] =
    [E_CLIENT_HOOK_ICONIFY] = NULL,
    [E_CLIENT_HOOK_UNICONIFY] = NULL,
    [E_CLIENT_HOOK_AUX_HINT_CHANGE] = NULL,
+   [E_CLIENT_HOOK_WINDOW_ROLE_CHANGE] = NULL,
 };
 
 ///////////////////////////////////////////
@@ -6076,3 +6077,12 @@ e_client_pixmap_change(E_Client *ec, E_Pixmap *newcp)
 
    return oldcp;
 }
+
+E_API void
+e_client_window_role_set(E_Client *ec, const char *role)
+{
+   EINA_SAFETY_ON_NULL_RETURN(ec);
+
+   if (eina_stringshare_replace(&ec->icccm.window_role, role))
+     _e_client_hook_call(E_CLIENT_HOOK_WINDOW_ROLE_CHANGE, ec);
+}
index 33d4658..ea9d03e 100644 (file)
@@ -221,6 +221,7 @@ typedef enum _E_Client_Hook_Point
    E_CLIENT_HOOK_ICONIFY,
    E_CLIENT_HOOK_UNICONIFY,
    E_CLIENT_HOOK_AUX_HINT_CHANGE,
+   E_CLIENT_HOOK_WINDOW_ROLE_CHANGE,
    E_CLIENT_HOOK_LAST,
 } E_Client_Hook_Point;
 
@@ -1016,6 +1017,7 @@ E_API int               e_client_transform_core_transform_count_get(E_Client *ec
 E_API E_Util_Transform *e_client_transform_core_transform_get(E_Client *ec, int index);
 
 E_API E_Pixmap *e_client_pixmap_change(E_Client *ec, E_Pixmap *newcp);
+E_API void e_client_window_role_set(E_Client *ec, const char *role);
 
 /**
  * Move window to coordinates that do not account client decorations yet.
index 170f9b7..4405235 100644 (file)
@@ -94,7 +94,7 @@ _e_comp_wl_input_pointer_cb_cursor_set(struct wl_client *client, struct wl_resou
         ec->lock_focus_out = ec->layer_block = ec->visible = 1;
         if (!e_config->show_cursor)  ec->override = 1;
         ec->icccm.title = eina_stringshare_add("Cursor");
-        ec->icccm.window_role = eina_stringshare_add("wl_pointer-cursor");
+        e_client_window_role_set(ec, "wl_pointer-cursor");
         evas_object_pass_events_set(ec->frame, 1);
         e_client_focus_stack_set(eina_list_remove(e_client_focus_stack_get(), ec));
         EC_CHANGED(ec);
index f1d9b8b..586ce87 100644 (file)
@@ -1442,7 +1442,7 @@ _tzpol_iface_cb_role_set(struct wl_client *client EINA_UNUSED, struct wl_resourc
    EINA_SAFETY_ON_NULL_RETURN(ec);
    EINA_SAFETY_ON_NULL_RETURN(ec->frame);
 
-   eina_stringshare_replace(&ec->icccm.window_role, role);
+   e_client_window_role_set(ec, role);
 
    /* TODO: support multiple roles */
    if (!e_util_strcmp("notification-low", role))
index 03be1e1..404d6c7 100644 (file)
@@ -232,7 +232,7 @@ e_service_cbhm_client_set(E_Client *ec)
    cbhm->show_block = EINA_TRUE;
 
    e_comp_wl->selection.cbhm = ec->comp_data->surface;
-   eina_stringshare_replace(&ec->icccm.window_role, "cbhm");
+   e_client_window_role_set(ec, "cbhm");
    e_policy_conformant_part_add(ec);
 
    evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_SHOW, _cbhm_cb_evas_show, cbhm);
index 7059297..1cfbbc8 100644 (file)
@@ -71,7 +71,7 @@ e_mod_indicator_client_set(E_Client *ec)
 
    ELOGF("TZ_IND", "Set indicator service", ec->pixmap, ec);
 
-   eina_stringshare_replace(&ec->icccm.window_role, "indicator");
+   e_client_window_role_set(ec, "indicator");
 
    E_LIST_HANDLER_APPEND(_ind_handlers, E_EVENT_CLIENT_ROTATION_CHANGE_END, _indicator_cb_rot_done, NULL);
    E_LIST_HOOK_APPEND(_ind_hooks, E_CLIENT_HOOK_DEL, _indicator_cb_client_del, NULL);
index 1bb4c03..a18694e 100644 (file)
@@ -9,7 +9,7 @@ e_service_lockscreen_client_set(E_Client *ec)
 
    ELOGF("LOCKSCREEN","Set Client", ec->pixmap, ec);
 
-   eina_stringshare_replace(&ec->icccm.window_role, "lockscreen");
+   e_client_window_role_set(ec, "lockscreen");
 
    // set lockscreen layer
    if (E_LAYER_CLIENT_NOTIFICATION_LOW > evas_object_layer_get(ec->frame))
index d3848b1..ce642d8 100644 (file)
@@ -1397,7 +1397,7 @@ e_service_quickpanel_client_set(E_Client *ec)
         return;
      }
 
-   eina_stringshare_replace(&ec->icccm.window_role, "quickpanel");
+   e_client_window_role_set(ec, "quickpanel");
 
    // set quickpanel layer
    if (E_POLICY_QUICKPANEL_LAYER != evas_object_layer_get(ec->frame))