ecore-wl2: Add API function to set if a window is fullscreen

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2015-09-28 11:31:43 -04:00
parent 6a6b56ce24
commit b0f65024ff
2 changed files with 34 additions and 0 deletions

View File

@ -403,6 +403,8 @@ EAPI void ecore_wl2_window_maximized_set(Ecore_Wl2_Window *window, Eina_Bool max
/* TODO: doxy */
EAPI Eina_Bool ecore_wl2_window_fullscreen_get(Ecore_Wl2_Window *window);
EAPI void ecore_wl2_window_fullscreen_set(Ecore_Wl2_Window *window, Eina_Bool fullscreen);
/* TODO: doxy */
EAPI void ecore_wl2_window_rotation_set(Ecore_Wl2_Window *window, int rotation);

View File

@ -634,6 +634,38 @@ ecore_wl2_window_fullscreen_get(Ecore_Wl2_Window *window)
return EINA_FALSE;
}
EAPI void
ecore_wl2_window_fullscreen_set(Ecore_Wl2_Window *window, Eina_Bool fullscreen)
{
EINA_SAFETY_ON_NULL_RETURN(window);
if ((window->type == ECORE_WL2_WINDOW_TYPE_FULLSCREEN) == fullscreen)
return;
if (fullscreen)
{
if (window->xdg_surface)
xdg_surface_set_fullscreen(window->xdg_surface, NULL);
else if (window->wl_shell_surface)
wl_shell_surface_set_fullscreen(window->wl_shell_surface,
WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT,
0, NULL);
window->type = ECORE_WL2_WINDOW_TYPE_FULLSCREEN;
}
else
{
if (window->xdg_surface)
xdg_surface_unset_fullscreen(window->xdg_surface);
else if (window->wl_shell_surface)
wl_shell_surface_set_toplevel(window->wl_shell_surface);
window->type = ECORE_WL2_WINDOW_TYPE_TOPLEVEL;
}
/* TODO: send configure ? */
}
EAPI void
ecore_wl2_window_rotation_set(Ecore_Wl2_Window *window, int rotation)
{