s/wl_list_insert(list.prev...)/wl_list_append(list...)/

This commit is contained in:
Consolatis 2022-10-05 08:43:56 +02:00 committed by Johan Malm
parent 042af48925
commit 89ad0b808f
11 changed files with 32 additions and 31 deletions

View file

@ -6,6 +6,7 @@
#include <strings.h>
#include <unistd.h>
#include <wlr/util/log.h>
#include "common/list.h"
#include "common/mem.h"
#include "common/spawn.h"
#include "debug.h"
@ -378,5 +379,5 @@ action_arg_add_str(struct action *action, char *key, const char *value)
arg->base.key = xstrdup(key);
}
arg->value = xstrdup(value);
wl_list_insert(action->args.prev, &arg->base.link);
wl_list_append(&action->args, &arg->base.link);
}

View file

@ -5,6 +5,7 @@
#include <stdlib.h>
#include <string.h>
#include <wlr/util/log.h>
#include "common/list.h"
#include "common/mem.h"
#include "config/keybind.h"
#include "config/rcxml.h"
@ -60,7 +61,7 @@ keybind_create(const char *keybind)
if (!k) {
return NULL;
}
wl_list_insert(rc.keybinds.prev, &k->link);
wl_list_append(&rc.keybinds, &k->link);
k->keysyms = xmalloc(k->keysyms_len * sizeof(xkb_keysym_t));
memcpy(k->keysyms, keysyms, k->keysyms_len * sizeof(xkb_keysym_t));
wl_list_init(&k->actions);

View file

@ -5,6 +5,7 @@
#include <strings.h>
#include <unistd.h>
#include <wlr/util/log.h>
#include "common/list.h"
#include "common/mem.h"
#include "config/mousebind.h"
#include "config/rcxml.h"
@ -112,7 +113,7 @@ mousebind_create(const char *context)
struct mousebind *m = znew(*m);
m->context = context_from_str(context);
if (m->context != LAB_SSD_NONE) {
wl_list_insert(rc.mousebinds.prev, &m->link);
wl_list_append(&rc.mousebinds, &m->link);
}
wl_list_init(&m->actions);
return m;

View file

