From 7f592ef01a9a6c68ae79acb464dc8a53f9f65642 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 17 Sep 2023 09:59:23 +0200 Subject: [PATCH] Apply clang-format --- cagebreak.c | 2 +- keybinding.c | 5 +++-- output.c | 41 ++++++++++++++++++++++------------------- seat.c | 2 +- workspace.c | 5 +++-- 5 files changed, 30 insertions(+), 25 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index 7ebf905..2189b08 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -370,7 +370,7 @@ main(int argc, char *argv[]) { server.event_loop = event_loop; backend = wlr_backend_autocreate(server.wl_display); - server.headless_backend=wlr_headless_backend_create(server.wl_display); + server.headless_backend = wlr_headless_backend_create(server.wl_display); if(!backend) { wlr_log(WLR_ERROR, "Unable to create the wlroots backend"); ret = 1; diff --git a/keybinding.c b/keybinding.c index 61aceeb..9429e03 100644 --- a/keybinding.c +++ b/keybinding.c @@ -1028,7 +1028,8 @@ print_output(struct cg_output *outp) { outp->wlr_output->width, outp->wlr_output->height); print_str(&outp_str, "\"refresh_rate\": %f,\n", (float)outp->wlr_output->refresh / 1000.0); - print_str(&outp_str, "\"permanent\": %d,\n", outp->role == OUTPUT_ROLE_PERMANENT); + print_str(&outp_str, "\"permanent\": %d,\n", + outp->role == OUTPUT_ROLE_PERMANENT); print_str(&outp_str, "\"curr_workspace\": %d,\n", outp->curr_workspace + 1); char *workspaces_str = print_workspaces(outp); if(workspaces_str != NULL) { @@ -1549,7 +1550,7 @@ keybinding_configure_output(struct cg_server *server, struct cg_output *output, *tmp_output; wl_list_for_each_safe(output, tmp_output, &server->outputs, link) { if(strcmp(config->output_name, output->name) == 0) { - int output_num=output_get_num(output); + int output_num = output_get_num(output); output_configure(server, output); ipc_send_event(server, "{\"event_name\":\"configure_output\",\"output\":\"%" diff --git a/output.c b/output.c index 5d16699..625e966 100644 --- a/output.c +++ b/output.c @@ -139,9 +139,11 @@ output_destroy(struct cg_output *output) { wlr_output_layout_get_box(server->output_layout, output->wlr_output, &output->layout_box); wlr_output_layout_remove(server->output_layout, output->wlr_output); - output->wlr_output=wlr_headless_add_output(server->headless_backend,output->layout_box.width,output->layout_box.height); - wlr_output_layout_add(server->output_layout, output->wlr_output, output->layout_box.x, - output->layout_box.y); + output->wlr_output = wlr_headless_add_output(server->headless_backend, + output->layout_box.width, + output->layout_box.height); + wlr_output_layout_add(server->output_layout, output->wlr_output, + output->layout_box.x, output->layout_box.y); } else { @@ -280,10 +282,11 @@ output_apply_config(struct cg_server *server, struct cg_output *output, struct wlr_output *wlr_output = output->wlr_output; wlr_output_layout_get_box(server->output_layout, output->wlr_output, - &output->layout_box); + &output->layout_box); if(config->role != OUTPUT_ROLE_DEFAULT) { output->role = config->role; - if((output->role == OUTPUT_ROLE_PERIPHERAL)&&(output->destroyed == true)) { + if((output->role == OUTPUT_ROLE_PERIPHERAL) && + (output->destroyed == true)) { output_destroy(output); wlr_output_destroy(wlr_output); return; @@ -319,38 +322,38 @@ output_apply_config(struct cg_server *server, struct cg_output *output, config->pos.y); /* Since the size of the output may have changed, we * reinitialize all workspaces with a fullscreen layout */ - if(output->layout_box.width!=config->pos.width||output->layout_box.height!=config->pos.height) { + if(output->layout_box.width != config->pos.width || + output->layout_box.height != config->pos.height) { for(unsigned int i = 0; i < output->server->nws; ++i) { output_make_workspace_fullscreen(output, i); } } else { wlr_output_layout_get_box(server->output_layout, output->wlr_output, - &output->layout_box); + &output->layout_box); for(unsigned int i = 0; i < server->nws; ++i) { - struct cg_workspace *ws=output->workspaces[i]; + struct cg_workspace *ws = output->workspaces[i]; bool first = true; for(struct cg_tile *tile = ws->focused_tile; - first || output->workspaces[i]->focused_tile != tile; - tile = tile->next) { + first || output->workspaces[i]->focused_tile != tile; + tile = tile->next) { first = false; if(tile->view != NULL) { wlr_scene_node_set_position( - &tile->view->scene_tree->node, - tile->view->ox + output->layout_box.x, - output->layout_box.y); + &tile->view->scene_tree->node, + tile->view->ox + output->layout_box.x, + output->layout_box.y); } } } } } else { wlr_output_layout_add_auto(server->output_layout, wlr_output); - // The following two lines make sure that the output is "manually" managed, - // so that its position doesn't change anymore in the future. + // The following two lines make sure that the output is "manually" + // managed, so that its position doesn't change anymore in the future. wlr_output_layout_get_box(server->output_layout, output->wlr_output, - &output->layout_box); - wlr_output_layout_move(server->output_layout, output->wlr_output, output->layout_box.x, - output->layout_box.y); - + &output->layout_box); + wlr_output_layout_move(server->output_layout, output->wlr_output, + output->layout_box.x, output->layout_box.y); struct wlr_output_mode *preferred_mode = wlr_output_preferred_mode(wlr_output); diff --git a/seat.c b/seat.c index efa6129..65565e7 100644 --- a/seat.c +++ b/seat.c @@ -914,7 +914,7 @@ handle_destroy(struct wl_listener *listener, void *_data) { wl_list_remove(&seat->request_set_cursor.link); wl_list_remove(&seat->request_set_selection.link); wl_list_remove(&seat->request_set_primary_selection.link); - seat->server->seat=NULL; + seat->server->seat = NULL; free(seat); } diff --git a/workspace.c b/workspace.c index 8be621d..0ce0e3d 100644 --- a/workspace.c +++ b/workspace.c @@ -100,8 +100,9 @@ void workspace_free_tiles(struct cg_workspace *workspace) { workspace->focused_tile->prev->next = NULL; while(workspace->focused_tile != NULL) { - if(workspace->server->seat!=NULL&&(!workspace->output->server->running || - workspace->focused_tile == workspace->server->seat->cursor_tile)) { + if(workspace->server->seat != NULL && + (!workspace->output->server->running || + workspace->focused_tile == workspace->server->seat->cursor_tile)) { workspace->server->seat->cursor_tile = NULL; } struct cg_tile *next = workspace->focused_tile->next;