[E_CLIENT_HOOK_ICONIFY] = NULL,
[E_CLIENT_HOOK_UNICONIFY] = NULL,
[E_CLIENT_HOOK_AUX_HINT_CHANGE] = NULL,
+ [E_CLIENT_HOOK_WINDOW_ROLE_CHANGE] = NULL,
};
///////////////////////////////////////////
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);
+}
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;
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.
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);
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))
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);
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);
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))
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))