@ -14,6 +14,7 @@
#include <wayland-server-core.h>
#include <wlr/util/log.h>
#include "action.h"
#include "common/list.h"
#include "common/mem.h"
#include "common/nodename.h"
#include "common/string-helpers.h"
@ -67,7 +68,7 @@ fill_keybind(char *nodename, char *content)
"nodename: '%s' content: '%s'", nodename, content);
} else if (!strcmp(nodename, "name.action")) {
current_keybind_action = action_create(content);
wl_list_insert(current_keybind->actions.prev,
wl_list_append(&current_keybind->actions,
&current_keybind_action->link);
} else if (!current_keybind_action) {
wlr_log(WLR_ERROR, "expect <action name=\"\"> element first. "
@ -127,7 +128,7 @@ fill_mousebind(char *nodename, char *content)
mousebind_event_from_str(content);
} else if (!strcmp(nodename, "name.action")) {
current_mousebind_action = action_create(content);
wl_list_insert(current_mousebind->actions.prev,
wl_list_append(&current_mousebind->actions,
&current_mousebind_action->link);
} else if (!current_mousebind_action) {
wlr_log(WLR_ERROR, "expect <action name=\"\"> element first. "
@ -403,7 +404,7 @@ entry(xmlNode *node, char *nodename, char *content)
} else if (!strcasecmp(nodename, "name.names.desktops")) {
struct workspace *workspace = znew(*workspace);
workspace->name = xstrdup(content);
wl_list_insert(rc.workspace_config.workspaces.prev, &workspace->link);
wl_list_append(&rc.workspace_config.workspaces, &workspace->link);
} else if (!strcasecmp(nodename, "popupTime.desktops")) {
rc.workspace_config.popuptime = atoi(content);
}
@ -547,7 +548,7 @@ load_default_key_bindings(void)
}
action = action_create(key_combos[i].action);
wl_list_insert(k->actions.prev, &action->link);
wl_list_append(&k->actions, &action->link);
if (key_combos[i].command) {
action_arg_add_str(action, NULL, key_combos[i].command);
@ -617,7 +618,7 @@ load_default_mouse_bindings(void)
}
action = action_create(current->action);
wl_list_insert(m->actions.prev, &action->link);
wl_list_append(&m->actions, &action->link);
if (current->command) {
action_arg_add_str(action, NULL, current->command);
@ -685,7 +686,7 @@ post_processing(void)
if (!wl_list_length(&rc.workspace_config.workspaces)) {
struct workspace *workspace = znew(*workspace);
workspace->name = xstrdup("Default");
wl_list_insert(rc.workspace_config.workspaces.prev, &workspace->link);
wl_list_append(&rc.workspace_config.workspaces, &workspace->link);
}
if (rc.workspace_config.popuptime == INT_MIN) {
rc.workspace_config.popuptime = 1000;

View file

@ -1,11 +1,12 @@
// SPDX-License-Identifier: GPL-2.0-only
#include "config.h"
#include <assert.h>
#include "common/list.h"
#include "common/scene-helpers.h"
#include "labwc.h"
#include "layers.h"
#include "node.h"
#include "ssd.h"
#include "common/scene-helpers.h"
#include "workspaces.h"
static void
@ -68,15 +69,6 @@ desktop_move_to_front(struct view *view)
cursor_update_focus(view->server);
}
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)
{
@ -84,7 +76,7 @@ desktop_move_to_back(struct view *view)
return;
}
wl_list_remove(&view->link);
wl_list_insert_tail(&view->server->views, &view->link);
wl_list_append(&view->server->views, &view->link);
}
void

View file

@ -14,6 +14,7 @@
#include <wayland-server.h>
#include <wlr/types/wlr_layer_shell_v1.h>
#include <wlr/util/log.h>
#include "common/list.h"
#include "common/mem.h"
#include "layers.h"
#include "labwc.h"
@ -366,7 +367,7 @@ new_layer_surface_notify(struct wl_listener *listener, void *data)
return;
}
wl_list_insert(output->layers[layer_surface->pending.layer].prev,
wl_list_append(&output->layers[layer_surface->pending.layer],
&surface->link);
/*
* Temporarily set the layer's current state to pending so that

View file

@ -10,17 +10,18 @@
#include <strings.h>
#include <wayland-server-core.h>
#include <wlr/util/log.h>
#include "action.h"
#include "common/buf.h"
#include "common/font.h"
#include "common/list.h"
#include "common/mem.h"
#include "common/nodename.h"
#include "common/scaled_font_buffer.h"
#include "common/string-helpers.h"
#include "labwc.h"
#include "menu/menu.h"
#include "theme.h"
#include "action.h"
#include "node.h"
#include "theme.h"
#define MENUWIDTH (110)
#define MENU_ITEM_PADDING_Y (4)
@ -225,7 +226,7 @@ fill_item(char *nodename, char *content)
*/
} else if (!strcmp(nodename, "name.action")) {
current_item_action = action_create(content);
wl_list_insert(current_item->actions.prev, &current_item_action->link);
wl_list_append(&current_item->actions, &current_item_action->link);
} else if (!current_item_action) {
wlr_log(WLR_ERROR, "expect <action name=\"\"> element first. "
"nodename: '%s' content: '%s'", nodename, content);

View file

@ -1,10 +1,11 @@
// SPDX-License-Identifier: GPL-2.0-only
#include <assert.h>
#include "common/list.h"
#include "common/mem.h"
#include "labwc.h"
#include "ssd.h"
#include "node.h"
#include "ssd.h"
/* Internal helpers */
static void
@ -41,7 +42,7 @@ add_scene_part(struct wl_list *part_list, enum ssd_part_type type)
{
struct ssd_part *part = znew(*part);
part->type = type;
wl_list_insert(part_list->prev, &part->link);
wl_list_append(part_list, &part->link);
return part;
}

View file

@ -7,10 +7,11 @@
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include "labwc.h"
#include "common/font.h"
#include "common/graphic-helpers.h"
#include "common/list.h"
#include "common/mem.h"
#include "labwc.h"
#include "workspaces.h"
/* Internal helpers */
@ -157,7 +158,7 @@ add_workspace(struct server *server, const char *name)
workspace->server = server;
workspace->name = xstrdup(name);
workspace->tree = wlr_scene_tree_create(server->view_tree);
wl_list_insert(server->workspaces.prev, &workspace->link);
wl_list_append(&server->workspaces, &workspace->link);
if (!server->workspace_current) {
server->workspace_current = workspace;
} else {

View file

@ -1,4 +1,5 @@
// SPDX-License-Identifier: GPL-2.0-only
#include "common/list.h"
#include "common/mem.h"
#include "labwc.h"
@ -37,8 +38,7 @@ unmanaged_handle_map(struct wl_listener *listener, void *data)
/* Stack new surface on top */
wlr_xwayland_surface_restack(xsurface, NULL, XCB_STACK_MODE_ABOVE);
wl_list_insert(unmanaged->server->unmanaged_surfaces.prev,
&unmanaged->link);
wl_list_append(&unmanaged->server->unmanaged_surfaces, &unmanaged->link);
wl_signal_add(&xsurface->events.set_geometry, &unmanaged->set_geometry);
unmanaged->set_geometry.notify = unmanaged_handle_set_geometry;