ecore-wl2: add ecore_wl2_window_activated_get()

this is specifically for returning the shell surface's activation state
which is NOT equivalent to the window having input focus

@feature
This commit is contained in:
Mike Blumenkrantz 2017-05-17 16:02:53 -04:00
parent 1bc837c3de
commit 704a22d1c9
2 changed files with 15 additions and 0 deletions

View File

@ -1496,6 +1496,14 @@ EAPI Eina_Bool ecore_wl2_window_shell_surface_exists(Ecore_Wl2_Window *win);
*/
EAPI void ecore_wl2_session_recovery_disable(void);
/**
* @brief Get the activated state of a window
* @param window The window
* @return @c EINA_TRUE if activated
*
* @since 1.20
*/
EAPI Eina_Bool ecore_wl2_window_activated_get(const Ecore_Wl2_Window *window);
# endif
# undef EAPI

View File

@ -1273,3 +1273,10 @@ ecore_wl2_window_shell_surface_exists(Ecore_Wl2_Window *window)
return (window->xdg_surface || window->zxdg_surface);
}
EAPI Eina_Bool
ecore_wl2_window_activated_get(const Ecore_Wl2_Window *window)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(window, EINA_FALSE);
return window->focused;
}