forked from enlightenment/efl
ecore-wl2: Add API to set window role
Small patch to add support for setting a window role on a given window "#divergence" @feature Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
parent
8b29ae7609
commit
bdcf798dba
|
@ -1205,6 +1205,17 @@ EAPI void ecore_wl2_window_focus_skip_set(Ecore_Wl2_Window *window, Eina_Bool fo
|
|||
*/
|
||||
EAPI Eina_Bool ecore_wl2_window_focus_skip_get(Ecore_Wl2_Window *window);
|
||||
|
||||
/**
|
||||
* Set the role of a given window
|
||||
*
|
||||
* @param window
|
||||
* @param role
|
||||
*
|
||||
* @ingroup Ecore_Wl2_Window_Group
|
||||
* @since 1.20
|
||||
*/
|
||||
EAPI void ecore_wl2_window_role_set(Ecore_Wl2_Window *window, const char *role);
|
||||
|
||||
/**
|
||||
* @defgroup Ecore_Wl2_Input_Group Wayland Library Input Functions
|
||||
* @ingroup Ecore_Wl2_Group
|
||||
|
|
|
@ -153,6 +153,7 @@ struct _Ecore_Wl2_Window
|
|||
int id, rotation, surface_id;
|
||||
const char *title;
|
||||
const char *class;
|
||||
const char *role;
|
||||
|
||||
struct wl_surface *surface;
|
||||
struct xdg_surface *xdg_surface;
|
||||
|
|
|
@ -666,6 +666,7 @@ ecore_wl2_window_free(Ecore_Wl2_Window *window)
|
|||
|
||||
if (window->title) eina_stringshare_del(window->title);
|
||||
if (window->class) eina_stringshare_del(window->class);
|
||||
if (window->role) eina_stringshare_del(window->role);
|
||||
|
||||
display->windows =
|
||||
eina_inlist_remove(display->windows, EINA_INLIST_GET(window));
|
||||
|
@ -1469,3 +1470,10 @@ ecore_wl2_window_focus_skip_get(Ecore_Wl2_Window *window)
|
|||
EINA_SAFETY_ON_NULL_RETURN_VAL(window, EINA_FALSE);
|
||||
return window->focus_skip;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
ecore_wl2_window_role_set(Ecore_Wl2_Window *window, const char *role)
|
||||
{
|
||||
EINA_SAFETY_ON_NULL_RETURN(window);
|
||||
eina_stringshare_replace(&window->role, role);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue