switch (win->type)
{
- case ECORE_WL_WINDOW_TYPE_FULLSCREEN:
- if (win->xdg_surface)
- xdg_surface_set_fullscreen(win->xdg_surface, NULL);
- else if (win->shell_surface)
- wl_shell_surface_set_fullscreen(win->shell_surface,
- WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT,
- 0, NULL);
- break;
- case ECORE_WL_WINDOW_TYPE_MAXIMIZED:
- if (win->xdg_surface)
- xdg_surface_set_maximized(win->xdg_surface);
- else if (win->shell_surface)
- wl_shell_surface_set_maximized(win->shell_surface, NULL);
- break;
- case ECORE_WL_WINDOW_TYPE_TRANSIENT:
- if (win->xdg_surface)
- xdg_surface_set_parent(win->xdg_surface, win->parent->xdg_surface);
- else if (win->shell_surface)
- wl_shell_surface_set_transient(win->shell_surface,
- win->parent->surface,
- win->allocation.x,
- win->allocation.y, 0);
- break;
case ECORE_WL_WINDOW_TYPE_MENU:
if (win->xdg_surface)
{
win->allocation.x, win->allocation.y, 0);
break;
case ECORE_WL_WINDOW_TYPE_TOPLEVEL:
+ if (win->shell_surface)
+ wl_shell_surface_set_toplevel(win->shell_surface);
+ break;
+ default:
+ break;
+ }
+
+ switch (win->style)
+ {
+ case ECORE_WL_WINDOW_STYLE_FULLSCREEN:
if (win->xdg_surface)
- xdg_surface_set_parent(win->xdg_surface, NULL);
+ xdg_surface_set_fullscreen(win->xdg_surface, NULL);
else if (win->shell_surface)
- wl_shell_surface_set_toplevel(win->shell_surface);
+ wl_shell_surface_set_fullscreen(win->shell_surface,
+ WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT,
+ 0, NULL);
+ break;
+ case ECORE_WL_WINDOW_STYLE_MAXIMIZED:
+ if (win->xdg_surface)
+ xdg_surface_set_maximized(win->xdg_surface);
+ else if (win->shell_surface)
+ wl_shell_surface_set_maximized(win->shell_surface, NULL);
break;
default:
break;
}
+ if (win->parent)
+ {
+ if (win->xdg_surface)
+ xdg_surface_set_parent(win->xdg_surface, win->parent->xdg_surface);
+ else if (win->shell_surface)
+ wl_shell_surface_set_transient(win->shell_surface,
+ win->parent->surface,
+ win->allocation.x,
+ win->allocation.y, 0);
+ }
+
if (!win->visible)
{
_ecore_wl_window_show_send(win);
win->configured.h = h;
win->configured.edges = 0;
win->transparent = EINA_FALSE;
- if (parent)
- win->type = ECORE_WL_WINDOW_TYPE_TRANSIENT;
- else
- win->type = ECORE_WL_WINDOW_TYPE_TOPLEVEL;
+ win->type = ECORE_WL_WINDOW_TYPE_TOPLEVEL;
win->buffer_type = buffer_type;
win->id = _win_id++;
win->rotation = 0;
if (!win) return;
- if ((win->type == ECORE_WL_WINDOW_TYPE_MAXIMIZED) == maximized) return;
+ if ((win->style == ECORE_WL_WINDOW_STYLE_MAXIMIZED) == maximized) return;
- if (win->type == ECORE_WL_WINDOW_TYPE_TOPLEVEL)
+ if (win->style == ECORE_WL_WINDOW_STYLE_NONE)
{
if (win->xdg_surface)
{
xdg_surface_set_maximized(win->xdg_surface);
- win->type = ECORE_WL_WINDOW_TYPE_MAXIMIZED;
+ win->style = ECORE_WL_WINDOW_STYLE_MAXIMIZED;
}
else if (win->shell_surface)
{
wl_shell_surface_set_maximized(win->shell_surface, NULL);
- win->type = ECORE_WL_WINDOW_TYPE_MAXIMIZED;
+ win->style = ECORE_WL_WINDOW_STYLE_MAXIMIZED;
}
}
- else if (win->type == ECORE_WL_WINDOW_TYPE_MAXIMIZED)
+ else if (win->style == ECORE_WL_WINDOW_STYLE_MAXIMIZED)
{
if (win->xdg_surface)
{
xdg_surface_unset_maximized(win->xdg_surface);
- win->type = ECORE_WL_WINDOW_TYPE_TOPLEVEL;
+ win->style = ECORE_WL_WINDOW_STYLE_NONE;
_ecore_wl_window_configure_send(win,
win->saved.w,
win->saved.h,
else if (win->shell_surface)
{
wl_shell_surface_set_toplevel(win->shell_surface);
- win->type = ECORE_WL_WINDOW_TYPE_TOPLEVEL;
+ win->style = ECORE_WL_WINDOW_STYLE_NONE;
_ecore_wl_window_configure_send(win,
win->saved.w,
win->saved.h,
if (!win) return EINA_FALSE;
- return (win->maximized) || (win->type == ECORE_WL_WINDOW_TYPE_MAXIMIZED);
+ return (win->maximized) || (win->style == ECORE_WL_WINDOW_STYLE_MAXIMIZED);
}
EAPI void
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!win) return;
- if ((win->type == ECORE_WL_WINDOW_TYPE_FULLSCREEN) == fullscreen) return;
+ if ((win->style == ECORE_WL_WINDOW_STYLE_FULLSCREEN) == fullscreen) return;
if (fullscreen)
{
- win->type = ECORE_WL_WINDOW_TYPE_FULLSCREEN;
+ win->style = ECORE_WL_WINDOW_STYLE_FULLSCREEN;
if (win->xdg_surface)
xdg_surface_set_fullscreen(win->xdg_surface, NULL);
else if (win->shell_surface)
wl_shell_surface_set_toplevel(win->shell_surface);
- win->type = ECORE_WL_WINDOW_TYPE_TOPLEVEL;
+ win->style = ECORE_WL_WINDOW_STYLE_NONE;
_ecore_wl_window_configure_send(win,
win->saved.w, win->saved.h, 0);
}
if (!win) return EINA_FALSE;
- return win->fullscreen || (win->type == ECORE_WL_WINDOW_TYPE_FULLSCREEN);
+ return win->fullscreen || (win->style == ECORE_WL_WINDOW_STYLE_FULLSCREEN);
}
EAPI void
win->parent = parent;
if (win->parent)
{
- win->type = ECORE_WL_WINDOW_TYPE_TRANSIENT;
if (win->xdg_surface)
xdg_surface_set_parent(win->xdg_surface, win->parent->xdg_surface);
else if (win->shell_surface)
}
else
{
- win->type = ECORE_WL_WINDOW_TYPE_TOPLEVEL;
if (win->xdg_surface)
xdg_surface_set_parent(win->xdg_surface, NULL);
else if (win->shell_surface)
}
else if (win->xdg_surface)
{
- win->type = ECORE_WL_WINDOW_TYPE_TOPLEVEL;
wl_array_init(&states);
s = wl_array_add(&states, sizeof(*s));
*s = XDG_SURFACE_STATE_ACTIVATED;
else if (win->shell_surface)
{
wl_shell_surface_set_toplevel(win->shell_surface);
- win->type = ECORE_WL_WINDOW_TYPE_TOPLEVEL;
_ecore_wl_window_configure_send(win,
win->saved.w, win->saved.h, 0);
}