struct wl_list;
struct action {
- struct wl_list link; /* struct keybinding.actions,
- * struct mousebinding.actions,
- * struct menuitem.actions */
+ struct wl_list link; /*
+ * struct keybinding.actions
+ * struct mousebinding.actions
+ * struct menuitem.actions
+ */
uint32_t type; /* enum action_type */
struct wl_list args; /* struct action_arg.link */
* Does nothing if <ptr> is already NULL.
*/
#define zfree(ptr) do { \
- free(ptr); (ptr) = NULL; \
+ free(ptr); (ptr) = NULL; \
} while (0)
#endif /* __LABWC_MEM_H */
/* Double use: as config in config/rcxml.c and as instance in workspaces.c */
struct workspace {
- struct wl_list link; /* struct server.workspaces
- struct rcxml.workspace_config.workspaces */
+ struct wl_list link; /*
+ * struct server.workspaces
+ * struct rcxml.workspace_config.workspaces
+ */
struct server *server;
char *name;
}
if (setrlimit(RLIMIT_NOFILE, &original_nofile_rlimit) != 0) {
- wlr_log_errno(WLR_ERROR, "Failed to restore max open files limit: setrlimit(NOFILE) failed");
+ wlr_log_errno(WLR_ERROR,
+ "Failed to restore max open files limit: setrlimit(NOFILE) failed");
}
}
double x, y, w, h;
/* The anchor point of a line is in the center */
- x = y = line_width / 2;
+ x = line_width / 2;
+ y = x;
w = width - line_width;
h = height - line_width;
cairo_set_line_width(cairo, line_width);
{
assert(parent);
struct scaled_font_buffer *self = znew(*self);
- struct scaled_scene_buffer *scaled_buffer
- = scaled_scene_buffer_create(parent, &impl);
+ struct scaled_scene_buffer *scaled_buffer =
+ scaled_scene_buffer_create(parent, &impl);
if (!scaled_buffer) {
free(self);
return NULL;
#include "resistance.h"
#include "ssd.h"
-static const char **cursor_names = NULL;
+static const char * const *cursor_names = NULL;
/* Usual cursor names */
-static const char *cursors_xdg[] = {
+static const char * const cursors_xdg[] = {
NULL,
"default",
"grab",
};
/* XCursor fallbacks */
-static const char *cursors_x11[] = {
+static const char * const cursors_x11[] = {
NULL,
"left_ptr",
"grabbing",
return NULL;
}
struct view *view;
- wl_list_for_each (view, &server->views, link) {
+ wl_list_for_each(view, &server->views, link) {
if (view->surface == focused_surface) {
return view;
}
handle_keybinding(struct server *server, uint32_t modifiers, xkb_keysym_t sym)
{
struct keybind *keybind;
- wl_list_for_each_reverse (keybind, &rc.keybinds, link) {
+ wl_list_for_each_reverse(keybind, &rc.keybinds, link) {
if (modifiers ^ keybind->modifiers) {
continue;
}
/ sizeof(layers_above_shell[0]);
struct lab_layer_surface *layer, *topmost = NULL;
for (size_t i = 0; i < nlayers; ++i) {
- wl_list_for_each_reverse (layer,
+ wl_list_for_each_reverse(layer,
&output->layers[layers_above_shell[i]], link) {
struct wlr_layer_surface_v1 *layer_surface =
layer->scene_layer_surface->layer_surface;
close_all_submenus(struct menu *menu)
{
struct menuitem *item;
- wl_list_for_each (item, &menu->menuitems, link) {
+ wl_list_for_each(item, &menu->menuitems, link) {
if (item->submenu) {
wlr_scene_node_set_enabled(
&item->submenu->scene_tree->node, false);
output_from_wlr_output(struct server *server, struct wlr_output *wlr_output)
{
struct output *output;
- wl_list_for_each (output, &server->outputs, link) {
+ wl_list_for_each(output, &server->outputs, link) {
if (output->wlr_output == wlr_output) {
return output;
}
theme_init(g_server->theme, rc.theme_name);
struct view *view;
- wl_list_for_each (view, &g_server->views, link) {
+ wl_list_for_each(view, &g_server->views, link) {
if (!view->mapped || !view->ssd.enabled) {
continue;
}
parent_of(struct view *view)
{
struct view *p;
- wl_list_for_each (p, &view->server->views, link) {
+ wl_list_for_each(p, &view->server->views, link) {
if (p->xdg_surface->toplevel
== view->xdg_surface->toplevel->parent) {
return p;
/* Try to focus on last created unmanaged xwayland surface */
struct xwayland_unmanaged *u;
struct wl_list *list = &server->unmanaged_surfaces;
- wl_list_for_each_reverse (u, list, link) {
+ wl_list_for_each_reverse(u, list, link) {
struct wlr_xwayland_surface *prev = u->xwayland_surface;
if (wlr_xwayland_or_surface_wants_focus(prev)) {
seat_focus_surface(&server->seat, prev->surface);
/* Restack unmanaged surfaces on top */
struct xwayland_unmanaged *u;
struct wl_list *list = &view->server->unmanaged_surfaces;
- wl_list_for_each (u, list, link) {
+ wl_list_for_each(u, list, link) {
wlr_xwayland_surface_restack(u->xwayland_surface, NULL,
XCB_STACK_MODE_ABOVE);
}