mirror of
https://github.com/labwc/labwc.git
synced 2025-11-04 13:30:07 -05:00
desktop: simplify desktop_move_view_to_end_of_cycle()
This commit is contained in:
parent
bb4c277e08
commit
10884ca2e9
1 changed files with 12 additions and 8 deletions
|
|
@ -170,16 +170,20 @@ desktop_cycle_view(struct server *server, struct view *current, enum lab_cycle_d
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
desktop_move_view_to_end_of_cycle(struct view *to_end) {
|
wl_list_insert_tail(struct wl_list *list, struct wl_list *elm)
|
||||||
wl_list_remove(&to_end->link);
|
{
|
||||||
struct view *view;
|
elm->prev = list->prev;
|
||||||
wl_list_for_each_reverse (view, &to_end->server->views, link) {
|
elm->next = list;
|
||||||
wl_list_insert(&view->link, &to_end->link);
|
list->prev = elm;
|
||||||
return;
|
elm->prev->next = elm;
|
||||||
}
|
}
|
||||||
/* if the foreach did not return, this window was the only one in the list, so just reinsert it at the start */
|
|
||||||
wl_list_insert(&to_end->server->views, &to_end->link);
|
void
|
||||||
|
desktop_move_view_to_end_of_cycle(struct view *to_end)
|
||||||
|
{
|
||||||
|
wl_list_remove(&to_end->link);
|
||||||
|
wl_list_insert_tail(&to_end->server->views, &to_end->link);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue