mirror of
https://github.com/labwc/labwc.git
synced 2025-11-18 07:00:01 -05:00
desktop: rename functions to increase consistency
...from - desktop_raise_view() - desktop_move_view_to_end_of_cycle() to - desktop_move_to_front() - desktop_move_to_back()
This commit is contained in:
parent
9b99ff9042
commit
238062a859
8 changed files with 29 additions and 26 deletions
|
|
@ -96,7 +96,7 @@ action(struct view *activator, struct server *server, const char *action, const
|
|||
} else if (!strcasecmp(action, "Raise")) {
|
||||
struct view *view = activator_or_focused_view(activator, server);
|
||||
if (view) {
|
||||
desktop_raise_view(view);
|
||||
desktop_move_to_front(view);
|
||||
damage_all_outputs(server);
|
||||
}
|
||||
} else if (!strcasecmp(action, "Resize")) {
|
||||
|
|
|
|||
|
|
@ -220,7 +220,7 @@ process_cursor_motion(struct server *server, uint32_t time)
|
|||
if (view && rc.focus_follow_mouse) {
|
||||
desktop_focus_and_activate_view(&server->seat, view);
|
||||
if (rc.raise_on_focus) {
|
||||
desktop_raise_view(view);
|
||||
desktop_move_to_front(view);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ move_xwayland_sub_views_to_front(struct view *parent)
|
|||
#endif
|
||||
|
||||
void
|
||||
desktop_raise_view(struct view *view)
|
||||
desktop_move_to_front(struct view *view)
|
||||
{
|
||||
if (!view) {
|
||||
return;
|
||||
|
|
@ -63,6 +63,25 @@ desktop_raise_view(struct view *view)
|
|||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
wl_list_insert_tail(struct wl_list *list, struct wl_list *elm)
|
||||
{
|
||||
elm->prev = list->prev;
|
||||
elm->next = list;
|
||||
list->prev = elm;
|
||||
elm->prev->next = elm;
|
||||
}
|
||||
|
||||
void
|
||||
desktop_move_to_back(struct view *view)
|
||||
{
|
||||
if (!view) {
|
||||
return;
|
||||
}
|
||||
wl_list_remove(&view->link);
|
||||
wl_list_insert_tail(&view->server->views, &view->link);
|
||||
}
|
||||
|
||||
static void
|
||||
deactivate_all_views(struct server *server)
|
||||
{
|
||||
|
|
@ -170,22 +189,6 @@ desktop_cycle_view(struct server *server, struct view *current, enum lab_cycle_d
|
|||
return view;
|
||||
}
|
||||
|
||||
static void
|
||||
wl_list_insert_tail(struct wl_list *list, struct wl_list *elm)
|
||||
{
|
||||
elm->prev = list->prev;
|
||||
elm->next = list;
|
||||
list->prev = elm;
|
||||
elm->prev->next = elm;
|
||||
}
|
||||
|
||||
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
|
||||
has_mapped_view(struct wl_list *wl_list)
|
||||
{
|
||||
|
|
@ -237,7 +240,7 @@ desktop_focus_topmost_mapped_view(struct server *server)
|
|||
{
|
||||
struct view *view = topmost_mapped_view(server);
|
||||
desktop_focus_and_activate_view(&server->seat, view);
|
||||
desktop_raise_view(view);
|
||||
desktop_move_to_front(view);
|
||||
}
|
||||
|
||||
static bool
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ handle_toplevel_handle_request_activate(struct wl_listener *listener, void *data
|
|||
// struct wlr_foreign_toplevel_handle_v1_activated_event *event = data;
|
||||
/* In a multi-seat world we would select seat based on event->seat here. */
|
||||
desktop_focus_and_activate_view(&view->server->seat, view);
|
||||
desktop_raise_view(view);
|
||||
desktop_move_to_front(view);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ keyboard_modifiers_notify(struct wl_listener *listener, void *data)
|
|||
/* end cycle */
|
||||
desktop_focus_and_activate_view(&server->seat,
|
||||
server->cycle_view);
|
||||
desktop_raise_view(server->cycle_view);
|
||||
desktop_move_to_front(server->cycle_view);
|
||||
server->cycle_view = NULL;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ void
|
|||
view_impl_map(struct view *view)
|
||||
{
|
||||
desktop_focus_and_activate_view(&view->server->seat, view);
|
||||
desktop_raise_view(view);
|
||||
desktop_move_to_front(view);
|
||||
|
||||
view_update_title(view);
|
||||
view_update_app_id(view);
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ view_minimize(struct view *view, bool minimized)
|
|||
view->minimized = minimized;
|
||||
if (minimized) {
|
||||
view->impl->unmap(view);
|
||||
desktop_move_view_to_end_of_cycle(view);
|
||||
desktop_move_to_back(view);
|
||||
} else {
|
||||
view->impl->map(view);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue