shell = shell_surface_get_shell(shsurf);
- if (wl_list_empty(&shell->fullscreen_layer.view_list))
+ if (wl_list_empty(&shell->fullscreen_layer.view_list.link))
return false;
- top_fs_ev = container_of(shell->fullscreen_layer.view_list.next,
+ top_fs_ev = container_of(shell->fullscreen_layer.view_list.link.next,
struct weston_view,
- layer_link);
+ layer_link.link);
return (shsurf == get_shell_surface(top_fs_ev->surface));
}
if (!output)
return 0;
- wl_list_for_each(view, &shell->panel_layer.view_list, layer_link) {
+ wl_list_for_each(view, &shell->panel_layer.view_list.link, layer_link.link) {
if (view->surface->output == output) {
panel_height = view->surface->height;
break;
main_surface = weston_surface_get_main_surface(state->keyboard_focus);
next = NULL;
- wl_list_for_each(view, &state->ws->layer.view_list, layer_link) {
+ wl_list_for_each(view,
+ &state->ws->layer.view_list.link, layer_link.link) {
if (view->surface == main_surface)
continue;
if (is_focus_view(view))
focus_surface_created = true;
} else {
- wl_list_remove(&ws->fsurf_front->view->layer_link);
- wl_list_remove(&ws->fsurf_back->view->layer_link);
+ weston_layer_entry_remove(&ws->fsurf_front->view->layer_link);
+ weston_layer_entry_remove(&ws->fsurf_back->view->layer_link);
}
if (ws->focus_animation) {
}
if (to)
- wl_list_insert(&to->layer_link,
- &ws->fsurf_front->view->layer_link);
+ weston_layer_entry_insert(&to->layer_link,
+ &ws->fsurf_front->view->layer_link);
else if (from)
- wl_list_insert(&ws->layer.view_list,
- &ws->fsurf_front->view->layer_link);
+ weston_layer_entry_insert(&ws->layer.view_list,
+ &ws->fsurf_front->view->layer_link);
if (focus_surface_created) {
ws->focus_animation = weston_fade_run(
ws->fsurf_front->view->alpha, 0.4, 300,
focus_animation_done, ws);
} else if (from) {
- wl_list_insert(&from->layer_link,
- &ws->fsurf_back->view->layer_link);
+ weston_layer_entry_insert(&from->layer_link,
+ &ws->fsurf_back->view->layer_link);
ws->focus_animation = weston_stable_fade_run(
ws->fsurf_front->view, 0.0,
ws->fsurf_back->view, 0.4,
focus_animation_done, ws);
} else if (to) {
- wl_list_insert(&ws->layer.view_list,
- &ws->fsurf_back->view->layer_link);
+ weston_layer_entry_insert(&ws->layer.view_list,
+ &ws->fsurf_back->view->layer_link);
ws->focus_animation = weston_stable_fade_run(
ws->fsurf_front->view, 0.0,
ws->fsurf_back->view, 0.4,
static int
workspace_is_empty(struct workspace *ws)
{
- return wl_list_empty(&ws->layer.view_list);
+ return wl_list_empty(&ws->layer.view_list.link);
}
static struct workspace *
unsigned int height;
double d;
- wl_list_for_each(view, &ws->layer.view_list, layer_link) {
+ wl_list_for_each(view, &ws->layer.view_list.link, layer_link.link) {
height = get_output_height(view->surface->output);
d = height * fraction;
unsigned int height;
double d;
- wl_list_for_each(view, &ws->layer.view_list, layer_link) {
+ wl_list_for_each(view, &ws->layer.view_list.link, layer_link.link) {
height = get_output_height(view->surface->output);
if (fraction > 0)
struct weston_view *view;
struct weston_transform *transform;
- wl_list_for_each(view, &ws->layer.view_list, layer_link) {
+ wl_list_for_each(view, &ws->layer.view_list.link, layer_link.link) {
if (is_focus_view(view)) {
struct focus_surface *fsurf = get_focus_surface(view->surface);
transform = &fsurf->workspace_transform;
* visible after the workspace animation ends but before its layer
* is hidden. In that case, we need to damage below those views so
* that the screen is properly repainted. */
- wl_list_for_each(view, &from->layer.view_list, layer_link)
+ wl_list_for_each(view, &from->layer.view_list.link, layer_link.link)
weston_view_damage_below(view);
wl_list_remove(&shell->workspaces.animation.link);
return;
/* Don't change workspace when there is any fullscreen surfaces. */
- if (!wl_list_empty(&shell->fullscreen_layer.view_list))
+ if (!wl_list_empty(&shell->fullscreen_layer.view_list.link))
return;
from = get_current_workspace(shell);
static bool
workspace_has_only(struct workspace *ws, struct weston_surface *surface)
{
- struct wl_list *list = &ws->layer.view_list;
+ struct wl_list *list = &ws->layer.view_list.link;
struct wl_list *e;
if (wl_list_empty(list))
if (e->next != list)
return false;
- return container_of(e, struct weston_view, layer_link)->surface == surface;
+ return container_of(e, struct weston_view, layer_link.link)->surface == surface;
}
static void
from = get_current_workspace(shell);
to = get_workspace(shell, workspace);
- wl_list_remove(&view->layer_link);
- wl_list_insert(&to->layer.view_list, &view->layer_link);
+ weston_layer_entry_remove(&view->layer_link);
+ weston_layer_entry_insert(&to->layer.view_list, &view->layer_link);
shell_surface_update_child_surface_layers(shsurf);
from = get_current_workspace(shell);
to = get_workspace(shell, index);
- wl_list_remove(&view->layer_link);
- wl_list_insert(&to->layer.view_list, &view->layer_link);
+ weston_layer_entry_remove(&view->layer_link);
+ weston_layer_entry_insert(&to->layer.view_list, &view->layer_link);
shsurf = get_shell_surface(surface);
if (shsurf != NULL)
/* The surface will be inserted into the list immediately after the link
* returned by this function (i.e. will be stacked immediately above the
* returned link). */
-static struct wl_list *
+static struct weston_layer_entry *
shell_surface_calculate_layer_link (struct shell_surface *shsurf)
{
struct workspace *ws;
/* TODO: Handle a parent with multiple views */
parent = get_default_view(shsurf->parent);
if (parent)
- return parent->layer_link.prev;
+ return container_of(parent->layer_link.link.prev,
+ struct weston_layer_entry, link);
}
/* Move the surface to a normal workspace layer so that surfaces
shell_surface_update_child_surface_layers (struct shell_surface *shsurf)
{
struct shell_surface *child;
+ struct weston_layer_entry *prev;
/* Move the child layers to the same workspace as shsurf. They will be
* stacked above shsurf. */
wl_list_for_each_reverse(child, &shsurf->children_list, children_link) {
- if (shsurf->view->layer_link.prev != &child->view->layer_link) {
+ if (shsurf->view->layer_link.link.prev != &child->view->layer_link.link) {
weston_view_damage_below(child->view);
weston_view_geometry_dirty(child->view);
- wl_list_remove(&child->view->layer_link);
- wl_list_insert(shsurf->view->layer_link.prev,
- &child->view->layer_link);
+ prev = container_of(shsurf->view->layer_link.link.prev,
+ struct weston_layer_entry, link);
+ weston_layer_entry_remove(&child->view->layer_link);
+ weston_layer_entry_insert(prev,
+ &child->view->layer_link);
weston_view_geometry_dirty(child->view);
weston_surface_damage(child->surface);
static void
shell_surface_update_layer(struct shell_surface *shsurf)
{
- struct wl_list *new_layer_link;
+ struct weston_layer_entry *new_layer_link;
new_layer_link = shell_surface_calculate_layer_link(shsurf);
return;
weston_view_geometry_dirty(shsurf->view);
- wl_list_remove(&shsurf->view->layer_link);
- wl_list_insert(new_layer_link, &shsurf->view->layer_link);
+ weston_layer_entry_remove(&shsurf->view->layer_link);
+ weston_layer_entry_insert(new_layer_link, &shsurf->view->layer_link);
weston_view_geometry_dirty(shsurf->view);
weston_surface_damage(shsurf->surface);
shsurf = get_shell_surface(surface);
current_ws = get_current_workspace(shsurf->shell);
- wl_list_remove(&view->layer_link);
+ weston_layer_entry_remove(&view->layer_link);
/* hide or show, depending on the state */
if (is_true) {
- wl_list_insert(&shsurf->shell->minimized_layer.view_list, &view->layer_link);
+ weston_layer_entry_insert(&shsurf->shell->minimized_layer.view_list, &view->layer_link);
drop_focus_state(shsurf->shell, current_ws, view->surface);
wl_list_for_each(seat, &shsurf->shell->compositor->seat_list, link) {
}
}
else {
- wl_list_insert(¤t_ws->layer.view_list, &view->layer_link);
+ weston_layer_entry_insert(¤t_ws->layer.view_list, &view->layer_link);
wl_list_for_each(seat, &shsurf->shell->compositor->seat_list, link) {
if (!seat->keyboard)
output->height);
weston_view_geometry_dirty(shsurf->fullscreen.black_view);
- wl_list_remove(&shsurf->fullscreen.black_view->layer_link);
- wl_list_insert(&shsurf->view->layer_link,
- &shsurf->fullscreen.black_view->layer_link);
+ weston_layer_entry_remove(&shsurf->fullscreen.black_view->layer_link);
+ weston_layer_entry_insert(&shsurf->view->layer_link,
+ &shsurf->fullscreen.black_view->layer_link);
weston_view_geometry_dirty(shsurf->fullscreen.black_view);
weston_surface_damage(shsurf->surface);
restore_output_mode(output);
/* Reverse the effect of lower_fullscreen_layer() */
- wl_list_remove(&shsurf->view->layer_link);
- wl_list_insert(&shsurf->shell->fullscreen_layer.view_list, &shsurf->view->layer_link);
+ weston_layer_entry_remove(&shsurf->view->layer_link);
+ weston_layer_entry_insert(&shsurf->shell->fullscreen_layer.view_list, &shsurf->view->layer_link);
shell_ensure_fullscreen_black_view(shsurf);
{
struct weston_view *v, *next;
- wl_list_for_each_safe(v, next, &layer->view_list, layer_link) {
+ wl_list_for_each_safe(v, next, &layer->view_list.link, layer_link.link) {
if (v->output == ev->output && v != ev) {
weston_view_unmap(v);
v->surface->configure = NULL;
weston_view_set_position(ev, ev->output->x, ev->output->y);
- if (wl_list_empty(&ev->layer_link)) {
- wl_list_insert(&layer->view_list, &ev->layer_link);
+ if (wl_list_empty(&ev->layer_link.link)) {
+ weston_layer_entry_insert(&layer->view_list, &ev->layer_link);
weston_compositor_schedule_repaint(ev->surface->compositor);
}
}
center_on_output(view, get_default_output(shell->compositor));
if (!weston_surface_is_mapped(surface)) {
- wl_list_insert(&shell->lock_layer.view_list,
- &view->layer_link);
+ weston_layer_entry_insert(&shell->lock_layer.view_list,
+ &view->layer_link);
weston_view_update_transform(view);
shell_fade(shell, FADE_IN);
}
ws = get_current_workspace(shell);
wl_list_for_each_reverse_safe(view, prev,
- &shell->fullscreen_layer.view_list,
- layer_link) {
+ &shell->fullscreen_layer.view_list.link,
+ layer_link.link) {
struct shell_surface *shsurf = get_shell_surface(view->surface);
if (!shsurf)
* in the fullscreen layer. */
if (shsurf->state.fullscreen) {
/* Hide the black view */
- wl_list_remove(&shsurf->fullscreen.black_view->layer_link);
- wl_list_init(&shsurf->fullscreen.black_view->layer_link);
+ weston_layer_entry_remove(&shsurf->fullscreen.black_view->layer_link);
+ wl_list_init(&shsurf->fullscreen.black_view->layer_link.link);
weston_view_damage_below(shsurf->fullscreen.black_view);
}
/* Lower the view to the workspace layer */
- wl_list_remove(&view->layer_link);
- wl_list_insert(&ws->layer.view_list, &view->layer_link);
+ weston_layer_entry_remove(&view->layer_link);
+ weston_layer_entry_insert(&ws->layer.view_list, &view->layer_link);
weston_view_damage_below(view);
weston_surface_damage(view->surface);
weston_surface_set_size(surface, 8192, 8192);
weston_view_set_position(view, 0, 0);
weston_surface_set_color(surface, 0.0, 0.0, 0.0, 1.0);
- wl_list_insert(&compositor->fade_layer.view_list,
- &view->layer_link);
+ weston_layer_entry_insert(&compositor->fade_layer.view_list,
+ &view->layer_link);
pixman_region32_init(&surface->input);
return view;
{
struct desktop_shell *shell = surface->configure_private;
struct weston_view *view;
+ struct weston_layer_entry *prev;
if (surface->width == 0)
return;
view = container_of(surface->views.next, struct weston_view, surface_link);
center_on_output(view, surface->output);
- if (wl_list_empty(&view->layer_link)) {
- wl_list_insert(shell->lock_layer.view_list.prev,
- &view->layer_link);
+ if (wl_list_empty(&view->layer_link.link)) {
+ prev = container_of(shell->lock_layer.view_list.link.prev,
+ struct weston_layer_entry, link);
+ weston_layer_entry_insert(prev, &view->layer_link);
weston_view_update_transform(view);
wl_event_source_timer_update(shell->screensaver.timer,
shell->screensaver.duration);
/* temporary re-display minimized surfaces */
struct weston_view *tmp;
struct weston_view **minimized;
- wl_list_for_each_safe(view, tmp, &switcher->shell->minimized_layer.view_list, layer_link) {
- wl_list_remove(&view->layer_link);
- wl_list_insert(&ws->layer.view_list, &view->layer_link);
+ wl_list_for_each_safe(view, tmp, &switcher->shell->minimized_layer.view_list.link, layer_link.link) {
+ weston_layer_entry_remove(&view->layer_link);
+ weston_layer_entry_insert(&ws->layer.view_list, &view->layer_link);
minimized = wl_array_add(&switcher->minimized_array, sizeof *minimized);
*minimized = view;
}
- wl_list_for_each(view, &ws->layer.view_list, layer_link) {
+ wl_list_for_each(view, &ws->layer.view_list.link, layer_link.link) {
shsurf = get_shell_surface(view->surface);
if (shsurf &&
shsurf->type == SHELL_SURFACE_TOPLEVEL &&
struct weston_keyboard *keyboard = switcher->grab.keyboard;
struct workspace *ws = get_current_workspace(switcher->shell);
- wl_list_for_each(view, &ws->layer.view_list, layer_link) {
+ wl_list_for_each(view, &ws->layer.view_list.link, layer_link.link) {
if (is_focus_view(view))
continue;
wl_array_for_each(minimized, &switcher->minimized_array) {
/* with the exception of the current selected */
if ((*minimized)->surface != switcher->current) {
- wl_list_remove(&(*minimized)->layer_link);
- wl_list_insert(&switcher->shell->minimized_layer.view_list, &(*minimized)->layer_link);
+ weston_layer_entry_remove(&(*minimized)->layer_link);
+ weston_layer_entry_insert(&switcher->shell->minimized_layer.view_list, &(*minimized)->layer_link);
weston_view_damage_below(*minimized);
}
}
struct weston_output *output = data;
struct weston_view *view;
- wl_list_for_each(view, &layer->view_list, layer_link) {
+ wl_list_for_each(view, &layer->view_list.link, layer_link.link) {
if (view->output != output)
continue;
struct weston_view *view;
float x, y;
- wl_list_for_each(view, &layer->view_list, layer_link) {
+ wl_list_for_each(view, &layer->view_list.link, layer_link.link) {
if (view->output != output)
continue;