From 375e4d5ea503cea950c12720b26e6e02acec55dc Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 22 Feb 2020 09:45:22 +0100 Subject: [PATCH 001/689] Completely switch to wlr_keyboard_group --- seat.c | 246 +++++++++++++++------------------------------------------ seat.h | 23 ++---- 2 files changed, 70 insertions(+), 199 deletions(-) diff --git a/seat.c b/seat.c index 75a6a78..0faacd5 100644 --- a/seat.c +++ b/seat.c @@ -112,7 +112,7 @@ static void update_capabilities(const struct cg_seat *seat) { uint32_t caps = 0; - if(!wl_list_empty(&seat->keyboards)) { + if(!wl_list_empty(&seat->keyboard_groups)) { caps |= WL_SEAT_CAPABILITY_KEYBOARD; } if(!wl_list_empty(&seat->pointers)) { @@ -216,41 +216,41 @@ handle_new_pointer(struct cg_seat *seat, struct wlr_input_device *device) { static int handle_keyboard_repeat(void *data) { - struct cg_keyboard *keyboard = (struct cg_keyboard *)data; - struct wlr_keyboard *wlr_device = keyboard->device->keyboard; - if(keyboard->repeat_keybinding != NULL) { + struct cg_keyboard_group *cg_group = data; + struct wlr_keyboard *wlr_device = + cg_group->wlr_group->input_device->keyboard; + if(cg_group->repeat_keybinding != NULL) { if(wlr_device->repeat_info.rate > 0) { if(wl_event_source_timer_update( - keyboard->key_repeat_timer, + cg_group->key_repeat_timer, 1000 / wlr_device->repeat_info.rate) < 0) { wlr_log(WLR_DEBUG, "failed to update key repeat timer"); } } - run_action((*keyboard->repeat_keybinding)->action, - keyboard->seat->server, - (*keyboard->repeat_keybinding)->data); + run_action((*cg_group->repeat_keybinding)->action, + cg_group->seat->server, + (*cg_group->repeat_keybinding)->data); } return 0; } static void -handle_modifier_event(struct cg_keyboard *keyboard) { - wlr_seat_set_keyboard(keyboard->seat->seat, keyboard->device); - wlr_seat_keyboard_notify_modifiers(keyboard->seat->seat, - &keyboard->device->keyboard->modifiers); +handle_modifier_event(struct wlr_input_device *device, struct cg_seat *seat) { + wlr_seat_set_keyboard(seat->seat, device); + wlr_seat_keyboard_notify_modifiers(seat->seat, + &device->keyboard->modifiers); - wlr_idle_notify_activity(keyboard->seat->server->idle, - keyboard->seat->seat); + wlr_idle_notify_activity(seat->server->idle, seat->seat); } void -keyboard_disarm_key_repeat(struct cg_keyboard *keyboard) { - if(!keyboard) { +keyboard_disarm_key_repeat(struct cg_keyboard_group *group) { + if(!group) { return; } - keyboard->repeat_keybinding = NULL; - if(wl_event_source_timer_update(keyboard->key_repeat_timer, 0) < 0) { + group->repeat_keybinding = NULL; + if(wl_event_source_timer_update(group->key_repeat_timer, 0) < 0) { wlr_log(WLR_DEBUG, "failed to disarm key repeat timer"); } } @@ -258,7 +258,7 @@ keyboard_disarm_key_repeat(struct cg_keyboard *keyboard) { static bool handle_command_key_bindings(struct cg_server *server, xkb_keysym_t sym, uint32_t modifiers, uint32_t mode, - struct cg_keyboard *keyboard) { + struct cg_keyboard_group *group) { struct keybinding **keybinding = find_keybinding( server->keybindings, &(struct keybinding){.key = sym, .mode = mode, .modifiers = modifiers}); @@ -271,15 +271,16 @@ handle_command_key_bindings(struct cg_server *server, xkb_keysym_t sym, "Recognized keybinding pressed (key: %d, mode: %d, modifiers: %d)", sym, mode, modifiers); - if(keyboard->device->keyboard->repeat_info.delay > 0) { - keyboard->repeat_keybinding = keybinding; - if(wl_event_source_timer_update( - keyboard->key_repeat_timer, - keyboard->device->keyboard->repeat_info.delay) < 0) { + if(group->wlr_group->input_device->keyboard->repeat_info.delay > 0) { + group->repeat_keybinding = keybinding; + if(wl_event_source_timer_update(group->key_repeat_timer, + group->wlr_group->input_device + ->keyboard->repeat_info.delay) < + 0) { wlr_log(WLR_DEBUG, "failed to set key repeat timer"); } } - message_clear(keyboard->seat->server->curr_output); + message_clear(group->seat->server->curr_output); run_action((*keybinding)->action, server, (*keybinding)->data); wlr_idle_notify_activity(server->idle, server->seat->seat); return true; @@ -315,42 +316,42 @@ key_is_modifier(const xkb_keysym_t key) { } static void -handle_key_event(struct cg_keyboard *keyboard, void *data) { - struct cg_seat *seat = keyboard->seat; +handle_key_event(struct cg_keyboard_group *group, struct cg_seat *seat, + void *data) { struct wlr_event_keyboard_key *event = data; + struct wlr_input_device *device = group->wlr_group->input_device; /* Translate from libinput keycode to an xkbcommon keycode. */ xkb_keycode_t keycode = event->keycode + 8; const xkb_keysym_t *syms; - int nsyms = xkb_state_key_get_syms(keyboard->device->keyboard->xkb_state, - keycode, &syms); + int nsyms = + xkb_state_key_get_syms(device->keyboard->xkb_state, keycode, &syms); bool handled = false; for(int i = 0; i < nsyms; ++i) { if(event->state == WLR_KEY_PRESSED && !key_is_modifier(syms[i])) { - uint32_t modifiers = - wlr_keyboard_get_modifiers(keyboard->device->keyboard); + uint32_t modifiers = wlr_keyboard_get_modifiers(device->keyboard); /* Get the consumed_modifiers and remove them from the modifier list */ xkb_mod_mask_t consumed_modifiers = - xkb_state_key_get_consumed_mods2( - keyboard->device->keyboard->xkb_state, keycode, - XKB_CONSUMED_MODE_XKB); + xkb_state_key_get_consumed_mods2(device->keyboard->xkb_state, + keycode, + XKB_CONSUMED_MODE_XKB); if(handle_command_key_bindings(seat->server, syms[i], modifiers & ~consumed_modifiers, - seat->mode, keyboard)) { + seat->mode, group)) { handled = true; } - } else if(keyboard->repeat_keybinding != NULL && handled == false) { - keyboard_disarm_key_repeat(keyboard); + } else if(group->repeat_keybinding != NULL && handled == false) { + keyboard_disarm_key_repeat(group); } } if(!handled) { /* Otherwise, we pass it along to the client. */ - wlr_seat_set_keyboard(seat->seat, keyboard->device); + wlr_seat_set_keyboard(seat->seat, device); wlr_seat_keyboard_notify_key(seat->seat, event->time_msec, event->keycode, event->state); } @@ -358,130 +359,28 @@ handle_key_event(struct cg_keyboard *keyboard, void *data) { wlr_idle_notify_activity(seat->server->idle, seat->seat); } -static void -cg_keyboard_group_remove(struct cg_keyboard *keyboard); - -static void -cg_keyboard_destroy(struct cg_keyboard *keyboard) { - struct cg_seat *seat = keyboard->seat; - - if(keyboard->device->keyboard->group != NULL) { - cg_keyboard_group_remove(keyboard); - } - - if(wlr_seat_get_keyboard(seat->seat) == keyboard->device->keyboard) { - wlr_seat_set_keyboard(seat->seat, NULL); - } - - keyboard_disarm_key_repeat(keyboard); - wl_event_source_remove(keyboard->key_repeat_timer); - - free(keyboard); -} - -static void -destroy_empty_wlr_keyboard_group(void *data) { - wlr_keyboard_group_destroy(data); -} - -static void -cg_keyboard_group_remove(struct cg_keyboard *keyboard) { - struct wlr_keyboard_group *wlr_group = keyboard->device->keyboard->group; - - wlr_keyboard_group_remove_keyboard(keyboard->device->keyboard->group, - keyboard->device->keyboard); - - if(wl_list_empty(&wlr_group->devices)) { - wlr_log(WLR_DEBUG, "Destroying empty keyboard group %p", - (void *)wlr_group); - struct cg_keyboard_group *cg_group = wlr_group->data; - wlr_group->data = NULL; - wl_list_remove(&cg_group->link); - wl_list_remove(&cg_group->key.link); - wl_list_remove(&cg_group->modifiers.link); - cg_keyboard_destroy(cg_group->keyboard); - free(cg_group); - - // To prevent use-after-free conditions when handling key events, defer - // freeing the wlr_keyboard_group until idle - if(keyboard->seat->server->running) { - wl_event_loop_add_idle(keyboard->seat->server->event_loop, - destroy_empty_wlr_keyboard_group, wlr_group); - } else { - destroy_empty_wlr_keyboard_group(wlr_group); - } - } -} - -static void -handle_keyboard_destroy(struct wl_listener *listener, void *_data) { - struct cg_keyboard *keyboard = wl_container_of(listener, keyboard, destroy); - struct cg_seat *seat = keyboard->seat; - wl_list_remove(&keyboard->link); - wl_list_remove(&keyboard->destroy.link); - cg_keyboard_destroy(keyboard); - update_capabilities(seat); -} - static void handle_keyboard_group_key(struct wl_listener *listener, void *data) { struct cg_keyboard_group *cg_group = wl_container_of(listener, cg_group, key); - handle_key_event(cg_group->keyboard, data); + handle_key_event(cg_group, cg_group->seat, data); } static void handle_keyboard_group_modifiers(struct wl_listener *listener, void *_data) { struct cg_keyboard_group *group = wl_container_of(listener, group, modifiers); - handle_modifier_event(group->keyboard); -} - -static bool -keymaps_match(struct xkb_keymap *km1, struct xkb_keymap *km2) { - char *km1_str = xkb_keymap_get_as_string(km1, XKB_KEYMAP_FORMAT_TEXT_V1); - char *km2_str = xkb_keymap_get_as_string(km2, XKB_KEYMAP_FORMAT_TEXT_V1); - bool result = strcmp(km1_str, km2_str) == 0; - free(km1_str); - free(km2_str); - return result; -} - -static bool -repeat_info_match(const struct cg_keyboard *a, const struct wlr_keyboard *b) { - return a->device->keyboard->repeat_info.rate == b->repeat_info.rate && - a->device->keyboard->repeat_info.delay == b->repeat_info.delay; -} - -struct cg_keyboard * -cg_keyboard_from_seat(struct cg_seat *seat, struct wlr_input_device *device) { - struct cg_keyboard *keyboard = calloc(1, sizeof(struct cg_keyboard)); - if(keyboard == NULL) { - wlr_log(WLR_ERROR, "Could not allocate new cg_keyboard."); - return NULL; - } - - keyboard->seat = seat; - keyboard->device = device; - - keyboard->key_repeat_timer = wl_event_loop_add_timer( - seat->server->event_loop, handle_keyboard_repeat, keyboard); - - return keyboard; + handle_modifier_event(group->wlr_group->input_device, group->seat); } static void -keyboard_group_add(const struct cg_keyboard *keyboard) { - struct cg_seat *seat = keyboard->seat; - struct wlr_keyboard *wlr_keyboard = keyboard->device->keyboard; +cg_keyboard_group_add(struct wlr_input_device *device, struct cg_seat *seat) { + struct wlr_keyboard *wlr_keyboard = device->keyboard; struct cg_keyboard_group *group; wl_list_for_each(group, &seat->keyboard_groups, link) { struct wlr_keyboard_group *wlr_group = group->wlr_group; - if(keymaps_match(wlr_keyboard->keymap, wlr_group->keyboard.keymap) && - repeat_info_match(keyboard, &wlr_group->keyboard)) { - wlr_log(WLR_DEBUG, "Adding keyboard %p to group %p.", - (void *)keyboard, (void *)wlr_group); - wlr_keyboard_group_add_keyboard(wlr_group, wlr_keyboard); + if(wlr_keyboard_group_add_keyboard(wlr_group, wlr_keyboard)) { + wlr_log(WLR_DEBUG, "Adding keyboard to existing group."); return; } } @@ -493,6 +392,7 @@ keyboard_group_add(const struct cg_keyboard *keyboard) { wlr_log(WLR_ERROR, "Failed to allocate keyboard group."); return; } + cg_group->seat = seat; cg_group->wlr_group = wlr_keyboard_group_create(); if(cg_group->wlr_group == NULL) { wlr_log(WLR_ERROR, "Failed to create wlr keyboard group."); @@ -501,22 +401,12 @@ keyboard_group_add(const struct cg_keyboard *keyboard) { cg_group->wlr_group->data = cg_group; wlr_keyboard_set_keymap(&cg_group->wlr_group->keyboard, - keyboard->device->keyboard->keymap); + device->keyboard->keymap); wlr_keyboard_set_repeat_info(&cg_group->wlr_group->keyboard, - keyboard->device->keyboard->repeat_info.rate, - keyboard->device->keyboard->repeat_info.delay); - wlr_log(WLR_DEBUG, "Created keyboard group %p", - (void *)cg_group->wlr_group); + device->keyboard->repeat_info.rate, + device->keyboard->repeat_info.delay); + wlr_log(WLR_DEBUG, "Created keyboard group."); - cg_group->keyboard = - cg_keyboard_from_seat(seat, cg_group->wlr_group->input_device); - if(cg_group->keyboard == NULL) { - wlr_log(WLR_ERROR, "Failed to create keyboard from seat."); - goto cleanup; - } - - wlr_log(WLR_DEBUG, "Adding keyboard %p to group %p.", (void *)keyboard, - (void *)cg_group->wlr_group); wlr_keyboard_group_add_keyboard(cg_group->wlr_group, wlr_keyboard); wl_list_insert(&seat->keyboard_groups, &cg_group->link); @@ -525,6 +415,10 @@ keyboard_group_add(const struct cg_keyboard *keyboard) { wl_signal_add(&cg_group->wlr_group->keyboard.events.modifiers, &cg_group->modifiers); + + cg_group->key_repeat_timer = wl_event_loop_add_timer( + seat->server->event_loop, handle_keyboard_repeat, cg_group); + cg_group->modifiers.notify = handle_keyboard_group_modifiers; return; @@ -537,16 +431,9 @@ cleanup: static void handle_new_keyboard(struct cg_seat *seat, struct wlr_input_device *device) { - struct cg_keyboard *keyboard = calloc(1, sizeof(struct cg_keyboard)); - if(!keyboard) { - wlr_log(WLR_ERROR, "Cannot allocate keyboard"); - return; - } - struct xkb_context *context = xkb_context_new(XKB_CONTEXT_NO_FLAGS); if(!context) { wlr_log(WLR_ERROR, "Unable to create XBK context"); - free(keyboard); return; } @@ -561,28 +448,19 @@ handle_new_keyboard(struct cg_seat *seat, struct wlr_input_device *device) { if(!keymap) { wlr_log(WLR_ERROR, "Unable to configure keyboard: keymap does not exist"); - free(keyboard); xkb_context_unref(context); return; } - keyboard->seat = seat; - keyboard->device = device; wlr_keyboard_set_keymap(device->keyboard, keymap); xkb_keymap_unref(keymap); xkb_context_unref(context); wlr_keyboard_set_repeat_info(device->keyboard, 25, 600); - keyboard_group_add(keyboard); + cg_keyboard_group_add(device, seat); - wlr_seat_set_keyboard(seat->seat, device->keyboard->group->input_device); - - wl_list_insert(&seat->keyboards, &keyboard->link); - keyboard->destroy.notify = handle_keyboard_destroy; - wl_signal_add(&device->events.destroy, &keyboard->destroy); - keyboard->key_repeat_timer = wl_event_loop_add_timer( - seat->server->event_loop, handle_keyboard_repeat, keyboard); + wlr_seat_set_keyboard(seat->seat, device); } static void @@ -914,9 +792,11 @@ handle_destroy(struct wl_listener *listener, void *_data) { struct cg_seat *seat = wl_container_of(listener, seat, destroy); wl_list_remove(&seat->destroy.link); - struct cg_keyboard *keyboard, *keyboard_tmp; - wl_list_for_each_safe(keyboard, keyboard_tmp, &seat->keyboards, link) { - handle_keyboard_destroy(&keyboard->destroy, NULL); + struct cg_keyboard_group *group, *group_tmp; + wl_list_for_each_safe(group, group_tmp, &seat->keyboard_groups, link) { + wlr_keyboard_group_destroy(group->wlr_group); + wl_event_source_remove(group->key_repeat_timer); + free(group); } struct cg_pointer *pointer, *pointer_tmp; wl_list_for_each_safe(pointer, pointer_tmp, &seat->pointers, link) { @@ -1014,7 +894,6 @@ seat_create(struct cg_server *server, struct wlr_backend *backend) { wl_signal_add(&seat->seat->events.request_set_primary_selection, &seat->request_set_primary_selection); - wl_list_init(&seat->keyboards); wl_list_init(&seat->keyboard_groups); wl_list_init(&seat->pointers); wl_list_init(&seat->touch); @@ -1095,7 +974,8 @@ seat_set_focus(struct cg_seat *seat, struct cg_view *view) { #if CG_HAS_XWAYLAND if(view->type == CG_XWAYLAND_VIEW) { - const struct cg_xwayland_view *xwayland_view = xwayland_view_from_view(view); + const struct cg_xwayland_view *xwayland_view = + xwayland_view_from_view(view); if(!wlr_xwayland_or_surface_wants_focus( xwayland_view->xwayland_surface)) { return; diff --git a/seat.h b/seat.h index 7d1d7c7..a7632d7 100644 --- a/seat.h +++ b/seat.h @@ -14,22 +14,11 @@ struct wlr_backend; #define DEFAULT_XCURSOR "left_ptr" #define XCURSOR_SIZE 24 -struct cg_keyboard_group { - struct cg_keyboard *keyboard; - - struct wlr_keyboard_group *wlr_group; - struct cg_seat *seat; - struct wl_listener key; - struct wl_listener modifiers; - struct wl_list link; -}; - struct cg_seat { struct wlr_seat *seat; struct cg_server *server; struct wl_listener destroy; - struct wl_list keyboards; struct wl_list keyboard_groups; struct wl_list pointers; struct wl_list touch; @@ -66,14 +55,16 @@ struct cg_seat { struct cg_view *focused_view; }; -struct cg_keyboard { - struct wl_list link; // seat::keyboards +struct cg_keyboard_group { + struct wlr_keyboard_group *wlr_group; struct cg_seat *seat; - struct wlr_input_device *device; - struct wl_listener destroy; - struct keybinding **repeat_keybinding; + struct wl_listener key; + struct wl_listener modifiers; + struct wl_list link; + struct wl_event_source *key_repeat_timer; + struct keybinding **repeat_keybinding; }; struct cg_pointer { From a2cc047132b31cbe4e7a87da4b033a827fad4087 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 23 Feb 2020 16:53:47 +0100 Subject: [PATCH 002/689] Add support for output layout configuration --- cagebreak.c | 16 +++++++ fuzz/fuzz-parse.c | 10 +++++ output.c | 70 +++++++++++++++++++++++++++---- output.h | 11 ++++- parse.c | 103 ++++++++++++++++++++++++++++++++++++++++++++++ server.h | 2 + 6 files changed, 204 insertions(+), 8 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index 4a71480..1ba61fe 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -307,6 +307,8 @@ main(int argc, char *argv[]) { goto end; } + wl_list_init(&server.output_config); + renderer = wlr_backend_get_renderer(backend); wlr_renderer_init_wl_display(renderer, server.wl_display); @@ -506,6 +508,13 @@ main(int argc, char *argv[]) { free(config_file); } + { + struct cg_output *output; + wl_list_for_each(output, &server.outputs, link) { + output_configure(&server, output); + } + } + /* Place the cursor to the topl left of the output layout. */ wlr_cursor_warp(server.seat->cursor, NULL, 0, 0); @@ -523,6 +532,13 @@ end: } free(server.modes); + struct cg_output_config *output_config, *output_config_tmp; + wl_list_for_each_safe(output_config, output_config_tmp, &server.output_config, link) { + wl_list_remove(&output_config->link); + free(output_config->output_name); + free(output_config); + } + keybinding_list_free(server.keybindings); wl_event_source_remove(sigint_source); wl_event_source_remove(sigterm_source); diff --git a/fuzz/fuzz-parse.c b/fuzz/fuzz-parse.c index 257f289..e159293 100644 --- a/fuzz/fuzz-parse.c +++ b/fuzz/fuzz-parse.c @@ -5,6 +5,7 @@ #include "../parse.h" #include "../seat.h" #include "../server.h" +#include "../output.h" #include #include #include @@ -58,6 +59,7 @@ LLVMFuzzerInitialize(int *argc, char ***argv) { /* new_xwayland_surface */ server.keybindings = keybinding_list_init(); server.output_transform = 0; + wl_list_init(&server.output_config); server.running = true; server.modes = malloc(sizeof(char *)); @@ -82,5 +84,13 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { free(str); keybinding_list_free(server.keybindings); server.keybindings = keybinding_list_init(); + + struct cg_output_config *output_config, *output_config_tmp; + wl_list_for_each_safe(output_config, output_config_tmp, &server.output_config, link) { + wl_list_remove(&output_config->link); + free(output_config->output_name); + free(output_config); + } + return 0; } diff --git a/output.c b/output.c index 4fd6960..c91f91b 100644 --- a/output.c +++ b/output.c @@ -480,6 +480,67 @@ handle_output_destroy(struct wl_listener *listener, void *data) { output_destroy(output); } +struct cg_output_config* +output_find_config(struct cg_server* server, struct wlr_output* output) { + struct cg_output_config *config; + wl_list_for_each(config, &server->output_config, link) { + if(strcmp(config->output_name, output->name) == 0) { + return config; + } + } + return NULL; +} + +static void output_set_mode(struct wlr_output *output, int width, int height, + float refresh_rate) { + int mhz = (int)(refresh_rate * 1000); + + if (wl_list_empty(&output->modes)) { + wlr_log(WLR_DEBUG, "Assigning custom mode to %s", output->name); + wlr_output_set_custom_mode(output, width, height, + refresh_rate > 0 ? mhz : 0); + return; + } + + struct wlr_output_mode *mode, *best = NULL; + wl_list_for_each(mode, &output->modes, link) { + if (mode->width == width && mode->height == height) { + if (mode->refresh == mhz) { + best = mode; + break; + } + if (best == NULL || mode->refresh > best->refresh) { + best = mode; + } + } + } + if (!best) { + wlr_log(WLR_ERROR, "Configured mode for %s not available", output->name); + wlr_log(WLR_INFO, "Picking preferred mode instead"); + best = wlr_output_preferred_mode(output); + } else { + wlr_log(WLR_DEBUG, "Assigning configured mode to %s", output->name); + } + wlr_output_set_mode(output, best); +} + +void +output_configure(struct cg_server* server, struct cg_output *output) { + struct wlr_output *wlr_output = output->wlr_output; + struct cg_output_config *config = output_find_config(server, wlr_output); + if(config == NULL) { + wlr_output_layout_add_auto(server->output_layout, wlr_output); + + struct wlr_output_mode *preferred_mode = + wlr_output_preferred_mode(wlr_output); + if(preferred_mode) { + wlr_output_set_mode(wlr_output, preferred_mode); + } + } else { + output_set_mode(wlr_output, config->pos.width, config->pos.height, config->refresh_rate); + } +} + void handle_new_output(struct wl_listener *listener, void *data) { struct cg_server *server = wl_container_of(listener, server, new_output); @@ -508,7 +569,8 @@ handle_new_output(struct wl_listener *listener, void *data) { wl_signal_add(&output->damage->events.destroy, &output->damage_destroy); wlr_output_set_transform(wlr_output, server->output_transform); - wlr_output_layout_add_auto(server->output_layout, wlr_output); + + output_configure(server, output); output->workspaces = malloc(server->nws * sizeof(struct cg_workspace *)); for(unsigned int i = 0; i < server->nws; ++i) { @@ -520,12 +582,6 @@ handle_new_output(struct wl_listener *listener, void *data) { output->curr_workspace = 0; wl_list_init(&output->messages); - struct wlr_output_mode *preferred_mode = - wlr_output_preferred_mode(wlr_output); - if(preferred_mode) { - wlr_output_set_mode(wlr_output, preferred_mode); - } - if(wlr_xcursor_manager_load(server->seat->xcursor_manager, wlr_output->scale)) { wlr_log(WLR_ERROR, diff --git a/output.h b/output.h index ffca3e7..ba12ea6 100644 --- a/output.h +++ b/output.h @@ -2,13 +2,13 @@ #define CG_OUTPUT_H #include +#include struct cg_server; struct cg_view; struct wlr_output; struct wlr_output_damage; struct wlr_surface; -struct wlr_box; struct cg_output { struct cg_server *server; @@ -27,6 +27,13 @@ struct cg_output { struct wl_list link; // cg_server::outputs }; +struct cg_output_config { + struct wlr_box pos; + char* output_name; + float refresh_rate; + struct wl_list link;// cg_server::output_config +}; + typedef void (*cg_surface_iterator_func_t)(struct cg_output *output, struct wlr_surface *surface, struct wlr_box *box, @@ -35,6 +42,8 @@ typedef void (*cg_surface_iterator_func_t)(struct cg_output *output, void handle_new_output(struct wl_listener *listener, void *data); void +output_configure(struct cg_server* server, struct cg_output* output); +void output_surface_for_each_surface(struct cg_output *output, struct wlr_surface *surface, double ox, double oy, cg_surface_iterator_func_t iterator, diff --git a/parse.c b/parse.c index e8c7b15..0b6e864 100644 --- a/parse.c +++ b/parse.c @@ -3,6 +3,7 @@ #include #include #include +#include #include "keybinding.h" #include "output.h" @@ -343,6 +344,104 @@ parse_definemode(char ***modes, char **saveptr) { return 0; } +int +parse_uint(char **saveptr, const char* delim) { + char *uint_str = strtok_r(NULL, delim, saveptr); + if(uint_str == NULL) { + wlr_log(WLR_ERROR, "Expected a non-negative integer, got nothing"); + return -1; + } + long uint = strtol(uint_str, NULL, 10); + if(uint >= 0 && uint <= INT_MAX) { + return uint; + } else { + wlr_log(WLR_ERROR, "Error parsing non-negative integer. Must be a number larger or equal to 0 and less or equal to %d",INT_MAX); + return -1; + } +} + +float +parse_float(char **saveptr, const char* delim) { + char *uint_str = strtok_r(NULL, delim, saveptr); + if(uint_str == NULL) { + wlr_log(WLR_ERROR, "Expected a non-negative float, got nothing"); + return -1; + } + float ufloat = strtof(uint_str, NULL); + if(ufloat >= 0) { + return ufloat; + } else { + wlr_log(WLR_ERROR, "Error parsing non-negative float. Must be a number larger or equal to 0"); + return -1; + } +} + +int +parse_output_config(struct wl_list *config_list, char **saveptr) { + struct cg_output_config* cfg = malloc(sizeof(struct cg_output_config)); + char *name = strtok_r(NULL, " ", saveptr); + if(name == NULL) { + wlr_log(WLR_ERROR, "Expected name of output to be configured, got none"); + goto error; + } + char *pos_str = strtok_r(NULL, " ", saveptr); + if(pos_str == NULL || strcmp(pos_str, "pos") != 0) { + wlr_log(WLR_ERROR, "Expected keyword \"pos\" in output configuration for output %s", name); + goto error; + } + + cfg->pos.x = parse_uint(saveptr, " "); + if(cfg->pos.x < 0) { + wlr_log(WLR_ERROR, "Error parsing x coordinate of output configuration for output %s", name); + goto error; + } + + cfg->pos.y = parse_uint(saveptr, " "); + if(cfg->pos.y < 0) { + wlr_log(WLR_ERROR, "Error parsing y coordinate of output configuration for output %s", name); + goto error; + } + + char *res_str = strtok_r(NULL, " ", saveptr); + if(res_str == NULL || strcmp(res_str, "res") != 0) { + wlr_log(WLR_ERROR, "Expected keyword \"res\" in output configuration for output %s", name); + goto error; + } + + cfg->pos.width = parse_uint(saveptr, "x"); + if(cfg->pos.width <= 0) { + wlr_log(WLR_ERROR, "Error parsing width of output configuration for output %s (hint: width must be larger than 0)", name); + goto error; + } + + cfg->pos.height = parse_uint(saveptr, " "); + if(cfg->pos.height <= 0) { + wlr_log(WLR_ERROR, "Error parsing height of output configuration for output %s (hint: height must e larger than 0)", name); + goto error; + } + + char *rate_str = strtok_r(NULL, " ", saveptr); + if(rate_str == NULL || strcmp(rate_str, "rate") != 0) { + wlr_log(WLR_ERROR, "Expected keyword \"rate\" in output configuration for output %s", name); + goto error; + } + + cfg->refresh_rate = parse_float(saveptr, " "); + if(cfg->refresh_rate <= 0.0) { + wlr_log(WLR_ERROR, "Error parsing refresh rate of output configuration for output %s", name); + goto error; + } + + cfg->output_name = strdup(name); + wl_list_insert(config_list, &cfg->link); + return 0; + +error: + free(cfg); + wlr_log(WLR_ERROR, "Output configuration must be of the form \"output pos res x rate "); + return -1; +} + int parse_rc_line(struct cg_server *server, char *line) { char *saveptr = NULL; // Used internally by strtok_r @@ -374,6 +473,10 @@ parse_rc_line(struct cg_server *server, char *line) { if(parse_and_run_exec(&saveptr) != 0) { return -1; } + } else if(strcmp(command, "output") == 0) { + if(parse_output_config(&server->output_config, &saveptr) != 0) { + return -1; + } } else if(strcmp(command, "workspaces") == 0) { char *nws_str = strtok_r(NULL, " ", &saveptr); if(nws_str == NULL) { diff --git a/server.h b/server.h index 92a9172..930cb56 100644 --- a/server.h +++ b/server.h @@ -11,6 +11,7 @@ struct cg_output; struct keybinding_list; struct wlr_output_layout; struct wlr_idle_inhibit_manager_v1; +struct cg_output_config; struct cg_server { struct wl_display *wl_display; @@ -35,6 +36,7 @@ struct cg_server { #endif struct keybinding_list *keybindings; + struct wl_list output_config; enum wl_output_transform output_transform; From 58746ee52fe49abf71d7ed528107c41e40230052 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Tue, 25 Feb 2020 12:57:49 +0000 Subject: [PATCH 003/689] Adjust version number for 1.0.3 release --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 6925b67..9fe4ce9 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('cagebreak', 'c', - version: '1.0.2', + version: '1.0.3', license: 'MIT', default_options: [ 'c_std=c11', From 0d4bb36068cf27854ba45423071111b285cee174 Mon Sep 17 00:00:00 2001 From: project-repo Date: Wed, 26 Feb 2020 07:55:25 +0100 Subject: [PATCH 004/689] Add documentation for "output" command --- man/cagebreak-config.5.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index bbf3096..6be7c60 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -182,6 +182,13 @@ by prepending a line with the # symbol. > Enter mode "``". After a keybinding is processed, return to default mode +**output pos res x rate ** + +> Configure the output "". and are the position of the monitor +> in pixels. The top-left monitor should have the coordinates 0 0. and +> specify the resolution in pixels and sets the refresh rate of +> the monitor (often this is 50 or 60). + **setmode ** > Set the default mode to `` From 33d245b60bfe86025d9244490bf144679af606f3 Mon Sep 17 00:00:00 2001 From: project-repo Date: Wed, 26 Feb 2020 07:56:28 +0100 Subject: [PATCH 005/689] Add example of "output" command usage --- examples/config | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/config b/examples/config index cd7ee3c..0f0a5b0 100644 --- a/examples/config +++ b/examples/config @@ -70,3 +70,8 @@ definekey top XF86AudioLowerVolume exec pactl set-sink-mute 0 off&&amixer set Ma definekey top XF86AudioRaiseVolume exec pactl set-sink-mute 0 off&&amixer set Master 1%+ definekey top XF86MonBrightnessDown exec xbacklight -dec 1 definekey top XF86MonBrightnessUp exec xbacklight -inc 1 + +###################### +#Output configuration +###################### +#output eDP-1 pos 0 0 res 1366x768 rate 60 From 6fdc55c9a55edd187d63bf92f78365d4440fb845 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 28 Feb 2020 17:30:06 +0100 Subject: [PATCH 006/689] Add missing functionality to output configuration --- output.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/output.c b/output.c index c91f91b..7983983 100644 --- a/output.c +++ b/output.c @@ -528,6 +528,10 @@ void output_configure(struct cg_server* server, struct cg_output *output) { struct wlr_output *wlr_output = output->wlr_output; struct cg_output_config *config = output_find_config(server, wlr_output); + if(output->wlr_output->enabled) { + wlr_output_layout_remove(server->output_layout, wlr_output); + } + if(config == NULL) { wlr_output_layout_add_auto(server->output_layout, wlr_output); @@ -538,6 +542,7 @@ output_configure(struct cg_server* server, struct cg_output *output) { } } else { output_set_mode(wlr_output, config->pos.width, config->pos.height, config->refresh_rate); + wlr_output_layout_add(server->output_layout, wlr_output, config->pos.x, config->pos.y); } } From 6ff175b048ccdf44a8dc7249f6ef25b511f668dd Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 1 Mar 2020 11:08:49 +0100 Subject: [PATCH 007/689] Fix bug in consumed modifier handling --- seat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seat.c b/seat.c index 57c2b04..67f8e60 100644 --- a/seat.c +++ b/seat.c @@ -337,7 +337,7 @@ handle_key_event(struct cg_keyboard *keyboard, void *data) { xkb_mod_mask_t consumed_modifiers = xkb_state_key_get_consumed_mods2( keyboard->device->keyboard->xkb_state, keycode, - XKB_CONSUMED_MODE_XKB); + XKB_CONSUMED_MODE_GTK); if(handle_command_key_bindings(seat->server, syms[i], modifiers & ~consumed_modifiers, seat->mode, keyboard)) { From 8ebacb4a284f6e726584ae5ed2bb531a2f150897 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Mon, 2 Mar 2020 17:49:49 +0000 Subject: [PATCH 008/689] Improve README - Add working merge process specification --- README.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8117d1f..2912c06 100644 --- a/README.md +++ b/README.md @@ -74,13 +74,19 @@ it is merged into `master`, creating a new release, which is tagged and signed. Merging into master is always done by ``` -git merge --no-ff development -git tag -u keyid version -git push origin master +git checkout development +git pull origin development +git checkout master +git merge --squash development +git tag -u keyid version HEAD +git tag -v version +git push --tags origin master ``` and a log message roughly describing the features is added in the commit. +In the past, our git history did not always reflect this scheme. + ### Releases Release checklist From f10395a16edf0e7a57d9a5c92f2df0ea1b80eea5 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Mon, 2 Mar 2020 18:17:25 +0000 Subject: [PATCH 009/689] Prepare 1.0.4 release --- Bugs.md | 7 +++++++ meson.build | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Bugs.md b/Bugs.md index 90758b8..5bea08a 100644 --- a/Bugs.md +++ b/Bugs.md @@ -26,3 +26,10 @@ Steps to reproduce: * enter text into the "Tags" field * if autocompletion of tags pops up, the keyboard will not enter further keystrokes into the text field + +### Issue 2 + + * Github issue number: N/A + * Fixed: 1.0.4 + +This issue fixes wrong consumption of modifier key on some keyboards. diff --git a/meson.build b/meson.build index 9fe4ce9..4387ce7 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('cagebreak', 'c', - version: '1.0.3', + version: '1.0.4', license: 'MIT', default_options: [ 'c_std=c11', From 54991cb6386a828aa721ab4d923285578f847b9d Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 6 Mar 2020 20:51:05 +0100 Subject: [PATCH 010/689] Unify parsing of config file --- keybinding.c | 80 +++++++- keybinding.h | 9 + parse.c | 537 +++++++++++++++++++++++++-------------------------- 3 files changed, 351 insertions(+), 275 deletions(-) diff --git a/keybinding.c b/keybinding.c index 2d5abdf..45a0021 100644 --- a/keybinding.c +++ b/keybinding.c @@ -54,12 +54,19 @@ find_keybinding(const struct keybinding_list *list, } void -keybinding_free(struct keybinding *keybinding) { +keybinding_free(struct keybinding *keybinding, bool recursive) { switch(keybinding->action) { + case KEYBINDING_DEFINEMODE: case KEYBINDING_RUN_COMMAND: if(keybinding->data.c != NULL) { free(keybinding->data.c); } + break; + case KEYBINDING_DEFINEKEY: + if(keybinding->data.kb != NULL && recursive) { + keybinding_free(keybinding->data.kb, true); + } + break; default: break; } @@ -79,7 +86,7 @@ keybinding_list_push(struct keybinding_list *list, * exist*/ struct keybinding **found_keybinding = find_keybinding(list, keybinding); if(found_keybinding != NULL) { - keybinding_free(*found_keybinding); + keybinding_free(*found_keybinding,true); *found_keybinding = keybinding; wlr_log(WLR_DEBUG, "A keybinding was found twice in the config file."); } else { @@ -101,7 +108,7 @@ keybinding_list_init() { void keybinding_list_free(struct keybinding_list *list) { for(unsigned int i = 0; i < list->length; ++i) { - keybinding_free(list->keybindings[i]); + keybinding_free(list->keybindings[i], true); } free(list->keybindings); free(list); @@ -634,6 +641,7 @@ keybinding_show_time(struct cg_server *server) { msg[strcspn(msg, "\n")] = '\0'; /* Remove the newline */ message_printf(server->curr_output, "%s", msg); + free(msg); } void @@ -670,6 +678,60 @@ keybinding_move_view_to_next_output(struct cg_server *server) { } } +void +keybinding_set_nws(struct cg_server *server, int nws) { + struct cg_output *output; + wl_list_for_each(output, &server->outputs, link) { + for(unsigned int i = nws; i < server->nws; ++i) { + workspace_free(output->workspaces[i]); + } + struct cg_workspace **new_workspaces = realloc( + output->workspaces, nws * sizeof(struct cg_workspace *)); + if(new_workspaces == NULL) { + wlr_log(WLR_ERROR, "Error reallocating memory for workspaces."); + return; + } + output->workspaces = new_workspaces; + for(int i = server->nws; i < nws; ++i) { + output->workspaces[i] = full_screen_workspace(output); + wl_list_init(&output->workspaces[i]->views); + wl_list_init(&output->workspaces[i]->unmanaged_views); + } + + if(output->curr_workspace >= nws) { + output->curr_workspace = nws-1; + } + } + server->nws = nws; +} + +void +keybinding_definemode(struct cg_server *server, char* mode) { + int length = 0; + while(server->modes[length++] != NULL); + char **tmp = realloc(server->modes, (length + 1) * sizeof(char *)); + if(tmp == NULL) { + wlr_log(WLR_ERROR, "Could not allocate memory for storing modes."); + return; + } + server->modes = tmp; + server->modes[length] = NULL; + + server->modes[length - 1] = strdup(mode); +} + +void +keybinding_definekey(struct cg_server *server, struct keybinding *kb) { + keybinding_list_push(server->keybindings,kb); +} + +void +keybinding_set_background(struct cg_server *server, float* bg) { + server->bg_color[0] = bg[0]; + server->bg_color[1] = bg[1]; + server->bg_color[2] = bg[2]; +} + void keybinding_move_view_to_workspace(struct cg_server *server, uint32_t ws) { struct cg_view *view = @@ -808,6 +870,18 @@ run_action(enum keybinding_action action, struct cg_server *server, keybinding_move_view_to_next_output(server); break; } + case KEYBINDING_DEFINEKEY: + keybinding_definekey(server,data.kb); + break; + case KEYBINDING_BACKGROUND: + keybinding_set_background(server, data.color); + break; + case KEYBINDING_DEFINEMODE: + keybinding_definemode(server, data.c); + break; + case KEYBINDING_WORKSPACES: + keybinding_set_nws(server, data.i); + break; default: { wlr_log(WLR_ERROR, "run_action was called with a value not present in \"enum " diff --git a/keybinding.h b/keybinding.h index d06bbbb..42ad114 100644 --- a/keybinding.h +++ b/keybinding.h @@ -43,6 +43,11 @@ enum keybinding_action { KEYBINDING_FOCUS_RIGHT, KEYBINDING_FOCUS_TOP, KEYBINDING_FOCUS_BOTTOM, + + KEYBINDING_DEFINEKEY, // data.kb is the keybinding definition + KEYBINDING_BACKGROUND, //data.color is the background color + KEYBINDING_DEFINEMODE, //data.c is the mode name + KEYBINDING_WORKSPACES, //data.i is the number of workspaces }; union keybinding_params { @@ -50,6 +55,8 @@ union keybinding_params { uint32_t u; int32_t i; bool b; + float color[3]; + struct keybinding* kb; }; struct keybinding { @@ -82,5 +89,7 @@ keybinding_list_init(); int run_action(enum keybinding_action action, struct cg_server *server, union keybinding_params data); +void +keybinding_free(struct keybinding *keybinding, bool recursive); #endif /* end of include guard KEYBINDINGS_H */ diff --git a/parse.c b/parse.c index e8c7b15..7e09fce 100644 --- a/parse.c +++ b/parse.c @@ -10,167 +10,6 @@ #include "server.h" #include "workspace.h" -int -parse_action(struct cg_server *server, struct keybinding *keybinding, - char **saveptr) { - char *action = strtok_r(NULL, " ", saveptr); - if(action == NULL) { - wlr_log( - WLR_ERROR, - "Not enough parameters to \"bind\". Expected action to execute"); - return -1; - } - keybinding->data = (union keybinding_params){.c = NULL}; - if(strcmp(action, "vsplit") == 0) { - keybinding->action = KEYBINDING_SPLIT_VERTICAL; - } else if(strcmp(action, "hsplit") == 0) { - keybinding->action = KEYBINDING_SPLIT_HORIZONTAL; - } else if(strcmp(action, "quit") == 0) { - keybinding->action = KEYBINDING_QUIT; - } else if(strcmp(action, "focus") == 0) { - keybinding->action = KEYBINDING_CYCLE_TILES; - keybinding->data.b = false; - } else if(strcmp(action, "focusprev") == 0) { - keybinding->action = KEYBINDING_CYCLE_TILES; - keybinding->data.b = true; - } else if(strcmp(action, "next") == 0) { - keybinding->action = KEYBINDING_CYCLE_VIEWS; - keybinding->data.b = false; - } else if(strcmp(action, "prev") == 0) { - keybinding->action = KEYBINDING_CYCLE_VIEWS; - keybinding->data.b = true; - } else if(strcmp(action, "only") == 0) { - keybinding->action = KEYBINDING_LAYOUT_FULLSCREEN; - } else if(strcmp(action, "abort") == 0) { - keybinding->action = KEYBINDING_NOOP; - } else if(strcmp(action, "time") == 0) { - keybinding->action = KEYBINDING_SHOW_TIME; - } else if(strcmp(action, "nextscreen") == 0) { - keybinding->action = KEYBINDING_CYCLE_OUTPUT; - keybinding->data.b = false; - } else if(strcmp(action, "prevscreen") == 0) { - keybinding->action = KEYBINDING_CYCLE_OUTPUT; - keybinding->data.b = true; - } else if(strcmp(action, "exec") == 0) { - keybinding->action = KEYBINDING_RUN_COMMAND; - if(*saveptr == NULL) { - wlr_log(WLR_ERROR, "Not enough paramaters to \"exec\". Expected " - "string to execute."); - return -1; - } - keybinding->data.c = strdup(*saveptr); - } else if(strcmp(action, "resizeleft") == 0) { - keybinding->action = KEYBINDING_RESIZE_TILE_HORIZONTAL; - keybinding->data.i = -10; - } else if(strcmp(action, "resizeright") == 0) { - keybinding->action = KEYBINDING_RESIZE_TILE_HORIZONTAL; - keybinding->data.i = 10; - } else if(strcmp(action, "resizedown") == 0) { - keybinding->action = KEYBINDING_RESIZE_TILE_VERTICAL; - keybinding->data.i = 10; - } else if(strcmp(action, "resizeup") == 0) { - keybinding->action = KEYBINDING_RESIZE_TILE_VERTICAL; - keybinding->data.i = -10; - } else if(strcmp(action, "workspace") == 0) { - keybinding->action = KEYBINDING_SWITCH_WORKSPACE; - char *nws_str = strtok_r(NULL, " ", saveptr); - if(nws_str == NULL) { - wlr_log(WLR_ERROR, - "Expected argument for \"workspace\" action, got none."); - return -1; - } - - long ws = strtol(nws_str, NULL, 10); - if(!(1 <= ws && ws <= server->nws)) { - wlr_log(WLR_ERROR, - "Requested binding for workspace %li, but have %u", ws, - server->nws); - return -1; - } - keybinding->data.u = ws - 1; - } else if(strcmp(action, "movetoworkspace") == 0) { - keybinding->action = KEYBINDING_MOVE_VIEW_TO_WORKSPACE; - char *nws_str = strtok_r(NULL, " ", saveptr); - if(nws_str == NULL) { - wlr_log(WLR_ERROR, - "Expected argument for \"workspace\" action, got none."); - return -1; - } - - long ws = strtol(nws_str, NULL, 10); - if(!(1 <= ws && ws <= server->nws)) { - wlr_log( - WLR_ERROR, - "Requested binding for moving to workspace %li, but have %u", - ws, server->nws); - return -1; - } - keybinding->data.u = ws - 1; - } else if(strcmp(action, "exchangeleft") == 0) { - keybinding->action = KEYBINDING_SWAP_LEFT; - } else if(strcmp(action, "exchangeright") == 0) { - keybinding->action = KEYBINDING_SWAP_RIGHT; - } else if(strcmp(action, "exchangeup") == 0) { - keybinding->action = KEYBINDING_SWAP_TOP; - } else if(strcmp(action, "exchangedown") == 0) { - keybinding->action = KEYBINDING_SWAP_BOTTOM; - } else if(strcmp(action, "focusleft") == 0) { - keybinding->action = KEYBINDING_FOCUS_LEFT; - } else if(strcmp(action, "focusright") == 0) { - keybinding->action = KEYBINDING_FOCUS_RIGHT; - } else if(strcmp(action, "focusup") == 0) { - keybinding->action = KEYBINDING_FOCUS_TOP; - } else if(strcmp(action, "focusdown") == 0) { - keybinding->action = KEYBINDING_FOCUS_BOTTOM; - } else if(strcmp(action, "movetonextscreen") == 0) { - keybinding->action = KEYBINDING_MOVE_VIEW_TO_NEXT_OUTPUT; - } else if(strcmp(action, "switchvt") == 0) { - keybinding->action = KEYBINDING_CHANGE_TTY; - char *ntty = strtok_r(NULL, " ", saveptr); - if(ntty == NULL) { - wlr_log(WLR_ERROR, - "Expected argument for \"switchvt\" command, got none."); - return -1; - } - long tty = strtol(ntty, NULL, 10); - keybinding->data.u = tty; - } else if(strcmp(action, "mode") == 0) { - keybinding->action = KEYBINDING_SWITCH_MODE; - char *mode = strtok_r(NULL, " ", saveptr); - if(mode == NULL) { - wlr_log(WLR_ERROR, - "Expected mode after \"switch_mode\". Got nothing."); - return -1; - } - int mode_idx = get_mode_index_from_name(server->modes, mode); - if(mode_idx == -1) { - wlr_log(WLR_ERROR, "Unknown mode \"%s\" for switch_mode", mode); - return -1; - } - keybinding->data.u = (unsigned int)mode_idx; - } else if(strcmp(action, "setmode") == 0) { - keybinding->action = KEYBINDING_SWITCH_DEFAULT_MODE; - char *mode = strtok_r(NULL, " ", saveptr); - if(mode == NULL) { - wlr_log( - WLR_ERROR, - "Expected mode after \"switch_default_mode\". Got nothing."); - return -1; - } - int mode_idx = get_mode_index_from_name(server->modes, mode); - if(mode_idx == -1) { - wlr_log(WLR_ERROR, "Unknown mode \"%s\" for switch_default_mode", - mode); - return -1; - } - keybinding->data.u = (unsigned int)mode_idx; - } else { - wlr_log(WLR_ERROR, "Error, unsupported action \"%s\".", action); - return -1; - } - return 0; -} - /* parses a key definition (e.g. "S-Tab") and sets key and modifiers in * keybinding respectivly */ int @@ -218,6 +57,9 @@ parse_key(struct keybinding *keybinding, const char *key_def) { return 0; } +int +parse_command(struct cg_server *server, struct keybinding *keybinding, char *saveptr); + /* Parse a keybinding definition and return it if successful, else return NULL */ struct keybinding * @@ -229,188 +71,339 @@ parse_keybinding(struct cg_server *server, char **saveptr) { free(keybinding); return NULL; } - if(parse_action(server, keybinding, saveptr) != 0) { + if(parse_command(server, keybinding, *saveptr) != 0) { free(keybinding); return NULL; } return keybinding; } -int -parse_bind(struct cg_server *server, struct keybinding_list *list, - char **saveptr) { +struct keybinding * +parse_bind(struct cg_server *server, char **saveptr) { struct keybinding *keybinding = parse_keybinding(server, saveptr); if(keybinding == NULL) { wlr_log(WLR_ERROR, "Could not parse keybinding for \"bind\"."); - return -1; + return NULL; } keybinding->mode = 1; - keybinding_list_push(list, keybinding); - return 0; + return keybinding; } -int -parse_definekey(struct cg_server *server, struct keybinding_list *list, - char **saveptr) { +struct keybinding * +parse_definekey(struct cg_server *server, char **saveptr) { char *mode = strtok_r(NULL, " ", saveptr); if(mode == NULL) { wlr_log(WLR_ERROR, "Too few arguments to \"definekey\". Expected mode"); - return -1; + return NULL; } int mode_idx = get_mode_index_from_name(server->modes, mode); if(mode_idx == -1) { wlr_log(WLR_ERROR, "Unknown mode \"%s\"", mode); - return -1; + return NULL; } struct keybinding *keybinding = parse_keybinding(server, saveptr); if(keybinding == NULL) { wlr_log(WLR_ERROR, "Could not parse keybinding for \"definekey\""); - return -1; + return NULL; } keybinding->mode = mode_idx; - keybinding_list_push(list, keybinding); - return 0; + return keybinding; } int -parse_and_run_exec(char **saveptr) { - return run_action(KEYBINDING_RUN_COMMAND, NULL, - (union keybinding_params){.c = *saveptr}); -} - -int -parse_background(struct cg_server *server, char **saveptr) { +parse_background(struct cg_server *server, float *color, char **saveptr) { /* Read rgb numbers */ for(unsigned int i = 0; i < 3; ++i) { - char *nstr = strtok_r(NULL, " ", saveptr); - if(nstr == NULL) { + char *nstr = strtok_r(NULL, " \n", saveptr); + int nstrlen; + if(nstr == NULL||(nstrlen = strlen(nstr))== 0) { wlr_log(WLR_ERROR, "Expected three space-separated numbers (rgb) for " "background color setting. Got %d.", i); return -1; } + if(nstr[nstrlen-1] == '\n') { + nstr[nstrlen-1] = '\0'; + --nstrlen; + } char *endptr = NULL; float nval = strtof(nstr, &endptr); - if(endptr == nstr) { + if(endptr != nstr+nstrlen) { wlr_log( WLR_ERROR, - "Could not parse number \"%s\" für background color setting.", + "Could not parse number \"%s\" for background color setting.", nstr); return -1; } - server->bg_color[i] = nval; + if(nval<0||nval>1) { + wlr_log(WLR_ERROR, "Expected a number between 0 and 1 for setting of background color. Got %f.",nval); + return -1; + } + color[i] = nval; } return 0; } -int -parse_escape(struct keybinding_list *list, char **saveptr) { +struct keybinding * +parse_escape(char **saveptr) { struct keybinding *keybinding = malloc(sizeof(struct keybinding)); char *key = strtok_r(NULL, " ", saveptr); if(parse_key(keybinding, key) != 0) { wlr_log(WLR_ERROR, "Could not parse key definition \"%s\" for \"escape\"", key); free(keybinding); - return -1; + return NULL; } keybinding->mode = 0; //"top" mode keybinding->action = KEYBINDING_SWITCH_MODE; keybinding->data.u = 1; //"root" mode - keybinding_list_push(list, keybinding); - return 0; + return keybinding; } -int -parse_definemode(char ***modes, char **saveptr) { - int length = 0; - while((*modes)[length++] != NULL) - ; - char **tmp = realloc(*modes, (length + 1) * sizeof(char *)); - if(tmp == NULL) { - wlr_log(WLR_ERROR, "Could not allocate memory for storing modes."); - return -1; - } - *modes = tmp; - (*modes)[length] = NULL; - +char* +parse_definemode(char **saveptr) { char *mode = strtok_r(NULL, " ", saveptr); if(mode == NULL) { wlr_log(WLR_ERROR, "Expected mode to succeed \"definemode\" keyword."); + return NULL; + } + return strdup(mode); +} + +int +parse_workspaces(char **saveptr) { + char *nws_str = strtok_r(NULL, " ", saveptr); + if(nws_str == NULL) { + wlr_log(WLR_ERROR, + "Expected argument for \"workspaces\" command, got none."); + return -1; + } + long nws = strtol(nws_str, NULL, 10); + if(!(1 <= nws && nws <= 30)) { + wlr_log(WLR_ERROR, + "More than 30 workspaces are not supported. Received %li", + nws); + return -1; + } + return nws; +} + +int +parse_command(struct cg_server *server, struct keybinding *keybinding, + char *saveptr) { + char *action = strtok_r(NULL, " ", &saveptr); + if(action == NULL) { + wlr_log( + WLR_ERROR, + "Expected an action to parse, got none."); + return -1; + } + keybinding->data = (union keybinding_params){.c = NULL}; + if(strcmp(action, "vsplit") == 0) { + keybinding->action = KEYBINDING_SPLIT_VERTICAL; + } else if(strcmp(action, "hsplit") == 0) { + keybinding->action = KEYBINDING_SPLIT_HORIZONTAL; + } else if(strcmp(action, "quit") == 0) { + keybinding->action = KEYBINDING_QUIT; + } else if(strcmp(action, "focus") == 0) { + keybinding->action = KEYBINDING_CYCLE_TILES; + keybinding->data.b = false; + } else if(strcmp(action, "focusprev") == 0) { + keybinding->action = KEYBINDING_CYCLE_TILES; + keybinding->data.b = true; + } else if(strcmp(action, "next") == 0) { + keybinding->action = KEYBINDING_CYCLE_VIEWS; + keybinding->data.b = false; + } else if(strcmp(action, "prev") == 0) { + keybinding->action = KEYBINDING_CYCLE_VIEWS; + keybinding->data.b = true; + } else if(strcmp(action, "only") == 0) { + keybinding->action = KEYBINDING_LAYOUT_FULLSCREEN; + } else if(strcmp(action, "abort") == 0) { + keybinding->action = KEYBINDING_NOOP; + } else if(strcmp(action, "time") == 0) { + keybinding->action = KEYBINDING_SHOW_TIME; + } else if(strcmp(action, "nextscreen") == 0) { + keybinding->action = KEYBINDING_CYCLE_OUTPUT; + keybinding->data.b = false; + } else if(strcmp(action, "prevscreen") == 0) { + keybinding->action = KEYBINDING_CYCLE_OUTPUT; + keybinding->data.b = true; + } else if(strcmp(action, "exec") == 0) { + keybinding->action = KEYBINDING_RUN_COMMAND; + if(saveptr == NULL) { + wlr_log(WLR_ERROR, "Not enough paramaters to \"exec\". Expected " + "string to execute."); + return -1; + } + keybinding->data.c = strdup(saveptr); + } else if(strcmp(action, "resizeleft") == 0) { + keybinding->action = KEYBINDING_RESIZE_TILE_HORIZONTAL; + keybinding->data.i = -10; + } else if(strcmp(action, "resizeright") == 0) { + keybinding->action = KEYBINDING_RESIZE_TILE_HORIZONTAL; + keybinding->data.i = 10; + } else if(strcmp(action, "resizedown") == 0) { + keybinding->action = KEYBINDING_RESIZE_TILE_VERTICAL; + keybinding->data.i = 10; + } else if(strcmp(action, "resizeup") == 0) { + keybinding->action = KEYBINDING_RESIZE_TILE_VERTICAL; + keybinding->data.i = -10; + } else if(strcmp(action, "workspace") == 0) { + keybinding->action = KEYBINDING_SWITCH_WORKSPACE; + char *nws_str = strtok_r(NULL, " ", &saveptr); + if(nws_str == NULL) { + wlr_log(WLR_ERROR, + "Expected argument for \"workspace\" action, got none."); + return -1; + } + + long ws = strtol(nws_str, NULL, 10); + if(!(1 <= ws && ws <= server->nws)) { + wlr_log(WLR_ERROR, + "Requested binding for workspace %li, but have %u", ws, + server->nws); + return -1; + } + keybinding->data.u = ws - 1; + } else if(strcmp(action, "movetoworkspace") == 0) { + keybinding->action = KEYBINDING_MOVE_VIEW_TO_WORKSPACE; + char *nws_str = strtok_r(NULL, " ", &saveptr); + if(nws_str == NULL) { + wlr_log(WLR_ERROR, + "Expected argument for \"workspace\" action, got none."); + return -1; + } + + long ws = strtol(nws_str, NULL, 10); + if(!(1 <= ws && ws <= server->nws)) { + wlr_log( + WLR_ERROR, + "Requested binding for moving to workspace %li, but have %u", + ws, server->nws); + return -1; + } + keybinding->data.u = ws - 1; + } else if(strcmp(action, "exchangeleft") == 0) { + keybinding->action = KEYBINDING_SWAP_LEFT; + } else if(strcmp(action, "exchangeright") == 0) { + keybinding->action = KEYBINDING_SWAP_RIGHT; + } else if(strcmp(action, "exchangeup") == 0) { + keybinding->action = KEYBINDING_SWAP_TOP; + } else if(strcmp(action, "exchangedown") == 0) { + keybinding->action = KEYBINDING_SWAP_BOTTOM; + } else if(strcmp(action, "focusleft") == 0) { + keybinding->action = KEYBINDING_FOCUS_LEFT; + } else if(strcmp(action, "focusright") == 0) { + keybinding->action = KEYBINDING_FOCUS_RIGHT; + } else if(strcmp(action, "focusup") == 0) { + keybinding->action = KEYBINDING_FOCUS_TOP; + } else if(strcmp(action, "focusdown") == 0) { + keybinding->action = KEYBINDING_FOCUS_BOTTOM; + } else if(strcmp(action, "movetonextscreen") == 0) { + keybinding->action = KEYBINDING_MOVE_VIEW_TO_NEXT_OUTPUT; + } else if(strcmp(action, "switchvt") == 0) { + keybinding->action = KEYBINDING_CHANGE_TTY; + char *ntty = strtok_r(NULL, " ", &saveptr); + if(ntty == NULL) { + wlr_log(WLR_ERROR, + "Expected argument for \"switchvt\" command, got none."); + return -1; + } + long tty = strtol(ntty, NULL, 10); + keybinding->data.u = tty; + } else if(strcmp(action, "mode") == 0) { + keybinding->action = KEYBINDING_SWITCH_MODE; + char *mode = strtok_r(NULL, " ", &saveptr); + if(mode == NULL) { + wlr_log(WLR_ERROR, + "Expected mode after \"switch_mode\". Got nothing."); + return -1; + } + int mode_idx = get_mode_index_from_name(server->modes, mode); + if(mode_idx == -1) { + wlr_log(WLR_ERROR, "Unknown mode \"%s\" for switch_mode", mode); + return -1; + } + keybinding->data.u = (unsigned int)mode_idx; + } else if(strcmp(action, "setmode") == 0) { + keybinding->action = KEYBINDING_SWITCH_DEFAULT_MODE; + char *mode = strtok_r(NULL, " ", &saveptr); + if(mode == NULL) { + wlr_log( + WLR_ERROR, + "Expected mode after \"switch_default_mode\". Got nothing."); + return -1; + } + int mode_idx = get_mode_index_from_name(server->modes, mode); + if(mode_idx == -1) { + wlr_log(WLR_ERROR, "Unknown mode \"%s\" for switch_default_mode", + mode); + return -1; + } + keybinding->data.u = (unsigned int)mode_idx; + } else if(strcmp(action, "bind") == 0) { + keybinding->action = KEYBINDING_DEFINEKEY; + keybinding->data.kb = parse_bind(server, &saveptr); + if(keybinding->data.kb == NULL) { + return -1; + } + } else if(strcmp(action, "definekey") == 0) { + keybinding->action = KEYBINDING_DEFINEKEY; + keybinding->data.kb = parse_definekey(server, &saveptr); + if(keybinding->data.kb == NULL) { + return -1; + } + } else if(strcmp(action, "background") == 0) { + keybinding->action = KEYBINDING_BACKGROUND; + if(parse_background(server, keybinding->data.color,&saveptr) != 0) { + return -1; + } + } else if(strcmp(action, "escape") == 0) { + keybinding->action = KEYBINDING_DEFINEKEY; + keybinding->data.kb = parse_escape(&saveptr); + if(keybinding->data.kb == NULL) { + return -1; + } + } else if(strcmp(action, "definemode") == 0) { + keybinding->action = KEYBINDING_DEFINEMODE; + keybinding->data.c = parse_definemode(&saveptr); + if(keybinding->data.c == NULL) { + return -1; + } + } else if(strcmp(action, "workspaces") == 0) { + keybinding->action = KEYBINDING_WORKSPACES; + keybinding->data.i=parse_workspaces(&saveptr); + if(keybinding->data.i<0) { + return -1; + } + } else { + wlr_log(WLR_ERROR, "Error, unsupported action \"%s\".", action); return -1; } - (*modes)[length - 1] = strdup(mode); return 0; } int parse_rc_line(struct cg_server *server, char *line) { - char *saveptr = NULL; // Used internally by strtok_r - char *command = strtok_r(line, " ", &saveptr); - if(command == NULL) { - return 0; - } - if(strcmp(command, "bind") == 0) { - if(parse_bind(server, server->keybindings, &saveptr) != 0) { - return -1; - } - } else if(strcmp(command, "definekey") == 0) { - if(parse_definekey(server, server->keybindings, &saveptr) != 0) { - return -1; - } - } else if(strcmp(command, "background") == 0) { - if(parse_background(server, &saveptr) != 0) { - return -1; - } - } else if(strcmp(command, "escape") == 0) { - if(parse_escape(server->keybindings, &saveptr) != 0) { - return -1; - } - } else if(strcmp(command, "definemode") == 0) { - if(parse_definemode(&server->modes, &saveptr) != 0) { - return -1; - } - } else if(strcmp(command, "exec") == 0) { - if(parse_and_run_exec(&saveptr) != 0) { - return -1; - } - } else if(strcmp(command, "workspaces") == 0) { - char *nws_str = strtok_r(NULL, " ", &saveptr); - if(nws_str == NULL) { - wlr_log(WLR_ERROR, - "Expected argument for \"workspaces\" command, got none."); - return -1; - } - long nws = strtol(nws_str, NULL, 10); - if(!(1 <= nws && nws <= 30)) { - wlr_log(WLR_ERROR, - "More than 30 workspaces are not supported. Received %li", - nws); - return -1; - } - struct cg_output *output; - wl_list_for_each(output, &server->outputs, link) { - for(unsigned int i = nws; i < server->nws; ++i) { - free(output->workspaces[i]); - } - struct cg_workspace **new_workspaces = realloc( - output->workspaces, nws * sizeof(struct cg_workspace *)); - if(new_workspaces == NULL) { - wlr_log(WLR_ERROR, "Error reallocating memory for workspaces."); - return -1; - } - output->workspaces = new_workspaces; - for(unsigned int i = server->nws; i < nws; ++i) { - output->workspaces[i] = full_screen_workspace(output); - wl_list_init(&output->workspaces[i]->views); - wl_list_init(&output->workspaces[i]->unmanaged_views); - } - } - server->nws = nws; - } else { - wlr_log(WLR_ERROR, "Unsupported command \"%s\" in config file", - command); + char *saveptr = strdup(line); // Used internally by strtok_r + + struct keybinding *keybinding = malloc(sizeof(struct keybinding)); + if(keybinding == NULL) { + wlr_log(WLR_ERROR, "Failed to allocate memory for temporary keybinding struct."); + free(keybinding); + free(saveptr); return -1; } + if(parse_command(server, keybinding, saveptr) != 0) { + wlr_log(WLR_ERROR, "Error parsing config file."); + free(keybinding); + free(saveptr); + return -1; + } + run_action(keybinding->action, server, keybinding->data); + keybinding_free(keybinding, false); + free(saveptr); return 0; } From cb46e463a3f65b1a58086fc3ffbecc1bf494a9d6 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 6 Mar 2020 21:04:29 +0100 Subject: [PATCH 011/689] Fix memory leaks --- message.c | 1 + workspace.c | 1 + 2 files changed, 2 insertions(+) diff --git a/message.c b/message.c index 66e09dd..c7b6b96 100644 --- a/message.c +++ b/message.c @@ -147,6 +147,7 @@ message_printf(struct cg_output *output, const char *fmt, ...) { message_set_output(output, buffer, box, CG_MESSAGE_TOP_RIGHT); free(buffer); + free(box); alarm(output->server->message_timeout); } diff --git a/workspace.c b/workspace.c index 8ed010e..7027710 100644 --- a/workspace.c +++ b/workspace.c @@ -51,6 +51,7 @@ workspace_focus_tile(struct cg_workspace *ws, struct cg_tile *tile) { box->x = tile->tile.x + tile->tile.width / 2; box->y = tile->tile.y + tile->tile.height / 2; message_printf_pos(ws->output, box, CG_MESSAGE_CENTER, "Current frame"); + free(box); } void From e7ca6d693ffebb716445286a89d35e61a45ab9fb Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 12 Mar 2020 22:08:52 +0100 Subject: [PATCH 012/689] Fix crash on view destroy --- view.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/view.c b/view.c index acd7603..6b0ed87 100644 --- a/view.c +++ b/view.c @@ -234,10 +234,14 @@ view_unmap(struct cg_view *view) { struct cg_tile *view_tile = view_get_tile(view); wlr_output_damage_add_box(view_tile->workspace->output->damage, &view_tile->tile); - if(view->workspace->server->seat->seat->keyboard_state - .focused_surface == NULL || - view->workspace->server->seat->seat->keyboard_state - .focused_surface == view->wlr_surface) { + if((view->workspace->server->seat->seat->keyboard_state + .focused_surface == NULL || + view->workspace->server->seat->seat->keyboard_state + .focused_surface == view->wlr_surface) && + view->workspace->server->curr_output + ->workspaces[view->workspace->server->curr_output + ->curr_workspace] + ->focused_tile == view_tile) { seat_set_focus(view->workspace->server->seat, prev); } else { view_tile->view = prev; From bdfbc4cd32b7e3632ef659340a0bfd536b6583d5 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Fri, 13 Mar 2020 13:07:01 +0000 Subject: [PATCH 013/689] Prepare 1.0.5 release - Summaize bug - Increment version number --- Bugs.md | 22 ++++++++++++++++++++++ meson.build | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/Bugs.md b/Bugs.md index 5bea08a..491d2c6 100644 --- a/Bugs.md +++ b/Bugs.md @@ -33,3 +33,25 @@ Steps to reproduce: * Fixed: 1.0.4 This issue fixes wrong consumption of modifier key on some keyboards. + +### Issue 3 + + * github issue number: N/A + * Fixed: 1.0.5 + +This issue is a bug causing crashes in cagebreak under specific circumstances. + +Steps to reproduce: + + * start cagebreak + * vertical split + * open a terminal on the left pane + * open firefox on the right pane + * focus the left pane + * close the terminal + * close firefox using the mouse while keeping focus on the left pane + * this causes a crash with the following error message: + +``` +(EE) failed to read Wayland events: Broken pipe +``` diff --git a/meson.build b/meson.build index 4387ce7..46f2547 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('cagebreak', 'c', - version: '1.0.4', + version: '1.0.5', license: 'MIT', default_options: [ 'c_std=c11', From 56ee91d396ec181330008d6d3b0262ac503aae80 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 21 Mar 2020 09:49:16 +0100 Subject: [PATCH 014/689] Cleanup cairo and pandoc structures on exit --- cagebreak.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cagebreak.c b/cagebreak.c index 4a71480..aeddf84 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -10,6 +10,9 @@ #include "config.h" +#include +#include +#include #include #include #include @@ -533,5 +536,10 @@ end: with a proper wl_display. */ wl_display_destroy(server.wl_display); wlr_output_layout_destroy(server.output_layout); + + pango_cairo_font_map_set_default(NULL); + cairo_debug_reset_static_data(); + FcFini(); + return ret; } From 0c7719011bf3db78be9545acb67c00ea118d8746 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 21 Mar 2020 09:49:50 +0100 Subject: [PATCH 015/689] Add fontconfig as dependency --- meson.build | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meson.build b/meson.build index 6925b67..9904430 100644 --- a/meson.build +++ b/meson.build @@ -64,6 +64,7 @@ xkbcommon = dependency('xkbcommon') cairo = dependency('cairo') pango = dependency('pango') pangocairo = dependency('pangocairo') +fontconfig = dependency('fontconfig') math = cc.find_library('m') wl_protocol_dir = wayland_protos.get_pkgconfig_variable('pkgdatadir') @@ -180,6 +181,7 @@ cagebreak_dependencies = [ wayland_cursor, wlroots, xkbcommon, + fontconfig, pixman, math, pango, From 3035866d78fb165aed8143d56c67eeee2f1b4cf2 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 21 Mar 2020 09:50:42 +0100 Subject: [PATCH 016/689] Fix parsing bugs --- parse.c | 50 ++++++++++++++++++++++++-------------------------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/parse.c b/parse.c index 7e09fce..5b0ac6e 100644 --- a/parse.c +++ b/parse.c @@ -58,7 +58,8 @@ parse_key(struct keybinding *keybinding, const char *key_def) { } int -parse_command(struct cg_server *server, struct keybinding *keybinding, char *saveptr); +parse_command(struct cg_server *server, struct keybinding *keybinding, + char *saveptr); /* Parse a keybinding definition and return it if successful, else return NULL */ @@ -116,28 +117,31 @@ parse_background(struct cg_server *server, float *color, char **saveptr) { for(unsigned int i = 0; i < 3; ++i) { char *nstr = strtok_r(NULL, " \n", saveptr); int nstrlen; - if(nstr == NULL||(nstrlen = strlen(nstr))== 0) { + if(nstr == NULL || (nstrlen = strlen(nstr)) == 0) { wlr_log(WLR_ERROR, "Expected three space-separated numbers (rgb) for " "background color setting. Got %d.", i); return -1; } - if(nstr[nstrlen-1] == '\n') { - nstr[nstrlen-1] = '\0'; + if(nstr[nstrlen - 1] == '\n') { + nstr[nstrlen - 1] = '\0'; --nstrlen; } char *endptr = NULL; float nval = strtof(nstr, &endptr); - if(endptr != nstr+nstrlen) { + if(endptr != nstr + nstrlen) { wlr_log( WLR_ERROR, "Could not parse number \"%s\" for background color setting.", nstr); return -1; } - if(nval<0||nval>1) { - wlr_log(WLR_ERROR, "Expected a number between 0 and 1 for setting of background color. Got %f.",nval); + if(nval < 0 || nval > 1) { + wlr_log(WLR_ERROR, + "Expected a number between 0 and 1 for setting of " + "background color. Got %f.", + nval); return -1; } color[i] = nval; @@ -161,7 +165,7 @@ parse_escape(char **saveptr) { return keybinding; } -char* +char * parse_definemode(char **saveptr) { char *mode = strtok_r(NULL, " ", saveptr); if(mode == NULL) { @@ -182,8 +186,7 @@ parse_workspaces(char **saveptr) { long nws = strtol(nws_str, NULL, 10); if(!(1 <= nws && nws <= 30)) { wlr_log(WLR_ERROR, - "More than 30 workspaces are not supported. Received %li", - nws); + "More than 30 workspaces are not supported. Received %li", nws); return -1; } return nws; @@ -191,12 +194,10 @@ parse_workspaces(char **saveptr) { int parse_command(struct cg_server *server, struct keybinding *keybinding, - char *saveptr) { + char *saveptr) { char *action = strtok_r(NULL, " ", &saveptr); if(action == NULL) { - wlr_log( - WLR_ERROR, - "Expected an action to parse, got none."); + wlr_log(WLR_ERROR, "Expected an action to parse, got none."); return -1; } keybinding->data = (union keybinding_params){.c = NULL}; @@ -260,10 +261,8 @@ parse_command(struct cg_server *server, struct keybinding *keybinding, } long ws = strtol(nws_str, NULL, 10); - if(!(1 <= ws && ws <= server->nws)) { - wlr_log(WLR_ERROR, - "Requested binding for workspace %li, but have %u", ws, - server->nws); + if(ws < 1) { + wlr_log(WLR_ERROR, "Workspace number must be a integer number larger or equal to 1. Got %ld", ws); return -1; } keybinding->data.u = ws - 1; @@ -277,11 +276,9 @@ parse_command(struct cg_server *server, struct keybinding *keybinding, } long ws = strtol(nws_str, NULL, 10); - if(!(1 <= ws && ws <= server->nws)) { + if(ws < 1) { wlr_log( - WLR_ERROR, - "Requested binding for moving to workspace %li, but have %u", - ws, server->nws); + WLR_ERROR, "Workspace number must be an integer larger or equal to 1. Got %ld", ws); return -1; } keybinding->data.u = ws - 1; @@ -357,7 +354,7 @@ parse_command(struct cg_server *server, struct keybinding *keybinding, } } else if(strcmp(action, "background") == 0) { keybinding->action = KEYBINDING_BACKGROUND; - if(parse_background(server, keybinding->data.color,&saveptr) != 0) { + if(parse_background(server, keybinding->data.color, &saveptr) != 0) { return -1; } } else if(strcmp(action, "escape") == 0) { @@ -374,8 +371,8 @@ parse_command(struct cg_server *server, struct keybinding *keybinding, } } else if(strcmp(action, "workspaces") == 0) { keybinding->action = KEYBINDING_WORKSPACES; - keybinding->data.i=parse_workspaces(&saveptr); - if(keybinding->data.i<0) { + keybinding->data.i = parse_workspaces(&saveptr); + if(keybinding->data.i < 0) { return -1; } } else { @@ -391,7 +388,8 @@ parse_rc_line(struct cg_server *server, char *line) { struct keybinding *keybinding = malloc(sizeof(struct keybinding)); if(keybinding == NULL) { - wlr_log(WLR_ERROR, "Failed to allocate memory for temporary keybinding struct."); + wlr_log(WLR_ERROR, + "Failed to allocate memory for temporary keybinding struct."); free(keybinding); free(saveptr); return -1; From f6240e9f687c2b101d4ae3754bd5ef9918995e9b Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 21 Mar 2020 09:50:52 +0100 Subject: [PATCH 017/689] Fix potential double-free --- workspace.c | 1 - 1 file changed, 1 deletion(-) diff --git a/workspace.c b/workspace.c index 7027710..8ed010e 100644 --- a/workspace.c +++ b/workspace.c @@ -51,7 +51,6 @@ workspace_focus_tile(struct cg_workspace *ws, struct cg_tile *tile) { box->x = tile->tile.x + tile->tile.width / 2; box->y = tile->tile.y + tile->tile.height / 2; message_printf_pos(ws->output, box, CG_MESSAGE_CENTER, "Current frame"); - free(box); } void From 8ffac22f1b4f175ccd9ff4b0f89c25e434bef829 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 21 Mar 2020 09:51:05 +0100 Subject: [PATCH 018/689] Fix conventions for system include --- pango.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pango.c b/pango.c index 035ac9b..ef3df10 100644 --- a/pango.c +++ b/pango.c @@ -1,4 +1,4 @@ -#include "cairo.h" +#include #include #include #include From b11e2409c6e7db5ca4fedd0392659b41e7f4f997 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 21 Mar 2020 09:51:35 +0100 Subject: [PATCH 019/689] Add support for disabling messages when fuzzing --- message.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/message.c b/message.c index c7b6b96..c41e1a4 100644 --- a/message.c +++ b/message.c @@ -46,6 +46,12 @@ create_message_texture(const char *string, const struct cg_output *output) { cairo_surface_t *dummy_surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 0, 0); cairo_t *c = cairo_create(dummy_surface); + + // This occurs when we are fuzzing. In that case, do nothing + if(c == NULL) { + return NULL; + } + cairo_set_antialias(c, CAIRO_ANTIALIAS_BEST); cairo_font_options_t *fo = cairo_font_options_create(); cairo_font_options_set_hint_style(fo, CAIRO_HINT_STYLE_FULL); @@ -147,7 +153,6 @@ message_printf(struct cg_output *output, const char *fmt, ...) { message_set_output(output, buffer, box, CG_MESSAGE_TOP_RIGHT); free(buffer); - free(box); alarm(output->server->message_timeout); } From 30bfa9b68928871b8a3f471d95f258ca27e1a27a Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 21 Mar 2020 09:52:41 +0100 Subject: [PATCH 020/689] Fix bugs in keybinding execution --- keybinding.c | 111 ++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 78 insertions(+), 33 deletions(-) diff --git a/keybinding.c b/keybinding.c index 45a0021..9bf5734 100644 --- a/keybinding.c +++ b/keybinding.c @@ -86,7 +86,7 @@ keybinding_list_push(struct keybinding_list *list, * exist*/ struct keybinding **found_keybinding = find_keybinding(list, keybinding); if(found_keybinding != NULL) { - keybinding_free(*found_keybinding,true); + keybinding_free(*found_keybinding, true); *found_keybinding = keybinding; wlr_log(WLR_DEBUG, "A keybinding was found twice in the config file."); } else { @@ -255,10 +255,27 @@ is_between_strict(int a, int b, int x) { return a < x && x < b; } +int +get_compl_coord(struct cg_tile *tile, int *(*get_coord)(struct cg_tile *tile)) { + return tile->tile.x + tile->tile.y - *get_coord(tile); +} + +int +get_compl_dim(struct cg_tile *tile, int *(*get_dim)(struct cg_tile *tile)) { + return tile->tile.width + tile->tile.height - *get_dim(tile); +} + bool -resize_allowed(struct cg_tile *tile, struct cg_tile *parent, int coord_offset, - int dim_offset, int *(*get_coord)(struct cg_tile *tile), - int *(*get_dim)(struct cg_tile *tile)) { +intervalls_intersect(int x1, int x2, int y1, int y2) { + return y2 > x1 && y1 < x2; +} + +bool +resize_allowed(struct cg_tile *tile, const struct cg_tile *parent, + int coord_offset, int dim_offset, + int *(*get_coord)(struct cg_tile *tile), + int *(*get_dim)(struct cg_tile *tile), struct cg_tile *orig) { + if(coord_offset == 0 && dim_offset == 0) { return true; } else if(*get_dim(tile) - coord_offset + dim_offset <= 0) { @@ -267,17 +284,25 @@ resize_allowed(struct cg_tile *tile, struct cg_tile *parent, int coord_offset, for(struct cg_tile *it = tile->next; it != tile && it != NULL; it = it->next) { - if(it == parent) { + if(it == parent || it == orig) { continue; } - if(it->tile.x == tile->tile.x + tile->tile.width) { - if(!resize_allowed(it, tile, dim_offset, -dim_offset, get_coord, - get_dim)) { - return false; - } - } else if(it->tile.x + it->tile.width == tile->tile.x) { - if(!resize_allowed(it, tile, 0, coord_offset, get_coord, get_dim)) { - return false; + if(intervalls_intersect( + get_compl_coord(tile, get_coord), + get_compl_coord(tile, get_coord) + get_compl_dim(tile, get_dim), + get_compl_coord(it, get_coord), + get_compl_coord(it, get_coord) + get_compl_dim(it, get_dim))) { + if(*get_coord(it) == *get_coord(tile) + *get_dim(tile)) { + if(!resize_allowed(it, tile, dim_offset + coord_offset, + -dim_offset - coord_offset, get_coord, + get_dim, orig)) { + return false; + } + } else if(*get_coord(it) + *get_dim(it) == *get_coord(tile)) { + if(!resize_allowed(it, tile, 0, coord_offset, get_coord, + get_dim, orig)) { + return false; + } } } } @@ -287,20 +312,27 @@ resize_allowed(struct cg_tile *tile, struct cg_tile *parent, int coord_offset, void resize(struct cg_tile *tile, const struct cg_tile *parent, int coord_offset, int dim_offset, int *(*get_coord)(struct cg_tile *tile), - int *(*get_dim)(struct cg_tile *tile)) { + int *(*get_dim)(struct cg_tile *tile), struct cg_tile *orig) { if(coord_offset == 0 && dim_offset == 0) { return; } for(struct cg_tile *it = tile->next; it != tile && it != NULL; it = it->next) { - if(it == parent) { + if(it == parent || it == orig) { continue; } - if(*get_coord(it) == *get_coord(tile) + *get_dim(tile)) { - resize(it, tile, dim_offset, -dim_offset, get_coord, get_dim); - } else if(*get_coord(it) + *get_dim(it) == *get_coord(tile)) { - resize(it, tile, 0, coord_offset, get_coord, get_dim); + if(intervalls_intersect( + get_compl_coord(tile, get_coord), + get_compl_coord(tile, get_coord) + get_compl_dim(tile, get_dim), + get_compl_coord(it, get_coord), + get_compl_coord(it, get_coord) + get_compl_dim(it, get_dim))) { + if(*get_coord(it) == *get_coord(tile) + *get_dim(tile)) { + resize(it, tile, dim_offset + coord_offset, + -dim_offset - coord_offset, get_coord, get_dim, orig); + } else if(*get_coord(it) + *get_dim(it) == *get_coord(tile)) { + resize(it, tile, 0, coord_offset, get_coord, get_dim, orig); + } } } @@ -342,26 +374,26 @@ bool resize_allowed_horizontal(struct cg_tile *tile, struct cg_tile *parent, int x_offset, int width_offset) { return resize_allowed(tile, parent, x_offset, width_offset, get_x, - get_width); + get_width, tile); } bool resize_allowed_vertical(struct cg_tile *tile, struct cg_tile *parent, int y_offset, int height_offset) { return resize_allowed(tile, parent, y_offset, height_offset, get_y, - get_height); + get_height, tile); } void resize_horizontal(struct cg_tile *tile, struct cg_tile *parent, int x_offset, int width_offset) { - resize(tile, parent, x_offset, width_offset, get_x, get_width); + resize(tile, parent, x_offset, width_offset, get_x, get_width, tile); } void resize_vertical(struct cg_tile *tile, struct cg_tile *parent, int y_offset, int height_offset) { - resize(tile, parent, y_offset, height_offset, get_y, get_height); + resize(tile, parent, y_offset, height_offset, get_y, get_height, tile); } /* hpixs: positiv -> right, negative -> left; vpixs: positiv -> down, negative @@ -615,9 +647,9 @@ keybinding_cycle_tiles(struct cg_server *server, bool reverse) { int keybinding_switch_ws(struct cg_server *server, uint32_t ws) { - if(ws > server->nws) { + if(ws >= server->nws) { wlr_log(WLR_ERROR, - "Requested workspace %u, but only have %u workspaces.", ws, + "Requested workspace %u, but only have %u workspaces.", ws+1, server->nws); return -1; } @@ -683,10 +715,21 @@ keybinding_set_nws(struct cg_server *server, int nws) { struct cg_output *output; wl_list_for_each(output, &server->outputs, link) { for(unsigned int i = nws; i < server->nws; ++i) { + struct cg_view *view, *tmp; + wl_list_for_each_safe(view,tmp, &output->workspaces[i]->views,link) { + wl_list_remove(&view->link); + wl_list_insert(&output->workspaces[nws-1]->views,&view->link); + view->workspace = output->workspaces[nws-1]; + } + wl_list_for_each_safe(view,tmp,&output->workspaces[i]->unmanaged_views,link) { + wl_list_remove(&view->link); + wl_list_insert(&output->workspaces[nws-1]->unmanaged_views,&view->link); + view->workspace = output->workspaces[nws-1]; + } workspace_free(output->workspaces[i]); } - struct cg_workspace **new_workspaces = realloc( - output->workspaces, nws * sizeof(struct cg_workspace *)); + struct cg_workspace **new_workspaces = + realloc(output->workspaces, nws * sizeof(struct cg_workspace *)); if(new_workspaces == NULL) { wlr_log(WLR_ERROR, "Error reallocating memory for workspaces."); return; @@ -699,16 +742,18 @@ keybinding_set_nws(struct cg_server *server, int nws) { } if(output->curr_workspace >= nws) { - output->curr_workspace = nws-1; + output->curr_workspace = nws - 1; } } server->nws = nws; + seat_set_focus(server->seat,server->curr_output->workspaces[server->curr_output->curr_workspace]->focused_tile->view); } void -keybinding_definemode(struct cg_server *server, char* mode) { +keybinding_definemode(struct cg_server *server, char *mode) { int length = 0; - while(server->modes[length++] != NULL); + while(server->modes[length++] != NULL) + ; char **tmp = realloc(server->modes, (length + 1) * sizeof(char *)); if(tmp == NULL) { wlr_log(WLR_ERROR, "Could not allocate memory for storing modes."); @@ -722,11 +767,11 @@ keybinding_definemode(struct cg_server *server, char* mode) { void keybinding_definekey(struct cg_server *server, struct keybinding *kb) { - keybinding_list_push(server->keybindings,kb); + keybinding_list_push(server->keybindings, kb); } void -keybinding_set_background(struct cg_server *server, float* bg) { +keybinding_set_background(struct cg_server *server, float *bg) { server->bg_color[0] = bg[0]; server->bg_color[1] = bg[1]; server->bg_color[2] = bg[2]; @@ -871,7 +916,7 @@ run_action(enum keybinding_action action, struct cg_server *server, break; } case KEYBINDING_DEFINEKEY: - keybinding_definekey(server,data.kb); + keybinding_definekey(server, data.kb); break; case KEYBINDING_BACKGROUND: keybinding_set_background(server, data.color); From 14a15feebbe676efd97c270597a91fabce2e108d Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 21 Mar 2020 10:07:24 +0100 Subject: [PATCH 021/689] Ameliorate fuzzing process --- fuzz/execl_override.c | 28 ++- fuzz/fuzz-parse.c | 443 ++++++++++++++++++++++++++++++++++++++---- fuzz/meson.build | 1 + message.c | 6 +- 4 files changed, 428 insertions(+), 50 deletions(-) diff --git a/fuzz/execl_override.c b/fuzz/execl_override.c index 281282f..8ce707b 100644 --- a/fuzz/execl_override.c +++ b/fuzz/execl_override.c @@ -1,11 +1,29 @@ /* This file is used by the fuzzer in order to prevent executing shell commands. */ #define _GNU_SOURCE -#include - -struct tm *(*orig_localtime)(const time_t *timep); +#include +#include "../output.h" +#include +#include +#include int -execl(const char *pathname, const char *arg, ...) { - return 0; +fork() { + return 1; +} + +void wlr_texture_get_size(struct wlr_texture *texture, int *width, + int *height) { + if(width != NULL) { + *width=0; + } + + if(height != NULL) { + *height=0; + } +} + +cairo_surface_t* +cairo_image_surface_create(cairo_format_t fmt, int width, int height) { + return NULL; } diff --git a/fuzz/fuzz-parse.c b/fuzz/fuzz-parse.c index 257f289..746e459 100644 --- a/fuzz/fuzz-parse.c +++ b/fuzz/fuzz-parse.c @@ -1,75 +1,410 @@ -#define _POSIX_C_SOURCE 200812L -#define FUZZING +/* + * Cagebreak: A Wayland tiling compositor. + * + * Copyright (C) 2018-2020 Jente Hidskes + * + * See the LICENSE file accompanying this file. + */ -#include "../keybinding.h" -#include "../parse.h" -#include "../seat.h" -#include "../server.h" -#include +#define _POSIX_C_SOURCE 200812L + +#include "config.h" + +#include +#include #include +#include #include #include #include #include + +#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#if CG_HAS_XWAYLAND +#include +#endif +#include +#include +#include +#include +#if CG_HAS_XWAYLAND +#include +#endif + +#include "idle_inhibit_v1.h" +#include "keybinding.h" +#include "message.h" +#include "output.h" +#include "workspace.h" +#include "parse.h" +#include "seat.h" +#include "server.h" +#include "view.h" +#include "xdg_shell.h" +#if CG_HAS_XWAYLAND +#include "xwayland.h" +#endif #ifndef WAIT_ANY #define WAIT_ANY -1 #endif -void -set_sig_handler(int sig) { - struct sigaction sa; - sa.sa_handler = SIG_IGN; // handle signal by ignoring - sigemptyset(&sa.sa_mask); - sa.sa_flags = 0; - if(sigaction(SIGCHLD, &sa, 0) == -1) { - perror(0); - exit(1); +static bool +drop_permissions(void) { + if(getuid() != geteuid() || getgid() != getegid()) { + if(setuid(getuid()) != 0 || setgid(getgid()) != 0) { + wlr_log(WLR_ERROR, "Unable to drop root, refusing to start"); + return false; + } } + + if(setuid(0) != -1) { + wlr_log(WLR_ERROR, "Unable to drop root (we shouldn't be able to " + "restore it after setuid), refusing to start"); + return false; + } + + return true; } -struct cg_server server; +static bool +parse_args(struct cg_server *server, int argc, char *argv[]) { + server->output_transform = WL_OUTPUT_TRANSFORM_NORMAL; + server->debug_damage_tracking = false; + return true; +} + +struct cg_server server = {0}; +struct wlr_xwayland *xwayland = NULL; +#if CG_HAS_XWAYLAND +struct wlr_xcursor_manager *xcursor_manager = NULL; +#endif + +void +cleanup() { + server.running = false; +#if CG_HAS_XWAYLAND + if(xwayland != NULL) { + wlr_xwayland_destroy(xwayland); + } + if(xcursor_manager != NULL) { + wlr_xcursor_manager_destroy(xcursor_manager); + } +#endif + wl_display_destroy_clients(server.wl_display); + + for(unsigned int i = 0; server.modes[i] != NULL; ++i) { + free(server.modes[i]); + } + free(server.modes); + + keybinding_list_free(server.keybindings); + + seat_destroy(server.seat); + /* This function is not null-safe, but we only ever get here + with a proper wl_display. */ + wl_display_destroy(server.wl_display); + wlr_output_layout_destroy(server.output_layout); +} int LLVMFuzzerInitialize(int *argc, char ***argv) { - set_sig_handler(SIGCHLD); + struct wl_event_loop *event_loop = NULL; + struct wlr_backend *backend = NULL; + struct wlr_renderer *renderer = NULL; + struct wlr_compositor *compositor = NULL; + struct wlr_data_device_manager *data_device_manager = NULL; + struct wlr_server_decoration_manager *server_decoration_manager = NULL; + struct wlr_xdg_decoration_manager_v1 *xdg_decoration_manager = NULL; + struct wlr_export_dmabuf_manager_v1 *export_dmabuf_manager = NULL; + struct wlr_screencopy_manager_v1 *screencopy_manager = NULL; + struct wlr_xdg_output_manager_v1 *output_manager = NULL; + struct wlr_gamma_control_manager_v1 *gamma_control_manager = NULL; + struct wlr_xdg_shell *xdg_shell = NULL; + int ret = 0; - server.wl_display = NULL; - server.event_loop = NULL; + if(!parse_args(&server, *argc, *argv)) { + return 1; + } - server.seat = malloc(sizeof(struct cg_seat)); - server.seat->mode = 0; - server.seat->default_mode = 0; +#ifdef DEBUG + wlr_log_init(WLR_DEBUG, NULL); +#else + wlr_log_init(WLR_ERROR, NULL); +#endif - server.idle = NULL; - server.idle_inhibit_v1 = NULL; - /* new_idle_inhibitor_v1 */ - wl_list_init(&server.inhibitors); + /* Wayland requires XDG_RUNTIME_DIR to be set. */ + if(!getenv("XDG_RUNTIME_DIR")) { + wlr_log(WLR_ERROR, "XDG_RUNTIME_DIR is not set in the environment"); + return 1; + } - server.output_layout = NULL; - wl_list_init(&server.outputs); - server.curr_output = NULL; - - /* new_output */ - - /* xdg_toplevel_decoration */ - /* new_xdg_shell_surface */ - /* new_xwayland_surface */ - server.keybindings = keybinding_list_init(); - server.output_transform = 0; + server.wl_display = wl_display_create(); + if(!server.wl_display) { + wlr_log(WLR_ERROR, "Cannot allocate a Wayland display"); + return 1; + } server.running = true; - server.modes = malloc(sizeof(char *)); - server.modes[0] = NULL; + + server.modes = malloc(4 * sizeof(char *)); + server.modes[0] = strdup("top"); + server.modes[1] = strdup("root"); + server.modes[2] = strdup("resize"); + server.modes[3] = NULL; + server.nws = 1; - server.message_timeout = 0; + server.message_timeout = 2; + + event_loop = wl_display_get_event_loop(server.wl_display); + server.event_loop = event_loop; + + backend = wlr_backend_autocreate(server.wl_display, NULL); + if(!backend) { + wlr_log(WLR_ERROR, "Unable to create the wlroots backend"); + ret = 1; + goto end; + } + server.backend = backend; + + if(!drop_permissions()) { + ret = 1; + goto end; + } + + server.keybindings = keybinding_list_init(); + if(server.keybindings == NULL || server.keybindings->keybindings == NULL) { + wlr_log(WLR_ERROR, "Unable to allocate keybindings"); + ret = 1; + goto end; + } + + renderer = wlr_backend_get_renderer(backend); + wlr_renderer_init_wl_display(renderer, server.wl_display); + server.bg_color = malloc(4 * sizeof(float)); server.bg_color[0] = 0; server.bg_color[1] = 0; server.bg_color[2] = 0; server.bg_color[3] = 1; + wl_list_init(&server.outputs); + server.output_layout = wlr_output_layout_create(); + if(!server.output_layout) { + wlr_log(WLR_ERROR, "Unable to create output layout"); + ret = 1; + goto end; + } + + compositor = wlr_compositor_create(server.wl_display, renderer); + if(!compositor) { + wlr_log(WLR_ERROR, "Unable to create the wlroots compositor"); + ret = 1; + goto end; + } + + data_device_manager = wlr_data_device_manager_create(server.wl_display); + if(!data_device_manager) { + wlr_log(WLR_ERROR, "Unable to create the data device manager"); + ret = 1; + goto end; + } + + /* Configure a listener to be notified when new outputs are + * available on the backend. We use this only to detect the + * first output and ignore subsequent outputs. */ + server.new_output.notify = handle_new_output; + wl_signal_add(&backend->events.new_output, &server.new_output); + + server.seat = seat_create(&server, backend); + if(!server.seat) { + wlr_log(WLR_ERROR, "Unable to create the seat"); + ret = 1; + goto end; + } + + server.idle = wlr_idle_create(server.wl_display); + if(!server.idle) { + wlr_log(WLR_ERROR, "Unable to create the idle tracker"); + ret = 1; + goto end; + } + + server.idle_inhibit_v1 = wlr_idle_inhibit_v1_create(server.wl_display); + if(!server.idle_inhibit_v1) { + wlr_log(WLR_ERROR, "Cannot create the idle inhibitor"); + ret = 1; + goto end; + } + server.new_idle_inhibitor_v1.notify = handle_idle_inhibitor_v1_new; + wl_signal_add(&server.idle_inhibit_v1->events.new_inhibitor, + &server.new_idle_inhibitor_v1); + wl_list_init(&server.inhibitors); + + xdg_shell = wlr_xdg_shell_create(server.wl_display); + if(!xdg_shell) { + wlr_log(WLR_ERROR, "Unable to create the XDG shell interface"); + ret = 1; + goto end; + } + server.new_xdg_shell_surface.notify = handle_xdg_shell_surface_new; + wl_signal_add(&xdg_shell->events.new_surface, + &server.new_xdg_shell_surface); + + xdg_decoration_manager = + wlr_xdg_decoration_manager_v1_create(server.wl_display); + if(!xdg_decoration_manager) { + wlr_log(WLR_ERROR, "Unable to create the XDG decoration manager"); + ret = 1; + goto end; + } + wl_signal_add(&xdg_decoration_manager->events.new_toplevel_decoration, + &server.xdg_toplevel_decoration); + server.xdg_toplevel_decoration.notify = handle_xdg_toplevel_decoration; + + server_decoration_manager = + wlr_server_decoration_manager_create(server.wl_display); + if(!server_decoration_manager) { + wlr_log(WLR_ERROR, "Unable to create the server decoration manager"); + ret = 1; + goto end; + } + wlr_server_decoration_manager_set_default_mode( + server_decoration_manager, WLR_SERVER_DECORATION_MANAGER_MODE_SERVER); + + export_dmabuf_manager = + wlr_export_dmabuf_manager_v1_create(server.wl_display); + if(!export_dmabuf_manager) { + wlr_log(WLR_ERROR, "Unable to create the export DMABUF manager"); + ret = 1; + goto end; + } + + screencopy_manager = wlr_screencopy_manager_v1_create(server.wl_display); + if(!screencopy_manager) { + wlr_log(WLR_ERROR, "Unable to create the screencopy manager"); + ret = 1; + goto end; + } + + output_manager = wlr_xdg_output_manager_v1_create(server.wl_display, + server.output_layout); + if(!output_manager) { + wlr_log(WLR_ERROR, "Unable to create the output manager"); + ret = 1; + goto end; + } + + gamma_control_manager = + wlr_gamma_control_manager_v1_create(server.wl_display); + if(!gamma_control_manager) { + wlr_log(WLR_ERROR, "Unable to create the gamma control manager"); + ret = 1; + goto end; + } + +#if CG_HAS_XWAYLAND + xwayland = wlr_xwayland_create(server.wl_display, compositor, true); + if(!xwayland) { + wlr_log(WLR_ERROR, "Cannot create XWayland server"); + ret = 1; + goto end; + } + server.new_xwayland_surface.notify = handle_xwayland_surface_new; + wl_signal_add(&xwayland->events.new_surface, &server.new_xwayland_surface); + + xcursor_manager = wlr_xcursor_manager_create(DEFAULT_XCURSOR, XCURSOR_SIZE); + if(!xcursor_manager) { + wlr_log(WLR_ERROR, "Cannot create XWayland XCursor manager"); + ret = 1; + goto end; + } + + if(setenv("DISPLAY", xwayland->display_name, true) < 0) { + wlr_log_errno(WLR_ERROR, "Unable to set DISPLAY for XWayland.", + "Clients may not be able to connect"); + } else { + wlr_log(WLR_DEBUG, "XWayland is running on display %s", + xwayland->display_name); + } + + if(wlr_xcursor_manager_load(xcursor_manager, 1)) { + wlr_log(WLR_ERROR, "Cannot load XWayland XCursor theme"); + } + struct wlr_xcursor *xcursor = + wlr_xcursor_manager_get_xcursor(xcursor_manager, DEFAULT_XCURSOR, 1); + if(xcursor) { + struct wlr_xcursor_image *image = xcursor->images[0]; + wlr_xwayland_set_cursor(xwayland, image->buffer, image->width * 4, + image->width, image->height, image->hotspot_x, + image->hotspot_y); + } +#endif + + const char *socket = wl_display_add_socket_auto(server.wl_display); + if(!socket) { + wlr_log_errno(WLR_ERROR, "Unable to open Wayland socket"); + ret = 1; + goto end; + } + + if(!wlr_backend_start(backend)) { + wlr_log(WLR_ERROR, "Unable to start the wlroots backend"); + ret = 1; + goto end; + } + + if(setenv("WAYLAND_DISPLAY", socket, true) < 0) { + wlr_log_errno(WLR_ERROR, "Unable to set WAYLAND_DISPLAY.", + "Clients may not be able to connect"); + } else { + wlr_log(WLR_DEBUG, + "Cagebreak " CG_VERSION " is running on Wayland display %s", + socket); + } + +#if CG_HAS_XWAYLAND + wlr_xwayland_set_seat(xwayland, server.seat->seat); +#endif + + /* Place the cursor to the topl left of the output layout. */ + wlr_cursor_warp(server.seat->cursor, NULL, 0, 0); + atexit(cleanup); + return 0; +end: + cleanup(); + return ret; +} + +/* Parse config file. Lines longer than "max_line_size" are ignored */ +int +set_configuration(struct cg_server *server, char *content) { + char *line; + for(unsigned int line_num = 1; + (line = strtok_r(NULL, "\n", &content)) != NULL; ++line_num) { + line[strcspn(line, "\n")] = '\0'; + if(*line != '\0' && *line != '#') { + if(parse_rc_line(server, line) != 0) { + return -1; + } + } + } return 0; } @@ -78,9 +413,33 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { char *str = malloc(size * sizeof(char) + 1); strncpy(str, (char *)data, size); str[size] = 0; - parse_rc_line(&server, str); + set_configuration(&server, str); free(str); keybinding_list_free(server.keybindings); server.keybindings = keybinding_list_init(); + run_action(KEYBINDING_WORKSPACES, &server, + (union keybinding_params){.i = 1}); + run_action(KEYBINDING_LAYOUT_FULLSCREEN, &server, + (union keybinding_params){.c = NULL}); + wl_display_flush_clients(server.wl_display); + wl_display_destroy_clients(server.wl_display); + struct cg_output* output; + wl_list_for_each(output, &server.outputs, link) { + message_clear(output); + struct cg_view *view; + wl_list_for_each(view, &(*output->workspaces)->views, link) { + view_unmap(view); + view_destroy(view); + } + wl_list_for_each(view, &(*output->workspaces)->unmanaged_views, link) { + view_unmap(view); + view_destroy(view); + } + } + for(unsigned int i = 3; server.modes[i] != NULL; ++i) { + free(server.modes[i]); + } + server.modes[3] = NULL; + server.modes = realloc(server.modes, 4 * sizeof(char *)); return 0; } diff --git a/fuzz/meson.build b/fuzz/meson.build index 0266717..8ff982a 100644 --- a/fuzz/meson.build +++ b/fuzz/meson.build @@ -17,6 +17,7 @@ endif override_lib = shared_library('execl_override', [ 'execl_override.c' ], + dependencies: [ pixman,cairo,pango,pangocairo ], install: false ) diff --git a/message.c b/message.c index c41e1a4..40ac033 100644 --- a/message.c +++ b/message.c @@ -45,13 +45,13 @@ create_message_texture(const char *string, const struct cg_output *output) { // Therefore, we cannot use cairo_create(NULL). cairo_surface_t *dummy_surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 0, 0); - cairo_t *c = cairo_create(dummy_surface); - // This occurs when we are fuzzing. In that case, do nothing - if(c == NULL) { + if(dummy_surface == NULL) { return NULL; } + cairo_t *c = cairo_create(dummy_surface); + cairo_set_antialias(c, CAIRO_ANTIALIAS_BEST); cairo_font_options_t *fo = cairo_font_options_create(); cairo_font_options_set_hint_style(fo, CAIRO_HINT_STYLE_FULL); From 9363a59b95d2a97f8451fa5a061d5a082d7ffad4 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 21 Mar 2020 14:31:06 +0100 Subject: [PATCH 022/689] Apply clang-format --- cagebreak.c | 4 ++-- fuzz/execl_override.c | 12 ++++++------ fuzz/fuzz-parse.c | 4 ++-- keybinding.c | 23 +++++++++++++++-------- keybinding.h | 10 +++++----- parse.c | 11 ++++++++--- 6 files changed, 38 insertions(+), 26 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index aeddf84..ba359e5 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -10,11 +10,11 @@ #include "config.h" +#include #include +#include #include #include -#include -#include #include #include #include diff --git a/fuzz/execl_override.c b/fuzz/execl_override.c index 8ce707b..316cf1e 100644 --- a/fuzz/execl_override.c +++ b/fuzz/execl_override.c @@ -1,10 +1,10 @@ /* This file is used by the fuzzer in order to prevent executing shell commands. */ #define _GNU_SOURCE -#include #include "../output.h" #include #include +#include #include int @@ -12,18 +12,18 @@ fork() { return 1; } -void wlr_texture_get_size(struct wlr_texture *texture, int *width, - int *height) { +void +wlr_texture_get_size(struct wlr_texture *texture, int *width, int *height) { if(width != NULL) { - *width=0; + *width = 0; } if(height != NULL) { - *height=0; + *height = 0; } } -cairo_surface_t* +cairo_surface_t * cairo_image_surface_create(cairo_format_t fmt, int width, int height) { return NULL; } diff --git a/fuzz/fuzz-parse.c b/fuzz/fuzz-parse.c index 746e459..24b15cf 100644 --- a/fuzz/fuzz-parse.c +++ b/fuzz/fuzz-parse.c @@ -51,11 +51,11 @@ #include "keybinding.h" #include "message.h" #include "output.h" -#include "workspace.h" #include "parse.h" #include "seat.h" #include "server.h" #include "view.h" +#include "workspace.h" #include "xdg_shell.h" #if CG_HAS_XWAYLAND #include "xwayland.h" @@ -423,7 +423,7 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { (union keybinding_params){.c = NULL}); wl_display_flush_clients(server.wl_display); wl_display_destroy_clients(server.wl_display); - struct cg_output* output; + struct cg_output *output; wl_list_for_each(output, &server.outputs, link) { message_clear(output); struct cg_view *view; diff --git a/keybinding.c b/keybinding.c index 9bf5734..f6f5eaf 100644 --- a/keybinding.c +++ b/keybinding.c @@ -649,7 +649,7 @@ int keybinding_switch_ws(struct cg_server *server, uint32_t ws) { if(ws >= server->nws) { wlr_log(WLR_ERROR, - "Requested workspace %u, but only have %u workspaces.", ws+1, + "Requested workspace %u, but only have %u workspaces.", ws + 1, server->nws); return -1; } @@ -716,15 +716,19 @@ keybinding_set_nws(struct cg_server *server, int nws) { wl_list_for_each(output, &server->outputs, link) { for(unsigned int i = nws; i < server->nws; ++i) { struct cg_view *view, *tmp; - wl_list_for_each_safe(view,tmp, &output->workspaces[i]->views,link) { + wl_list_for_each_safe(view, tmp, &output->workspaces[i]->views, + link) { wl_list_remove(&view->link); - wl_list_insert(&output->workspaces[nws-1]->views,&view->link); - view->workspace = output->workspaces[nws-1]; + wl_list_insert(&output->workspaces[nws - 1]->views, + &view->link); + view->workspace = output->workspaces[nws - 1]; } - wl_list_for_each_safe(view,tmp,&output->workspaces[i]->unmanaged_views,link) { + wl_list_for_each_safe( + view, tmp, &output->workspaces[i]->unmanaged_views, link) { wl_list_remove(&view->link); - wl_list_insert(&output->workspaces[nws-1]->unmanaged_views,&view->link); - view->workspace = output->workspaces[nws-1]; + wl_list_insert(&output->workspaces[nws - 1]->unmanaged_views, + &view->link); + view->workspace = output->workspaces[nws - 1]; } workspace_free(output->workspaces[i]); } @@ -746,7 +750,10 @@ keybinding_set_nws(struct cg_server *server, int nws) { } } server->nws = nws; - seat_set_focus(server->seat,server->curr_output->workspaces[server->curr_output->curr_workspace]->focused_tile->view); + seat_set_focus( + server->seat, + server->curr_output->workspaces[server->curr_output->curr_workspace] + ->focused_tile->view); } void diff --git a/keybinding.h b/keybinding.h index 42ad114..24f8af2 100644 --- a/keybinding.h +++ b/keybinding.h @@ -44,10 +44,10 @@ enum keybinding_action { KEYBINDING_FOCUS_TOP, KEYBINDING_FOCUS_BOTTOM, - KEYBINDING_DEFINEKEY, // data.kb is the keybinding definition - KEYBINDING_BACKGROUND, //data.color is the background color - KEYBINDING_DEFINEMODE, //data.c is the mode name - KEYBINDING_WORKSPACES, //data.i is the number of workspaces + KEYBINDING_DEFINEKEY, // data.kb is the keybinding definition + KEYBINDING_BACKGROUND, // data.color is the background color + KEYBINDING_DEFINEMODE, // data.c is the mode name + KEYBINDING_WORKSPACES, // data.i is the number of workspaces }; union keybinding_params { @@ -56,7 +56,7 @@ union keybinding_params { int32_t i; bool b; float color[3]; - struct keybinding* kb; + struct keybinding *kb; }; struct keybinding { diff --git a/parse.c b/parse.c index 5b0ac6e..cb6abe3 100644 --- a/parse.c +++ b/parse.c @@ -262,7 +262,10 @@ parse_command(struct cg_server *server, struct keybinding *keybinding, long ws = strtol(nws_str, NULL, 10); if(ws < 1) { - wlr_log(WLR_ERROR, "Workspace number must be a integer number larger or equal to 1. Got %ld", ws); + wlr_log(WLR_ERROR, + "Workspace number must be a integer number larger or equal " + "to 1. Got %ld", + ws); return -1; } keybinding->data.u = ws - 1; @@ -277,8 +280,10 @@ parse_command(struct cg_server *server, struct keybinding *keybinding, long ws = strtol(nws_str, NULL, 10); if(ws < 1) { - wlr_log( - WLR_ERROR, "Workspace number must be an integer larger or equal to 1. Got %ld", ws); + wlr_log(WLR_ERROR, + "Workspace number must be an integer larger or equal to 1. " + "Got %ld", + ws); return -1; } keybinding->data.u = ws - 1; From 741a0a4928eb4775074544d7159db69f4698e3bc Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 28 Mar 2020 09:09:24 +0100 Subject: [PATCH 023/689] Add warning message on version missmatch --- meson.build | 56 +++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 42 insertions(+), 14 deletions(-) diff --git a/meson.build b/meson.build index 46f2547..bec9dba 100644 --- a/meson.build +++ b/meson.build @@ -64,7 +64,7 @@ xkbcommon = dependency('xkbcommon') cairo = dependency('cairo') pango = dependency('pango') pangocairo = dependency('pangocairo') -math = cc.find_library('m') +fontconfig = dependency('fontconfig') wl_protocol_dir = wayland_protos.get_pkgconfig_variable('pkgdatadir') wayland_scanner = find_program('wayland-scanner') @@ -173,19 +173,47 @@ foreach header : cagebreak_header_strings cagebreak_headers += files(header) endforeach -cagebreak_dependencies = [ - server_protos, - wayland_server, - wayland_client, - wayland_cursor, - wlroots, - xkbcommon, - pixman, - math, - pango, - cairo, - pangocairo, -] +cagebreak_dependencies_dict = { + 'server_protos': server_protos, + 'wayland_server': wayland_server, + 'wayland_client': wayland_client, + 'wayland_cursor': wayland_cursor, + 'wlroots': wlroots, + 'xkbcommon': xkbcommon, + 'fontconfig': fontconfig, + 'pixman': pixman, + 'pango': pango, + 'cairo': cairo, + 'pangocairo': pangocairo, +} + +reproducible_build_versions = { + 'server_protos': '1.0.5', + 'wayland_server': '1.18.0', + 'wayland_client': '1.18.0', + 'wayland_cursor': '1.18.0', + 'wlroots': '0.10.1', + 'xkbcommon': '0.10.0', + 'fontconfig': '2.13.91', + 'pixman': '0.38.4', + 'pango': '1.44.7', + 'cairo': '1.17.3', + 'pangocairo': '1.44.7', +} + +cagebreak_dependencies = [] + +foreach name, dep : cagebreak_dependencies_dict + cagebreak_dependencies += dep +endforeach + +foreach name, dep : cagebreak_dependencies_dict + if reproducible_build_versions[name] != dep.version() + warning('The installed version of "' + name + '" on your machine (' + dep.version() + ') differs from the one used to generate the hash specified in the "Reproducible Build" section of the manual (' + reproducible_build_versions[name] + '). There is therefore no guaranty that the hashes of the binaries match.' + ) + break + endif +endforeach executable( meson.project_name(), From d40db590f579c208c03ad72017640b41bc039487 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 28 Mar 2020 09:11:11 +0100 Subject: [PATCH 024/689] Reword warning message --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index bec9dba..3c6575c 100644 --- a/meson.build +++ b/meson.build @@ -209,7 +209,7 @@ endforeach foreach name, dep : cagebreak_dependencies_dict if reproducible_build_versions[name] != dep.version() - warning('The installed version of "' + name + '" on your machine (' + dep.version() + ') differs from the one used to generate the hash specified in the "Reproducible Build" section of the manual (' + reproducible_build_versions[name] + '). There is therefore no guaranty that the hashes of the binaries match.' + warning('The installed version of "' + name + '" on your machine (' + dep.version() + ') differs from the one used to generate the hash specified in the "Reproducible Build" section of the README (' + reproducible_build_versions[name] + '). There is therefore no guaranty that the hashes of the binaries match.' ) break endif From 82512a5b52be389b29707c3e6f351275a2bf914c Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 28 Mar 2020 21:14:33 +0100 Subject: [PATCH 025/689] Add missing dependency --- meson.build | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 3c6575c..b4f6350 100644 --- a/meson.build +++ b/meson.build @@ -65,6 +65,7 @@ cairo = dependency('cairo') pango = dependency('pango') pangocairo = dependency('pangocairo') fontconfig = dependency('fontconfig') +math = cc.find_library('m') wl_protocol_dir = wayland_protos.get_pkgconfig_variable('pkgdatadir') wayland_scanner = find_program('wayland-scanner') @@ -185,6 +186,7 @@ cagebreak_dependencies_dict = { 'pango': pango, 'cairo': cairo, 'pangocairo': pangocairo, + 'math': math } reproducible_build_versions = { @@ -199,6 +201,7 @@ reproducible_build_versions = { 'pango': '1.44.7', 'cairo': '1.17.3', 'pangocairo': '1.44.7', + 'math': '-1' } cagebreak_dependencies = [] @@ -208,7 +211,7 @@ foreach name, dep : cagebreak_dependencies_dict endforeach foreach name, dep : cagebreak_dependencies_dict - if reproducible_build_versions[name] != dep.version() + if reproducible_build_versions[name] != '-1' and reproducible_build_versions[name] != dep.version() warning('The installed version of "' + name + '" on your machine (' + dep.version() + ') differs from the one used to generate the hash specified in the "Reproducible Build" section of the README (' + reproducible_build_versions[name] + '). There is therefore no guaranty that the hashes of the binaries match.' ) break From 78fc95e098d54501cab04be6d2ea97b5cd6af76f Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Sat, 28 Mar 2020 21:33:54 +0000 Subject: [PATCH 026/689] Prepare cagebreak 1.0.6 for review - Make build reproducible accross commits - Document reproducibility regimen --- README.md | 36 ++++++++++++++++++++++++++++++++---- cagebreak.c | 2 +- meson.build | 4 ++-- signatures/cagebreak.sig | Bin 0 -> 566 bytes 4 files changed, 35 insertions(+), 7 deletions(-) create mode 100644 signatures/cagebreak.sig diff --git a/README.md b/README.md index 2912c06..0e7093a 100644 --- a/README.md +++ b/README.md @@ -105,6 +105,8 @@ Release checklist * [ ] wiki * [ ] Changelog in README * [ ] Document fixed bugs in Bugs.md + * [ ] Update hashes of the binary + * [ ] Update signature of the binary * [ ] Signature * [ ] Branching Strategy @@ -126,10 +128,36 @@ The full public keys can be found in `keys/` along with any revocation certifica ### Reproducible Builds -Currently our project seems to build the same way on any given system, when compiled -multiple times. However, at the moment we are unable to supply instructions -for building our software reproducibly. Reproducible builds are planned for the -near future. +Cagebreak offers reproducible builds given the exact library versions specified +in `meson.build`. Should the versions not match, a warning will be emitted. We have +decided on this compromise to allow flexibility and security. In general we will +adapt the versions to the packages available under archlinux at the time of +release. + +#### Reproducible Build Instructions + +All hashes and signatures are provided for the following build instructions. + +``` +meson build -Dxwayland=true --buildtype=release +ninja -C build +``` + +#### Hashes for Builds + +For every release after 1.0.5, hashes will be provided. + +1.0.6 + + * sha 256: 875d77ae0d1266ace899b143ca738e6adc514ea26b2dae58a0ce5989139149f2 + * sha 512: 066829ed30b299a21ef74d5d9c7f3ff8021b877ac18a141a0aa77aae1acf880305743eedf546cba0aa06acc53d26750bf989b7fb029f0ea5ac01b3804288ab88 + +#### GPG Signatures + +For every release after 1.0.5, a GPG signature will be provided in `signatures`. + +The current signature is called `cagebreak.sig`, whereas all older signatures +will be named after their release version. ### Fuzzing diff --git a/cagebreak.c b/cagebreak.c index 4a71480..1adc5a1 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -160,7 +160,7 @@ parse_args(struct cg_server *server, int argc, char *argv[]) { usage(stdout, argv[0]); return false; case 'v': - fprintf(stdout, "Cagebreak version " CG_VERSION "\n"); + fprintf(stdout, "Cagebreak version 1.0.6\n"); exit(0); default: usage(stderr, argv[0]); diff --git a/meson.build b/meson.build index b4f6350..419e625 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('cagebreak', 'c', - version: '1.0.5', + version: '1.0.6', license: 'MIT', default_options: [ 'c_std=c11', @@ -212,7 +212,7 @@ endforeach foreach name, dep : cagebreak_dependencies_dict if reproducible_build_versions[name] != '-1' and reproducible_build_versions[name] != dep.version() - warning('The installed version of "' + name + '" on your machine (' + dep.version() + ') differs from the one used to generate the hash specified in the "Reproducible Build" section of the README (' + reproducible_build_versions[name] + '). There is therefore no guaranty that the hashes of the binaries match.' + warning('The installed version of "' + name + '" on your machine (' + dep.version() + ') differs from the one used to generate the binary specified in the README section "Reproducible Builds" (' + reproducible_build_versions[name] + '). Cagebreak does not guarantee a reproducible build for this configuration.' ) break endif diff --git a/signatures/cagebreak.sig b/signatures/cagebreak.sig new file mode 100644 index 0000000000000000000000000000000000000000..e742f265d2fbf6e489061218b890414e4e5037a9 GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j-ZpKYEIH7WG5|K!!g`E=I|>?~Ua0$zW>rT_{F5XAX( z*9`0|TZdy10G}F0tA5dHph^EPvbU}7ZX$N|Vy>@UXujVCSDrGj9@HHZp+xZij|C^B z_rB#LQ&^vSQJq=9{ih4&+?V{HIarH!^c>-6uig8NDrlOxseNzxrM^8v1;25mL!PYn zOvkj;V^+nK!K|X1c$hpi2_y1)ttqMr!b06hm$)nGelp4iEis58Kfx{j-gHWs5e{YW z*ogldyWE;DFk)+Po}<7S54vp-6s`4n&>paTU>E{<4l??ekA!!8bDaMa(SRt`KRmQJ zI44N>DrL2zJ~ozhqpjZ7fqW0nI^^DWHY*0^=Go)$>XT#0%S>CyIFuc%MbEn}#k_xP zb~Wws>IK5R$eia4zF?>#&b|XMc=i)_5(iT^13{fMkr+>9|A$yMgQKiUi2_sFo{Vqq zWC7#i5$FM0+Rf*ws&XX&g%HmHKfxhb7T=xp$V@l3O+_)K9R#4ldB>Tde~W1w^Uti= zNZ|;qFo4;y=}yBw&&1aA5tZt;#tb|I8{Aj6))Qe61SSYSv=*6r_fn8SdYGjb}0zdyJry^-|rO|cqVJ;PlGW2hLon-@%$Tqn%|5?rV_0>XmN E_hhge9{>OV literal 0 HcmV?d00001 From 1934b56fa144194a67690d5fa31f64ef6f288e42 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 28 Mar 2020 22:42:37 +0100 Subject: [PATCH 027/689] Reword readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0e7093a..f2437aa 100644 --- a/README.md +++ b/README.md @@ -129,7 +129,7 @@ The full public keys can be found in `keys/` along with any revocation certifica ### Reproducible Builds Cagebreak offers reproducible builds given the exact library versions specified -in `meson.build`. Should the versions not match, a warning will be emitted. We have +in `meson.build`. Should a version mismatch occur, a warning will be emitted. We have decided on this compromise to allow flexibility and security. In general we will adapt the versions to the packages available under archlinux at the time of release. From c794d3519bb67cbd6576be02ce508e7b7072171d Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 29 Mar 2020 10:33:28 +0200 Subject: [PATCH 028/689] Remove git hash from version --- cagebreak.c | 2 +- meson.build | 16 ++++------------ meson_options.txt | 1 + 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index 1adc5a1..4a71480 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -160,7 +160,7 @@ parse_args(struct cg_server *server, int argc, char *argv[]) { usage(stdout, argv[0]); return false; case 'v': - fprintf(stdout, "Cagebreak version 1.0.6\n"); + fprintf(stdout, "Cagebreak version " CG_VERSION "\n"); exit(0); default: usage(stderr, argv[0]); diff --git a/meson.build b/meson.build index 419e625..31a6611 100644 --- a/meson.build +++ b/meson.build @@ -101,18 +101,10 @@ else have_xwayland = false endif -version = '@0@'.format(meson.project_version()) -git = find_program('git', native: true, required: false) -if git.found() - git_commit = run_command([git, 'rev-parse', '--short', 'HEAD']) - git_branch = run_command([git, 'rev-parse', '--abbrev-ref', 'HEAD']) - if git_commit.returncode() == 0 and git_branch.returncode() == 0 - version = '@0@-@1@ (branch \'@2@\')'.format( - meson.project_version(), - git_commit.stdout().strip(), - git_branch.stdout().strip(), - ) - endif +if get_option('version_override') != '' + version = '@0@'.format(get_option('version_override')) +else + version = '@0@'.format(meson.project_version()) endif conf_data = configuration_data() diff --git a/meson_options.txt b/meson_options.txt index 5982c3d..bb96c4f 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,2 +1,3 @@ option('xwayland', type: 'boolean', value: 'false', description: 'Enable support for X11 applications') option('fuzz', type: 'boolean', value: 'false', description: 'Enable building fuzzer targets') +option('version_override', type: 'string', description: 'Set the project version to the string specified. Used for creating hashes for reproducible builds.') From 8eb17bc54bb3db765e850aefd510a687bf4ecd19 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Sun, 29 Mar 2020 09:37:22 +0000 Subject: [PATCH 029/689] Update server_protos version --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 31a6611..6b2e509 100644 --- a/meson.build +++ b/meson.build @@ -182,7 +182,7 @@ cagebreak_dependencies_dict = { } reproducible_build_versions = { - 'server_protos': '1.0.5', + 'server_protos': '1.0.6', 'wayland_server': '1.18.0', 'wayland_client': '1.18.0', 'wayland_cursor': '1.18.0', From 6a1266bc216991ad22a7165ea8237acf9713f782 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Sun, 29 Mar 2020 09:46:25 +0000 Subject: [PATCH 030/689] Add current hashes and signatures --- README.md | 4 ++-- signatures/cagebreak.sig | Bin 566 -> 566 bytes 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f2437aa..c793ac0 100644 --- a/README.md +++ b/README.md @@ -149,8 +149,8 @@ For every release after 1.0.5, hashes will be provided. 1.0.6 - * sha 256: 875d77ae0d1266ace899b143ca738e6adc514ea26b2dae58a0ce5989139149f2 - * sha 512: 066829ed30b299a21ef74d5d9c7f3ff8021b877ac18a141a0aa77aae1acf880305743eedf546cba0aa06acc53d26750bf989b7fb029f0ea5ac01b3804288ab88 + * sha 256: 712ae9a8f17a9e589e108f0d503da203cc5eaf1c4a6ca6efb5b4c83b432ce0b8 + * sha 512: d574003023a00cfd6623aac986a5a7f397cfd0bc9114017629a8c72731b0df3977c4a31768502dfa8a6607be06930089b2ccf6ffca9b5bcd1096b7ca0aede226 #### GPG Signatures diff --git a/signatures/cagebreak.sig b/signatures/cagebreak.sig index e742f265d2fbf6e489061218b890414e4e5037a9..3a641bee171da79f5d93fc627d5230d0786eb715 100644 GIT binary patch delta 542 zcmV+(0^$9(1hxc_BY%Kx*8mC$5XAX(*9`0|Tc$z}|64$gG`MHKZ=AWaCuyalWsk4k zO22O@Vk;D@>@jJuMc1+zpA&G+@{_qVO`Y09k!O{I7iHTUnPT zkIYpcNNuceS3$Os?#EXLAyy`{?}uNjVHyd*;iJ~`1b>hBSmWUVf{UFQ>F9NW=K#IT@oo||J1{+Y@VaDU&9OEld zP{GeM)oL;krO_f@kyJ9bTNNg&f~=06r2QHAgQCuNEq%o6iAOx19R`F`ptnrGLq1Bn g*EQ@+!WV+4{8k&L$Lf7F?L)YbTwZlvADEF0$t#x(F8}}l delta 542 zcmV+(0^$9(1hxc_BY%IurT_{F5XAX(*9`0|TZdy10G}F0tA5dHph^EPvbU}7ZX$N| zVy>@UXujVCSDrGj9@HHZp+xZij|C^B_rB#LQ&^vSQJq=9{ih4&+?V{HIarH!^c>-6 zuig8NDrlOxseNzxrM^8v1;25mL!PYnOvkj;V^+nK!K|X1cz>8YGzlZ}daWs{3Bp3% zNSC-P>3%ZG1}!m&AwR(_{@!#-m=O+T@Ysm|8@t?^FEC@c@8rAmyd*Zd~=-t6w!bv)jvG6I5;Or_$p;sG&jCNdAy^jQ zo%F~|H?~bhF{K>@pu%~_nW2A+X&dv;tl3E62&^!G*?+O=PQyOW#Mbi>mFl*}3_JrH zk(u(J5L;8W>F4T{R$g>um%l9Ygi@Vs7>suu_Fl<&ClFVDfJZ0XhELhbjALn3{A zts2*A)?)S)q=uXs?%#clXEGLhjG&X_#XmN_k$4;?EnA( From 4bdc2640a74ff66413ba3814fb3281f88f19017a Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Sun, 29 Mar 2020 11:47:44 +0000 Subject: [PATCH 031/689] Merge 1.0.6 for compatibility testing --- Bugs.md | 29 +++++ README.md | 48 ++++++-- meson.build | 74 +++++++----- meson_options.txt | 1 + seat.c | 243 ++++++++++----------------------------- seat.h | 23 ++-- signatures/cagebreak.sig | Bin 0 -> 566 bytes view.c | 12 +- 8 files changed, 194 insertions(+), 236 deletions(-) create mode 100644 signatures/cagebreak.sig diff --git a/Bugs.md b/Bugs.md index 90758b8..491d2c6 100644 --- a/Bugs.md +++ b/Bugs.md @@ -26,3 +26,32 @@ Steps to reproduce: * enter text into the "Tags" field * if autocompletion of tags pops up, the keyboard will not enter further keystrokes into the text field + +### Issue 2 + + * Github issue number: N/A + * Fixed: 1.0.4 + +This issue fixes wrong consumption of modifier key on some keyboards. + +### Issue 3 + + * github issue number: N/A + * Fixed: 1.0.5 + +This issue is a bug causing crashes in cagebreak under specific circumstances. + +Steps to reproduce: + + * start cagebreak + * vertical split + * open a terminal on the left pane + * open firefox on the right pane + * focus the left pane + * close the terminal + * close firefox using the mouse while keeping focus on the left pane + * this causes a crash with the following error message: + +``` +(EE) failed to read Wayland events: Broken pipe +``` diff --git a/README.md b/README.md index 8117d1f..c793ac0 100644 --- a/README.md +++ b/README.md @@ -74,13 +74,19 @@ it is merged into `master`, creating a new release, which is tagged and signed. Merging into master is always done by ``` -git merge --no-ff development -git tag -u keyid version -git push origin master +git checkout development +git pull origin development +git checkout master +git merge --squash development +git tag -u keyid version HEAD +git tag -v version +git push --tags origin master ``` and a log message roughly describing the features is added in the commit. +In the past, our git history did not always reflect this scheme. + ### Releases Release checklist @@ -99,6 +105,8 @@ Release checklist * [ ] wiki * [ ] Changelog in README * [ ] Document fixed bugs in Bugs.md + * [ ] Update hashes of the binary + * [ ] Update signature of the binary * [ ] Signature * [ ] Branching Strategy @@ -120,10 +128,36 @@ The full public keys can be found in `keys/` along with any revocation certifica ### Reproducible Builds -Currently our project seems to build the same way on any given system, when compiled -multiple times. However, at the moment we are unable to supply instructions -for building our software reproducibly. Reproducible builds are planned for the -near future. +Cagebreak offers reproducible builds given the exact library versions specified +in `meson.build`. Should a version mismatch occur, a warning will be emitted. We have +decided on this compromise to allow flexibility and security. In general we will +adapt the versions to the packages available under archlinux at the time of +release. + +#### Reproducible Build Instructions + +All hashes and signatures are provided for the following build instructions. + +``` +meson build -Dxwayland=true --buildtype=release +ninja -C build +``` + +#### Hashes for Builds + +For every release after 1.0.5, hashes will be provided. + +1.0.6 + + * sha 256: 712ae9a8f17a9e589e108f0d503da203cc5eaf1c4a6ca6efb5b4c83b432ce0b8 + * sha 512: d574003023a00cfd6623aac986a5a7f397cfd0bc9114017629a8c72731b0df3977c4a31768502dfa8a6607be06930089b2ccf6ffca9b5bcd1096b7ca0aede226 + +#### GPG Signatures + +For every release after 1.0.5, a GPG signature will be provided in `signatures`. + +The current signature is called `cagebreak.sig`, whereas all older signatures +will be named after their release version. ### Fuzzing diff --git a/meson.build b/meson.build index 9904430..a65d0b6 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('cagebreak', 'c', - version: '1.0.2', + version: '1.0.6', license: 'MIT', default_options: [ 'c_std=c11', @@ -101,18 +101,10 @@ else have_xwayland = false endif -version = '@0@'.format(meson.project_version()) -git = find_program('git', native: true, required: false) -if git.found() - git_commit = run_command([git, 'rev-parse', '--short', 'HEAD']) - git_branch = run_command([git, 'rev-parse', '--abbrev-ref', 'HEAD']) - if git_commit.returncode() == 0 and git_branch.returncode() == 0 - version = '@0@-@1@ (branch \'@2@\')'.format( - meson.project_version(), - git_commit.stdout().strip(), - git_branch.stdout().strip(), - ) - endif +if get_option('version_override') != '' + version = '@0@'.format(get_option('version_override')) +else + version = '@0@'.format(meson.project_version()) endif conf_data = configuration_data() @@ -173,21 +165,49 @@ endforeach foreach header : cagebreak_header_strings cagebreak_headers += files(header) endforeach +cagebreak_dependencies_dict = { + 'server_protos': server_protos, + 'wayland_server': wayland_server, + 'wayland_client': wayland_client, + 'wayland_cursor': wayland_cursor, + 'wlroots': wlroots, + 'xkbcommon': xkbcommon, + 'fontconfig': fontconfig, + 'pixman': pixman, + 'pango': pango, + 'cairo': cairo, + 'pangocairo': pangocairo, + 'math': math +} -cagebreak_dependencies = [ - server_protos, - wayland_server, - wayland_client, - wayland_cursor, - wlroots, - xkbcommon, - fontconfig, - pixman, - math, - pango, - cairo, - pangocairo, -] +reproducible_build_versions = { + 'server_protos': '1.0.6', + 'wayland_server': '1.18.0', + 'wayland_client': '1.18.0', + 'wayland_cursor': '1.18.0', + 'wlroots': '0.10.1', + 'xkbcommon': '0.10.0', + 'fontconfig': '2.13.91', + 'pixman': '0.38.4', + 'pango': '1.44.7', + 'cairo': '1.17.3', + 'pangocairo': '1.44.7', + 'math': '-1' +} + +cagebreak_dependencies = [] + +foreach name, dep : cagebreak_dependencies_dict + cagebreak_dependencies += dep +endforeach + +foreach name, dep : cagebreak_dependencies_dict + if reproducible_build_versions[name] != '-1' and reproducible_build_versions[name] != dep.version() + warning('The installed version of "' + name + '" on your machine (' + dep.version() + ') differs from the one used to generate the binary specified in the README section "Reproducible Builds" (' + reproducible_build_versions[name] + '). Cagebreak does not guarantee a reproducible build for this configuration.' + ) + break + endif +endforeach executable( meson.project_name(), diff --git a/meson_options.txt b/meson_options.txt index 5982c3d..bb96c4f 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,2 +1,3 @@ option('xwayland', type: 'boolean', value: 'false', description: 'Enable support for X11 applications') option('fuzz', type: 'boolean', value: 'false', description: 'Enable building fuzzer targets') +option('version_override', type: 'string', description: 'Set the project version to the string specified. Used for creating hashes for reproducible builds.') diff --git a/seat.c b/seat.c index 57c2b04..7567586 100644 --- a/seat.c +++ b/seat.c @@ -112,7 +112,7 @@ static void update_capabilities(const struct cg_seat *seat) { uint32_t caps = 0; - if(!wl_list_empty(&seat->keyboards)) { + if(!wl_list_empty(&seat->keyboard_groups)) { caps |= WL_SEAT_CAPABILITY_KEYBOARD; } if(!wl_list_empty(&seat->pointers)) { @@ -216,41 +216,41 @@ handle_new_pointer(struct cg_seat *seat, struct wlr_input_device *device) { static int handle_keyboard_repeat(void *data) { - struct cg_keyboard *keyboard = (struct cg_keyboard *)data; - struct wlr_keyboard *wlr_device = keyboard->device->keyboard; - if(keyboard->repeat_keybinding != NULL) { + struct cg_keyboard_group *cg_group = data; + struct wlr_keyboard *wlr_device = + cg_group->wlr_group->input_device->keyboard; + if(cg_group->repeat_keybinding != NULL) { if(wlr_device->repeat_info.rate > 0) { if(wl_event_source_timer_update( - keyboard->key_repeat_timer, + cg_group->key_repeat_timer, 1000 / wlr_device->repeat_info.rate) < 0) { wlr_log(WLR_DEBUG, "failed to update key repeat timer"); } } - run_action((*keyboard->repeat_keybinding)->action, - keyboard->seat->server, - (*keyboard->repeat_keybinding)->data); + run_action((*cg_group->repeat_keybinding)->action, + cg_group->seat->server, + (*cg_group->repeat_keybinding)->data); } return 0; } static void -handle_modifier_event(struct cg_keyboard *keyboard) { - wlr_seat_set_keyboard(keyboard->seat->seat, keyboard->device); - wlr_seat_keyboard_notify_modifiers(keyboard->seat->seat, - &keyboard->device->keyboard->modifiers); +handle_modifier_event(struct wlr_input_device *device, struct cg_seat *seat) { + wlr_seat_set_keyboard(seat->seat, device); + wlr_seat_keyboard_notify_modifiers(seat->seat, + &device->keyboard->modifiers); - wlr_idle_notify_activity(keyboard->seat->server->idle, - keyboard->seat->seat); + wlr_idle_notify_activity(seat->server->idle, seat->seat); } void -keyboard_disarm_key_repeat(struct cg_keyboard *keyboard) { - if(!keyboard) { +keyboard_disarm_key_repeat(struct cg_keyboard_group *group) { + if(!group) { return; } - keyboard->repeat_keybinding = NULL; - if(wl_event_source_timer_update(keyboard->key_repeat_timer, 0) < 0) { + group->repeat_keybinding = NULL; + if(wl_event_source_timer_update(group->key_repeat_timer, 0) < 0) { wlr_log(WLR_DEBUG, "failed to disarm key repeat timer"); } } @@ -258,7 +258,7 @@ keyboard_disarm_key_repeat(struct cg_keyboard *keyboard) { static bool handle_command_key_bindings(struct cg_server *server, xkb_keysym_t sym, uint32_t modifiers, uint32_t mode, - struct cg_keyboard *keyboard) { + struct cg_keyboard_group *group) { struct keybinding **keybinding = find_keybinding( server->keybindings, &(struct keybinding){.key = sym, .mode = mode, .modifiers = modifiers}); @@ -271,15 +271,16 @@ handle_command_key_bindings(struct cg_server *server, xkb_keysym_t sym, "Recognized keybinding pressed (key: %d, mode: %d, modifiers: %d)", sym, mode, modifiers); - if(keyboard->device->keyboard->repeat_info.delay > 0) { - keyboard->repeat_keybinding = keybinding; - if(wl_event_source_timer_update( - keyboard->key_repeat_timer, - keyboard->device->keyboard->repeat_info.delay) < 0) { + if(group->wlr_group->input_device->keyboard->repeat_info.delay > 0) { + group->repeat_keybinding = keybinding; + if(wl_event_source_timer_update(group->key_repeat_timer, + group->wlr_group->input_device + ->keyboard->repeat_info.delay) < + 0) { wlr_log(WLR_DEBUG, "failed to set key repeat timer"); } } - message_clear(keyboard->seat->server->curr_output); + message_clear(group->seat->server->curr_output); run_action((*keybinding)->action, server, (*keybinding)->data); wlr_idle_notify_activity(server->idle, server->seat->seat); return true; @@ -315,42 +316,42 @@ key_is_modifier(const xkb_keysym_t key) { } static void -handle_key_event(struct cg_keyboard *keyboard, void *data) { - struct cg_seat *seat = keyboard->seat; +handle_key_event(struct cg_keyboard_group *group, struct cg_seat *seat, + void *data) { struct wlr_event_keyboard_key *event = data; + struct wlr_input_device *device = group->wlr_group->input_device; /* Translate from libinput keycode to an xkbcommon keycode. */ xkb_keycode_t keycode = event->keycode + 8; const xkb_keysym_t *syms; - int nsyms = xkb_state_key_get_syms(keyboard->device->keyboard->xkb_state, - keycode, &syms); + int nsyms = + xkb_state_key_get_syms(device->keyboard->xkb_state, keycode, &syms); bool handled = false; for(int i = 0; i < nsyms; ++i) { if(event->state == WLR_KEY_PRESSED && !key_is_modifier(syms[i])) { - uint32_t modifiers = - wlr_keyboard_get_modifiers(keyboard->device->keyboard); + uint32_t modifiers = wlr_keyboard_get_modifiers(device->keyboard); /* Get the consumed_modifiers and remove them from the modifier list */ xkb_mod_mask_t consumed_modifiers = - xkb_state_key_get_consumed_mods2( - keyboard->device->keyboard->xkb_state, keycode, - XKB_CONSUMED_MODE_XKB); + xkb_state_key_get_consumed_mods2(device->keyboard->xkb_state, + keycode, + XKB_CONSUMED_MODE_GTK); if(handle_command_key_bindings(seat->server, syms[i], modifiers & ~consumed_modifiers, - seat->mode, keyboard)) { + seat->mode, group)) { handled = true; } - } else if(keyboard->repeat_keybinding != NULL && handled == false) { - keyboard_disarm_key_repeat(keyboard); + } else if(group->repeat_keybinding != NULL && handled == false) { + keyboard_disarm_key_repeat(group); } } if(!handled) { /* Otherwise, we pass it along to the client. */ - wlr_seat_set_keyboard(seat->seat, keyboard->device); + wlr_seat_set_keyboard(seat->seat, device); wlr_seat_keyboard_notify_key(seat->seat, event->time_msec, event->keycode, event->state); } @@ -358,130 +359,28 @@ handle_key_event(struct cg_keyboard *keyboard, void *data) { wlr_idle_notify_activity(seat->server->idle, seat->seat); } -static void -cg_keyboard_group_remove(struct cg_keyboard *keyboard); - -static void -cg_keyboard_destroy(struct cg_keyboard *keyboard) { - struct cg_seat *seat = keyboard->seat; - - if(keyboard->device->keyboard->group != NULL) { - cg_keyboard_group_remove(keyboard); - } - - if(wlr_seat_get_keyboard(seat->seat) == keyboard->device->keyboard) { - wlr_seat_set_keyboard(seat->seat, NULL); - } - - keyboard_disarm_key_repeat(keyboard); - wl_event_source_remove(keyboard->key_repeat_timer); - - free(keyboard); -} - -static void -destroy_empty_wlr_keyboard_group(void *data) { - wlr_keyboard_group_destroy(data); -} - -static void -cg_keyboard_group_remove(struct cg_keyboard *keyboard) { - struct wlr_keyboard_group *wlr_group = keyboard->device->keyboard->group; - - wlr_keyboard_group_remove_keyboard(keyboard->device->keyboard->group, - keyboard->device->keyboard); - - if(wl_list_empty(&wlr_group->devices)) { - wlr_log(WLR_DEBUG, "Destroying empty keyboard group %p", - (void *)wlr_group); - struct cg_keyboard_group *cg_group = wlr_group->data; - wlr_group->data = NULL; - wl_list_remove(&cg_group->link); - wl_list_remove(&cg_group->key.link); - wl_list_remove(&cg_group->modifiers.link); - cg_keyboard_destroy(cg_group->keyboard); - free(cg_group); - - // To prevent use-after-free conditions when handling key events, defer - // freeing the wlr_keyboard_group until idle - if(keyboard->seat->server->running) { - wl_event_loop_add_idle(keyboard->seat->server->event_loop, - destroy_empty_wlr_keyboard_group, wlr_group); - } else { - destroy_empty_wlr_keyboard_group(wlr_group); - } - } -} - -static void -handle_keyboard_destroy(struct wl_listener *listener, void *_data) { - struct cg_keyboard *keyboard = wl_container_of(listener, keyboard, destroy); - struct cg_seat *seat = keyboard->seat; - wl_list_remove(&keyboard->link); - wl_list_remove(&keyboard->destroy.link); - cg_keyboard_destroy(keyboard); - update_capabilities(seat); -} - static void handle_keyboard_group_key(struct wl_listener *listener, void *data) { struct cg_keyboard_group *cg_group = wl_container_of(listener, cg_group, key); - handle_key_event(cg_group->keyboard, data); + handle_key_event(cg_group, cg_group->seat, data); } static void handle_keyboard_group_modifiers(struct wl_listener *listener, void *_data) { struct cg_keyboard_group *group = wl_container_of(listener, group, modifiers); - handle_modifier_event(group->keyboard); -} - -static bool -keymaps_match(struct xkb_keymap *km1, struct xkb_keymap *km2) { - char *km1_str = xkb_keymap_get_as_string(km1, XKB_KEYMAP_FORMAT_TEXT_V1); - char *km2_str = xkb_keymap_get_as_string(km2, XKB_KEYMAP_FORMAT_TEXT_V1); - bool result = strcmp(km1_str, km2_str) == 0; - free(km1_str); - free(km2_str); - return result; -} - -static bool -repeat_info_match(const struct cg_keyboard *a, const struct wlr_keyboard *b) { - return a->device->keyboard->repeat_info.rate == b->repeat_info.rate && - a->device->keyboard->repeat_info.delay == b->repeat_info.delay; -} - -struct cg_keyboard * -cg_keyboard_from_seat(struct cg_seat *seat, struct wlr_input_device *device) { - struct cg_keyboard *keyboard = calloc(1, sizeof(struct cg_keyboard)); - if(keyboard == NULL) { - wlr_log(WLR_ERROR, "Could not allocate new cg_keyboard."); - return NULL; - } - - keyboard->seat = seat; - keyboard->device = device; - - keyboard->key_repeat_timer = wl_event_loop_add_timer( - seat->server->event_loop, handle_keyboard_repeat, keyboard); - - return keyboard; + handle_modifier_event(group->wlr_group->input_device, group->seat); } static void -keyboard_group_add(const struct cg_keyboard *keyboard) { - struct cg_seat *seat = keyboard->seat; - struct wlr_keyboard *wlr_keyboard = keyboard->device->keyboard; +cg_keyboard_group_add(struct wlr_input_device *device, struct cg_seat *seat) { + struct wlr_keyboard *wlr_keyboard = device->keyboard; struct cg_keyboard_group *group; wl_list_for_each(group, &seat->keyboard_groups, link) { struct wlr_keyboard_group *wlr_group = group->wlr_group; - if(keymaps_match(wlr_keyboard->keymap, wlr_group->keyboard.keymap) && - repeat_info_match(keyboard, &wlr_group->keyboard)) { - wlr_log(WLR_DEBUG, "Adding keyboard %p to group %p.", - (void *)keyboard, (void *)wlr_group); - wlr_keyboard_group_add_keyboard(wlr_group, wlr_keyboard); + if(wlr_keyboard_group_add_keyboard(wlr_group, wlr_keyboard)) { + wlr_log(WLR_DEBUG, "Adding keyboard to existing group."); return; } } @@ -493,6 +392,7 @@ keyboard_group_add(const struct cg_keyboard *keyboard) { wlr_log(WLR_ERROR, "Failed to allocate keyboard group."); return; } + cg_group->seat = seat; cg_group->wlr_group = wlr_keyboard_group_create(); if(cg_group->wlr_group == NULL) { wlr_log(WLR_ERROR, "Failed to create wlr keyboard group."); @@ -501,22 +401,12 @@ keyboard_group_add(const struct cg_keyboard *keyboard) { cg_group->wlr_group->data = cg_group; wlr_keyboard_set_keymap(&cg_group->wlr_group->keyboard, - keyboard->device->keyboard->keymap); + device->keyboard->keymap); wlr_keyboard_set_repeat_info(&cg_group->wlr_group->keyboard, - keyboard->device->keyboard->repeat_info.rate, - keyboard->device->keyboard->repeat_info.delay); - wlr_log(WLR_DEBUG, "Created keyboard group %p", - (void *)cg_group->wlr_group); + device->keyboard->repeat_info.rate, + device->keyboard->repeat_info.delay); + wlr_log(WLR_DEBUG, "Created keyboard group."); - cg_group->keyboard = - cg_keyboard_from_seat(seat, cg_group->wlr_group->input_device); - if(cg_group->keyboard == NULL) { - wlr_log(WLR_ERROR, "Failed to create keyboard from seat."); - goto cleanup; - } - - wlr_log(WLR_DEBUG, "Adding keyboard %p to group %p.", (void *)keyboard, - (void *)cg_group->wlr_group); wlr_keyboard_group_add_keyboard(cg_group->wlr_group, wlr_keyboard); wl_list_insert(&seat->keyboard_groups, &cg_group->link); @@ -525,6 +415,10 @@ keyboard_group_add(const struct cg_keyboard *keyboard) { wl_signal_add(&cg_group->wlr_group->keyboard.events.modifiers, &cg_group->modifiers); + + cg_group->key_repeat_timer = wl_event_loop_add_timer( + seat->server->event_loop, handle_keyboard_repeat, cg_group); + cg_group->modifiers.notify = handle_keyboard_group_modifiers; return; @@ -537,16 +431,9 @@ cleanup: static void handle_new_keyboard(struct cg_seat *seat, struct wlr_input_device *device) { - struct cg_keyboard *keyboard = calloc(1, sizeof(struct cg_keyboard)); - if(!keyboard) { - wlr_log(WLR_ERROR, "Cannot allocate keyboard"); - return; - } - struct xkb_context *context = xkb_context_new(XKB_CONTEXT_NO_FLAGS); if(!context) { wlr_log(WLR_ERROR, "Unable to create XBK context"); - free(keyboard); return; } @@ -561,28 +448,19 @@ handle_new_keyboard(struct cg_seat *seat, struct wlr_input_device *device) { if(!keymap) { wlr_log(WLR_ERROR, "Unable to configure keyboard: keymap does not exist"); - free(keyboard); xkb_context_unref(context); return; } - keyboard->seat = seat; - keyboard->device = device; wlr_keyboard_set_keymap(device->keyboard, keymap); xkb_keymap_unref(keymap); xkb_context_unref(context); wlr_keyboard_set_repeat_info(device->keyboard, 25, 600); - keyboard_group_add(keyboard); + cg_keyboard_group_add(device, seat); - wlr_seat_set_keyboard(seat->seat, device->keyboard->group->input_device); - - wl_list_insert(&seat->keyboards, &keyboard->link); - keyboard->destroy.notify = handle_keyboard_destroy; - wl_signal_add(&device->events.destroy, &keyboard->destroy); - keyboard->key_repeat_timer = wl_event_loop_add_timer( - seat->server->event_loop, handle_keyboard_repeat, keyboard); + wlr_seat_set_keyboard(seat->seat, device); } static void @@ -914,9 +792,11 @@ handle_destroy(struct wl_listener *listener, void *_data) { struct cg_seat *seat = wl_container_of(listener, seat, destroy); wl_list_remove(&seat->destroy.link); - struct cg_keyboard *keyboard, *keyboard_tmp; - wl_list_for_each_safe(keyboard, keyboard_tmp, &seat->keyboards, link) { - handle_keyboard_destroy(&keyboard->destroy, NULL); + struct cg_keyboard_group *group, *group_tmp; + wl_list_for_each_safe(group, group_tmp, &seat->keyboard_groups, link) { + wlr_keyboard_group_destroy(group->wlr_group); + wl_event_source_remove(group->key_repeat_timer); + free(group); } struct cg_pointer *pointer, *pointer_tmp; wl_list_for_each_safe(pointer, pointer_tmp, &seat->pointers, link) { @@ -1014,7 +894,6 @@ seat_create(struct cg_server *server, struct wlr_backend *backend) { wl_signal_add(&seat->seat->events.request_set_primary_selection, &seat->request_set_primary_selection); - wl_list_init(&seat->keyboards); wl_list_init(&seat->keyboard_groups); wl_list_init(&seat->pointers); wl_list_init(&seat->touch); diff --git a/seat.h b/seat.h index 7d1d7c7..a7632d7 100644 --- a/seat.h +++ b/seat.h @@ -14,22 +14,11 @@ struct wlr_backend; #define DEFAULT_XCURSOR "left_ptr" #define XCURSOR_SIZE 24 -struct cg_keyboard_group { - struct cg_keyboard *keyboard; - - struct wlr_keyboard_group *wlr_group; - struct cg_seat *seat; - struct wl_listener key; - struct wl_listener modifiers; - struct wl_list link; -}; - struct cg_seat { struct wlr_seat *seat; struct cg_server *server; struct wl_listener destroy; - struct wl_list keyboards; struct wl_list keyboard_groups; struct wl_list pointers; struct wl_list touch; @@ -66,14 +55,16 @@ struct cg_seat { struct cg_view *focused_view; }; -struct cg_keyboard { - struct wl_list link; // seat::keyboards +struct cg_keyboard_group { + struct wlr_keyboard_group *wlr_group; struct cg_seat *seat; - struct wlr_input_device *device; - struct wl_listener destroy; - struct keybinding **repeat_keybinding; + struct wl_listener key; + struct wl_listener modifiers; + struct wl_list link; + struct wl_event_source *key_repeat_timer; + struct keybinding **repeat_keybinding; }; struct cg_pointer { diff --git a/signatures/cagebreak.sig b/signatures/cagebreak.sig new file mode 100644 index 0000000000000000000000000000000000000000..3a641bee171da79f5d93fc627d5230d0786eb715 GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j-ZpKYEIH7WG5|K!!g`E=I|>?~Ua0$zY^*8mC$5XAX( z*9`0|Tc$z}|64$gG`MHKZ=AWaCuyalWsk4kO22O@Vk;D@>@jJuMc1+zpA&G+@{_qV zY9~dDUAwMOK2VHMa&iLO!uOvyglM zhBjpy;1P1#FHLT#7v>lpVVi6Z)1C)>q}@RqNpe^BE8D&&DY2=Mik-G~dS%Sl z0UXfHXw_6n^tAebKouvI4 z_=BR(cP)Ly>xoA^o*f2+Q=qp@z(YPty4N-AOu~Yv{8k&L$Lf7F?L)YbTwZlvADEF0 E$r~dTVE_OC literal 0 HcmV?d00001 diff --git a/view.c b/view.c index acd7603..6b0ed87 100644 --- a/view.c +++ b/view.c @@ -234,10 +234,14 @@ view_unmap(struct cg_view *view) { struct cg_tile *view_tile = view_get_tile(view); wlr_output_damage_add_box(view_tile->workspace->output->damage, &view_tile->tile); - if(view->workspace->server->seat->seat->keyboard_state - .focused_surface == NULL || - view->workspace->server->seat->seat->keyboard_state - .focused_surface == view->wlr_surface) { + if((view->workspace->server->seat->seat->keyboard_state + .focused_surface == NULL || + view->workspace->server->seat->seat->keyboard_state + .focused_surface == view->wlr_surface) && + view->workspace->server->curr_output + ->workspaces[view->workspace->server->curr_output + ->curr_workspace] + ->focused_tile == view_tile) { seat_set_focus(view->workspace->server->seat, prev); } else { view_tile->view = prev; From 9c93e3d4e84bea2eb75591eb90dfe4c5d6bf63cf Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Sun, 29 Mar 2020 12:51:26 +0000 Subject: [PATCH 032/689] Prepare for merge --- Bugs.md | 24 ++++++++++++++++++++++++ meson.build | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/Bugs.md b/Bugs.md index 491d2c6..835fc94 100644 --- a/Bugs.md +++ b/Bugs.md @@ -55,3 +55,27 @@ Steps to reproduce: ``` (EE) failed to read Wayland events: Broken pipe ``` + +### Issue 4 + + github issue number: #1 + Fixed: 1.0.7 + +This issue is code duplication in `parse.c`. + +Github issue text: + +``` +As of right now, the actions which can be run in the config file and the +actions which can be run as a keybinding are parsed separately in `parse.c`. +This leads to a lot of code duplication. Furthermore, unifying these +functionalities would enable a more versatile configuration. For instance, it +would enable the user to write `hsplit` into the configuration file to split +the output on startup and workspace 2 to set the default workspace to +workspace 2. Therefore, this change would simplify the code base, while at +the same time increasing the feature set. + +PS: As a side effect, this would allow quirky statements such as +`bind dbind r hsplit` which would bind the d key to binding the r key to +split the output... +``` diff --git a/meson.build b/meson.build index a65d0b6..e42700b 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('cagebreak', 'c', - version: '1.0.6', + version: '1.0.7', license: 'MIT', default_options: [ 'c_std=c11', From 3461b70baa38bc507362a90423a7d5c60c734432 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 29 Mar 2020 18:02:38 +0200 Subject: [PATCH 033/689] Fix missing ifdef guards --- fuzz/fuzz-parse.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fuzz/fuzz-parse.c b/fuzz/fuzz-parse.c index 24b15cf..e5b75cb 100644 --- a/fuzz/fuzz-parse.c +++ b/fuzz/fuzz-parse.c @@ -86,7 +86,9 @@ drop_permissions(void) { static bool parse_args(struct cg_server *server, int argc, char *argv[]) { server->output_transform = WL_OUTPUT_TRANSFORM_NORMAL; +#ifdef DEBUG server->debug_damage_tracking = false; +#endif return true; } From d54c2ecea9db31265d7c560dac74aaa5ff1bda24 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 29 Mar 2020 23:13:12 +0200 Subject: [PATCH 034/689] Fix version checking for server_protos --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index e42700b..0bf6076 100644 --- a/meson.build +++ b/meson.build @@ -181,7 +181,7 @@ cagebreak_dependencies_dict = { } reproducible_build_versions = { - 'server_protos': '1.0.6', + 'server_protos': '-1', 'wayland_server': '1.18.0', 'wayland_client': '1.18.0', 'wayland_cursor': '1.18.0', From e0e980d8286cc3436861e83fc2e39fc4bd196db6 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Mon, 30 Mar 2020 09:33:28 +0000 Subject: [PATCH 035/689] Fix merging error --- meson.build | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/meson.build b/meson.build index f4b01d1..0bf6076 100644 --- a/meson.build +++ b/meson.build @@ -201,42 +201,6 @@ foreach name, dep : cagebreak_dependencies_dict cagebreak_dependencies += dep endforeach -cagebreak_dependencies_dict = { - 'server_protos': server_protos, - 'wayland_server': wayland_server, - 'wayland_client': wayland_client, - 'wayland_cursor': wayland_cursor, - 'wlroots': wlroots, - 'xkbcommon': xkbcommon, - 'fontconfig': fontconfig, - 'pixman': pixman, - 'pango': pango, - 'cairo': cairo, - 'pangocairo': pangocairo, - 'math': math -} - -reproducible_build_versions = { - 'server_protos': '1.0.6', - 'wayland_server': '1.18.0', - 'wayland_client': '1.18.0', - 'wayland_cursor': '1.18.0', - 'wlroots': '0.10.1', - 'xkbcommon': '0.10.0', - 'fontconfig': '2.13.91', - 'pixman': '0.38.4', - 'pango': '1.44.7', - 'cairo': '1.17.3', - 'pangocairo': '1.44.7', - 'math': '-1' -} - -cagebreak_dependencies = [] - -foreach name, dep : cagebreak_dependencies_dict - cagebreak_dependencies += dep -endforeach - foreach name, dep : cagebreak_dependencies_dict if reproducible_build_versions[name] != '-1' and reproducible_build_versions[name] != dep.version() warning('The installed version of "' + name + '" on your machine (' + dep.version() + ') differs from the one used to generate the binary specified in the README section "Reproducible Builds" (' + reproducible_build_versions[name] + '). Cagebreak does not guarantee a reproducible build for this configuration.' From f25e5d9ec3cd8a3f425385f4c2b0b8dc606f5ad1 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Wed, 1 Apr 2020 11:01:27 +0000 Subject: [PATCH 036/689] Prepare 1.1.0 release - adjust versions - adapt documentation --- Bugs.md | 2 +- README.md | 27 +++++++++++++++++++----- man/cagebreak-config.5.md | 20 ++++++++---------- man/cagebreak.1.md | 2 +- meson.build | 2 +- signatures/{cagebreak.sig => 1.0.6.sig} | Bin 6 files changed, 34 insertions(+), 19 deletions(-) rename signatures/{cagebreak.sig => 1.0.6.sig} (100%) diff --git a/Bugs.md b/Bugs.md index 835fc94..b34f4f6 100644 --- a/Bugs.md +++ b/Bugs.md @@ -59,7 +59,7 @@ Steps to reproduce: ### Issue 4 github issue number: #1 - Fixed: 1.0.7 + Fixed: 1.1.0 This issue is code duplication in `parse.c`. diff --git a/README.md b/README.md index c793ac0..953a7d5 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Cagebreak: A Wayland Tiling Compositor Inspired by Ratpoison This is Cagebreak, a Wayland tiling compositor. The goal of this project is to -provide a successor to ratpoison for wayland users. However, this is +provide a successor to ratpoison for Wayland users. However, this is no reimplementation of ratpoison. Should you like to know if a feature will be implemented, open an issue or get in touch with the development team. @@ -83,7 +83,7 @@ git tag -v version git push --tags origin master ``` -and a log message roughly describing the features is added in the commit. +and a log message roughly describing the features added in the commit. In the past, our git history did not always reflect this scheme. @@ -94,8 +94,9 @@ Release checklist * [ ] Cursory testing * [ ] libfuzzer testing * [ ] Version Number - * [ ] -v flag + * [ ] meson.build * [ ] git tag + * [ ] man pages * [ ] Relevant Documentation * [ ] New features documented * [ ] man page @@ -131,7 +132,7 @@ The full public keys can be found in `keys/` along with any revocation certifica Cagebreak offers reproducible builds given the exact library versions specified in `meson.build`. Should a version mismatch occur, a warning will be emitted. We have decided on this compromise to allow flexibility and security. In general we will -adapt the versions to the packages available under archlinux at the time of +adapt the versions to the packages available under arch linux at the time of release. #### Reproducible Build Instructions @@ -163,12 +164,28 @@ will be named after their release version. Along with the project source code, a fuzzing framework based on `libfuzzer` is supplied. This allows for the testing of the parsing code responsible for reading -the `cagebreak` configuration file. When the `libfuzzer` is available (please +the `cagebreak` configuration file. When `libfuzzer` is available (please use the `clang` compiler to enable it), building the fuzz-testing software can be enabled by passing `-Dfuzz=true` to meson. This generates a `build/fuzz/fuzz-parse` binary according to the `libfuzzer` specifications. Further documentation on how to run this binary can be found [here](https://llvm.org/docs/LibFuzzer.html). +Here is an example workflow: + +``` +rm -rf build +CC=clang meson build -Dfuzz=true +ninja -C build/ +mkdir build/fuzz_corpus +cp examples/config build/fuzz_corpus/ +WLR_BACKENDS=headless ./build/fuzz/fuzz-parse -jobs=12 -max_len=50000 -close_fd_mask=3 build/fuzz_corpus/ +``` + +You may want to tweak `-jobs` or add other options depending on your own setup. +We have found code path discovery to increase rapidly when the fuzzer is supplied +with an initial config file. We are working on improving our fuzzing coverage to +find bugs in other areas of the code. + ## Bugs For any bug, please [create an diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index bbf3096..eebeda2 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -1,4 +1,4 @@ -% CAGEBREAK-CONFIG(1) Version 1.0 | Cagebreak Manual +% CAGEBREAK-CONFIG(1) Version 1.1 | Cagebreak Manual # NAME @@ -21,16 +21,16 @@ by prepending a line with the # symbol. **background - Set background color** > Set the background color. This command expects three floating point numbers -> between 0 and 1, specifying the r,g and b values respectively. +> between 0 and 1, specifying the r, g and b values respectively. > (e.g. "background 1.0 0.0 0.0" sets to background color to red) > There is no support for specifying a background image. -**bind - Bind key to action in command mode** +**bind - Bind key to command in root mode** -> This command requires a key (see **KEY DEFINITIONS**) and an action (see **ACTIONS**) as an argument. +> This command requires a key (see **KEY DEFINITIONS**) and a command (see **COMMANDS**) as an argument. > Subsequently, pressing this key while in command mode executes the -> supplied action. `bind ` is equivalent to -> `definekey root ` +> supplied action. `bind ` is equivalent to +>> `definekey root ` **definekey - Bind key to action in arbitrary mode** @@ -38,13 +38,13 @@ by prepending a line with the # symbol. > difference that the mode in which the keybinding is activated is > specified by the user. A call to this function is to be structured as follows: > ->> `definekey ` +>> `definekey ` **definemode** > This command requires a single argument; the name of the mode to be defined. > Subsequent to a call to this function, the defined mode may be used along with -> the definekey command to create a custom keymapping. Synopsis: +> the definekey command to create a custom key mapping. Synopsis: > >> `definemode ` @@ -64,8 +64,6 @@ by prepending a line with the # symbol. > Requires a single integer larger than 1 and less than 30 as an argument. Sets the number of > workspaces to the supplied number -# ACTIONS - **vsplit** > Split current tile vertically @@ -100,7 +98,7 @@ by prepending a line with the # symbol. **abort** -> Return to the default mode without running any action +> Return to the default mode without running any command **time** diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index 6d5b051..cacd1c2 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -1,4 +1,4 @@ -% CAGEBREAK(1) Version 1.0 | Cagebreak Manual +% CAGEBREAK(1) Version 1.1 | Cagebreak Manual # NAME diff --git a/meson.build b/meson.build index 0bf6076..959d35f 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('cagebreak', 'c', - version: '1.0.7', + version: '1.1.0', license: 'MIT', default_options: [ 'c_std=c11', diff --git a/signatures/cagebreak.sig b/signatures/1.0.6.sig similarity index 100% rename from signatures/cagebreak.sig rename to signatures/1.0.6.sig From 9608770bc7f3c43aebc49074090693739ec9275f Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 1 Apr 2020 13:44:26 +0200 Subject: [PATCH 037/689] Add sanitizers to fuzzer workflow --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 953a7d5..980c786 100644 --- a/README.md +++ b/README.md @@ -174,7 +174,7 @@ Here is an example workflow: ``` rm -rf build -CC=clang meson build -Dfuzz=true +CC=clang meson build -Dfuzz=true -Db_sanitize=address,undefined -Db_lundef=false ninja -C build/ mkdir build/fuzz_corpus cp examples/config build/fuzz_corpus/ From ddae878c851dbdaf2039d10f5301ca22a1944476 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Wed, 1 Apr 2020 11:54:29 +0000 Subject: [PATCH 038/689] Update Hashes and release information --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 953a7d5..fbb6ea6 100644 --- a/README.md +++ b/README.md @@ -148,6 +148,11 @@ ninja -C build For every release after 1.0.5, hashes will be provided. +1.1.0 + + * sha 256: fc393e225c549f893b9e21e8b904e546d5857bac1d905b3d26334c8f8a1cda11 + * sha 512: 8b94b1069e767202bcab087cb592eadc42f0453d17ee119d48760be00bc66278cf0fa60bb09308d30cb551df6a7a3e26e2ab8b29c04f0e953cc6906542cd2d6f + 1.0.6 * sha 256: 712ae9a8f17a9e589e108f0d503da203cc5eaf1c4a6ca6efb5b4c83b432ce0b8 @@ -201,6 +206,10 @@ independent of github, in case this service is unavailable. Adds basic tiling window manager functionality to cage. +### Release 1.1.0 + +Unifies commands and actions. See Issue 4 in Bugs.md. + ## License Please see [LICENSE](https://github.com/project-repo/cagebreak/blob/master/LICENSE) From e0e6fd50bd0a3e8871761018adc1e4b9fc77f71e Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Wed, 1 Apr 2020 11:57:26 +0000 Subject: [PATCH 039/689] Add release signature --- signatures/cagebreak.sig | Bin 0 -> 566 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 signatures/cagebreak.sig diff --git a/signatures/cagebreak.sig b/signatures/cagebreak.sig new file mode 100644 index 0000000000000000000000000000000000000000..ac5a0e800ff52d34973b17b4349461fee72fbd32 GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j-ZpKYEIH7WG5|K!!g`E=I|>?~Ua0$zl9z5ogd5XAX( z*9`0|TO2eH0JT8XB2TlbW_=Xa#kN@qTWL1V>FRsd$`XXjWfmfAwn0iW4MZ|YvHJeIWJfF7KYe&A8|sFKPdA1_Drb%haK7vulHRk zEMD~%b(50NLn5pw!`aLDjT(@M$UFDv2s--0L2nBQE)P{N*5~e{_vwv0$G0=EA=Bvn zZ8UxfiQ&n=5b7$KTxX|U0Lqfxe5cOlCH*kTg7Zy2T7{i0K(`ZryMgc_6sifgmu?YM zrz`#KXmh*1yEh9uWyl2>1}jRf>MDZOY%v)#J@hnSQguMrM@%jLr)bjhvCY3dP+X2!IIcI+tJ-9R-P+)!(96Nss%)jo$0`9L1W zzHaSL4fo5r)T7FcHo0nBw^&s~@EB=I(@Bb{-P Date: Wed, 1 Apr 2020 14:43:48 +0200 Subject: [PATCH 040/689] Reorder commands --- man/cagebreak-config.5.md | 186 +++++++++++++++++++------------------- 1 file changed, 93 insertions(+), 93 deletions(-) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index eebeda2..dffc8b3 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -18,6 +18,10 @@ by prepending a line with the # symbol. ## COMMANDS +**abort** + +> Return to the default mode without running any command + **background - Set background color** > Set the background color. This command expects three floating point numbers @@ -53,88 +57,9 @@ by prepending a line with the # symbol. > Defines the key with which the current mode can be changed to "root". > `escape ` is equivalent to `definekey top switch_mode root` -**exec** +**exchangedown** -> Executes the supplied shell command using *`sh -c ""`*. Synopsis: -> ->> `exec ` - -**workspaces** - -> Requires a single integer larger than 1 and less than 30 as an argument. Sets the number of -> workspaces to the supplied number - -**vsplit** - -> Split current tile vertically - -**hsplit** - -> Split current tile horizontally - -**quit** - -> Exit cagebreak - -**focus** - -> Focus next tile - -**focusprev** - -> Focus previous tile - -**next** - -> Focus next window in current tile - -**prev** - -> Focus previous window in current tile - -**only** - -> Remove all splits and make the current window fill the entire screen - -**abort** - -> Return to the default mode without running any command - -**time** - -> Display time - -**nextscreen** - -> Focus the next screen - -**prevscreen** - -> Focus the previous screen - -**resizeleft** - -> Resize the current tile towards the left - -**resizeright** - -> Resize the current tile towards the right - -**resizedown** - -> Resize the current tile towards the bottom - -**resizeup** - -> Resize the current tile towards the top - -**workspace ** - -> Change to the n-th workspace - -**movetoworkspace ** - -> Move the currently focused window to the n-th workspace +> Exchange the current window with the window in the tile to the bottom **exchangeleft** @@ -148,14 +73,28 @@ by prepending a line with the # symbol. > Exchange the current window with the window in the tile to the top -**exchangedown** +**exec** -> Exchange the current window with the window in the tile to the bottom +> Executes the supplied shell command using *`sh -c ""`*. Synopsis: +> +>> `exec ` + +**focus** + +> Focus next tile + +**focusdown** + +> Focus the tile to the bottom **focusleft** > Focus the tile to the left +**focusprev** + +> Focus previous tile + **focusright** > Focus the tile to the right @@ -164,26 +103,87 @@ by prepending a line with the # symbol. > Focus the tile to the top -**focusdown** +**hsplit** -> Focus the tile to the bottom - -**movetonextscreen** - -> Move the current window to the next screen - -**switchvt ** - -> Switch to tty n +> Split current tile horizontally **mode ** > Enter mode "``". After a keybinding is processed, return to default mode +**movetonextscreen** + +> Move the current window to the next screen + +**movetoworkspace ** + +> Move the currently focused window to the n-th workspace + +**next** + +> Focus next window in current tile + +**nextscreen** + +> Focus the next screen + +**only** + +> Remove all splits and make the current window fill the entire screen + +**prev** + +> Focus previous window in current tile + +**prevscreen** + +> Focus the previous screen + +**quit** + +> Exit cagebreak + +**resizedown** + +> Resize the current tile towards the bottom + +**resizeleft** + +> Resize the current tile towards the left + +**resizeright** + +> Resize the current tile towards the right + +**resizeup** + +> Resize the current tile towards the top + **setmode ** > Set the default mode to `` +**switchvt ** + +> Switch to tty n + +**time** + +> Display time + +**vsplit** + +> Split current tile vertically + +**workspace ** + +> Change to the n-th workspace + +**workspaces** + +> Requires a single integer larger than 1 and less than 30 as an argument. Sets the number of +> workspaces to the supplied number + # MODES By default, three modes are defined: From 484ad8280e144258652f17a1ea5292572a705780 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 4 Apr 2020 09:26:00 +0200 Subject: [PATCH 041/689] Make include paths more intuitive --- fuzz/fuzz-parse.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/fuzz/fuzz-parse.c b/fuzz/fuzz-parse.c index e5b75cb..e4dcd06 100644 --- a/fuzz/fuzz-parse.c +++ b/fuzz/fuzz-parse.c @@ -47,18 +47,18 @@ #include #endif -#include "idle_inhibit_v1.h" -#include "keybinding.h" -#include "message.h" -#include "output.h" -#include "parse.h" -#include "seat.h" -#include "server.h" -#include "view.h" -#include "workspace.h" -#include "xdg_shell.h" +#include "../idle_inhibit_v1.h" +#include "../keybinding.h" +#include "../message.h" +#include "../output.h" +#include "../parse.h" +#include "../seat.h" +#include "../server.h" +#include "../view.h" +#include "../workspace.h" +#include "../xdg_shell.h" #if CG_HAS_XWAYLAND -#include "xwayland.h" +#include "../xwayland.h" #endif #ifndef WAIT_ANY From ce9b68d44834ae3cd258447d5495bcc1051d693b Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 4 Apr 2020 21:33:54 +0200 Subject: [PATCH 042/689] Squashed commit of the following: commit 27fa2b70b9d45a41860bf5332ba80f8d6b11bc8e Merge: 1a87477 6fdc55c Author: Cagebreak Signing Key 1 Date: Mon Mar 2 18:45:11 2020 +0000 Merge branch 'output_config' of https://github.com/project-repo/cagebreak into output_config commit 6fdc55c9a55edd187d63bf92f78365d4440fb845 Author: project-repo Date: Fri Feb 28 17:30:06 2020 +0100 Add missing functionality to output configuration commit 33d245b60bfe86025d9244490bf144679af606f3 Author: project-repo Date: Wed Feb 26 07:56:28 2020 +0100 Add example of "output" command usage commit 0d4bb36068cf27854ba45423071111b285cee174 Author: project-repo Date: Wed Feb 26 07:55:25 2020 +0100 Add documentation for "output" command commit a2cc047132b31cbe4e7a87da4b033a827fad4087 Author: project-repo Date: Sun Feb 23 16:53:47 2020 +0100 Add support for output layout configuration --- cagebreak.c | 16 ++++++ examples/config | 5 ++ fuzz/fuzz-parse.c | 17 +++++-- man/cagebreak-config.5.md | 7 +++ output.c | 75 ++++++++++++++++++++++++--- output.h | 11 +++- parse.c | 103 ++++++++++++++++++++++++++++++++++++++ server.h | 2 + 8 files changed, 225 insertions(+), 11 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index ba359e5..03cd5b9 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -310,6 +310,8 @@ main(int argc, char *argv[]) { goto end; } + wl_list_init(&server.output_config); + renderer = wlr_backend_get_renderer(backend); wlr_renderer_init_wl_display(renderer, server.wl_display); @@ -509,6 +511,13 @@ main(int argc, char *argv[]) { free(config_file); } + { + struct cg_output *output; + wl_list_for_each(output, &server.outputs, link) { + output_configure(&server, output); + } + } + /* Place the cursor to the topl left of the output layout. */ wlr_cursor_warp(server.seat->cursor, NULL, 0, 0); @@ -526,6 +535,13 @@ end: } free(server.modes); + struct cg_output_config *output_config, *output_config_tmp; + wl_list_for_each_safe(output_config, output_config_tmp, &server.output_config, link) { + wl_list_remove(&output_config->link); + free(output_config->output_name); + free(output_config); + } + keybinding_list_free(server.keybindings); wl_event_source_remove(sigint_source); wl_event_source_remove(sigterm_source); diff --git a/examples/config b/examples/config index cd7ee3c..0f0a5b0 100644 --- a/examples/config +++ b/examples/config @@ -70,3 +70,8 @@ definekey top XF86AudioLowerVolume exec pactl set-sink-mute 0 off&&amixer set Ma definekey top XF86AudioRaiseVolume exec pactl set-sink-mute 0 off&&amixer set Master 1%+ definekey top XF86MonBrightnessDown exec xbacklight -dec 1 definekey top XF86MonBrightnessUp exec xbacklight -inc 1 + +###################### +#Output configuration +###################### +#output eDP-1 pos 0 0 res 1366x768 rate 60 diff --git a/fuzz/fuzz-parse.c b/fuzz/fuzz-parse.c index e4dcd06..ff13a15 100644 --- a/fuzz/fuzz-parse.c +++ b/fuzz/fuzz-parse.c @@ -8,10 +8,13 @@ #define _POSIX_C_SOURCE 200812L -#include "config.h" -#include -#include +#include "../keybinding.h" +#include "../parse.h" +#include "../seat.h" +#include "../server.h" +#include "../output.h" +#include #include #include #include @@ -443,5 +446,13 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { } server.modes[3] = NULL; server.modes = realloc(server.modes, 4 * sizeof(char *)); + + struct cg_output_config *output_config, *output_config_tmp; + wl_list_for_each_safe(output_config, output_config_tmp, &server.output_config, link) { + wl_list_remove(&output_config->link); + free(output_config->output_name); + free(output_config); + } + return 0; } diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index dffc8b3..cdcf229 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -131,6 +131,13 @@ by prepending a line with the # symbol. > Remove all splits and make the current window fill the entire screen +**output pos res x rate ** + +> Configure the output "". and are the position of the monitor +> in pixels. The top-left monitor should have the coordinates 0 0. and +> specify the resolution in pixels and sets the refresh rate of +> the monitor (often this is 50 or 60). + **prev** > Focus previous window in current tile diff --git a/output.c b/output.c index 4fd6960..7983983 100644 --- a/output.c +++ b/output.c @@ -480,6 +480,72 @@ handle_output_destroy(struct wl_listener *listener, void *data) { output_destroy(output); } +struct cg_output_config* +output_find_config(struct cg_server* server, struct wlr_output* output) { + struct cg_output_config *config; + wl_list_for_each(config, &server->output_config, link) { + if(strcmp(config->output_name, output->name) == 0) { + return config; + } + } + return NULL; +} + +static void output_set_mode(struct wlr_output *output, int width, int height, + float refresh_rate) { + int mhz = (int)(refresh_rate * 1000); + + if (wl_list_empty(&output->modes)) { + wlr_log(WLR_DEBUG, "Assigning custom mode to %s", output->name); + wlr_output_set_custom_mode(output, width, height, + refresh_rate > 0 ? mhz : 0); + return; + } + + struct wlr_output_mode *mode, *best = NULL; + wl_list_for_each(mode, &output->modes, link) { + if (mode->width == width && mode->height == height) { + if (mode->refresh == mhz) { + best = mode; + break; + } + if (best == NULL || mode->refresh > best->refresh) { + best = mode; + } + } + } + if (!best) { + wlr_log(WLR_ERROR, "Configured mode for %s not available", output->name); + wlr_log(WLR_INFO, "Picking preferred mode instead"); + best = wlr_output_preferred_mode(output); + } else { + wlr_log(WLR_DEBUG, "Assigning configured mode to %s", output->name); + } + wlr_output_set_mode(output, best); +} + +void +output_configure(struct cg_server* server, struct cg_output *output) { + struct wlr_output *wlr_output = output->wlr_output; + struct cg_output_config *config = output_find_config(server, wlr_output); + if(output->wlr_output->enabled) { + wlr_output_layout_remove(server->output_layout, wlr_output); + } + + if(config == NULL) { + wlr_output_layout_add_auto(server->output_layout, wlr_output); + + struct wlr_output_mode *preferred_mode = + wlr_output_preferred_mode(wlr_output); + if(preferred_mode) { + wlr_output_set_mode(wlr_output, preferred_mode); + } + } else { + output_set_mode(wlr_output, config->pos.width, config->pos.height, config->refresh_rate); + wlr_output_layout_add(server->output_layout, wlr_output, config->pos.x, config->pos.y); + } +} + void handle_new_output(struct wl_listener *listener, void *data) { struct cg_server *server = wl_container_of(listener, server, new_output); @@ -508,7 +574,8 @@ handle_new_output(struct wl_listener *listener, void *data) { wl_signal_add(&output->damage->events.destroy, &output->damage_destroy); wlr_output_set_transform(wlr_output, server->output_transform); - wlr_output_layout_add_auto(server->output_layout, wlr_output); + + output_configure(server, output); output->workspaces = malloc(server->nws * sizeof(struct cg_workspace *)); for(unsigned int i = 0; i < server->nws; ++i) { @@ -520,12 +587,6 @@ handle_new_output(struct wl_listener *listener, void *data) { output->curr_workspace = 0; wl_list_init(&output->messages); - struct wlr_output_mode *preferred_mode = - wlr_output_preferred_mode(wlr_output); - if(preferred_mode) { - wlr_output_set_mode(wlr_output, preferred_mode); - } - if(wlr_xcursor_manager_load(server->seat->xcursor_manager, wlr_output->scale)) { wlr_log(WLR_ERROR, diff --git a/output.h b/output.h index ffca3e7..ba12ea6 100644 --- a/output.h +++ b/output.h @@ -2,13 +2,13 @@ #define CG_OUTPUT_H #include +#include struct cg_server; struct cg_view; struct wlr_output; struct wlr_output_damage; struct wlr_surface; -struct wlr_box; struct cg_output { struct cg_server *server; @@ -27,6 +27,13 @@ struct cg_output { struct wl_list link; // cg_server::outputs }; +struct cg_output_config { + struct wlr_box pos; + char* output_name; + float refresh_rate; + struct wl_list link;// cg_server::output_config +}; + typedef void (*cg_surface_iterator_func_t)(struct cg_output *output, struct wlr_surface *surface, struct wlr_box *box, @@ -35,6 +42,8 @@ typedef void (*cg_surface_iterator_func_t)(struct cg_output *output, void handle_new_output(struct wl_listener *listener, void *data); void +output_configure(struct cg_server* server, struct cg_output* output); +void output_surface_for_each_surface(struct cg_output *output, struct wlr_surface *surface, double ox, double oy, cg_surface_iterator_func_t iterator, diff --git a/parse.c b/parse.c index cb6abe3..dae5164 100644 --- a/parse.c +++ b/parse.c @@ -3,6 +3,7 @@ #include #include #include +#include #include "keybinding.h" #include "output.h" @@ -192,6 +193,104 @@ parse_workspaces(char **saveptr) { return nws; } +int +parse_uint(char **saveptr, const char* delim) { + char *uint_str = strtok_r(NULL, delim, saveptr); + if(uint_str == NULL) { + wlr_log(WLR_ERROR, "Expected a non-negative integer, got nothing"); + return -1; + } + long uint = strtol(uint_str, NULL, 10); + if(uint >= 0 && uint <= INT_MAX) { + return uint; + } else { + wlr_log(WLR_ERROR, "Error parsing non-negative integer. Must be a number larger or equal to 0 and less or equal to %d",INT_MAX); + return -1; + } +} + +float +parse_float(char **saveptr, const char* delim) { + char *uint_str = strtok_r(NULL, delim, saveptr); + if(uint_str == NULL) { + wlr_log(WLR_ERROR, "Expected a non-negative float, got nothing"); + return -1; + } + float ufloat = strtof(uint_str, NULL); + if(ufloat >= 0) { + return ufloat; + } else { + wlr_log(WLR_ERROR, "Error parsing non-negative float. Must be a number larger or equal to 0"); + return -1; + } +} + +int +parse_output_config(struct wl_list *config_list, char **saveptr) { + struct cg_output_config* cfg = malloc(sizeof(struct cg_output_config)); + char *name = strtok_r(NULL, " ", saveptr); + if(name == NULL) { + wlr_log(WLR_ERROR, "Expected name of output to be configured, got none"); + goto error; + } + char *pos_str = strtok_r(NULL, " ", saveptr); + if(pos_str == NULL || strcmp(pos_str, "pos") != 0) { + wlr_log(WLR_ERROR, "Expected keyword \"pos\" in output configuration for output %s", name); + goto error; + } + + cfg->pos.x = parse_uint(saveptr, " "); + if(cfg->pos.x < 0) { + wlr_log(WLR_ERROR, "Error parsing x coordinate of output configuration for output %s", name); + goto error; + } + + cfg->pos.y = parse_uint(saveptr, " "); + if(cfg->pos.y < 0) { + wlr_log(WLR_ERROR, "Error parsing y coordinate of output configuration for output %s", name); + goto error; + } + + char *res_str = strtok_r(NULL, " ", saveptr); + if(res_str == NULL || strcmp(res_str, "res") != 0) { + wlr_log(WLR_ERROR, "Expected keyword \"res\" in output configuration for output %s", name); + goto error; + } + + cfg->pos.width = parse_uint(saveptr, "x"); + if(cfg->pos.width <= 0) { + wlr_log(WLR_ERROR, "Error parsing width of output configuration for output %s (hint: width must be larger than 0)", name); + goto error; + } + + cfg->pos.height = parse_uint(saveptr, " "); + if(cfg->pos.height <= 0) { + wlr_log(WLR_ERROR, "Error parsing height of output configuration for output %s (hint: height must e larger than 0)", name); + goto error; + } + + char *rate_str = strtok_r(NULL, " ", saveptr); + if(rate_str == NULL || strcmp(rate_str, "rate") != 0) { + wlr_log(WLR_ERROR, "Expected keyword \"rate\" in output configuration for output %s", name); + goto error; + } + + cfg->refresh_rate = parse_float(saveptr, " "); + if(cfg->refresh_rate <= 0.0) { + wlr_log(WLR_ERROR, "Error parsing refresh rate of output configuration for output %s", name); + goto error; + } + + cfg->output_name = strdup(name); + wl_list_insert(config_list, &cfg->link); + return 0; + +error: + free(cfg); + wlr_log(WLR_ERROR, "Output configuration must be of the form \"output pos res x rate "); + return -1; +} + int parse_command(struct cg_server *server, struct keybinding *keybinding, char *saveptr) { @@ -380,6 +479,10 @@ parse_command(struct cg_server *server, struct keybinding *keybinding, if(keybinding->data.i < 0) { return -1; } + } else if(strcmp(action, "output") == 0) { + if(parse_output_config(&server->output_config, &saveptr) != 0) { + return -1; + } } else { wlr_log(WLR_ERROR, "Error, unsupported action \"%s\".", action); return -1; diff --git a/server.h b/server.h index 92a9172..930cb56 100644 --- a/server.h +++ b/server.h @@ -11,6 +11,7 @@ struct cg_output; struct keybinding_list; struct wlr_output_layout; struct wlr_idle_inhibit_manager_v1; +struct cg_output_config; struct cg_server { struct wl_display *wl_display; @@ -35,6 +36,7 @@ struct cg_server { #endif struct keybinding_list *keybindings; + struct wl_list output_config; enum wl_output_transform output_transform; From 50be52b7fc2d19eecba2836f3575bb8392668920 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 4 Apr 2020 21:47:07 +0200 Subject: [PATCH 043/689] Fix bug in fuzzer --- fuzz/fuzz-parse.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fuzz/fuzz-parse.c b/fuzz/fuzz-parse.c index ff13a15..2103a20 100644 --- a/fuzz/fuzz-parse.c +++ b/fuzz/fuzz-parse.c @@ -200,6 +200,8 @@ LLVMFuzzerInitialize(int *argc, char ***argv) { goto end; } + wl_list_init(&server.output_config); + renderer = wlr_backend_get_renderer(backend); wlr_renderer_init_wl_display(renderer, server.wl_display); From 3f277d2b7f13e955fa27b23d60decf303963664d Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Thu, 9 Apr 2020 17:31:35 +0000 Subject: [PATCH 044/689] Prepare new release - Update version numbers --- README.md | 4 ++++ man/cagebreak-config.5.md | 2 +- man/cagebreak.1.md | 2 +- meson.build | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 619fd75..33e0e35 100644 --- a/README.md +++ b/README.md @@ -210,6 +210,10 @@ Adds basic tiling window manager functionality to cage. Unifies commands and actions. See Issue 4 in Bugs.md. +### Release 1.2.0 + +Adds output configuration as described in the man pages. + ## License Please see [LICENSE](https://github.com/project-repo/cagebreak/blob/master/LICENSE) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index cdcf229..8f9cb72 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -1,4 +1,4 @@ -% CAGEBREAK-CONFIG(1) Version 1.1 | Cagebreak Manual +% CAGEBREAK-CONFIG(1) Version 1.2 | Cagebreak Manual # NAME diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index cacd1c2..07c0058 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -1,4 +1,4 @@ -% CAGEBREAK(1) Version 1.1 | Cagebreak Manual +% CAGEBREAK(1) Version 1.2 | Cagebreak Manual # NAME diff --git a/meson.build b/meson.build index 959d35f..148a3e2 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('cagebreak', 'c', - version: '1.1.0', + version: '1.2.0', license: 'MIT', default_options: [ 'c_std=c11', From da8d0304a61a4c508e4c6661ec0aa787978f1d6f Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 12 Apr 2020 09:07:54 +0200 Subject: [PATCH 045/689] Remove keyboard group from list on destroy --- seat.c | 1 + 1 file changed, 1 insertion(+) diff --git a/seat.c b/seat.c index 7567586..ae8e52f 100644 --- a/seat.c +++ b/seat.c @@ -794,6 +794,7 @@ handle_destroy(struct wl_listener *listener, void *_data) { struct cg_keyboard_group *group, *group_tmp; wl_list_for_each_safe(group, group_tmp, &seat->keyboard_groups, link) { + wl_list_remove(&group->link); wlr_keyboard_group_destroy(group->wlr_group); wl_event_source_remove(group->key_repeat_timer); free(group); From 91bf4913b20e50e18d699fda6100813d45c1f688 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Thu, 14 May 2020 13:26:34 +0000 Subject: [PATCH 046/689] Update dependency version --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 148a3e2..38b46f7 100644 --- a/meson.build +++ b/meson.build @@ -188,7 +188,7 @@ reproducible_build_versions = { 'wlroots': '0.10.1', 'xkbcommon': '0.10.0', 'fontconfig': '2.13.91', - 'pixman': '0.38.4', + 'pixman': '0.40.0', 'pango': '1.44.7', 'cairo': '1.17.3', 'pangocairo': '1.44.7', From 9a5b26716f8eba0023f8c048ecb69606187a4f36 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Thu, 14 May 2020 14:21:00 +0000 Subject: [PATCH 047/689] Remove -Wall because warning_level=3 includes it --- meson.build | 1 - 1 file changed, 1 deletion(-) diff --git a/meson.build b/meson.build index 38b46f7..40c09d7 100644 --- a/meson.build +++ b/meson.build @@ -10,7 +10,6 @@ project('cagebreak', 'c', add_project_arguments( [ '-DWLR_USE_UNSTABLE', - '-Wall', '-Wundef', '-Wno-unused-parameter', ], From 212da7a3454de94e0ce2763ed9e88514b7311faa Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Thu, 14 May 2020 14:42:09 +0000 Subject: [PATCH 048/689] Add binary hashes --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 33e0e35..0eb113b 100644 --- a/README.md +++ b/README.md @@ -148,6 +148,11 @@ ninja -C build For every release after 1.0.5, hashes will be provided. +1.2.0 + + * sha 256: b3c6135833001a0ef600ea9628cca11f4130a524ebe748929d8f7bad034f2bf0 + * sha 512: c044a086a9f65b0d27d05e2f12a20fe5d77386fc5682991c13a1894a84804bcd337c9167235869661d6e6581133521bd710ef2330066a5d2e2703d1630042f3f + 1.1.0 * sha 256: fc393e225c549f893b9e21e8b904e546d5857bac1d905b3d26334c8f8a1cda11 From a0a6b2625da8371a852e854d123a27c768dc6027 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Thu, 14 May 2020 14:52:40 +0000 Subject: [PATCH 049/689] Add release signature --- signatures/1.1.0.sig | Bin 0 -> 566 bytes signatures/cagebreak.sig | Bin 566 -> 566 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 signatures/1.1.0.sig diff --git a/signatures/1.1.0.sig b/signatures/1.1.0.sig new file mode 100644 index 0000000000000000000000000000000000000000..ac5a0e800ff52d34973b17b4349461fee72fbd32 GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j-ZpKYEIH7WG5|K!!g`E=I|>?~Ua0$zl9z5ogd5XAX( z*9`0|TO2eH0JT8XB2TlbW_=Xa#kN@qTWL1V>FRsd$`XXjWfmfAwn0iW4MZ|YvHJeIWJfF7KYe&A8|sFKPdA1_Drb%haK7vulHRk zEMD~%b(50NLn5pw!`aLDjT(@M$UFDv2s--0L2nBQE)P{N*5~e{_vwv0$G0=EA=Bvn zZ8UxfiQ&n=5b7$KTxX|U0Lqfxe5cOlCH*kTg7Zy2T7{i0K(`ZryMgc_6sifgmu?YM zrz`#KXmh*1yEh9uWyl2>1}jRf>MDZOY%v)#J@hnSQguMrM@%jLr)bjhvCY3dP+X2!IIcI+tJ-9R-P+)!(96Nss%)jo$0`9L1W zzHaSL4fo5r)T7FcHo0nBw^&s~@EB=I(@Bb{-P;=&|eqh z+5NTd^Vmn-Yf;hi9?v`un2@!jWj@ zpD7oQnvI3QO^SRPx;FLXS9Rlm>Dx)uj8~KZ>RgVL!w5-k+kZM))aP;Pbmou%1JxGZ zR{zN*1;o~TVdW3#Uhb`Q;<~fz(B5R11P_n7GbgxufMMH|;&cYcrf0+lhUl*@Sn_Z7 zO^Hac&@>)&^p^SdC0LWmvXnu%7haaK-Fv!OoG4^HWi=?$-!mjgX1lla;a$<^S$QFa zrqH=c&T|}&y?;NqT;}DaOMfUBH!W2p>k75}i_PWNVG8!F z49YIZ#D`M?vELRP?_B3u2=nW$b!Y_giac^m@a9zxO_FsRRuDV~RxC_}!#stghbW|4 zj`6TbAd4Q@>kHq)$ delta 542 zcmV+(0^$9(1hxc_BY%W>z5ogd5XAX(*9`0|TO2eH0JT8XB2TlbW_=Xa#kN@qTWL1V z>FRsd$`XXjWfmfAwn0iW4MZ|YvHCHnh{!wl=LkCb z!a;8f2`&#+FV^Soqxb2JJIA*(up!gv{cSXU35ns!zYyvwnOtY5T>#3G-F&Cc<|X|w z$%6AuK3avHEq_3_6Mwsb@F5hc3AdMS5mcuu{q1OTyS}?O3p!=U1sDb^O0DWDg4Jv> z88bcfG+>0J?N1H&%YV7lqsomoxoTVEqR{@|j?eq+ zf_Wszus)TC);~$H9CeLJWCm>7Ssiobp&>ao;G33i?%Kke3Sv?%2suKd!K7J+77HoU z&jO)2-!K8RgC50dKWg-iA^OEiO}_fo5 Date: Wed, 20 May 2020 11:53:46 +0200 Subject: [PATCH 050/689] Apply fixes suggested by -fanalyze --- cagebreak.c | 17 ++++++++++++++++- keybinding.c | 15 +++++++++++++-- message.c | 15 +++++++++++++++ output.c | 8 ++++++++ parse.c | 14 +++++++++++++- workspace.c | 26 ++++++++++++++++++++------ workspace.h | 4 ++-- 7 files changed, 87 insertions(+), 12 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index 03cd5b9..28ba139 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -198,10 +198,12 @@ set_configuration(struct cg_server *server, if(parse_rc_line(server, line) != 0) { wlr_log(WLR_ERROR, "Error in config file \"%s\", line %d\n", config_file_path, line_num); + fclose(config_file); return -1; } } } + fclose(config_file); return 0; } @@ -218,6 +220,10 @@ get_config_file() { } char *config_path = malloc( (strlen(config_home_path) + strlen(addition) + 1) * sizeof(char)); + if(!config_path) { + wlr_log(WLR_ERROR, "Failed to allocate space for configuration path"); + return NULL; + } sprintf(config_path, "%s%s", config_home_path, addition); return config_path; } @@ -256,6 +262,12 @@ main(int argc, char *argv[]) { wlr_log_init(WLR_ERROR, NULL); #endif + server.modes = malloc(4 * sizeof(char *)); + if(!server.modes) { + wlr_log(WLR_ERROR,"Error allocating mode array"); + return -1; + } + /* Wayland requires XDG_RUNTIME_DIR to be set. */ if(!getenv("XDG_RUNTIME_DIR")) { wlr_log(WLR_ERROR, "XDG_RUNTIME_DIR is not set in the environment"); @@ -270,11 +282,14 @@ main(int argc, char *argv[]) { server.running = true; - server.modes = malloc(4 * sizeof(char *)); server.modes[0] = strdup("top"); server.modes[1] = strdup("root"); server.modes[2] = strdup("resize"); server.modes[3] = NULL; + if(!server.modes[0]||!server.modes[1]||server.modes[2]) { + wlr_log(WLR_ERROR,"Error allocating default modes"); + goto end; + } server.nws = 1; server.message_timeout = 2; diff --git a/keybinding.c b/keybinding.c index f6f5eaf..c9fe665 100644 --- a/keybinding.c +++ b/keybinding.c @@ -453,8 +453,10 @@ keybinding_workspace_fullscreen(struct cg_server *server) { } workspace_free_tiles(output->workspaces[output->curr_workspace]); - full_screen_workspace_tiles(output, - output->workspaces[output->curr_workspace]); + if(full_screen_workspace_tiles(server->output_layout,output->wlr_output, output->workspaces[output->curr_workspace])!=0) { + wlr_log(WLR_ERROR, "Failed to allocate space for fullscreen workspace"); + return; + } seat_set_focus(server->seat, current_view); } @@ -517,6 +519,10 @@ keybinding_split_output(struct cg_output *output, bool vertical) { } struct cg_tile *new_tile = calloc(1, sizeof(struct cg_tile)); + if(!new_tile) { + wlr_log(WLR_ERROR, "Failed to allocate new tile for splitting"); + return; + } new_tile->tile.x = new_x; new_tile->tile.y = new_y; new_tile->tile.width = x + width - new_x; @@ -741,6 +747,11 @@ keybinding_set_nws(struct cg_server *server, int nws) { output->workspaces = new_workspaces; for(int i = server->nws; i < nws; ++i) { output->workspaces[i] = full_screen_workspace(output); + if(!output->workspaces[i]) { + wlr_log(WLR_ERROR, "Failed to allocate additional workspaces"); + return; + } + wl_list_init(&output->workspaces[i]->views); wl_list_init(&output->workspaces[i]->unmanaged_views); } diff --git a/message.c b/message.c index 40ac033..bc24928 100644 --- a/message.c +++ b/message.c @@ -7,6 +7,7 @@ #include #include #include +#include #include "cairo.h" #include "message.h" @@ -98,6 +99,11 @@ void message_set_output(struct cg_output *output, const char *string, struct wlr_box *box, enum cg_message_align align) { struct cg_message *message = malloc(sizeof(struct cg_message)); + if(!message) { + wlr_log(WLR_ERROR, "Error allocating message structure"); + free(box); + return; + } message->message = create_message_texture(string, output); message->position = box; wl_list_insert(&output->messages, &message->link); @@ -136,6 +142,10 @@ void message_printf(struct cg_output *output, const char *fmt, ...) { uint16_t buf_len = 256; char *buffer = (char *)malloc(buf_len * sizeof(char)); + if(buffer == NULL) { + wlr_log(WLR_ERROR, "Failed to allocate buffer in message_printf"); + return; + } va_list ap; va_start(ap, fmt); @@ -143,6 +153,11 @@ message_printf(struct cg_output *output, const char *fmt, ...) { va_end(ap); struct wlr_box *box = malloc(sizeof(struct wlr_box)); + if(box == NULL) { + wlr_log(WLR_ERROR, "Failed to allocate box in message_printf"); + free(buffer); + return; + } struct wlr_box *output_box = wlr_output_layout_get_box( output->server->output_layout, output->wlr_output); diff --git a/output.c b/output.c index 7983983..dbf75b5 100644 --- a/output.c +++ b/output.c @@ -580,6 +580,10 @@ handle_new_output(struct wl_listener *listener, void *data) { output->workspaces = malloc(server->nws * sizeof(struct cg_workspace *)); for(unsigned int i = 0; i < server->nws; ++i) { output->workspaces[i] = full_screen_workspace(output); + if(!output->workspaces[i]) { + wlr_log(WLR_ERROR, "Failed to allocate workspaces for output"); + return; + } wl_list_init(&output->workspaces[i]->views); wl_list_init(&output->workspaces[i]->unmanaged_views); } @@ -603,6 +607,10 @@ handle_new_output(struct wl_listener *listener, void *data) { for(unsigned int i = 0; i < server->nws; ++i) { workspace_free(output->workspaces[i]); output->workspaces[i] = full_screen_workspace(output); + if(!output->workspaces[i]) { + wlr_log(WLR_ERROR, "Failed to allocate workspaces for output"); + return; + } wl_list_init(&output->workspaces[i]->views); wl_list_init(&output->workspaces[i]->unmanaged_views); } diff --git a/parse.c b/parse.c index dae5164..33082c8 100644 --- a/parse.c +++ b/parse.c @@ -67,7 +67,11 @@ parse_command(struct cg_server *server, struct keybinding *keybinding, struct keybinding * parse_keybinding(struct cg_server *server, char **saveptr) { struct keybinding *keybinding = malloc(sizeof(struct keybinding)); - char *key = strtok_r(NULL, " ", saveptr); + if(keybinding == NULL) { + wlr_log(WLR_ERROR, "Failed to allocate memory for keybinding in parse_keybinding"); + return NULL; + } +char *key = strtok_r(NULL, " ", saveptr); if(parse_key(keybinding, key) != 0) { wlr_log(WLR_ERROR, "Could not parse key definition \"%s\"", key); free(keybinding); @@ -153,6 +157,10 @@ parse_background(struct cg_server *server, float *color, char **saveptr) { struct keybinding * parse_escape(char **saveptr) { struct keybinding *keybinding = malloc(sizeof(struct keybinding)); + if(keybinding == NULL) { + wlr_log(WLR_ERROR, "Failed to allocate memory for keybinding in parse_escape"); + return NULL; + } char *key = strtok_r(NULL, " ", saveptr); if(parse_key(keybinding, key) != 0) { wlr_log(WLR_ERROR, @@ -228,6 +236,10 @@ parse_float(char **saveptr, const char* delim) { int parse_output_config(struct wl_list *config_list, char **saveptr) { struct cg_output_config* cfg = malloc(sizeof(struct cg_output_config)); + if(cfg == NULL) { + wlr_log(WLR_ERROR, "Failed to allocate memory for output configuration"); + goto error; + } char *name = strtok_r(NULL, " ", saveptr); if(name == NULL) { wlr_log(WLR_ERROR, "Expected name of output to be configured, got none"); diff --git a/workspace.c b/workspace.c index 8ed010e..10a476d 100644 --- a/workspace.c +++ b/workspace.c @@ -12,6 +12,7 @@ #include #include #include +#include #include "message.h" #include "output.h" @@ -19,27 +20,36 @@ #include "view.h" #include "workspace.h" -void -full_screen_workspace_tiles(const struct cg_output *output, +int +full_screen_workspace_tiles(struct wlr_output_layout *layout,struct wlr_output *output, struct cg_workspace *workspace) { - workspace->server = output->server; workspace->focused_tile = calloc(1, sizeof(struct cg_tile)); + if(!workspace->focused_tile) { + return -1; + } workspace->focused_tile->workspace = workspace; workspace->focused_tile->next = workspace->focused_tile; workspace->focused_tile->prev = workspace->focused_tile; workspace->focused_tile->tile.x = 0; workspace->focused_tile->tile.y = 0; - struct wlr_box *output_box = wlr_output_layout_get_box( - output->server->output_layout, output->wlr_output); + struct wlr_box *output_box = wlr_output_layout_get_box(layout, output); workspace->focused_tile->tile.width = output_box->width; workspace->focused_tile->tile.height = output_box->height; workspace->focused_tile->view = NULL; + return 0; } struct cg_workspace * full_screen_workspace(struct cg_output *output) { struct cg_workspace *workspace = calloc(1, sizeof(struct cg_workspace)); - full_screen_workspace_tiles(output, workspace); + if(!workspace) { + return NULL; + } + workspace->server=output->server; + if(full_screen_workspace_tiles(output->server->output_layout, output->wlr_output, workspace)!=0) { + free(workspace); + return NULL; + } workspace->output = output; return workspace; } @@ -48,6 +58,10 @@ void workspace_focus_tile(struct cg_workspace *ws, struct cg_tile *tile) { ws->focused_tile = tile; struct wlr_box *box = malloc(sizeof(struct wlr_box)); + if(!box) { + wlr_log(WLR_ERROR, "Failed to allocate box required to focus tile"); + return; + } box->x = tile->tile.x + tile->tile.width / 2; box->y = tile->tile.y + tile->tile.height / 2; message_printf_pos(ws->output, box, CG_MESSAGE_CENTER, "Current frame"); diff --git a/workspace.h b/workspace.h index 069d036..34586f7 100644 --- a/workspace.h +++ b/workspace.h @@ -25,8 +25,8 @@ struct cg_workspace { struct cg_workspace * full_screen_workspace(struct cg_output *output); -void -full_screen_workspace_tiles(const struct cg_output *output, +int +full_screen_workspace_tiles(struct wlr_output_layout *layout,struct wlr_output *output, struct cg_workspace *workspace); void workspace_free_tiles(struct cg_workspace *workspace); From 9ac95ce69c7faf7b9be1fb0dbb10436a1556a702 Mon Sep 17 00:00:00 2001 From: project-repo Date: Wed, 20 May 2020 19:35:16 +0200 Subject: [PATCH 051/689] Apply clang-format --- cagebreak.c | 9 +++--- fuzz/fuzz-parse.c | 6 ++-- keybinding.c | 4 ++- output.c | 32 +++++++++++--------- output.h | 6 ++-- parse.c | 74 ++++++++++++++++++++++++++++++++++------------- workspace.c | 8 +++-- workspace.h | 3 +- 8 files changed, 93 insertions(+), 49 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index 28ba139..8f5c01d 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -264,7 +264,7 @@ main(int argc, char *argv[]) { server.modes = malloc(4 * sizeof(char *)); if(!server.modes) { - wlr_log(WLR_ERROR,"Error allocating mode array"); + wlr_log(WLR_ERROR, "Error allocating mode array"); return -1; } @@ -286,8 +286,8 @@ main(int argc, char *argv[]) { server.modes[1] = strdup("root"); server.modes[2] = strdup("resize"); server.modes[3] = NULL; - if(!server.modes[0]||!server.modes[1]||server.modes[2]) { - wlr_log(WLR_ERROR,"Error allocating default modes"); + if(!server.modes[0] || !server.modes[1] || server.modes[2]) { + wlr_log(WLR_ERROR, "Error allocating default modes"); goto end; } @@ -551,7 +551,8 @@ end: free(server.modes); struct cg_output_config *output_config, *output_config_tmp; - wl_list_for_each_safe(output_config, output_config_tmp, &server.output_config, link) { + wl_list_for_each_safe(output_config, output_config_tmp, + &server.output_config, link) { wl_list_remove(&output_config->link); free(output_config->output_name); free(output_config); diff --git a/fuzz/fuzz-parse.c b/fuzz/fuzz-parse.c index 2103a20..bcfb701 100644 --- a/fuzz/fuzz-parse.c +++ b/fuzz/fuzz-parse.c @@ -8,12 +8,11 @@ #define _POSIX_C_SOURCE 200812L - #include "../keybinding.h" +#include "../output.h" #include "../parse.h" #include "../seat.h" #include "../server.h" -#include "../output.h" #include #include #include @@ -450,7 +449,8 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { server.modes = realloc(server.modes, 4 * sizeof(char *)); struct cg_output_config *output_config, *output_config_tmp; - wl_list_for_each_safe(output_config, output_config_tmp, &server.output_config, link) { + wl_list_for_each_safe(output_config, output_config_tmp, + &server.output_config, link) { wl_list_remove(&output_config->link); free(output_config->output_name); free(output_config); diff --git a/keybinding.c b/keybinding.c index c9fe665..752a434 100644 --- a/keybinding.c +++ b/keybinding.c @@ -453,7 +453,9 @@ keybinding_workspace_fullscreen(struct cg_server *server) { } workspace_free_tiles(output->workspaces[output->curr_workspace]); - if(full_screen_workspace_tiles(server->output_layout,output->wlr_output, output->workspaces[output->curr_workspace])!=0) { + if(full_screen_workspace_tiles( + server->output_layout, output->wlr_output, + output->workspaces[output->curr_workspace]) != 0) { wlr_log(WLR_ERROR, "Failed to allocate space for fullscreen workspace"); return; } diff --git a/output.c b/output.c index dbf75b5..7c23ad8 100644 --- a/output.c +++ b/output.c @@ -480,8 +480,8 @@ handle_output_destroy(struct wl_listener *listener, void *data) { output_destroy(output); } -struct cg_output_config* -output_find_config(struct cg_server* server, struct wlr_output* output) { +struct cg_output_config * +output_find_config(struct cg_server *server, struct wlr_output *output) { struct cg_output_config *config; wl_list_for_each(config, &server->output_config, link) { if(strcmp(config->output_name, output->name) == 0) { @@ -491,31 +491,33 @@ output_find_config(struct cg_server* server, struct wlr_output* output) { return NULL; } -static void output_set_mode(struct wlr_output *output, int width, int height, - float refresh_rate) { +static void +output_set_mode(struct wlr_output *output, int width, int height, + float refresh_rate) { int mhz = (int)(refresh_rate * 1000); - if (wl_list_empty(&output->modes)) { + if(wl_list_empty(&output->modes)) { wlr_log(WLR_DEBUG, "Assigning custom mode to %s", output->name); wlr_output_set_custom_mode(output, width, height, - refresh_rate > 0 ? mhz : 0); + refresh_rate > 0 ? mhz : 0); return; } struct wlr_output_mode *mode, *best = NULL; wl_list_for_each(mode, &output->modes, link) { - if (mode->width == width && mode->height == height) { - if (mode->refresh == mhz) { + if(mode->width == width && mode->height == height) { + if(mode->refresh == mhz) { best = mode; break; } - if (best == NULL || mode->refresh > best->refresh) { + if(best == NULL || mode->refresh > best->refresh) { best = mode; } } } - if (!best) { - wlr_log(WLR_ERROR, "Configured mode for %s not available", output->name); + if(!best) { + wlr_log(WLR_ERROR, "Configured mode for %s not available", + output->name); wlr_log(WLR_INFO, "Picking preferred mode instead"); best = wlr_output_preferred_mode(output); } else { @@ -525,7 +527,7 @@ static void output_set_mode(struct wlr_output *output, int width, int height, } void -output_configure(struct cg_server* server, struct cg_output *output) { +output_configure(struct cg_server *server, struct cg_output *output) { struct wlr_output *wlr_output = output->wlr_output; struct cg_output_config *config = output_find_config(server, wlr_output); if(output->wlr_output->enabled) { @@ -541,8 +543,10 @@ output_configure(struct cg_server* server, struct cg_output *output) { wlr_output_set_mode(wlr_output, preferred_mode); } } else { - output_set_mode(wlr_output, config->pos.width, config->pos.height, config->refresh_rate); - wlr_output_layout_add(server->output_layout, wlr_output, config->pos.x, config->pos.y); + output_set_mode(wlr_output, config->pos.width, config->pos.height, + config->refresh_rate); + wlr_output_layout_add(server->output_layout, wlr_output, config->pos.x, + config->pos.y); } } diff --git a/output.h b/output.h index ba12ea6..bf9abb4 100644 --- a/output.h +++ b/output.h @@ -29,9 +29,9 @@ struct cg_output { struct cg_output_config { struct wlr_box pos; - char* output_name; + char *output_name; float refresh_rate; - struct wl_list link;// cg_server::output_config + struct wl_list link; // cg_server::output_config }; typedef void (*cg_surface_iterator_func_t)(struct cg_output *output, @@ -42,7 +42,7 @@ typedef void (*cg_surface_iterator_func_t)(struct cg_output *output, void handle_new_output(struct wl_listener *listener, void *data); void -output_configure(struct cg_server* server, struct cg_output* output); +output_configure(struct cg_server *server, struct cg_output *output); void output_surface_for_each_surface(struct cg_output *output, struct wlr_surface *surface, double ox, diff --git a/parse.c b/parse.c index 33082c8..f08b59d 100644 --- a/parse.c +++ b/parse.c @@ -1,9 +1,9 @@ #define _POSIX_C_SOURCE 200812L +#include #include #include #include -#include #include "keybinding.h" #include "output.h" @@ -68,10 +68,11 @@ struct keybinding * parse_keybinding(struct cg_server *server, char **saveptr) { struct keybinding *keybinding = malloc(sizeof(struct keybinding)); if(keybinding == NULL) { - wlr_log(WLR_ERROR, "Failed to allocate memory for keybinding in parse_keybinding"); + wlr_log(WLR_ERROR, + "Failed to allocate memory for keybinding in parse_keybinding"); return NULL; } -char *key = strtok_r(NULL, " ", saveptr); + char *key = strtok_r(NULL, " ", saveptr); if(parse_key(keybinding, key) != 0) { wlr_log(WLR_ERROR, "Could not parse key definition \"%s\"", key); free(keybinding); @@ -158,7 +159,8 @@ struct keybinding * parse_escape(char **saveptr) { struct keybinding *keybinding = malloc(sizeof(struct keybinding)); if(keybinding == NULL) { - wlr_log(WLR_ERROR, "Failed to allocate memory for keybinding in parse_escape"); + wlr_log(WLR_ERROR, + "Failed to allocate memory for keybinding in parse_escape"); return NULL; } char *key = strtok_r(NULL, " ", saveptr); @@ -202,7 +204,7 @@ parse_workspaces(char **saveptr) { } int -parse_uint(char **saveptr, const char* delim) { +parse_uint(char **saveptr, const char *delim) { char *uint_str = strtok_r(NULL, delim, saveptr); if(uint_str == NULL) { wlr_log(WLR_ERROR, "Expected a non-negative integer, got nothing"); @@ -212,13 +214,16 @@ parse_uint(char **saveptr, const char* delim) { if(uint >= 0 && uint <= INT_MAX) { return uint; } else { - wlr_log(WLR_ERROR, "Error parsing non-negative integer. Must be a number larger or equal to 0 and less or equal to %d",INT_MAX); + wlr_log(WLR_ERROR, + "Error parsing non-negative integer. Must be a number larger " + "or equal to 0 and less or equal to %d", + INT_MAX); return -1; } } float -parse_float(char **saveptr, const char* delim) { +parse_float(char **saveptr, const char *delim) { char *uint_str = strtok_r(NULL, delim, saveptr); if(uint_str == NULL) { wlr_log(WLR_ERROR, "Expected a non-negative float, got nothing"); @@ -228,68 +233,95 @@ parse_float(char **saveptr, const char* delim) { if(ufloat >= 0) { return ufloat; } else { - wlr_log(WLR_ERROR, "Error parsing non-negative float. Must be a number larger or equal to 0"); + wlr_log(WLR_ERROR, "Error parsing non-negative float. Must be a number " + "larger or equal to 0"); return -1; } } int parse_output_config(struct wl_list *config_list, char **saveptr) { - struct cg_output_config* cfg = malloc(sizeof(struct cg_output_config)); + struct cg_output_config *cfg = malloc(sizeof(struct cg_output_config)); if(cfg == NULL) { - wlr_log(WLR_ERROR, "Failed to allocate memory for output configuration"); + wlr_log(WLR_ERROR, + "Failed to allocate memory for output configuration"); goto error; } char *name = strtok_r(NULL, " ", saveptr); if(name == NULL) { - wlr_log(WLR_ERROR, "Expected name of output to be configured, got none"); + wlr_log(WLR_ERROR, + "Expected name of output to be configured, got none"); goto error; } char *pos_str = strtok_r(NULL, " ", saveptr); if(pos_str == NULL || strcmp(pos_str, "pos") != 0) { - wlr_log(WLR_ERROR, "Expected keyword \"pos\" in output configuration for output %s", name); + wlr_log( + WLR_ERROR, + "Expected keyword \"pos\" in output configuration for output %s", + name); goto error; } cfg->pos.x = parse_uint(saveptr, " "); if(cfg->pos.x < 0) { - wlr_log(WLR_ERROR, "Error parsing x coordinate of output configuration for output %s", name); + wlr_log( + WLR_ERROR, + "Error parsing x coordinate of output configuration for output %s", + name); goto error; } cfg->pos.y = parse_uint(saveptr, " "); if(cfg->pos.y < 0) { - wlr_log(WLR_ERROR, "Error parsing y coordinate of output configuration for output %s", name); + wlr_log( + WLR_ERROR, + "Error parsing y coordinate of output configuration for output %s", + name); goto error; } char *res_str = strtok_r(NULL, " ", saveptr); if(res_str == NULL || strcmp(res_str, "res") != 0) { - wlr_log(WLR_ERROR, "Expected keyword \"res\" in output configuration for output %s", name); + wlr_log( + WLR_ERROR, + "Expected keyword \"res\" in output configuration for output %s", + name); goto error; } cfg->pos.width = parse_uint(saveptr, "x"); if(cfg->pos.width <= 0) { - wlr_log(WLR_ERROR, "Error parsing width of output configuration for output %s (hint: width must be larger than 0)", name); + wlr_log(WLR_ERROR, + "Error parsing width of output configuration for output %s " + "(hint: width must be larger than 0)", + name); goto error; } cfg->pos.height = parse_uint(saveptr, " "); if(cfg->pos.height <= 0) { - wlr_log(WLR_ERROR, "Error parsing height of output configuration for output %s (hint: height must e larger than 0)", name); + wlr_log(WLR_ERROR, + "Error parsing height of output configuration for output %s " + "(hint: height must e larger than 0)", + name); goto error; } char *rate_str = strtok_r(NULL, " ", saveptr); if(rate_str == NULL || strcmp(rate_str, "rate") != 0) { - wlr_log(WLR_ERROR, "Expected keyword \"rate\" in output configuration for output %s", name); + wlr_log( + WLR_ERROR, + "Expected keyword \"rate\" in output configuration for output %s", + name); goto error; } cfg->refresh_rate = parse_float(saveptr, " "); if(cfg->refresh_rate <= 0.0) { - wlr_log(WLR_ERROR, "Error parsing refresh rate of output configuration for output %s", name); + wlr_log( + WLR_ERROR, + "Error parsing refresh rate of output configuration for output %s", + name); goto error; } @@ -299,7 +331,9 @@ parse_output_config(struct wl_list *config_list, char **saveptr) { error: free(cfg); - wlr_log(WLR_ERROR, "Output configuration must be of the form \"output pos res x rate "); + wlr_log(WLR_ERROR, + "Output configuration must be of the form \"output pos " + " res x rate "); return -1; } diff --git a/workspace.c b/workspace.c index 10a476d..265010e 100644 --- a/workspace.c +++ b/workspace.c @@ -21,7 +21,8 @@ #include "workspace.h" int -full_screen_workspace_tiles(struct wlr_output_layout *layout,struct wlr_output *output, +full_screen_workspace_tiles(struct wlr_output_layout *layout, + struct wlr_output *output, struct cg_workspace *workspace) { workspace->focused_tile = calloc(1, sizeof(struct cg_tile)); if(!workspace->focused_tile) { @@ -45,8 +46,9 @@ full_screen_workspace(struct cg_output *output) { if(!workspace) { return NULL; } - workspace->server=output->server; - if(full_screen_workspace_tiles(output->server->output_layout, output->wlr_output, workspace)!=0) { + workspace->server = output->server; + if(full_screen_workspace_tiles(output->server->output_layout, + output->wlr_output, workspace) != 0) { free(workspace); return NULL; } diff --git a/workspace.h b/workspace.h index 34586f7..a5da674 100644 --- a/workspace.h +++ b/workspace.h @@ -26,7 +26,8 @@ struct cg_workspace { struct cg_workspace * full_screen_workspace(struct cg_output *output); int -full_screen_workspace_tiles(struct wlr_output_layout *layout,struct wlr_output *output, +full_screen_workspace_tiles(struct wlr_output_layout *layout, + struct wlr_output *output, struct cg_workspace *workspace); void workspace_free_tiles(struct cg_workspace *workspace); From 3367d8e0bac480f9a431552fb5c5810764020601 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Wed, 20 May 2020 19:12:00 +0000 Subject: [PATCH 052/689] Add formatting to release checklist --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 0eb113b..e278804 100644 --- a/README.md +++ b/README.md @@ -93,6 +93,7 @@ Release checklist * [ ] Cursory testing * [ ] libfuzzer testing + * [ ] ninja -C build clang-format * [ ] Version Number * [ ] meson.build * [ ] git tag From d7970326940684175273f066d9c2d6d96d50ad28 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Thu, 21 May 2020 08:27:07 +0000 Subject: [PATCH 053/689] Manage fanalyzer warnings with pragmas --- idle_inhibit_v1.c | 3 +++ message.c | 3 +++ xdg_shell.c | 3 +++ 3 files changed, 9 insertions(+) diff --git a/idle_inhibit_v1.c b/idle_inhibit_v1.c index ee7ca82..e73915d 100644 --- a/idle_inhibit_v1.c +++ b/idle_inhibit_v1.c @@ -22,6 +22,8 @@ struct cg_idle_inhibitor_v1 { struct wl_listener destroy; }; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wanalyzer-malloc-leak" static void idle_inhibit_v1_check_active(struct cg_server *server) { /* As of right now, this does not check whether the inhibitor @@ -29,6 +31,7 @@ idle_inhibit_v1_check_active(struct cg_server *server) { bool inhibited = !wl_list_empty(&server->inhibitors); wlr_idle_set_enabled(server->idle, NULL, !inhibited); } +#pragma GCC diagnostic pop static void handle_destroy(struct wl_listener *listener, void *data) { diff --git a/message.c b/message.c index bc24928..07dd0b6 100644 --- a/message.c +++ b/message.c @@ -95,6 +95,8 @@ create_message_texture(const char *string, const struct cg_output *output) { return texture; } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wanalyzer-malloc-leak" void message_set_output(struct cg_output *output, const char *string, struct wlr_box *box, enum cg_message_align align) { @@ -137,6 +139,7 @@ message_set_output(struct cg_output *output, const char *string, } wlr_output_damage_add_box(output->damage, message->position); } +#pragma GCC diagnostic pop void message_printf(struct cg_output *output, const char *fmt, ...) { diff --git a/xdg_shell.c b/xdg_shell.c index b420795..00af384 100644 --- a/xdg_shell.c +++ b/xdg_shell.c @@ -32,6 +32,8 @@ xdg_decoration_handle_destroy(struct wl_listener *listener, void *_data) { free(xdg_decoration); } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wanalyzer-malloc-leak" static void xdg_decoration_handle_request_mode(struct wl_listener *listener, void *_data) { struct cg_xdg_decoration *xdg_decoration = @@ -42,6 +44,7 @@ xdg_decoration_handle_request_mode(struct wl_listener *listener, void *_data) { wlr_xdg_toplevel_decoration_v1_set_mode(xdg_decoration->wlr_decoration, mode); } +#pragma GCC diagnostic pop static void xdg_popup_destroy(struct cg_view_child *child) { From 19e1407983fe3e9149c8bd66dc03024578667a62 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Thu, 21 May 2020 13:33:32 +0000 Subject: [PATCH 054/689] Fix remaining fanalyzer errors --- cagebreak.c | 3 +++ meson.build | 1 + view.c | 3 +++ 3 files changed, 7 insertions(+) diff --git a/cagebreak.c b/cagebreak.c index 8f5c01d..63bb000 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -545,6 +545,8 @@ main(int argc, char *argv[]) { wl_display_destroy_clients(server.wl_display); end: +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wanalyzer-double-free" for(unsigned int i = 0; server.modes[i] != NULL; ++i) { free(server.modes[i]); } @@ -575,3 +577,4 @@ end: return ret; } +#pragma GCC diagnostic pop diff --git a/meson.build b/meson.build index 40c09d7..f562b3f 100644 --- a/meson.build +++ b/meson.build @@ -11,6 +11,7 @@ add_project_arguments( [ '-DWLR_USE_UNSTABLE', '-Wundef', + '-fanalyzer', '-Wno-unused-parameter', ], language: 'c', diff --git a/view.c b/view.c index 6b0ed87..f90baaf 100644 --- a/view.c +++ b/view.c @@ -223,6 +223,8 @@ view_for_each_popup(struct cg_view *view, wlr_surface_iterator_func_t iterator, view->impl->for_each_popup(view, iterator, data); } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wanalyzer-null-dereference" void view_unmap(struct cg_view *view) { #if CG_HAS_XWAYLAND @@ -263,6 +265,7 @@ view_unmap(struct cg_view *view) { } } #endif +#pragma GCC diagnostic pop wl_list_remove(&view->link); From af6adcc9730d18d94b263253a9b12ecbd9d6469c Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 21 May 2020 17:17:11 +0200 Subject: [PATCH 055/689] Fix null pointer dereference warning --- view.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/view.c b/view.c index f90baaf..609b01e 100644 --- a/view.c +++ b/view.c @@ -223,17 +223,15 @@ view_for_each_popup(struct cg_view *view, wlr_surface_iterator_func_t iterator, view->impl->for_each_popup(view, iterator, data); } -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wanalyzer-null-dereference" void view_unmap(struct cg_view *view) { #if CG_HAS_XWAYLAND if((view->type != CG_XWAYLAND_VIEW || xwayland_view_should_manage(view))) #endif { - if(view_is_visible(view)) { + struct cg_tile *view_tile = view_get_tile(view); + if(view_tile != NULL) { struct cg_view *prev = view_get_prev_view(view); - struct cg_tile *view_tile = view_get_tile(view); wlr_output_damage_add_box(view_tile->workspace->output->damage, &view_tile->tile); if((view->workspace->server->seat->seat->keyboard_state @@ -265,7 +263,6 @@ view_unmap(struct cg_view *view) { } } #endif -#pragma GCC diagnostic pop wl_list_remove(&view->link); From 7b83f7a31935713303bde40e4b933dc639801bc4 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Thu, 21 May 2020 15:36:28 +0000 Subject: [PATCH 056/689] Remove fanalyzer from meson.build --- meson.build | 1 - 1 file changed, 1 deletion(-) diff --git a/meson.build b/meson.build index f562b3f..40c09d7 100644 --- a/meson.build +++ b/meson.build @@ -11,7 +11,6 @@ add_project_arguments( [ '-DWLR_USE_UNSTABLE', '-Wundef', - '-fanalyzer', '-Wno-unused-parameter', ], language: 'c', From 4b383b55747b0e0b32f5c898de212551c89457fd Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Thu, 21 May 2020 15:57:25 +0000 Subject: [PATCH 057/689] Fix debug build fanalyzer warnings --- message.c | 2 +- output.c | 3 +++ parse.c | 3 +++ workspace.c | 3 +++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/message.c b/message.c index 07dd0b6..bd6eed0 100644 --- a/message.c +++ b/message.c @@ -139,7 +139,6 @@ message_set_output(struct cg_output *output, const char *string, } wlr_output_damage_add_box(output->damage, message->position); } -#pragma GCC diagnostic pop void message_printf(struct cg_output *output, const char *fmt, ...) { @@ -173,6 +172,7 @@ message_printf(struct cg_output *output, const char *fmt, ...) { free(buffer); alarm(output->server->message_timeout); } +#pragma GCC diagnostic pop void message_printf_pos(struct cg_output *output, struct wlr_box *position, diff --git a/output.c b/output.c index 7c23ad8..388471d 100644 --- a/output.c +++ b/output.c @@ -550,6 +550,8 @@ output_configure(struct cg_server *server, struct cg_output *output) { } } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wanalyzer-malloc-leak" void handle_new_output(struct wl_listener *listener, void *data) { struct cg_server *server = wl_container_of(listener, server, new_output); @@ -627,6 +629,7 @@ handle_new_output(struct wl_listener *listener, void *data) { DEFAULT_XCURSOR, server->seat->cursor); wlr_cursor_warp(server->seat->cursor, NULL, 0, 0); } +#pragma GCC diagnostic pop void output_set_window_title(struct cg_output *output, const char *title) { diff --git a/parse.c b/parse.c index f08b59d..043f843 100644 --- a/parse.c +++ b/parse.c @@ -325,9 +325,12 @@ parse_output_config(struct wl_list *config_list, char **saveptr) { goto error; } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wanalyzer-malloc-leak" cfg->output_name = strdup(name); wl_list_insert(config_list, &cfg->link); return 0; +#pragma GCC diagnostic pop error: free(cfg); diff --git a/workspace.c b/workspace.c index 265010e..440a83e 100644 --- a/workspace.c +++ b/workspace.c @@ -20,6 +20,8 @@ #include "view.h" #include "workspace.h" +#pragma GCC diagnostic push +#pragma GCC ignored "-Wanalyzer-malloc-leak" int full_screen_workspace_tiles(struct wlr_output_layout *layout, struct wlr_output *output, @@ -39,6 +41,7 @@ full_screen_workspace_tiles(struct wlr_output_layout *layout, workspace->focused_tile->view = NULL; return 0; } +#pragma GCC diagnostic pop struct cg_workspace * full_screen_workspace(struct cg_output *output) { From 8e7f954b329f864a22ce6997ca0c1e18b258edd7 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Thu, 21 May 2020 16:00:53 +0000 Subject: [PATCH 058/689] Fix typo --- workspace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workspace.c b/workspace.c index 440a83e..c7688ab 100644 --- a/workspace.c +++ b/workspace.c @@ -21,7 +21,7 @@ #include "workspace.h" #pragma GCC diagnostic push -#pragma GCC ignored "-Wanalyzer-malloc-leak" +#pragma GCC diagnostic ignored "-Wanalyzer-malloc-leak" int full_screen_workspace_tiles(struct wlr_output_layout *layout, struct wlr_output *output, From 989438a1cbb2b4d013a2a1daab25858e455b07be Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 21 May 2020 19:36:35 +0200 Subject: [PATCH 059/689] Fix compilation under clang --- cagebreak.c | 4 ++++ config.h.in | 1 + idle_inhibit_v1.c | 4 ++++ meson.build | 7 +++++++ message.c | 4 ++++ output.c | 4 ++++ parse.c | 4 ++++ workspace.c | 4 ++++ xdg_shell.c | 4 ++++ 9 files changed, 36 insertions(+) diff --git a/cagebreak.c b/cagebreak.c index 63bb000..e9690a1 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -545,8 +545,10 @@ main(int argc, char *argv[]) { wl_display_destroy_clients(server.wl_display); end: +#if CG_HAS_FANALYZE #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wanalyzer-double-free" +#endif for(unsigned int i = 0; server.modes[i] != NULL; ++i) { free(server.modes[i]); } @@ -577,4 +579,6 @@ end: return ret; } +#if CG_HAS_FANALYZE #pragma GCC diagnostic pop +#endif diff --git a/config.h.in b/config.h.in index cf6bcbc..8495284 100644 --- a/config.h.in +++ b/config.h.in @@ -2,6 +2,7 @@ #define CG_CONFIG_H #mesondefine CG_HAS_XWAYLAND +#mesondefine CG_HAS_FANALYZE #mesondefine CG_VERSION diff --git a/idle_inhibit_v1.c b/idle_inhibit_v1.c index e73915d..17c0041 100644 --- a/idle_inhibit_v1.c +++ b/idle_inhibit_v1.c @@ -22,8 +22,10 @@ struct cg_idle_inhibitor_v1 { struct wl_listener destroy; }; +#if CG_HAS_FANALYZE #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wanalyzer-malloc-leak" +#endif static void idle_inhibit_v1_check_active(struct cg_server *server) { /* As of right now, this does not check whether the inhibitor @@ -31,7 +33,9 @@ idle_inhibit_v1_check_active(struct cg_server *server) { bool inhibited = !wl_list_empty(&server->inhibitors); wlr_idle_set_enabled(server->idle, NULL, !inhibited); } +#if CG_HAS_FANALYZE #pragma GCC diagnostic pop +#endif static void handle_destroy(struct wl_listener *listener, void *data) { diff --git a/meson.build b/meson.build index 40c09d7..b9ff4ed 100644 --- a/meson.build +++ b/meson.build @@ -100,6 +100,12 @@ else have_xwayland = false endif +if cc.get_id() == 'gcc' and cc.version().version_compare('>=10') + have_fanalyze=true +else + have_fanalyze=false +endif + if get_option('version_override') != '' version = '@0@'.format(get_option('version_override')) else @@ -108,6 +114,7 @@ endif conf_data = configuration_data() conf_data.set10('CG_HAS_XWAYLAND', have_xwayland) +conf_data.set10('CG_HAS_FANALYZE', have_fanalyze) conf_data.set_quoted('CG_VERSION', version) diff --git a/message.c b/message.c index bd6eed0..8ada1f8 100644 --- a/message.c +++ b/message.c @@ -95,8 +95,10 @@ create_message_texture(const char *string, const struct cg_output *output) { return texture; } +#if CG_HAS_FANALYZE #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wanalyzer-malloc-leak" +#endif void message_set_output(struct cg_output *output, const char *string, struct wlr_box *box, enum cg_message_align align) { @@ -172,7 +174,9 @@ message_printf(struct cg_output *output, const char *fmt, ...) { free(buffer); alarm(output->server->message_timeout); } +#if CG_HAS_FANALYZE #pragma GCC diagnostic pop +#endif void message_printf_pos(struct cg_output *output, struct wlr_box *position, diff --git a/output.c b/output.c index 388471d..4f40050 100644 --- a/output.c +++ b/output.c @@ -550,8 +550,10 @@ output_configure(struct cg_server *server, struct cg_output *output) { } } +#if CG_HAS_FANALYZE #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wanalyzer-malloc-leak" +#endif void handle_new_output(struct wl_listener *listener, void *data) { struct cg_server *server = wl_container_of(listener, server, new_output); @@ -629,7 +631,9 @@ handle_new_output(struct wl_listener *listener, void *data) { DEFAULT_XCURSOR, server->seat->cursor); wlr_cursor_warp(server->seat->cursor, NULL, 0, 0); } +#if CG_HAS_FANALYZE #pragma GCC diagnostic pop +#endif void output_set_window_title(struct cg_output *output, const char *title) { diff --git a/parse.c b/parse.c index 043f843..82cc0f2 100644 --- a/parse.c +++ b/parse.c @@ -325,12 +325,16 @@ parse_output_config(struct wl_list *config_list, char **saveptr) { goto error; } +#if CG_HAS_FANALYZE #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wanalyzer-malloc-leak" +#endif cfg->output_name = strdup(name); wl_list_insert(config_list, &cfg->link); return 0; +#if CG_HAS_FANALYZE #pragma GCC diagnostic pop +#endif error: free(cfg); diff --git a/workspace.c b/workspace.c index c7688ab..fcc7650 100644 --- a/workspace.c +++ b/workspace.c @@ -20,8 +20,10 @@ #include "view.h" #include "workspace.h" +#if CG_HAS_FANALYZE #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wanalyzer-malloc-leak" +#endif int full_screen_workspace_tiles(struct wlr_output_layout *layout, struct wlr_output *output, @@ -41,7 +43,9 @@ full_screen_workspace_tiles(struct wlr_output_layout *layout, workspace->focused_tile->view = NULL; return 0; } +#if CG_HAS_FANALYZE #pragma GCC diagnostic pop +#endif struct cg_workspace * full_screen_workspace(struct cg_output *output) { diff --git a/xdg_shell.c b/xdg_shell.c index 00af384..fd9ef3d 100644 --- a/xdg_shell.c +++ b/xdg_shell.c @@ -32,8 +32,10 @@ xdg_decoration_handle_destroy(struct wl_listener *listener, void *_data) { free(xdg_decoration); } +#if CG_HAS_FANALYZE #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wanalyzer-malloc-leak" +#endif static void xdg_decoration_handle_request_mode(struct wl_listener *listener, void *_data) { struct cg_xdg_decoration *xdg_decoration = @@ -44,7 +46,9 @@ xdg_decoration_handle_request_mode(struct wl_listener *listener, void *_data) { wlr_xdg_toplevel_decoration_v1_set_mode(xdg_decoration->wlr_decoration, mode); } +#if CG_HAS_FANALYZE #pragma GCC diagnostic pop +#endif static void xdg_popup_destroy(struct cg_view_child *child) { From 0017ad48c5bfc3a8d52306e03df05760b356bcba Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 21 May 2020 23:04:45 +0200 Subject: [PATCH 060/689] Add ipc capability --- cagebreak.c | 14 +-- ipc_server.c | 248 +++++++++++++++++++++++++++++++++++++++++++++++++++ ipc_server.h | 44 +++++++++ meson.build | 2 + parse.h | 2 + server.h | 3 + 6 files changed, 307 insertions(+), 6 deletions(-) create mode 100644 ipc_server.c create mode 100644 ipc_server.h diff --git a/cagebreak.c b/cagebreak.c index e9690a1..0f0a539 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -55,6 +55,7 @@ #include "server.h" #include "view.h" #include "xdg_shell.h" +#include "ipc_server.h" #if CG_HAS_XWAYLAND #include "xwayland.h" #endif @@ -189,10 +190,9 @@ set_configuration(struct cg_server *server, config_file_path); return -1; } - size_t max_line_size = 256; - char line[max_line_size * sizeof(char)]; + char line[MAX_LINE_SIZE * sizeof(char)]; for(unsigned int line_num = 1; - fgets(line, max_line_size, config_file) != NULL; ++line_num) { + fgets(line, MAX_LINE_SIZE, config_file) != NULL; ++line_num) { line[strcspn(line, "\n")] = '\0'; if(*line != '\0' && *line != '#') { if(parse_rc_line(server, line) != 0) { @@ -286,9 +286,9 @@ main(int argc, char *argv[]) { server.modes[1] = strdup("root"); server.modes[2] = strdup("resize"); server.modes[3] = NULL; - if(!server.modes[0] || !server.modes[1] || server.modes[2]) { + if(server.modes[0] == NULL || server.modes[1] == NULL || server.modes[2] == NULL) { wlr_log(WLR_ERROR, "Error allocating default modes"); - goto end; + return 1; } server.nws = 1; @@ -533,7 +533,9 @@ main(int argc, char *argv[]) { } } - /* Place the cursor to the topl left of the output layout. */ + ipc_init(&server); + + /* Place the cursor to the top left of the output layout. */ wlr_cursor_warp(server.seat->cursor, NULL, 0, 0); wl_display_run(server.wl_display); diff --git a/ipc_server.c b/ipc_server.c new file mode 100644 index 0000000..2c415c1 --- /dev/null +++ b/ipc_server.c @@ -0,0 +1,248 @@ +/* + * Cagebreak: A Wayland tiling compositor. + * + * Copyright (C) 2020 The Cagebreak Authors + * Copyright (C) 2018-2020 Jente Hidskes + * + * See the LICENSE file accompanying this file. + */ + +#define _POSIX_C_SOURCE 200112L + +#include "ipc_server.h" +#include "server.h" +#include "parse.h" +#include "message.h" + +#include +#include +#include +#include +#include +#include +#include + +static void handle_display_destroy(struct wl_listener *listener, void *data) { + struct cg_ipc_handle *ipc = wl_container_of(listener, ipc,display_destroy); + if (ipc->event_source != NULL) { + wl_event_source_remove(ipc->event_source); + } + close(ipc->socket); + unlink(ipc->sockaddr->sun_path); + + struct cg_ipc_client *tmp_client, *client; + wl_list_for_each_safe(client, tmp_client, &ipc->client_list, link) { + ipc_client_disconnect(client); + } + + free(ipc->sockaddr); + + wl_list_remove(&ipc->display_destroy.link); +} + +int ipc_init(struct cg_server *server) { + struct cg_ipc_handle *ipc = &server->ipc; + ipc->socket = socket(AF_UNIX, SOCK_STREAM, 0); + if (ipc->socket == -1) { + wlr_log(WLR_ERROR, "Unable to create IPC socket"); + return -1; + } + if (fcntl(ipc->socket, F_SETFD, FD_CLOEXEC) == -1) { + wlr_log(WLR_ERROR,"Unable to set CLOEXEC on IPC socket"); + return -1; + } + if (fcntl(ipc->socket, F_SETFL, O_NONBLOCK) == -1) { + wlr_log(WLR_ERROR, "Unable to set NONBLOCK on IPC socket"); + return -1; + } + + ipc->sockaddr = malloc(sizeof(struct sockaddr_un)); + + if(ipc->sockaddr == NULL) { + wlr_log(WLR_ERROR, "Unable to allocate socket address"); + return -1; + } + + ipc->sockaddr->sun_family=AF_UNIX; + int max_path_size = sizeof(ipc->sockaddr->sun_path); + const char *sockdir=getenv("XDG_RUNTIME_DIR"); + if(sockdir == NULL) { + sockdir = "/tmp"; + } + + if (max_path_size <= snprintf(ipc->sockaddr->sun_path, max_path_size, + "%s/cagebreak-ipc.%i.%i.sock", sockdir, getuid(), getpid())) { + wlr_log(WLR_ERROR,"Unable to write socket path to ipc->sockaddr->sun_path. Path too long"); + return -1; + } + + unlink(ipc->sockaddr->sun_path); + + if (bind(ipc->socket, (struct sockaddr *)ipc->sockaddr, sizeof(*ipc->sockaddr)) == -1) { + wlr_log(WLR_ERROR, "Unable to bind IPC socket"); + return -1; + } + + if (listen(ipc->socket, 3) == -1) { + wlr_log(WLR_ERROR, "Unable to listen on IPC socket"); + } + + setenv("CAGEBREAK_SOCKET", ipc->sockaddr->sun_path, 1); + + wl_list_init(&ipc->client_list); + + ipc->display_destroy.notify = handle_display_destroy; + wl_display_add_destroy_listener(server->wl_display, &ipc->display_destroy); + + ipc->event_source = wl_event_loop_add_fd(server->event_loop, ipc->socket, + WL_EVENT_READABLE, ipc_handle_connection, server); + return 0; +} + +int ipc_handle_connection(int fd, uint32_t mask, void *data) { + (void) fd; + struct cg_server *server = data; + struct cg_ipc_handle *ipc = &server->ipc; + if(mask != WL_EVENT_READABLE) { + wlr_log(WLR_ERROR, "Expected to receive a WL_EVENT_READABLE"); + return 0; + } + + int client_fd = accept(ipc->socket, NULL, NULL); + if (client_fd == -1) { + wlr_log(WLR_ERROR, "Unable to accept IPC client connection"); + return 0; + } + + int flags; + if ((flags = fcntl(client_fd, F_GETFD)) == -1 + || fcntl(client_fd, F_SETFD, flags|FD_CLOEXEC) == -1) { + wlr_log(WLR_ERROR, "Unable to set CLOEXEC on IPC client socket"); + close(client_fd); + return 0; + } + if ((flags = fcntl(client_fd, F_GETFL)) == -1 + || fcntl(client_fd, F_SETFL, flags|O_NONBLOCK) == -1) { + wlr_log(WLR_ERROR, "Unable to set NONBLOCK on IPC client socket"); + close(client_fd); + return 0; + } + + struct cg_ipc_client *client = malloc(sizeof(struct cg_ipc_client)); + if (!client) { + wlr_log(WLR_ERROR, "Unable to allocate ipc client"); + close(client_fd); + return 0; + } + // +1 for \n and +1 for \0 + client->read_buffer = malloc(sizeof(char)*(MAX_LINE_SIZE+2)); + client->read_buf_len = 0; + client->read_discard = 0; + client->server = server; + client->fd = client_fd; + client->event_source = wl_event_loop_add_fd(server->event_loop, + client_fd, WL_EVENT_READABLE, ipc_client_handle_readable, client); + client->writable_event_source = NULL; + + client->write_buffer_size = 128; + client->write_buffer_len = 0; + client->write_buffer = malloc(client->write_buffer_size); + if (!client->write_buffer) { + wlr_log(WLR_ERROR, "Unable to allocate ipc client write buffer"); + close(client_fd); + return 0; + } + + wl_list_insert(&ipc->client_list, &client->link); + return 0; +} + +int ipc_client_handle_readable(int client_fd, uint32_t mask, void *data) { + struct cg_ipc_client *client = data; + + if (mask & WL_EVENT_ERROR) { + wlr_log(WLR_ERROR, "IPC Client socket error, removing client"); + ipc_client_disconnect(client); + return 0; + } + + if (mask & WL_EVENT_HANGUP) { + ipc_client_disconnect(client); + return 0; + } + + int read_available; + if (ioctl(client_fd, FIONREAD, &read_available) == -1) { + wlr_log(WLR_ERROR, "Unable to read IPC socket buffer size"); + ipc_client_disconnect(client); + return 0; + } + + int read_size = read_available < MAX_LINE_SIZE+1-client->read_buf_len ? read_available:MAX_LINE_SIZE+1-client->read_buf_len; + // Append to buffer + ssize_t received = recv(client_fd, client->read_buffer+client->read_buf_len, read_size, 0); + if (received == -1) { + wlr_log(WLR_ERROR, "Unable to receive data from IPC client"); + ipc_client_disconnect(client); + return 0; + } + client->read_buf_len+=received; + + ipc_client_handle_command(client); + + return 0; +} + +void ipc_client_disconnect(struct cg_ipc_client *client) { + if (client == NULL) { + wlr_log(WLR_ERROR, "Client \"NULL\" was passed to ipc_client_disconnect"); + return; + } + + shutdown(client->fd, SHUT_RDWR); + + wl_event_source_remove(client->event_source); + if (client->writable_event_source) { + wl_event_source_remove(client->writable_event_source); + } + wl_list_remove(&client->link); + free(client->write_buffer); + free(client->read_buffer); + close(client->fd); + free(client); +} + +void ipc_client_handle_command(struct cg_ipc_client *client) { + if (client == NULL) { + wlr_log(WLR_ERROR, "Client \"NULL\" was passed to ipc_client_handle_command"); + return; + } + client->read_buffer[client->read_buf_len]='\0'; + char *nl_pos; + int offset=0; + while((nl_pos = strchr(client->read_buffer+offset,'\n')) != NULL){ + if(client->read_discard) { + client->read_discard = 0; + } else { + *nl_pos='\0'; + char *line=client->read_buffer+offset; + if(*line != '\0' && *line != '#') { + message_clear(client->server->curr_output); + if(parse_rc_line(client->server, line) != 0) { + wlr_log(WLR_ERROR, "Error parsing input from IPC socket."); + } + } + } + offset+=(nl_pos-client->read_buffer)+1; + } + if(client->read_buf_len-offset == MAX_LINE_SIZE+1) { + wlr_log(WLR_ERROR, "Line received was longer that %d, discarding it",MAX_LINE_SIZE); + client->read_buf_len =0; + client->read_discard = 1; + return; + } + if(offsetread_buf_len) { + memmove(client->read_buffer, client->read_buffer+offset, client->read_buf_len-offset); + } + client->read_buf_len-=offset; +} diff --git a/ipc_server.h b/ipc_server.h new file mode 100644 index 0000000..0e5aadd --- /dev/null +++ b/ipc_server.h @@ -0,0 +1,44 @@ +#ifndef CG_IPC_SERVER_H +#define CG_IPC_SERVER_H + +#include "config.h" + +#include +#include +#include + +struct cg_server; + +struct cg_ipc_client { + struct wl_event_source *event_source; + struct wl_event_source *writable_event_source; + struct cg_server *server; + struct wl_list link; + int fd; + uint32_t security_policy; + size_t write_buffer_len; + size_t write_buffer_size; + char *write_buffer; + // The following is for storing data between event_loop calls + uint8_t read_buf_len; + uint8_t read_discard;// 1 if the current line is to be discarded + char *read_buffer; +}; + +struct cg_ipc_handle { + int socket; + struct wl_event_source *event_source; + struct wl_list client_list; + struct wl_listener display_destroy; + struct sockaddr_un *sockaddr; +}; + +int ipc_init(struct cg_server *server); +int ipc_handle_connection(int fd, uint32_t mask, void *data); +int ipc_client_handle_readable(int client_fd, uint32_t mask, void *data); +//int ipc_client_handle_writable(int client_fd, uint32_t mask, void *data); +void ipc_client_disconnect(struct cg_ipc_client *client); +void ipc_client_handle_command(struct cg_ipc_client *client); +//bool ipc_send_reply(struct ipc_client *client, const char *payload, uint32_t payload_length); + +#endif diff --git a/meson.build b/meson.build index b9ff4ed..23e6367 100644 --- a/meson.build +++ b/meson.build @@ -121,6 +121,7 @@ conf_data.set_quoted('CG_VERSION', version) cagebreak_main_file = [ 'cagebreak.c', ] cagebreak_source_strings = [ 'idle_inhibit_v1.c', + 'ipc_server.c', 'keybinding.c', 'workspace.c', 'output.c', @@ -137,6 +138,7 @@ cagebreak_source_strings = [ cagebreak_header_strings = [ 'idle_inhibit_v1.h', + 'ipc_server.h', 'keybinding.h', 'workspace.h', 'output.h', diff --git a/parse.h b/parse.h index 622697f..f170b0d 100644 --- a/parse.h +++ b/parse.h @@ -2,6 +2,8 @@ #define PARSE_H +# define MAX_LINE_SIZE 256 + struct cg_server; int diff --git a/server.h b/server.h index 930cb56..24c2fb1 100644 --- a/server.h +++ b/server.h @@ -2,6 +2,7 @@ #define CG_SERVER_H #include "config.h" +#include "ipc_server.h" #include #include @@ -40,6 +41,8 @@ struct cg_server { enum wl_output_transform output_transform; + struct cg_ipc_handle ipc; + bool running; char **modes; uint16_t nws; From 4482bb495cde9fba2b7a1dd1857802fbc452d405 Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 21 May 2020 23:16:57 +0200 Subject: [PATCH 061/689] Fix ordering of ipc --- cagebreak.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index 0f0a539..3a2c3e7 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -511,6 +511,8 @@ main(int argc, char *argv[]) { wlr_xwayland_set_seat(xwayland, server.seat->seat); #endif + ipc_init(&server); + { // config_file should only be visible as long as it is valid char *config_file = get_config_file(); if(config_file == NULL) { @@ -533,8 +535,6 @@ main(int argc, char *argv[]) { } } - ipc_init(&server); - /* Place the cursor to the top left of the output layout. */ wlr_cursor_warp(server.seat->cursor, NULL, 0, 0); From fd9c301c4d28292ccd2c57d98a5e222a05a389a1 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 22 May 2020 00:22:28 +0200 Subject: [PATCH 062/689] Fix bug on startup --- cagebreak.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cagebreak.c b/cagebreak.c index e9690a1..42fef88 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -286,7 +286,7 @@ main(int argc, char *argv[]) { server.modes[1] = strdup("root"); server.modes[2] = strdup("resize"); server.modes[3] = NULL; - if(!server.modes[0] || !server.modes[1] || server.modes[2]) { + if(server.modes[0] == NULL || server.modes[1] == NULL || server.modes[2] == NULL) { wlr_log(WLR_ERROR, "Error allocating default modes"); goto end; } From 5c0d68e2e50d86ff09363a994898175a06508c50 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 22 May 2020 09:05:41 +0200 Subject: [PATCH 063/689] Ameliorate ipc --- ipc_server.c | 10 +++++----- ipc_server.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ipc_server.c b/ipc_server.c index 2c415c1..f0b1e08 100644 --- a/ipc_server.c +++ b/ipc_server.c @@ -172,7 +172,7 @@ int ipc_client_handle_readable(int client_fd, uint32_t mask, void *data) { } int read_available; - if (ioctl(client_fd, FIONREAD, &read_available) == -1) { + if (ioctl(client_fd, FIONREAD, &read_available) < 0) { wlr_log(WLR_ERROR, "Unable to read IPC socket buffer size"); ipc_client_disconnect(client); return 0; @@ -219,7 +219,7 @@ void ipc_client_handle_command(struct cg_ipc_client *client) { } client->read_buffer[client->read_buf_len]='\0'; char *nl_pos; - int offset=0; + uint32_t offset=0; while((nl_pos = strchr(client->read_buffer+offset,'\n')) != NULL){ if(client->read_discard) { client->read_discard = 0; @@ -233,11 +233,11 @@ void ipc_client_handle_command(struct cg_ipc_client *client) { } } } - offset+=(nl_pos-client->read_buffer)+1; + offset=(nl_pos-client->read_buffer)+1; } - if(client->read_buf_len-offset == MAX_LINE_SIZE+1) { + if(offset == 0) { wlr_log(WLR_ERROR, "Line received was longer that %d, discarding it",MAX_LINE_SIZE); - client->read_buf_len =0; + client->read_buf_len = 0; client->read_discard = 1; return; } diff --git a/ipc_server.h b/ipc_server.h index 0e5aadd..91d09b2 100644 --- a/ipc_server.h +++ b/ipc_server.h @@ -20,7 +20,7 @@ struct cg_ipc_client { size_t write_buffer_size; char *write_buffer; // The following is for storing data between event_loop calls - uint8_t read_buf_len; + uint16_t read_buf_len; uint8_t read_discard;// 1 if the current line is to be discarded char *read_buffer; }; From 4bae00f5933e39dbd8196e7e13697d2213845c72 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 22 May 2020 15:40:15 +0200 Subject: [PATCH 064/689] Add fanalyzer flag by default if supported --- meson.build | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index b9ff4ed..eeef2e0 100644 --- a/meson.build +++ b/meson.build @@ -100,8 +100,10 @@ else have_xwayland = false endif -if cc.get_id() == 'gcc' and cc.version().version_compare('>=10') +fanalyzer_compile_flag=[] +if cc.has_argument('-fanalyzer') have_fanalyze=true + fanalyzer_compile_flag=[ '-fanalyzer' ] else have_fanalyze=false endif @@ -220,7 +222,7 @@ executable( cagebreak_main_file + cagebreak_sources + cagebreak_headers, dependencies: cagebreak_dependencies, install: true, - link_args: fuzz_link_args, + link_args: fuzz_link_args+fanalyzer_compile_flag, c_args: fuzz_compile_args, ) From 07ec19e45e3323c492a315ac05703e17649ea05c Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Fri, 22 May 2020 17:04:21 +0000 Subject: [PATCH 065/689] Add fanalyzer development documentation --- README.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/README.md b/README.md index e278804..b6672e5 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,35 @@ Nonetheless, don't be intimidated by the (slightly lengthy) release checklist or part of this file. Do what you can, open an issue and we will collaborate toward a solution. +### GCC and -fanalyzer + +Cagebreak should be buildable with any reasonably new gcc or clang. Consider +a gcc version of at least [10.1](https://gcc.gnu.org/gcc-10/changes.html) if +you want to get the benefit of the brand-new +[-fanalyzer](https://gcc.gnu.org/onlinedocs/gcc/Static-Analyzer-Options.html) +flag. However, this new flag sometimes produces false-postives and we +selectively disable warnings for affected code segments as described below. + +Meson is configured to set 'CG_HAS_FANALYZE' if '-fanalyzer' is available. +Because we also compile with clang for fuzzing, please use the following +preprocessor statements before + +``` +#if CG_HAS_FANALYZE +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "WARNING OPTION" +#endif +``` +and after + +``` +#if CG_HAS_FANALYZE +#pragma GCC diagnostic pop +#endif +``` + +the offending part of the code iff the warning is a false positive. + ### Branching strategy All features are to be developed on feature branches, named after the feature. From 66683293b565278acd5ac85f555f9b0102c8ef36 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Fri, 22 May 2020 17:04:39 +0000 Subject: [PATCH 066/689] Prepare 1.2.1 release --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index eeef2e0..4a06c92 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('cagebreak', 'c', - version: '1.2.0', + version: '1.2.1', license: 'MIT', default_options: [ 'c_std=c11', From 64a305cd4c1a01e5f4555d928780f6e6e57be15c Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Fri, 22 May 2020 17:23:20 +0000 Subject: [PATCH 067/689] Fix highlighting --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b6672e5..2df3e90 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ you want to get the benefit of the brand-new flag. However, this new flag sometimes produces false-postives and we selectively disable warnings for affected code segments as described below. -Meson is configured to set 'CG_HAS_FANALYZE' if '-fanalyzer' is available. +Meson is configured to set `CG_HAS_FANALYZE` if `-fanalyzer` is available. Because we also compile with clang for fuzzing, please use the following preprocessor statements before From 68950664e343c9dd4e8822aa03973343a3957d9e Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 22 May 2020 20:24:35 +0200 Subject: [PATCH 068/689] Ameliorate README --- README.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 2df3e90..6938686 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ toward a solution. ### GCC and -fanalyzer -Cagebreak should be buildable with any reasonably new gcc or clang. Consider +Cagebreak should compile with any reasonably new gcc or clang. Consider a gcc version of at least [10.1](https://gcc.gnu.org/gcc-10/changes.html) if you want to get the benefit of the brand-new [-fanalyzer](https://gcc.gnu.org/onlinedocs/gcc/Static-Analyzer-Options.html) @@ -71,8 +71,8 @@ flag. However, this new flag sometimes produces false-postives and we selectively disable warnings for affected code segments as described below. Meson is configured to set `CG_HAS_FANALYZE` if `-fanalyzer` is available. -Because we also compile with clang for fuzzing, please use the following -preprocessor statements before +Therefore, to maintain portability, false-positive fanalyzer warnings are to be +disabled using the following syntax: ``` #if CG_HAS_FANALYZE @@ -88,8 +88,6 @@ and after #endif ``` -the offending part of the code iff the warning is a false positive. - ### Branching strategy All features are to be developed on feature branches, named after the feature. @@ -112,7 +110,8 @@ git tag -v version git push --tags origin master ``` -and a log message roughly describing the features added in the commit. +and a log message roughly describing the features added in the commit is +included. In the past, our git history did not always reflect this scheme. From f568f5379e0f47f6d807744580dd45bf0469aff7 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 23 May 2020 09:16:18 +0200 Subject: [PATCH 069/689] Add error messaging to ipc --- cagebreak.c | 6 +- fuzz/fuzz-parse.c | 6 +- ipc_server.c | 10 ++- parse.c | 200 +++++++++++++++++++--------------------------- parse.h | 2 +- 5 files changed, 103 insertions(+), 121 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index 3a2c3e7..ccbbc7d 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -195,10 +195,14 @@ set_configuration(struct cg_server *server, fgets(line, MAX_LINE_SIZE, config_file) != NULL; ++line_num) { line[strcspn(line, "\n")] = '\0'; if(*line != '\0' && *line != '#') { - if(parse_rc_line(server, line) != 0) { + char *errstr; + if(parse_rc_line(server, line, &errstr) != 0) { wlr_log(WLR_ERROR, "Error in config file \"%s\", line %d\n", config_file_path, line_num); fclose(config_file); + if(errstr != NULL) { + free(errstr); + } return -1; } } diff --git a/fuzz/fuzz-parse.c b/fuzz/fuzz-parse.c index bcfb701..70602fe 100644 --- a/fuzz/fuzz-parse.c +++ b/fuzz/fuzz-parse.c @@ -406,7 +406,11 @@ set_configuration(struct cg_server *server, char *content) { (line = strtok_r(NULL, "\n", &content)) != NULL; ++line_num) { line[strcspn(line, "\n")] = '\0'; if(*line != '\0' && *line != '#') { - if(parse_rc_line(server, line) != 0) { + char *errstr; + if(parse_rc_line(server, line, &errstr) != 0) { + if(errstr != NULL) { + free(errstr); + } return -1; } } diff --git a/ipc_server.c b/ipc_server.c index f0b1e08..8a7b083 100644 --- a/ipc_server.c +++ b/ipc_server.c @@ -228,8 +228,14 @@ void ipc_client_handle_command(struct cg_ipc_client *client) { char *line=client->read_buffer+offset; if(*line != '\0' && *line != '#') { message_clear(client->server->curr_output); - if(parse_rc_line(client->server, line) != 0) { - wlr_log(WLR_ERROR, "Error parsing input from IPC socket."); + char *errstr; + if(parse_rc_line(client->server, line, &errstr) != 0) { + if(errstr != NULL) { + message_printf(client->server->curr_output, "%s", errstr); + wlr_log(WLR_ERROR, "%s",errstr); + free(errstr); + } + wlr_log(WLR_ERROR, "Error parsing input from IPC socket"); } } } diff --git a/parse.c b/parse.c index 82cc0f2..12f7ee5 100644 --- a/parse.c +++ b/parse.c @@ -11,12 +11,34 @@ #include "server.h" #include "workspace.h" +char *malloc_vsprintf(const char *fmt, va_list ap) { + va_list ap2; + va_copy(ap2,ap); + int len = vsnprintf(NULL, 0, fmt, ap); + char *ret=malloc(sizeof(char)*(len+1)); + vsnprintf(ret, len+1, fmt, ap2); + va_end(ap2); + return ret; +} + +char *log_error(const char *fmt, ...) { + va_list args; + va_start(args,fmt); + char *ret=malloc_vsprintf(fmt, args); + if(ret != NULL) { + wlr_log(WLR_ERROR, "%s", ret); + } + va_end(args); + return ret; + +} + /* parses a key definition (e.g. "S-Tab") and sets key and modifiers in * keybinding respectivly */ int -parse_key(struct keybinding *keybinding, const char *key_def) { +parse_key(struct keybinding *keybinding, const char *key_def,char **errstr) { if(key_def == NULL) { - wlr_log(WLR_ERROR, "Expected key definition, got nothing."); + *errstr=log_error("Expected key definition, got nothing."); return -1; } keybinding->modifiers = 0; @@ -44,14 +66,14 @@ parse_key(struct keybinding *keybinding, const char *key_def) { keybinding->modifiers |= WLR_MODIFIER_MOD5; break; default: - wlr_log(WLR_ERROR, "Unknown modifier \"%c\"", key_def[0]); + *errstr=log_error("Unknown modifier \"%c\"", key_def[0]); return -1; } key_def += 2; } xkb_keysym_t keysym = xkb_keysym_from_name(key_def, XKB_KEYSYM_NO_FLAGS); if(keysym == XKB_KEY_NoSymbol) { - wlr_log(WLR_ERROR, "Could not convert key \"%s\" to keysym.", key_def); + *errstr=log_error("Could not convert key \"%s\" to keysym.", key_def); return -1; } keybinding->key = keysym; @@ -60,25 +82,24 @@ parse_key(struct keybinding *keybinding, const char *key_def) { int parse_command(struct cg_server *server, struct keybinding *keybinding, - char *saveptr); + char *saveptr, char **errstr); /* Parse a keybinding definition and return it if successful, else return NULL */ struct keybinding * -parse_keybinding(struct cg_server *server, char **saveptr) { +parse_keybinding(struct cg_server *server, char **saveptr, char **errstr) { struct keybinding *keybinding = malloc(sizeof(struct keybinding)); if(keybinding == NULL) { - wlr_log(WLR_ERROR, - "Failed to allocate memory for keybinding in parse_keybinding"); + *errstr=log_error("Failed to allocate memory for keybinding in parse_keybinding"); return NULL; } char *key = strtok_r(NULL, " ", saveptr); - if(parse_key(keybinding, key) != 0) { + if(parse_key(keybinding, key, errstr) != 0) { wlr_log(WLR_ERROR, "Could not parse key definition \"%s\"", key); free(keybinding); return NULL; } - if(parse_command(server, keybinding, *saveptr) != 0) { + if(parse_command(server, keybinding, *saveptr, errstr) != 0) { free(keybinding); return NULL; } @@ -86,8 +107,8 @@ parse_keybinding(struct cg_server *server, char **saveptr) { } struct keybinding * -parse_bind(struct cg_server *server, char **saveptr) { - struct keybinding *keybinding = parse_keybinding(server, saveptr); +parse_bind(struct cg_server *server, char **saveptr, char **errstr) { + struct keybinding *keybinding = parse_keybinding(server, saveptr, errstr); if(keybinding == NULL) { wlr_log(WLR_ERROR, "Could not parse keybinding for \"bind\"."); return NULL; @@ -97,18 +118,18 @@ parse_bind(struct cg_server *server, char **saveptr) { } struct keybinding * -parse_definekey(struct cg_server *server, char **saveptr) { +parse_definekey(struct cg_server *server, char **saveptr, char **errstr) { char *mode = strtok_r(NULL, " ", saveptr); if(mode == NULL) { - wlr_log(WLR_ERROR, "Too few arguments to \"definekey\". Expected mode"); + *errstr=log_error("Too few arguments to \"definekey\". Expected mode"); return NULL; } int mode_idx = get_mode_index_from_name(server->modes, mode); if(mode_idx == -1) { - wlr_log(WLR_ERROR, "Unknown mode \"%s\"", mode); + *errstr=log_error("Unknown mode \"%s\"", mode); return NULL; } - struct keybinding *keybinding = parse_keybinding(server, saveptr); + struct keybinding *keybinding = parse_keybinding(server, saveptr, errstr); if(keybinding == NULL) { wlr_log(WLR_ERROR, "Could not parse keybinding for \"definekey\""); return NULL; @@ -118,16 +139,13 @@ parse_definekey(struct cg_server *server, char **saveptr) { } int -parse_background(struct cg_server *server, float *color, char **saveptr) { +parse_background(struct cg_server *server, float *color, char **saveptr, char **errstr) { /* Read rgb numbers */ for(unsigned int i = 0; i < 3; ++i) { char *nstr = strtok_r(NULL, " \n", saveptr); int nstrlen; if(nstr == NULL || (nstrlen = strlen(nstr)) == 0) { - wlr_log(WLR_ERROR, - "Expected three space-separated numbers (rgb) for " - "background color setting. Got %d.", - i); + *errstr=log_error("Expected three space-separated numbers (rgb) for background color setting. Got %d.", i); return -1; } if(nstr[nstrlen - 1] == '\n') { @@ -137,17 +155,11 @@ parse_background(struct cg_server *server, float *color, char **saveptr) { char *endptr = NULL; float nval = strtof(nstr, &endptr); if(endptr != nstr + nstrlen) { - wlr_log( - WLR_ERROR, - "Could not parse number \"%s\" for background color setting.", - nstr); + *errstr=log_error("Could not parse number \"%s\" for background color setting.", nstr); return -1; } if(nval < 0 || nval > 1) { - wlr_log(WLR_ERROR, - "Expected a number between 0 and 1 for setting of " - "background color. Got %f.", - nval); + *errstr=log_error("Expected a number between 0 and 1 for setting of background color. Got %f.", nval); return -1; } color[i] = nval; @@ -156,15 +168,14 @@ parse_background(struct cg_server *server, float *color, char **saveptr) { } struct keybinding * -parse_escape(char **saveptr) { +parse_escape(char **saveptr, char **errstr) { struct keybinding *keybinding = malloc(sizeof(struct keybinding)); if(keybinding == NULL) { - wlr_log(WLR_ERROR, - "Failed to allocate memory for keybinding in parse_escape"); + *errstr=log_error("Failed to allocate memory for keybinding in parse_escape"); return NULL; } char *key = strtok_r(NULL, " ", saveptr); - if(parse_key(keybinding, key) != 0) { + if(parse_key(keybinding, key, errstr) != 0) { wlr_log(WLR_ERROR, "Could not parse key definition \"%s\" for \"escape\"", key); free(keybinding); @@ -177,27 +188,25 @@ parse_escape(char **saveptr) { } char * -parse_definemode(char **saveptr) { +parse_definemode(char **saveptr, char **errstr) { char *mode = strtok_r(NULL, " ", saveptr); if(mode == NULL) { - wlr_log(WLR_ERROR, "Expected mode to succeed \"definemode\" keyword."); + *errstr=log_error("Expected mode to succeed \"definemode\" keyword."); return NULL; } return strdup(mode); } int -parse_workspaces(char **saveptr) { +parse_workspaces(char **saveptr, char **errstr) { char *nws_str = strtok_r(NULL, " ", saveptr); if(nws_str == NULL) { - wlr_log(WLR_ERROR, - "Expected argument for \"workspaces\" command, got none."); + *errstr=log_error("Expected argument for \"workspaces\" command, got none."); return -1; } long nws = strtol(nws_str, NULL, 10); if(!(1 <= nws && nws <= 30)) { - wlr_log(WLR_ERROR, - "More than 30 workspaces are not supported. Received %li", nws); + *errstr=log_error("More than 30 workspaces are not supported. Received %li", nws); return -1; } return nws; @@ -240,88 +249,62 @@ parse_float(char **saveptr, const char *delim) { } int -parse_output_config(struct wl_list *config_list, char **saveptr) { +parse_output_config(struct wl_list *config_list, char **saveptr, char **errstr) { struct cg_output_config *cfg = malloc(sizeof(struct cg_output_config)); if(cfg == NULL) { - wlr_log(WLR_ERROR, - "Failed to allocate memory for output configuration"); + *errstr=log_error("Failed to allocate memory for output configuration"); goto error; } char *name = strtok_r(NULL, " ", saveptr); if(name == NULL) { - wlr_log(WLR_ERROR, - "Expected name of output to be configured, got none"); + *errstr=log_error("Expected name of output to be configured, got none"); goto error; } char *pos_str = strtok_r(NULL, " ", saveptr); if(pos_str == NULL || strcmp(pos_str, "pos") != 0) { - wlr_log( - WLR_ERROR, - "Expected keyword \"pos\" in output configuration for output %s", - name); + *errstr=log_error("Expected keyword \"pos\" in output configuration for output %s", name); goto error; } cfg->pos.x = parse_uint(saveptr, " "); if(cfg->pos.x < 0) { - wlr_log( - WLR_ERROR, - "Error parsing x coordinate of output configuration for output %s", - name); + *errstr=log_error("Error parsing x coordinate of output configuration for output %s", name); goto error; } cfg->pos.y = parse_uint(saveptr, " "); if(cfg->pos.y < 0) { - wlr_log( - WLR_ERROR, - "Error parsing y coordinate of output configuration for output %s", - name); + *errstr=log_error("Error parsing y coordinate of output configuration for output %s", name); goto error; } char *res_str = strtok_r(NULL, " ", saveptr); if(res_str == NULL || strcmp(res_str, "res") != 0) { - wlr_log( - WLR_ERROR, - "Expected keyword \"res\" in output configuration for output %s", - name); + *errstr=log_error("Expected keyword \"res\" in output configuration for output %s", name); goto error; } cfg->pos.width = parse_uint(saveptr, "x"); if(cfg->pos.width <= 0) { - wlr_log(WLR_ERROR, - "Error parsing width of output configuration for output %s " - "(hint: width must be larger than 0)", - name); + *errstr=log_error("Error parsing width of output configuration for output %s (hint: width must be larger than 0)", name); goto error; } cfg->pos.height = parse_uint(saveptr, " "); if(cfg->pos.height <= 0) { - wlr_log(WLR_ERROR, - "Error parsing height of output configuration for output %s " - "(hint: height must e larger than 0)", - name); + *errstr=log_error("Error parsing height of output configuration for output %s (hint: height must e larger than 0)", name); goto error; } char *rate_str = strtok_r(NULL, " ", saveptr); if(rate_str == NULL || strcmp(rate_str, "rate") != 0) { - wlr_log( - WLR_ERROR, - "Expected keyword \"rate\" in output configuration for output %s", - name); + *errstr=log_error("Expected keyword \"rate\" in output configuration for output %s", name); goto error; } cfg->refresh_rate = parse_float(saveptr, " "); if(cfg->refresh_rate <= 0.0) { - wlr_log( - WLR_ERROR, - "Error parsing refresh rate of output configuration for output %s", - name); + *errstr=log_error("Error parsing refresh rate of output configuration for output %s", name); goto error; } @@ -346,10 +329,10 @@ error: int parse_command(struct cg_server *server, struct keybinding *keybinding, - char *saveptr) { + char *saveptr, char** errstr) { char *action = strtok_r(NULL, " ", &saveptr); if(action == NULL) { - wlr_log(WLR_ERROR, "Expected an action to parse, got none."); + *errstr=log_error("Expexted an action to parse, got none."); return -1; } keybinding->data = (union keybinding_params){.c = NULL}; @@ -386,8 +369,7 @@ parse_command(struct cg_server *server, struct keybinding *keybinding, } else if(strcmp(action, "exec") == 0) { keybinding->action = KEYBINDING_RUN_COMMAND; if(saveptr == NULL) { - wlr_log(WLR_ERROR, "Not enough paramaters to \"exec\". Expected " - "string to execute."); + *errstr=log_error("Not enough paramaters to \"exec\". Expected " "string to execute."); return -1; } keybinding->data.c = strdup(saveptr); @@ -407,17 +389,13 @@ parse_command(struct cg_server *server, struct keybinding *keybinding, keybinding->action = KEYBINDING_SWITCH_WORKSPACE; char *nws_str = strtok_r(NULL, " ", &saveptr); if(nws_str == NULL) { - wlr_log(WLR_ERROR, - "Expected argument for \"workspace\" action, got none."); + *errstr=log_error("Expected argument for \"workspace\" action, got none."); return -1; } long ws = strtol(nws_str, NULL, 10); if(ws < 1) { - wlr_log(WLR_ERROR, - "Workspace number must be a integer number larger or equal " - "to 1. Got %ld", - ws); + *errstr=log_error("Workspace number must be an integer number larger or equal to 1. Got %ld", ws); return -1; } keybinding->data.u = ws - 1; @@ -425,17 +403,13 @@ parse_command(struct cg_server *server, struct keybinding *keybinding, keybinding->action = KEYBINDING_MOVE_VIEW_TO_WORKSPACE; char *nws_str = strtok_r(NULL, " ", &saveptr); if(nws_str == NULL) { - wlr_log(WLR_ERROR, - "Expected argument for \"workspace\" action, got none."); + *errstr=log_error("Expected argument for \"workspace\" action, got none."); return -1; } long ws = strtol(nws_str, NULL, 10); if(ws < 1) { - wlr_log(WLR_ERROR, - "Workspace number must be an integer larger or equal to 1. " - "Got %ld", - ws); + *errstr=log_error("Workspace number must be an integer larger or equal to 1. Got %ld", ws); return -1; } keybinding->data.u = ws - 1; @@ -461,8 +435,7 @@ parse_command(struct cg_server *server, struct keybinding *keybinding, keybinding->action = KEYBINDING_CHANGE_TTY; char *ntty = strtok_r(NULL, " ", &saveptr); if(ntty == NULL) { - wlr_log(WLR_ERROR, - "Expected argument for \"switchvt\" command, got none."); + *errstr=log_error("Expected argument for \"switchvt\" command, got none."); return -1; } long tty = strtol(ntty, NULL, 10); @@ -471,13 +444,12 @@ parse_command(struct cg_server *server, struct keybinding *keybinding, keybinding->action = KEYBINDING_SWITCH_MODE; char *mode = strtok_r(NULL, " ", &saveptr); if(mode == NULL) { - wlr_log(WLR_ERROR, - "Expected mode after \"switch_mode\". Got nothing."); + *errstr=log_error("Expected mode after \"switch_mode\". Got nothing."); return -1; } int mode_idx = get_mode_index_from_name(server->modes, mode); if(mode_idx == -1) { - wlr_log(WLR_ERROR, "Unknown mode \"%s\" for switch_mode", mode); + *errstr=log_error("Unknown mode \"%s\" for switch_mode", mode); return -1; } keybinding->data.u = (unsigned int)mode_idx; @@ -485,78 +457,74 @@ parse_command(struct cg_server *server, struct keybinding *keybinding, keybinding->action = KEYBINDING_SWITCH_DEFAULT_MODE; char *mode = strtok_r(NULL, " ", &saveptr); if(mode == NULL) { - wlr_log( - WLR_ERROR, - "Expected mode after \"switch_default_mode\". Got nothing."); + *errstr=log_error("Expected mode after \"switch_default_mode\". Got nothing."); return -1; } int mode_idx = get_mode_index_from_name(server->modes, mode); if(mode_idx == -1) { - wlr_log(WLR_ERROR, "Unknown mode \"%s\" for switch_default_mode", - mode); + *errstr=log_error("Unknown mode \"%s\" for switch_default_mode", mode); return -1; } keybinding->data.u = (unsigned int)mode_idx; } else if(strcmp(action, "bind") == 0) { keybinding->action = KEYBINDING_DEFINEKEY; - keybinding->data.kb = parse_bind(server, &saveptr); + keybinding->data.kb = parse_bind(server, &saveptr, errstr); if(keybinding->data.kb == NULL) { return -1; } } else if(strcmp(action, "definekey") == 0) { keybinding->action = KEYBINDING_DEFINEKEY; - keybinding->data.kb = parse_definekey(server, &saveptr); + keybinding->data.kb = parse_definekey(server, &saveptr, errstr); if(keybinding->data.kb == NULL) { return -1; } } else if(strcmp(action, "background") == 0) { keybinding->action = KEYBINDING_BACKGROUND; - if(parse_background(server, keybinding->data.color, &saveptr) != 0) { + if(parse_background(server, keybinding->data.color, &saveptr, errstr) != 0) { return -1; } } else if(strcmp(action, "escape") == 0) { keybinding->action = KEYBINDING_DEFINEKEY; - keybinding->data.kb = parse_escape(&saveptr); + keybinding->data.kb = parse_escape(&saveptr, errstr); if(keybinding->data.kb == NULL) { return -1; } } else if(strcmp(action, "definemode") == 0) { keybinding->action = KEYBINDING_DEFINEMODE; - keybinding->data.c = parse_definemode(&saveptr); + keybinding->data.c = parse_definemode(&saveptr, errstr); if(keybinding->data.c == NULL) { return -1; } } else if(strcmp(action, "workspaces") == 0) { keybinding->action = KEYBINDING_WORKSPACES; - keybinding->data.i = parse_workspaces(&saveptr); + keybinding->data.i = parse_workspaces(&saveptr, errstr); if(keybinding->data.i < 0) { return -1; } } else if(strcmp(action, "output") == 0) { - if(parse_output_config(&server->output_config, &saveptr) != 0) { + if(parse_output_config(&server->output_config, &saveptr, errstr) != 0) { return -1; } } else { - wlr_log(WLR_ERROR, "Error, unsupported action \"%s\".", action); + *errstr=log_error("Error, unsupported action \"%s\".", action); return -1; } return 0; } int -parse_rc_line(struct cg_server *server, char *line) { +parse_rc_line(struct cg_server *server, char *line, char **errstr) { char *saveptr = strdup(line); // Used internally by strtok_r struct keybinding *keybinding = malloc(sizeof(struct keybinding)); if(keybinding == NULL) { - wlr_log(WLR_ERROR, - "Failed to allocate memory for temporary keybinding struct."); + *errstr=log_error("Failed to allocate memory for temporary keybinding struct."); free(keybinding); free(saveptr); return -1; } - if(parse_command(server, keybinding, saveptr) != 0) { - wlr_log(WLR_ERROR, "Error parsing config file."); + if(parse_command(server, keybinding, saveptr, errstr) != 0) { + wlr_log(WLR_ERROR, "Error parsing command."); free(keybinding); free(saveptr); return -1; diff --git a/parse.h b/parse.h index f170b0d..2a5da8d 100644 --- a/parse.h +++ b/parse.h @@ -7,6 +7,6 @@ struct cg_server; int -parse_rc_line(struct cg_server *server, char *line); +parse_rc_line(struct cg_server *server, char *line, char **errstr); #endif /* end of include guard PARSE_H */ From f55f70e86717cc73aaf957c954a50901780679f4 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Sat, 23 May 2020 17:27:34 +0200 Subject: [PATCH 070/689] Update version number --- man/cagebreak-config.5.md | 2 +- man/cagebreak.1.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index 8f9cb72..ed82205 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -1,4 +1,4 @@ -% CAGEBREAK-CONFIG(1) Version 1.2 | Cagebreak Manual +% CAGEBREAK-CONFIG(1) Version 1.2.1 | Cagebreak Manual # NAME diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index 07c0058..a2731d3 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -1,4 +1,4 @@ -% CAGEBREAK(1) Version 1.2 | Cagebreak Manual +% CAGEBREAK(1) Version 1.2.1 | Cagebreak Manual # NAME From 82398c777b70738741abe2353efae5235144bbe2 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Sat, 23 May 2020 17:53:41 +0200 Subject: [PATCH 071/689] Apply clang-format --- cagebreak.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cagebreak.c b/cagebreak.c index 42fef88..223beae 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -286,7 +286,8 @@ main(int argc, char *argv[]) { server.modes[1] = strdup("root"); server.modes[2] = strdup("resize"); server.modes[3] = NULL; - if(server.modes[0] == NULL || server.modes[1] == NULL || server.modes[2] == NULL) { + if(server.modes[0] == NULL || server.modes[1] == NULL || + server.modes[2] == NULL) { wlr_log(WLR_ERROR, "Error allocating default modes"); goto end; } From eb86303e841d20c0166c7c3ec1b32b2f3a8ee414 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Sun, 24 May 2020 17:50:52 +0200 Subject: [PATCH 072/689] Fix reproducibility - See Issue 5 in Bugs.md --- Bugs.md | 14 ++++++++++++-- README.md | 3 +++ meson.build | 11 +++++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/Bugs.md b/Bugs.md index b34f4f6..b4c2277 100644 --- a/Bugs.md +++ b/Bugs.md @@ -58,8 +58,8 @@ Steps to reproduce: ### Issue 4 - github issue number: #1 - Fixed: 1.1.0 + * github issue number: #1 + * Fixed: 1.1.0 This issue is code duplication in `parse.c`. @@ -79,3 +79,13 @@ PS: As a side effect, this would allow quirky statements such as `bind dbind r hsplit` which would bind the d key to binding the r key to split the output... ``` + +### Issue 5 + + * github issue number : N/A + * Fixed: 1.2.1 + +Cagebreak up to and including release 1.2.0 does not warn of irreproducibility +if a different compiler or compiler version is used. This makes cagebreak +difficult to reproduce. + diff --git a/README.md b/README.md index 6938686..8f54992 100644 --- a/README.md +++ b/README.md @@ -164,6 +164,9 @@ decided on this compromise to allow flexibility and security. In general we will adapt the versions to the packages available under arch linux at the time of release. +There are reproducibility issues up to and including release `1.2.0`. See +`Issue 5` in [Bugs.md](Bugs.md). + #### Reproducible Build Instructions All hashes and signatures are provided for the following build instructions. diff --git a/meson.build b/meson.build index 4a06c92..4c8643b 100644 --- a/meson.build +++ b/meson.build @@ -217,6 +217,17 @@ foreach name, dep : cagebreak_dependencies_dict endif endforeach +reproducible_build_compiler = 'gcc' +reproducible_build_compiler_version = '10.1.0' + +if cc.get_id() != reproducible_build_compiler + warning('The compiler "' + cc.get_id() + '" differs from the one used to generate to binary specified in the README section "Reproducible Builds" (' + reproducible_build_compiler + ').') +endif + +if cc.version() != reproducible_build_compiler_version + warning('The version of ' + cc.get_id() + ' (' + cc.version() + ') differs from the one used to generate the binary specified in the README section "Reproducible Builds" ' + reproducible_build_compiler_version + '.') +endif + executable( meson.project_name(), cagebreak_main_file + cagebreak_sources + cagebreak_headers, From 8c3821c75efdb27ef8e052cc2f0279c5651d2a9a Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 24 May 2020 18:14:38 +0200 Subject: [PATCH 073/689] Add line length check to fuzzing infrastructure --- fuzz/fuzz-parse.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/fuzz/fuzz-parse.c b/fuzz/fuzz-parse.c index bcfb701..a53883d 100644 --- a/fuzz/fuzz-parse.c +++ b/fuzz/fuzz-parse.c @@ -416,9 +416,13 @@ set_configuration(struct cg_server *server, char *content) { int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { - char *str = malloc(size * sizeof(char) + 1); - strncpy(str, (char *)data, size); - str[size] = 0; + if(size == 0) { + return 0; + } + int max_line_size=256>size?size:256; + char *str = malloc(sizeof(char)*max_line_size); + strncpy(str, (char *)data, max_line_size); + str[max_line_size-1] = 0; set_configuration(&server, str); free(str); keybinding_list_free(server.keybindings); From c3db5393b027743ce69e47f5ff0b25d830a84a46 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Sun, 24 May 2020 18:27:20 +0200 Subject: [PATCH 074/689] Add Issue 6 documentation --- Bugs.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Bugs.md b/Bugs.md index b4c2277..7845cca 100644 --- a/Bugs.md +++ b/Bugs.md @@ -89,3 +89,11 @@ Cagebreak up to and including release 1.2.0 does not warn of irreproducibility if a different compiler or compiler version is used. This makes cagebreak difficult to reproduce. +### Issue 6 + + * github issue number : N/A + * Fixed: 1.2.1 + +Our fuzzing framework up to and including release 1.2.0 does not the limit line +lengths. This can crash the fuzzing framework with a segfault due to running +out of memory. From 66d3f51e687f145337ae0bba505f04cb6db2835e Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Sun, 24 May 2020 18:31:24 +0200 Subject: [PATCH 075/689] Apply clang-format --- fuzz/fuzz-parse.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fuzz/fuzz-parse.c b/fuzz/fuzz-parse.c index a53883d..2434feb 100644 --- a/fuzz/fuzz-parse.c +++ b/fuzz/fuzz-parse.c @@ -419,10 +419,10 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { if(size == 0) { return 0; } - int max_line_size=256>size?size:256; - char *str = malloc(sizeof(char)*max_line_size); + int max_line_size = 256 > size ? size : 256; + char *str = malloc(sizeof(char) * max_line_size); strncpy(str, (char *)data, max_line_size); - str[max_line_size-1] = 0; + str[max_line_size - 1] = 0; set_configuration(&server, str); free(str); keybinding_list_free(server.keybindings); From ab33d5c230b504c0b7b015d285ac9c2de5efb52c Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Sun, 24 May 2020 18:38:27 +0200 Subject: [PATCH 076/689] Add signatures for 1.2.1 release --- signatures/1.2.0.sig | Bin 0 -> 566 bytes signatures/cagebreak.sig | Bin 566 -> 566 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 signatures/1.2.0.sig diff --git a/signatures/1.2.0.sig b/signatures/1.2.0.sig new file mode 100644 index 0000000000000000000000000000000000000000..18255c989a5f248014471ca87d0e34d33d1565fb GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j-ZpKYEIH7WG5|K!!g`E=I|>?~Ua0$#mZGyn<-5XAX( z*9`0|Td=GU0IR~cjMr-vzp4+Q%y>;=&|eqh+5NTd^Vmn-Yf;hi9?v`un2@!jWj@pD7oQnvI3QO^SRPx;FLXS9Rlm>Dx)u zj8~KZ>RgVL!w5-k+d5g)=W*(E=8ymb)fV1X|H&l<#MXRaN{|lJwd zd6Zn{<)up~7&k3dB*#A0=>Tk*iOZLIMt~y zFR_Ir{^)C8U08LeU6zITA1u^p-y14+)m+CI!*eP`gncOXgP4|!1mZ<5lNnU~kZ*p4 E?97)K8~^|S literal 0 HcmV?d00001 diff --git a/signatures/cagebreak.sig b/signatures/cagebreak.sig index 18255c989a5f248014471ca87d0e34d33d1565fb..a37d71e32647647a7bb002a6190182802402fd72 100644 GIT binary patch delta 542 zcmV+(0^$9(1hxc_BY(=Gx&R6Z5XAX(*9`0|TOcnG0FlIP=RBx_{a+33HaD1>)MaI`0crcBBFt0RJ5mVd|$aT!!ycLAjp6G_vT)Dj*E6CmG@w12!N6`*#-BR(+P8Ku=O zpP_EmJ16aa@##xv=$M`QU(IrV2|+ecF!C0AB8-W4f|}6Kn`*0s#z2`aWN_sq&$*D= zAy0s_iW1%wV#{0WCIBxSmUm-MFF++2XdBq{uFRHd6b+wtGZ+B{(hhk`0B5XX}vcMHnp5tHFArxrbtI_bet&1)c`d^>U6{Urcfn znNlE2PNzIknI~H(O7F+vvi#z}h*i~Gus`USQ7_yKw110s+l#iIzNLSlH5m=HkBmFq z%mvfmJ5K_fiEzK>0{3(7P$QfWQUo&lY74TGXZpU(Rm=IyN{&A92fzR4fSrjtJ;G9T_7bX9&#v?qpmM$ gL#YvZY!@CXqi%JK8<7W@8be!l_nW9?uxjX=MbQ2HJ^%m! delta 542 zcmV+(0^$9(1hxc_BY(YGGyn<-5XAX(*9`0|Td=GU0IR~cjMr-vzp4+Q%y>;=&|eqh z+5NTd^Vmn-Yf;hi9?v`un2@!jWj@ zpD7oQnvI3QO^SRPx;FLXS9Rlm>Dx)uj8~KZ>RgVL!w5-k+kZM))aP;Pbmou%1JxGZ zR{zN*1;o~TVdW3#Uhb`Q;<~fz(B5R11P_n7GbgxufMMH|;&cYcrf0+lhUl*@Sn_Z7 zO^Hac&@>)&^p^SdC0LWmvXnu%7haaK-Fv!OoG4^HWi=?$-!mjgX1lla;a$<^S$QFa zrqH=c&T|}&y?;NqT;}DaOMfUBH!W2p>k75}i_PWNVG8!F z49YIZ#D`M?vELRP?_B3u2=nW$b!Y_giac^m@a9zxO_FsRRuDV~RxC_}!#stghbW|4 zj`6TbAd4Q@>kHq)$ From 08dc40376db812594bf7eefcccdd8df5b99027d8 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Sun, 24 May 2020 18:40:53 +0200 Subject: [PATCH 077/689] Add hashes for 1.2.1 release --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 8f54992..9e47706 100644 --- a/README.md +++ b/README.md @@ -180,6 +180,11 @@ ninja -C build For every release after 1.0.5, hashes will be provided. +1.2.1 + + * sha 256: 803f7667dc4997062f9ec95afcdca0cac68c82a7cf057cef83fe1ccfee33b8bc + * sha 512: 4d6b7efea10d190a153f893123b1715f290f4b131b490f3d23f489e2dd8edbb886001282849aad9575ad2f40375bbbded59c1cb6157115fcc14dd6a2a061b103 + 1.2.0 * sha 256: b3c6135833001a0ef600ea9628cca11f4130a524ebe748929d8f7bad034f2bf0 From d11e744bc3020daccc34f0560daf5543ff65a04b Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Mon, 25 May 2020 13:59:55 +0200 Subject: [PATCH 078/689] Add asset generation to release checklist --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 9e47706..aa091d4 100644 --- a/README.md +++ b/README.md @@ -139,6 +139,9 @@ Release checklist * [ ] Update signature of the binary * [ ] Signature * [ ] Branching Strategy + * [ ] git archive --prefix=cagebreak/ -o release_version.tar.gz tags/version . + * [ ] gpg --detach-sign -u keyid release_version.tar.gz + * [ ] upload build assets ### Signing Key From 8f9ed7220159e97135e794b942d225e925d5ce22 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 25 May 2020 17:45:19 +0200 Subject: [PATCH 079/689] Improve error handling --- cagebreak.c | 6 +++++- ipc_server.c | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/cagebreak.c b/cagebreak.c index ccbbc7d..c99bd95 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -515,7 +515,11 @@ main(int argc, char *argv[]) { wlr_xwayland_set_seat(xwayland, server.seat->seat); #endif - ipc_init(&server); + if(ipc_init(&server) != 0) { + wlr_log(WLR_ERROR, "Failed to initialize IPC"); + ret = 1; + goto end; + } { // config_file should only be visible as long as it is valid char *config_file = get_config_file(); diff --git a/ipc_server.c b/ipc_server.c index 8a7b083..35eea2d 100644 --- a/ipc_server.c +++ b/ipc_server.c @@ -73,6 +73,7 @@ int ipc_init(struct cg_server *server) { if (max_path_size <= snprintf(ipc->sockaddr->sun_path, max_path_size, "%s/cagebreak-ipc.%i.%i.sock", sockdir, getuid(), getpid())) { wlr_log(WLR_ERROR,"Unable to write socket path to ipc->sockaddr->sun_path. Path too long"); + free(ipc->sockaddr); return -1; } @@ -80,11 +81,14 @@ int ipc_init(struct cg_server *server) { if (bind(ipc->socket, (struct sockaddr *)ipc->sockaddr, sizeof(*ipc->sockaddr)) == -1) { wlr_log(WLR_ERROR, "Unable to bind IPC socket"); + free(ipc->sockaddr); return -1; } if (listen(ipc->socket, 3) == -1) { wlr_log(WLR_ERROR, "Unable to listen on IPC socket"); + free(ipc->sockaddr); + return -1; } setenv("CAGEBREAK_SOCKET", ipc->sockaddr->sun_path, 1); From b8ba8186ece3e4f8b4cdb7334d3d1e33604223aa Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Mon, 25 May 2020 18:34:24 +0200 Subject: [PATCH 080/689] Update version number --- man/cagebreak-config.5.md | 2 +- man/cagebreak.1.md | 2 +- meson.build | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index ed82205..96aff5f 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -1,4 +1,4 @@ -% CAGEBREAK-CONFIG(1) Version 1.2.1 | Cagebreak Manual +% CAGEBREAK-CONFIG(1) Version 1.3.0 | Cagebreak Manual # NAME diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index a2731d3..de820a1 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -1,4 +1,4 @@ -% CAGEBREAK(1) Version 1.2.1 | Cagebreak Manual +% CAGEBREAK(1) Version 1.3.0 | Cagebreak Manual # NAME diff --git a/meson.build b/meson.build index fb52671..c7aef6e 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('cagebreak', 'c', - version: '1.2.1', + version: '1.3.03.03.0 license: 'MIT', default_options: [ 'c_std=c11', From e98378bffd805fd74fc469c029b42080dc15d172 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Mon, 25 May 2020 20:04:29 +0200 Subject: [PATCH 081/689] Fix quotation error --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index c7aef6e..2a2d0ba 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('cagebreak', 'c', - version: '1.3.03.03.0 + version: '1.3.0', license: 'MIT', default_options: [ 'c_std=c11', From 816283cdb15c40b0ba30e0bac41babe2f49388a0 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Mon, 25 May 2020 20:13:33 +0200 Subject: [PATCH 082/689] Apply clang-format --- cagebreak.c | 5 +- ipc_server.c | 141 ++++++++++++++++++++++++++++---------------------- ipc_server.h | 24 +++++---- parse.c | 143 +++++++++++++++++++++++++++++++++------------------ parse.h | 2 +- 5 files changed, 193 insertions(+), 122 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index c99bd95..f908117 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -47,6 +47,7 @@ #endif #include "idle_inhibit_v1.h" +#include "ipc_server.h" #include "keybinding.h" #include "message.h" #include "output.h" @@ -55,7 +56,6 @@ #include "server.h" #include "view.h" #include "xdg_shell.h" -#include "ipc_server.h" #if CG_HAS_XWAYLAND #include "xwayland.h" #endif @@ -290,7 +290,8 @@ main(int argc, char *argv[]) { server.modes[1] = strdup("root"); server.modes[2] = strdup("resize"); server.modes[3] = NULL; - if(server.modes[0] == NULL || server.modes[1] == NULL || server.modes[2] == NULL) { + if(server.modes[0] == NULL || server.modes[1] == NULL || + server.modes[2] == NULL) { wlr_log(WLR_ERROR, "Error allocating default modes"); return 1; } diff --git a/ipc_server.c b/ipc_server.c index 35eea2d..a7c6f21 100644 --- a/ipc_server.c +++ b/ipc_server.c @@ -10,21 +10,22 @@ #define _POSIX_C_SOURCE 200112L #include "ipc_server.h" -#include "server.h" -#include "parse.h" #include "message.h" +#include "parse.h" +#include "server.h" +#include +#include +#include #include #include -#include #include -#include #include -#include -static void handle_display_destroy(struct wl_listener *listener, void *data) { - struct cg_ipc_handle *ipc = wl_container_of(listener, ipc,display_destroy); - if (ipc->event_source != NULL) { +static void +handle_display_destroy(struct wl_listener *listener, void *data) { + struct cg_ipc_handle *ipc = wl_container_of(listener, ipc, display_destroy); + if(ipc->event_source != NULL) { wl_event_source_remove(ipc->event_source); } close(ipc->socket); @@ -40,18 +41,19 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) { wl_list_remove(&ipc->display_destroy.link); } -int ipc_init(struct cg_server *server) { +int +ipc_init(struct cg_server *server) { struct cg_ipc_handle *ipc = &server->ipc; ipc->socket = socket(AF_UNIX, SOCK_STREAM, 0); - if (ipc->socket == -1) { + if(ipc->socket == -1) { wlr_log(WLR_ERROR, "Unable to create IPC socket"); return -1; } - if (fcntl(ipc->socket, F_SETFD, FD_CLOEXEC) == -1) { - wlr_log(WLR_ERROR,"Unable to set CLOEXEC on IPC socket"); + if(fcntl(ipc->socket, F_SETFD, FD_CLOEXEC) == -1) { + wlr_log(WLR_ERROR, "Unable to set CLOEXEC on IPC socket"); return -1; } - if (fcntl(ipc->socket, F_SETFL, O_NONBLOCK) == -1) { + if(fcntl(ipc->socket, F_SETFL, O_NONBLOCK) == -1) { wlr_log(WLR_ERROR, "Unable to set NONBLOCK on IPC socket"); return -1; } @@ -63,29 +65,32 @@ int ipc_init(struct cg_server *server) { return -1; } - ipc->sockaddr->sun_family=AF_UNIX; + ipc->sockaddr->sun_family = AF_UNIX; int max_path_size = sizeof(ipc->sockaddr->sun_path); - const char *sockdir=getenv("XDG_RUNTIME_DIR"); + const char *sockdir = getenv("XDG_RUNTIME_DIR"); if(sockdir == NULL) { sockdir = "/tmp"; } - if (max_path_size <= snprintf(ipc->sockaddr->sun_path, max_path_size, - "%s/cagebreak-ipc.%i.%i.sock", sockdir, getuid(), getpid())) { - wlr_log(WLR_ERROR,"Unable to write socket path to ipc->sockaddr->sun_path. Path too long"); + if(max_path_size <= snprintf(ipc->sockaddr->sun_path, max_path_size, + "%s/cagebreak-ipc.%i.%i.sock", sockdir, + getuid(), getpid())) { + wlr_log(WLR_ERROR, "Unable to write socket path to " + "ipc->sockaddr->sun_path. Path too long"); free(ipc->sockaddr); return -1; } unlink(ipc->sockaddr->sun_path); - if (bind(ipc->socket, (struct sockaddr *)ipc->sockaddr, sizeof(*ipc->sockaddr)) == -1) { + if(bind(ipc->socket, (struct sockaddr *)ipc->sockaddr, + sizeof(*ipc->sockaddr)) == -1) { wlr_log(WLR_ERROR, "Unable to bind IPC socket"); free(ipc->sockaddr); return -1; } - if (listen(ipc->socket, 3) == -1) { + if(listen(ipc->socket, 3) == -1) { wlr_log(WLR_ERROR, "Unable to listen on IPC socket"); free(ipc->sockaddr); return -1; @@ -98,13 +103,15 @@ int ipc_init(struct cg_server *server) { ipc->display_destroy.notify = handle_display_destroy; wl_display_add_destroy_listener(server->wl_display, &ipc->display_destroy); - ipc->event_source = wl_event_loop_add_fd(server->event_loop, ipc->socket, - WL_EVENT_READABLE, ipc_handle_connection, server); + ipc->event_source = + wl_event_loop_add_fd(server->event_loop, ipc->socket, WL_EVENT_READABLE, + ipc_handle_connection, server); return 0; } -int ipc_handle_connection(int fd, uint32_t mask, void *data) { - (void) fd; +int +ipc_handle_connection(int fd, uint32_t mask, void *data) { + (void)fd; struct cg_server *server = data; struct cg_ipc_handle *ipc = &server->ipc; if(mask != WL_EVENT_READABLE) { @@ -113,45 +120,46 @@ int ipc_handle_connection(int fd, uint32_t mask, void *data) { } int client_fd = accept(ipc->socket, NULL, NULL); - if (client_fd == -1) { + if(client_fd == -1) { wlr_log(WLR_ERROR, "Unable to accept IPC client connection"); return 0; } int flags; - if ((flags = fcntl(client_fd, F_GETFD)) == -1 - || fcntl(client_fd, F_SETFD, flags|FD_CLOEXEC) == -1) { + if((flags = fcntl(client_fd, F_GETFD)) == -1 || + fcntl(client_fd, F_SETFD, flags | FD_CLOEXEC) == -1) { wlr_log(WLR_ERROR, "Unable to set CLOEXEC on IPC client socket"); close(client_fd); return 0; } - if ((flags = fcntl(client_fd, F_GETFL)) == -1 - || fcntl(client_fd, F_SETFL, flags|O_NONBLOCK) == -1) { + if((flags = fcntl(client_fd, F_GETFL)) == -1 || + fcntl(client_fd, F_SETFL, flags | O_NONBLOCK) == -1) { wlr_log(WLR_ERROR, "Unable to set NONBLOCK on IPC client socket"); close(client_fd); return 0; } struct cg_ipc_client *client = malloc(sizeof(struct cg_ipc_client)); - if (!client) { + if(!client) { wlr_log(WLR_ERROR, "Unable to allocate ipc client"); close(client_fd); return 0; } // +1 for \n and +1 for \0 - client->read_buffer = malloc(sizeof(char)*(MAX_LINE_SIZE+2)); + client->read_buffer = malloc(sizeof(char) * (MAX_LINE_SIZE + 2)); client->read_buf_len = 0; client->read_discard = 0; client->server = server; client->fd = client_fd; - client->event_source = wl_event_loop_add_fd(server->event_loop, - client_fd, WL_EVENT_READABLE, ipc_client_handle_readable, client); + client->event_source = + wl_event_loop_add_fd(server->event_loop, client_fd, WL_EVENT_READABLE, + ipc_client_handle_readable, client); client->writable_event_source = NULL; client->write_buffer_size = 128; client->write_buffer_len = 0; client->write_buffer = malloc(client->write_buffer_size); - if (!client->write_buffer) { + if(!client->write_buffer) { wlr_log(WLR_ERROR, "Unable to allocate ipc client write buffer"); close(client_fd); return 0; @@ -161,52 +169,58 @@ int ipc_handle_connection(int fd, uint32_t mask, void *data) { return 0; } -int ipc_client_handle_readable(int client_fd, uint32_t mask, void *data) { +int +ipc_client_handle_readable(int client_fd, uint32_t mask, void *data) { struct cg_ipc_client *client = data; - if (mask & WL_EVENT_ERROR) { + if(mask & WL_EVENT_ERROR) { wlr_log(WLR_ERROR, "IPC Client socket error, removing client"); ipc_client_disconnect(client); return 0; } - if (mask & WL_EVENT_HANGUP) { + if(mask & WL_EVENT_HANGUP) { ipc_client_disconnect(client); return 0; } int read_available; - if (ioctl(client_fd, FIONREAD, &read_available) < 0) { + if(ioctl(client_fd, FIONREAD, &read_available) < 0) { wlr_log(WLR_ERROR, "Unable to read IPC socket buffer size"); ipc_client_disconnect(client); return 0; } - int read_size = read_available < MAX_LINE_SIZE+1-client->read_buf_len ? read_available:MAX_LINE_SIZE+1-client->read_buf_len; + int read_size = read_available < MAX_LINE_SIZE + 1 - client->read_buf_len + ? read_available + : MAX_LINE_SIZE + 1 - client->read_buf_len; // Append to buffer - ssize_t received = recv(client_fd, client->read_buffer+client->read_buf_len, read_size, 0); - if (received == -1) { + ssize_t received = recv( + client_fd, client->read_buffer + client->read_buf_len, read_size, 0); + if(received == -1) { wlr_log(WLR_ERROR, "Unable to receive data from IPC client"); ipc_client_disconnect(client); return 0; } - client->read_buf_len+=received; + client->read_buf_len += received; ipc_client_handle_command(client); return 0; } -void ipc_client_disconnect(struct cg_ipc_client *client) { - if (client == NULL) { - wlr_log(WLR_ERROR, "Client \"NULL\" was passed to ipc_client_disconnect"); +void +ipc_client_disconnect(struct cg_ipc_client *client) { + if(client == NULL) { + wlr_log(WLR_ERROR, + "Client \"NULL\" was passed to ipc_client_disconnect"); return; } shutdown(client->fd, SHUT_RDWR); wl_event_source_remove(client->event_source); - if (client->writable_event_source) { + if(client->writable_event_source) { wl_event_source_remove(client->writable_event_source); } wl_list_remove(&client->link); @@ -216,43 +230,48 @@ void ipc_client_disconnect(struct cg_ipc_client *client) { free(client); } -void ipc_client_handle_command(struct cg_ipc_client *client) { - if (client == NULL) { - wlr_log(WLR_ERROR, "Client \"NULL\" was passed to ipc_client_handle_command"); +void +ipc_client_handle_command(struct cg_ipc_client *client) { + if(client == NULL) { + wlr_log(WLR_ERROR, + "Client \"NULL\" was passed to ipc_client_handle_command"); return; } - client->read_buffer[client->read_buf_len]='\0'; + client->read_buffer[client->read_buf_len] = '\0'; char *nl_pos; - uint32_t offset=0; - while((nl_pos = strchr(client->read_buffer+offset,'\n')) != NULL){ + uint32_t offset = 0; + while((nl_pos = strchr(client->read_buffer + offset, '\n')) != NULL) { if(client->read_discard) { client->read_discard = 0; } else { - *nl_pos='\0'; - char *line=client->read_buffer+offset; + *nl_pos = '\0'; + char *line = client->read_buffer + offset; if(*line != '\0' && *line != '#') { message_clear(client->server->curr_output); char *errstr; if(parse_rc_line(client->server, line, &errstr) != 0) { if(errstr != NULL) { - message_printf(client->server->curr_output, "%s", errstr); - wlr_log(WLR_ERROR, "%s",errstr); + message_printf(client->server->curr_output, "%s", + errstr); + wlr_log(WLR_ERROR, "%s", errstr); free(errstr); } wlr_log(WLR_ERROR, "Error parsing input from IPC socket"); } } } - offset=(nl_pos-client->read_buffer)+1; + offset = (nl_pos - client->read_buffer) + 1; } if(offset == 0) { - wlr_log(WLR_ERROR, "Line received was longer that %d, discarding it",MAX_LINE_SIZE); + wlr_log(WLR_ERROR, "Line received was longer that %d, discarding it", + MAX_LINE_SIZE); client->read_buf_len = 0; client->read_discard = 1; return; } - if(offsetread_buf_len) { - memmove(client->read_buffer, client->read_buffer+offset, client->read_buf_len-offset); + if(offset < client->read_buf_len) { + memmove(client->read_buffer, client->read_buffer + offset, + client->read_buf_len - offset); } - client->read_buf_len-=offset; + client->read_buf_len -= offset; } diff --git a/ipc_server.h b/ipc_server.h index 91d09b2..5e66ea4 100644 --- a/ipc_server.h +++ b/ipc_server.h @@ -3,8 +3,8 @@ #include "config.h" -#include #include +#include #include struct cg_server; @@ -21,7 +21,7 @@ struct cg_ipc_client { char *write_buffer; // The following is for storing data between event_loop calls uint16_t read_buf_len; - uint8_t read_discard;// 1 if the current line is to be discarded + uint8_t read_discard; // 1 if the current line is to be discarded char *read_buffer; }; @@ -33,12 +33,18 @@ struct cg_ipc_handle { struct sockaddr_un *sockaddr; }; -int ipc_init(struct cg_server *server); -int ipc_handle_connection(int fd, uint32_t mask, void *data); -int ipc_client_handle_readable(int client_fd, uint32_t mask, void *data); -//int ipc_client_handle_writable(int client_fd, uint32_t mask, void *data); -void ipc_client_disconnect(struct cg_ipc_client *client); -void ipc_client_handle_command(struct cg_ipc_client *client); -//bool ipc_send_reply(struct ipc_client *client, const char *payload, uint32_t payload_length); +int +ipc_init(struct cg_server *server); +int +ipc_handle_connection(int fd, uint32_t mask, void *data); +int +ipc_client_handle_readable(int client_fd, uint32_t mask, void *data); +// int ipc_client_handle_writable(int client_fd, uint32_t mask, void *data); +void +ipc_client_disconnect(struct cg_ipc_client *client); +void +ipc_client_handle_command(struct cg_ipc_client *client); +// bool ipc_send_reply(struct ipc_client *client, const char *payload, uint32_t +// payload_length); #endif diff --git a/parse.c b/parse.c index 12f7ee5..1cdcd0c 100644 --- a/parse.c +++ b/parse.c @@ -11,34 +11,35 @@ #include "server.h" #include "workspace.h" -char *malloc_vsprintf(const char *fmt, va_list ap) { +char * +malloc_vsprintf(const char *fmt, va_list ap) { va_list ap2; - va_copy(ap2,ap); + va_copy(ap2, ap); int len = vsnprintf(NULL, 0, fmt, ap); - char *ret=malloc(sizeof(char)*(len+1)); - vsnprintf(ret, len+1, fmt, ap2); + char *ret = malloc(sizeof(char) * (len + 1)); + vsnprintf(ret, len + 1, fmt, ap2); va_end(ap2); return ret; } -char *log_error(const char *fmt, ...) { +char * +log_error(const char *fmt, ...) { va_list args; - va_start(args,fmt); - char *ret=malloc_vsprintf(fmt, args); + va_start(args, fmt); + char *ret = malloc_vsprintf(fmt, args); if(ret != NULL) { wlr_log(WLR_ERROR, "%s", ret); } va_end(args); return ret; - } /* parses a key definition (e.g. "S-Tab") and sets key and modifiers in * keybinding respectivly */ int -parse_key(struct keybinding *keybinding, const char *key_def,char **errstr) { +parse_key(struct keybinding *keybinding, const char *key_def, char **errstr) { if(key_def == NULL) { - *errstr=log_error("Expected key definition, got nothing."); + *errstr = log_error("Expected key definition, got nothing."); return -1; } keybinding->modifiers = 0; @@ -66,14 +67,14 @@ parse_key(struct keybinding *keybinding, const char *key_def,char **errstr) { keybinding->modifiers |= WLR_MODIFIER_MOD5; break; default: - *errstr=log_error("Unknown modifier \"%c\"", key_def[0]); + *errstr = log_error("Unknown modifier \"%c\"", key_def[0]); return -1; } key_def += 2; } xkb_keysym_t keysym = xkb_keysym_from_name(key_def, XKB_KEYSYM_NO_FLAGS); if(keysym == XKB_KEY_NoSymbol) { - *errstr=log_error("Could not convert key \"%s\" to keysym.", key_def); + *errstr = log_error("Could not convert key \"%s\" to keysym.", key_def); return -1; } keybinding->key = keysym; @@ -90,7 +91,8 @@ struct keybinding * parse_keybinding(struct cg_server *server, char **saveptr, char **errstr) { struct keybinding *keybinding = malloc(sizeof(struct keybinding)); if(keybinding == NULL) { - *errstr=log_error("Failed to allocate memory for keybinding in parse_keybinding"); + *errstr = log_error( + "Failed to allocate memory for keybinding in parse_keybinding"); return NULL; } char *key = strtok_r(NULL, " ", saveptr); @@ -121,12 +123,13 @@ struct keybinding * parse_definekey(struct cg_server *server, char **saveptr, char **errstr) { char *mode = strtok_r(NULL, " ", saveptr); if(mode == NULL) { - *errstr=log_error("Too few arguments to \"definekey\". Expected mode"); + *errstr = + log_error("Too few arguments to \"definekey\". Expected mode"); return NULL; } int mode_idx = get_mode_index_from_name(server->modes, mode); if(mode_idx == -1) { - *errstr=log_error("Unknown mode \"%s\"", mode); + *errstr = log_error("Unknown mode \"%s\"", mode); return NULL; } struct keybinding *keybinding = parse_keybinding(server, saveptr, errstr); @@ -139,13 +142,16 @@ parse_definekey(struct cg_server *server, char **saveptr, char **errstr) { } int -parse_background(struct cg_server *server, float *color, char **saveptr, char **errstr) { +parse_background(struct cg_server *server, float *color, char **saveptr, + char **errstr) { /* Read rgb numbers */ for(unsigned int i = 0; i < 3; ++i) { char *nstr = strtok_r(NULL, " \n", saveptr); int nstrlen; if(nstr == NULL || (nstrlen = strlen(nstr)) == 0) { - *errstr=log_error("Expected three space-separated numbers (rgb) for background color setting. Got %d.", i); + *errstr = log_error("Expected three space-separated numbers (rgb) " + "for background color setting. Got %d.", + i); return -1; } if(nstr[nstrlen - 1] == '\n') { @@ -155,11 +161,15 @@ parse_background(struct cg_server *server, float *color, char **saveptr, char ** char *endptr = NULL; float nval = strtof(nstr, &endptr); if(endptr != nstr + nstrlen) { - *errstr=log_error("Could not parse number \"%s\" for background color setting.", nstr); + *errstr = log_error( + "Could not parse number \"%s\" for background color setting.", + nstr); return -1; } if(nval < 0 || nval > 1) { - *errstr=log_error("Expected a number between 0 and 1 for setting of background color. Got %f.", nval); + *errstr = log_error("Expected a number between 0 and 1 for setting " + "of background color. Got %f.", + nval); return -1; } color[i] = nval; @@ -171,7 +181,8 @@ struct keybinding * parse_escape(char **saveptr, char **errstr) { struct keybinding *keybinding = malloc(sizeof(struct keybinding)); if(keybinding == NULL) { - *errstr=log_error("Failed to allocate memory for keybinding in parse_escape"); + *errstr = log_error( + "Failed to allocate memory for keybinding in parse_escape"); return NULL; } char *key = strtok_r(NULL, " ", saveptr); @@ -191,7 +202,7 @@ char * parse_definemode(char **saveptr, char **errstr) { char *mode = strtok_r(NULL, " ", saveptr); if(mode == NULL) { - *errstr=log_error("Expected mode to succeed \"definemode\" keyword."); + *errstr = log_error("Expected mode to succeed \"definemode\" keyword."); return NULL; } return strdup(mode); @@ -201,12 +212,14 @@ int parse_workspaces(char **saveptr, char **errstr) { char *nws_str = strtok_r(NULL, " ", saveptr); if(nws_str == NULL) { - *errstr=log_error("Expected argument for \"workspaces\" command, got none."); + *errstr = log_error( + "Expected argument for \"workspaces\" command, got none."); return -1; } long nws = strtol(nws_str, NULL, 10); if(!(1 <= nws && nws <= 30)) { - *errstr=log_error("More than 30 workspaces are not supported. Received %li", nws); + *errstr = log_error( + "More than 30 workspaces are not supported. Received %li", nws); return -1; } return nws; @@ -249,62 +262,81 @@ parse_float(char **saveptr, const char *delim) { } int -parse_output_config(struct wl_list *config_list, char **saveptr, char **errstr) { +parse_output_config(struct wl_list *config_list, char **saveptr, + char **errstr) { struct cg_output_config *cfg = malloc(sizeof(struct cg_output_config)); if(cfg == NULL) { - *errstr=log_error("Failed to allocate memory for output configuration"); + *errstr = + log_error("Failed to allocate memory for output configuration"); goto error; } char *name = strtok_r(NULL, " ", saveptr); if(name == NULL) { - *errstr=log_error("Expected name of output to be configured, got none"); + *errstr = + log_error("Expected name of output to be configured, got none"); goto error; } char *pos_str = strtok_r(NULL, " ", saveptr); if(pos_str == NULL || strcmp(pos_str, "pos") != 0) { - *errstr=log_error("Expected keyword \"pos\" in output configuration for output %s", name); + *errstr = log_error( + "Expected keyword \"pos\" in output configuration for output %s", + name); goto error; } cfg->pos.x = parse_uint(saveptr, " "); if(cfg->pos.x < 0) { - *errstr=log_error("Error parsing x coordinate of output configuration for output %s", name); + *errstr = log_error( + "Error parsing x coordinate of output configuration for output %s", + name); goto error; } cfg->pos.y = parse_uint(saveptr, " "); if(cfg->pos.y < 0) { - *errstr=log_error("Error parsing y coordinate of output configuration for output %s", name); + *errstr = log_error( + "Error parsing y coordinate of output configuration for output %s", + name); goto error; } char *res_str = strtok_r(NULL, " ", saveptr); if(res_str == NULL || strcmp(res_str, "res") != 0) { - *errstr=log_error("Expected keyword \"res\" in output configuration for output %s", name); + *errstr = log_error( + "Expected keyword \"res\" in output configuration for output %s", + name); goto error; } cfg->pos.width = parse_uint(saveptr, "x"); if(cfg->pos.width <= 0) { - *errstr=log_error("Error parsing width of output configuration for output %s (hint: width must be larger than 0)", name); + *errstr = log_error("Error parsing width of output configuration for " + "output %s (hint: width must be larger than 0)", + name); goto error; } cfg->pos.height = parse_uint(saveptr, " "); if(cfg->pos.height <= 0) { - *errstr=log_error("Error parsing height of output configuration for output %s (hint: height must e larger than 0)", name); + *errstr = log_error("Error parsing height of output configuration for " + "output %s (hint: height must e larger than 0)", + name); goto error; } char *rate_str = strtok_r(NULL, " ", saveptr); if(rate_str == NULL || strcmp(rate_str, "rate") != 0) { - *errstr=log_error("Expected keyword \"rate\" in output configuration for output %s", name); + *errstr = log_error( + "Expected keyword \"rate\" in output configuration for output %s", + name); goto error; } cfg->refresh_rate = parse_float(saveptr, " "); if(cfg->refresh_rate <= 0.0) { - *errstr=log_error("Error parsing refresh rate of output configuration for output %s", name); + *errstr = log_error( + "Error parsing refresh rate of output configuration for output %s", + name); goto error; } @@ -329,10 +361,10 @@ error: int parse_command(struct cg_server *server, struct keybinding *keybinding, - char *saveptr, char** errstr) { + char *saveptr, char **errstr) { char *action = strtok_r(NULL, " ", &saveptr); if(action == NULL) { - *errstr=log_error("Expexted an action to parse, got none."); + *errstr = log_error("Expexted an action to parse, got none."); return -1; } keybinding->data = (union keybinding_params){.c = NULL}; @@ -369,7 +401,8 @@ parse_command(struct cg_server *server, struct keybinding *keybinding, } else if(strcmp(action, "exec") == 0) { keybinding->action = KEYBINDING_RUN_COMMAND; if(saveptr == NULL) { - *errstr=log_error("Not enough paramaters to \"exec\". Expected " "string to execute."); + *errstr = log_error("Not enough paramaters to \"exec\". Expected " + "string to execute."); return -1; } keybinding->data.c = strdup(saveptr); @@ -389,13 +422,16 @@ parse_command(struct cg_server *server, struct keybinding *keybinding, keybinding->action = KEYBINDING_SWITCH_WORKSPACE; char *nws_str = strtok_r(NULL, " ", &saveptr); if(nws_str == NULL) { - *errstr=log_error("Expected argument for \"workspace\" action, got none."); + *errstr = log_error( + "Expected argument for \"workspace\" action, got none."); return -1; } long ws = strtol(nws_str, NULL, 10); if(ws < 1) { - *errstr=log_error("Workspace number must be an integer number larger or equal to 1. Got %ld", ws); + *errstr = log_error("Workspace number must be an integer number " + "larger or equal to 1. Got %ld", + ws); return -1; } keybinding->data.u = ws - 1; @@ -403,13 +439,16 @@ parse_command(struct cg_server *server, struct keybinding *keybinding, keybinding->action = KEYBINDING_MOVE_VIEW_TO_WORKSPACE; char *nws_str = strtok_r(NULL, " ", &saveptr); if(nws_str == NULL) { - *errstr=log_error("Expected argument for \"workspace\" action, got none."); + *errstr = log_error( + "Expected argument for \"workspace\" action, got none."); return -1; } long ws = strtol(nws_str, NULL, 10); if(ws < 1) { - *errstr=log_error("Workspace number must be an integer larger or equal to 1. Got %ld", ws); + *errstr = log_error("Workspace number must be an integer larger or " + "equal to 1. Got %ld", + ws); return -1; } keybinding->data.u = ws - 1; @@ -435,7 +474,8 @@ parse_command(struct cg_server *server, struct keybinding *keybinding, keybinding->action = KEYBINDING_CHANGE_TTY; char *ntty = strtok_r(NULL, " ", &saveptr); if(ntty == NULL) { - *errstr=log_error("Expected argument for \"switchvt\" command, got none."); + *errstr = log_error( + "Expected argument for \"switchvt\" command, got none."); return -1; } long tty = strtol(ntty, NULL, 10); @@ -444,12 +484,13 @@ parse_command(struct cg_server *server, struct keybinding *keybinding, keybinding->action = KEYBINDING_SWITCH_MODE; char *mode = strtok_r(NULL, " ", &saveptr); if(mode == NULL) { - *errstr=log_error("Expected mode after \"switch_mode\". Got nothing."); + *errstr = + log_error("Expected mode after \"switch_mode\". Got nothing."); return -1; } int mode_idx = get_mode_index_from_name(server->modes, mode); if(mode_idx == -1) { - *errstr=log_error("Unknown mode \"%s\" for switch_mode", mode); + *errstr = log_error("Unknown mode \"%s\" for switch_mode", mode); return -1; } keybinding->data.u = (unsigned int)mode_idx; @@ -457,12 +498,14 @@ parse_command(struct cg_server *server, struct keybinding *keybinding, keybinding->action = KEYBINDING_SWITCH_DEFAULT_MODE; char *mode = strtok_r(NULL, " ", &saveptr); if(mode == NULL) { - *errstr=log_error("Expected mode after \"switch_default_mode\". Got nothing."); + *errstr = log_error( + "Expected mode after \"switch_default_mode\". Got nothing."); return -1; } int mode_idx = get_mode_index_from_name(server->modes, mode); if(mode_idx == -1) { - *errstr=log_error("Unknown mode \"%s\" for switch_default_mode", mode); + *errstr = + log_error("Unknown mode \"%s\" for switch_default_mode", mode); return -1; } keybinding->data.u = (unsigned int)mode_idx; @@ -480,7 +523,8 @@ parse_command(struct cg_server *server, struct keybinding *keybinding, } } else if(strcmp(action, "background") == 0) { keybinding->action = KEYBINDING_BACKGROUND; - if(parse_background(server, keybinding->data.color, &saveptr, errstr) != 0) { + if(parse_background(server, keybinding->data.color, &saveptr, errstr) != + 0) { return -1; } } else if(strcmp(action, "escape") == 0) { @@ -506,7 +550,7 @@ parse_command(struct cg_server *server, struct keybinding *keybinding, return -1; } } else { - *errstr=log_error("Error, unsupported action \"%s\".", action); + *errstr = log_error("Error, unsupported action \"%s\".", action); return -1; } return 0; @@ -518,7 +562,8 @@ parse_rc_line(struct cg_server *server, char *line, char **errstr) { struct keybinding *keybinding = malloc(sizeof(struct keybinding)); if(keybinding == NULL) { - *errstr=log_error("Failed to allocate memory for temporary keybinding struct."); + *errstr = log_error( + "Failed to allocate memory for temporary keybinding struct."); free(keybinding); free(saveptr); return -1; diff --git a/parse.h b/parse.h index 2a5da8d..ba1b2e8 100644 --- a/parse.h +++ b/parse.h @@ -2,7 +2,7 @@ #define PARSE_H -# define MAX_LINE_SIZE 256 +#define MAX_LINE_SIZE 256 struct cg_server; From 43b06932d75aee64e8392a9d871a81998fbc2845 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Mon, 25 May 2020 21:01:27 +0200 Subject: [PATCH 083/689] Add ipc documentation --- man/cagebreak.1.md | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index de820a1..4150ad4 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -18,10 +18,16 @@ in contrast to the original `ratpoison`, has native support for multi-workspace operation. All interactions between the user and `cagebreak` are done via -the keyboard. Configuration of this behaviour is specified -in the **\$XDG_CONFIG_PATH/cagebreak/config** file (See **cagebreak-config(5)**). +the keyboard. -## OPTIONS +Configuration of this behaviour is specified in the +**\$XDG_CONFIG_PATH/cagebreak/config** file (See **cagebreak-config(5)**). + +Scripting support is provided through the inter process communication +socket **\$CAGEBREAK_SOCKET**. +Errors are displayed in the top right corner of the screen. + +# OPTIONS -h @@ -37,6 +43,11 @@ in the **\$XDG_CONFIG_PATH/cagebreak/config** file (See **cagebreak-config(5)**) # ENVIRONMENT +`CAGEBREAK_SOCKET` + +: The inter process communication unix domain socket address accepting +everything specified in **cagebreak-config(5)** + `XKB_DEFAULT_LAYOUT` : The keyboard layout to be used (See **xkeyboard-config(7)**) From d8f801bb064151b894a660a586a4d0089f5f1777 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 25 May 2020 21:16:59 +0200 Subject: [PATCH 084/689] Reword manpage --- man/cagebreak.1.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index 4150ad4..c72323f 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -23,9 +23,12 @@ the keyboard. Configuration of this behaviour is specified in the **\$XDG_CONFIG_PATH/cagebreak/config** file (See **cagebreak-config(5)**). -Scripting support is provided through the inter process communication -socket **\$CAGEBREAK_SOCKET**. -Errors are displayed in the top right corner of the screen. +Scripting support is provided through the IPC +socket specified in the environment variable **\$CAGEBREAK_SOCKET**. +The syntax accepted through this socket is identical to +that of the configuration file (see **cagebreak-config(5)**). +Errors which occur during interaction over IPC channel +are displayed in a message box at the top right of the screen. # OPTIONS @@ -45,8 +48,8 @@ Errors are displayed in the top right corner of the screen. `CAGEBREAK_SOCKET` -: The inter process communication unix domain socket address accepting -everything specified in **cagebreak-config(5)** +: The IPC unix domain socket address accepting +commands as specified in **cagebreak-config(5)** `XKB_DEFAULT_LAYOUT` From 2f366fb4ca47b57cb97dbde53d2406004998d04d Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Mon, 25 May 2020 21:49:18 +0200 Subject: [PATCH 085/689] Add 1.3.0 Changelog --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index aa091d4..bfa20a3 100644 --- a/README.md +++ b/README.md @@ -259,6 +259,10 @@ Unifies commands and actions. See Issue 4 in Bugs.md. Adds output configuration as described in the man pages. +### Release 1.3.0 + +Adds IPC as described in the man pages. + ## License Please see [LICENSE](https://github.com/project-repo/cagebreak/blob/master/LICENSE) From f9babbe52205e7ae60286fb9c83e116c0d167e66 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Mon, 25 May 2020 22:57:56 +0200 Subject: [PATCH 086/689] Fix typo --- Bugs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bugs.md b/Bugs.md index 7845cca..f39de1c 100644 --- a/Bugs.md +++ b/Bugs.md @@ -94,6 +94,6 @@ difficult to reproduce. * github issue number : N/A * Fixed: 1.2.1 -Our fuzzing framework up to and including release 1.2.0 does not the limit line +Our fuzzing framework up to and including release 1.2.0 does not limit line lengths. This can crash the fuzzing framework with a segfault due to running out of memory. From 9605d7c243bd4b5dcdc486c24b76f996c11af3d7 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Mon, 25 May 2020 22:59:25 +0200 Subject: [PATCH 087/689] Update hashes --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index bfa20a3..19a1f02 100644 --- a/README.md +++ b/README.md @@ -183,6 +183,11 @@ ninja -C build For every release after 1.0.5, hashes will be provided. +1.3.0 + + * sha 256: aecc5292f56f7250d777110cee1f11a92018a9eb2117d7d37cd51d7d3a5cbae0 + * sha 512: 1d2d220f44787a97359a32f305e33185f0369551e61a9d7066023bfa43de50849eba5bcbb0083d2dc563ac993b8d51dd733afa0adb2a823ef50ecfee5624bbc0 + 1.2.1 * sha 256: 803f7667dc4997062f9ec95afcdca0cac68c82a7cf057cef83fe1ccfee33b8bc From b10dfb287d3619cc42bc913b3d1e1eed93991c94 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Mon, 25 May 2020 23:01:42 +0200 Subject: [PATCH 088/689] Update signatures --- signatures/1.2.1.sig | Bin 0 -> 566 bytes signatures/cagebreak.sig | Bin 566 -> 566 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 signatures/1.2.1.sig diff --git a/signatures/1.2.1.sig b/signatures/1.2.1.sig new file mode 100644 index 0000000000000000000000000000000000000000..a37d71e32647647a7bb002a6190182802402fd72 GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j-ZpKYEIH7WG5|K!!g`E=I|>?~Ua0$$3Zx&R6Z5XAX( z*9`0|TOcnG0FlIP=RBx_{a+33HaD1>)MaI`0crcBBFt0RJ5mVd|$aT!!ycLAjp z6G_vT)Dj*E6CmG@w7e!2pmxP0J}}%FrPVH

EYXC+&Xm=}Twmn4S7x&2oPUK{ik@ z@)mm{jEQ!Fn$XajYO93CK$$LNaOEV=xsci+Pk^(E65bSI%UkOv052StcVka4KqVMx z8`$)&%$8~t4WD*17y$*+4tYxeXRKo7UPc*j6|u?;M4tmV)YY~dU87{}NNshUPVs7^=CQSvN2GaF%j#^(#aub%1y&Bvi;V#HYus2~z6?VA(evWumTk&VE(Lvitm>LVRWku}b2yQ|uQ|6L#@DIRhtlcTOLX+x-2e&+5XAX(*9`0|TaZ-`|8B19v8nWt+`yQRe_>?zV9R$K zNOZ;Ao6nXhbU1&)=v=`5F>DZu{#kbT6{L}V-K$1hB}cOf3-I#7y8ey(rb(#xaKdnF zJw~ z8`fdv%)~Z_(|<4L#TiH=Ny}^&kAR=rb;~L{@JAa$My;n&b>9`oK*kX3BOp>H8@eZ# zbU)__h%*`N3}{$BBEl;tzu^qD(b*2&(|}8VO5{o)FM^hjH-UX=^?;TB%|a3~F9^;o zKfu6<&~OnzlOr+eB)@;cVVqMb;7Ph)tYRB;tvoWzF@N_#6J%u5aEWgA%%3IIiWbNH z;7~)MaI`0crcBBFt0RJ5mVd|$aT!!ycLAjp6G_vT)Dj*E6CmG@w12!N6`*#-BR(+P8Ku=O zpP_EmJ16aa@##xv=$M`QU(IrV2|+ecF!C0AB8-W4f|}6Kn`*0s#z2`aWN_sq&$*D= zAy0s_iW1%wV#{0WCIBxSmUm-MFF++2XdBq{uFRHd6b+wtGZ+B{(hhk`0B5XX}vcMHnp5tHFArxrbtI_bet&1)c`d^>U6{Urcfn znNlE2PNzIknI~H(O7F+vvi#z}h*i~Gus`USQ7_yKw110s+l#iIzNLSlH5m=HkBmFq z%mvfmJ5K_fiEzK>0{3(7P$QfWQUo&lY74TGXZpU(Rm=IyN{&A92fzR4fSrjtJ;G9T_7bX9&#v?qpmM$ gL#YvZY!@CXqi%JK8<7W@8be!l_nW9?uxjX=MbQ2HJ^%m! From a277f06224d709f78d190c212459fbecbf86b89e Mon Sep 17 00:00:00 2001 From: project-repo Date: Tue, 26 May 2020 14:16:58 +0200 Subject: [PATCH 089/689] Ameliorate meson.build - Only warn about compiler version missmatch in the case that the compilers are the same --- meson.build | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/meson.build b/meson.build index 2a2d0ba..de94fda 100644 --- a/meson.build +++ b/meson.build @@ -224,9 +224,7 @@ reproducible_build_compiler_version = '10.1.0' if cc.get_id() != reproducible_build_compiler warning('The compiler "' + cc.get_id() + '" differs from the one used to generate to binary specified in the README section "Reproducible Builds" (' + reproducible_build_compiler + ').') -endif - -if cc.version() != reproducible_build_compiler_version +elif cc.version() != reproducible_build_compiler_version warning('The version of ' + cc.get_id() + ' (' + cc.version() + ') differs from the one used to generate the binary specified in the README section "Reproducible Builds" ' + reproducible_build_compiler_version + '.') endif From 5bd9164c3b1450bb83519cefd35a3e8de92e48fd Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 28 May 2020 15:03:59 +0200 Subject: [PATCH 090/689] Fix indentiing issues --- view.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/view.c b/view.c index 609b01e..0bc6dfc 100644 --- a/view.c +++ b/view.c @@ -238,10 +238,10 @@ view_unmap(struct cg_view *view) { .focused_surface == NULL || view->workspace->server->seat->seat->keyboard_state .focused_surface == view->wlr_surface) && - view->workspace->server->curr_output - ->workspaces[view->workspace->server->curr_output - ->curr_workspace] - ->focused_tile == view_tile) { + view->workspace->server->curr_output + ->workspaces[view->workspace->server->curr_output + ->curr_workspace] + ->focused_tile == view_tile) { seat_set_focus(view->workspace->server->seat, prev); } else { view_tile->view = prev; From 32dc8c3717e10b079c3c6da0b31e10d2099a5bf3 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 29 May 2020 14:42:01 +0200 Subject: [PATCH 091/689] Restructure fuzzer --- fuzz/fuzz-lib.c | 554 ++++++++++++++++++++++++++++++++++++++++++++++ fuzz/fuzz-lib.h | 42 ++++ fuzz/fuzz-parse.c | 413 ++++------------------------------ fuzz/meson.build | 2 + 4 files changed, 642 insertions(+), 369 deletions(-) create mode 100644 fuzz/fuzz-lib.c create mode 100644 fuzz/fuzz-lib.h diff --git a/fuzz/fuzz-lib.c b/fuzz/fuzz-lib.c new file mode 100644 index 0000000..aad54b3 --- /dev/null +++ b/fuzz/fuzz-lib.c @@ -0,0 +1,554 @@ +/* + * Cagebreak: A Wayland tiling compositor. + * + * Copyright (C) 2018-2020 Jente Hidskes + * + * See the LICENSE file accompanying this file. + */ + +#define _POSIX_C_SOURCE 200812L + +#include "../keybinding.h" +#include "../output.h" +#include "../parse.h" +#include "../seat.h" +#include "../server.h" +#include "config.h" +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#if CG_HAS_XWAYLAND +#include +#endif +#include +#include +#include +#include +#if CG_HAS_XWAYLAND +#include +#endif + +#include "../idle_inhibit_v1.h" +#include "../xdg_shell.h" +#if CG_HAS_XWAYLAND +#include "../xwayland.h" +#endif + +#include "fuzz-lib.h" + +static bool +drop_permissions(void) { + if(getuid() != geteuid() || getgid() != getegid()) { + if(setuid(getuid()) != 0 || setgid(getgid()) != 0) { + wlr_log(WLR_ERROR, "Unable to drop root, refusing to start"); + return false; + } + } + + if(setuid(0) != -1) { + wlr_log(WLR_ERROR, "Unable to drop root (we shouldn't be able to " + "restore it after setuid), refusing to start"); + return false; + } + + return true; +} + +static bool +parse_args(struct cg_server *server, int argc, char *argv[]) { + server->output_transform = WL_OUTPUT_TRANSFORM_NORMAL; +#ifdef DEBUG + server->debug_damage_tracking = false; +#endif + return true; +} + +void +cleanup() { + server.running = false; +#if CG_HAS_XWAYLAND + if(xwayland != NULL) { + wlr_xwayland_destroy(xwayland); + } + if(xcursor_manager != NULL) { + wlr_xcursor_manager_destroy(xcursor_manager); + } +#endif + wl_display_destroy_clients(server.wl_display); + + for(unsigned int i = 0; server.modes[i] != NULL; ++i) { + free(server.modes[i]); + } + free(server.modes); + + keybinding_list_free(server.keybindings); + + seat_destroy(server.seat); + /* This function is not null-safe, but we only ever get here + with a proper wl_display. */ + wl_display_destroy(server.wl_display); + wlr_output_layout_destroy(server.output_layout); +} + +int +LLVMFuzzerInitialize(int *argc, char ***argv) { + struct wl_event_loop *event_loop = NULL; + struct wlr_backend *backend = NULL; + struct wlr_renderer *renderer = NULL; + struct wlr_compositor *compositor = NULL; + struct wlr_data_device_manager *data_device_manager = NULL; + struct wlr_server_decoration_manager *server_decoration_manager = NULL; + struct wlr_xdg_decoration_manager_v1 *xdg_decoration_manager = NULL; + struct wlr_export_dmabuf_manager_v1 *export_dmabuf_manager = NULL; + struct wlr_screencopy_manager_v1 *screencopy_manager = NULL; + struct wlr_xdg_output_manager_v1 *output_manager = NULL; + struct wlr_gamma_control_manager_v1 *gamma_control_manager = NULL; + int ret = 0; + + if(!parse_args(&server, *argc, *argv)) { + return 1; + } + +#ifdef DEBUG + wlr_log_init(WLR_DEBUG, NULL); +#else + wlr_log_init(WLR_ERROR, NULL); +#endif + + /* Wayland requires XDG_RUNTIME_DIR to be set. */ + if(!getenv("XDG_RUNTIME_DIR")) { + wlr_log(WLR_ERROR, "XDG_RUNTIME_DIR is not set in the environment"); + return 1; + } + + server.wl_display = wl_display_create(); + if(!server.wl_display) { + wlr_log(WLR_ERROR, "Cannot allocate a Wayland display"); + return 1; + } + + server.running = true; + + server.modes = malloc(4 * sizeof(char *)); + server.modes[0] = strdup("top"); + server.modes[1] = strdup("root"); + server.modes[2] = strdup("resize"); + server.modes[3] = NULL; + + server.nws = 1; + server.message_timeout = 2; + + event_loop = wl_display_get_event_loop(server.wl_display); + server.event_loop = event_loop; + + backend = wlr_multi_backend_create(server.wl_display); + if(!backend) { + wlr_log(WLR_ERROR, "Unable to create the wlroots multi backend"); + ret = 1; + goto end; + } + server.backend = backend; + + struct wlr_backend *headless_backend=wlr_headless_backend_create(server.wl_display, NULL); + if(!headless_backend) { + wlr_log(WLR_ERROR, "Unable to create the wlroots headless backend"); + ret = 1; + goto end; + } + wlr_headless_add_output(headless_backend,600,300); + + + if(!wlr_multi_backend_add(backend, headless_backend)) { + wlr_log(WLR_ERROR, "Unable to insert headless backend into multi backend"); + ret = 1; + goto end; + }; + + if(!drop_permissions()) { + ret = 1; + goto end; + } + + server.keybindings = keybinding_list_init(); + if(server.keybindings == NULL || server.keybindings->keybindings == NULL) { + wlr_log(WLR_ERROR, "Unable to allocate keybindings"); + ret = 1; + goto end; + } + + wl_list_init(&server.output_config); + + renderer = wlr_backend_get_renderer(backend); + wlr_renderer_init_wl_display(renderer, server.wl_display); + + server.bg_color = malloc(4 * sizeof(float)); + server.bg_color[0] = 0; + server.bg_color[1] = 0; + server.bg_color[2] = 0; + server.bg_color[3] = 1; + wl_list_init(&server.outputs); + + server.output_layout = wlr_output_layout_create(); + if(!server.output_layout) { + wlr_log(WLR_ERROR, "Unable to create output layout"); + ret = 1; + goto end; + } + + data_device_manager = wlr_data_device_manager_create(server.wl_display); + if(!data_device_manager) { + wlr_log(WLR_ERROR, "Unable to create the data device manager"); + ret = 1; + goto end; + } + + /* Configure a listener to be notified when new outputs are + * available on the backend. We use this only to detect the + * first output and ignore subsequent outputs. */ + server.new_output.notify = handle_new_output; + wl_signal_add(&backend->events.new_output, &server.new_output); + + server.seat = seat_create(&server, backend); + if(!server.seat) { + wlr_log(WLR_ERROR, "Unable to create the seat"); + ret = 1; + goto end; + } + + server.idle = wlr_idle_create(server.wl_display); + if(!server.idle) { + wlr_log(WLR_ERROR, "Unable to create the idle tracker"); + ret = 1; + goto end; + } + + server.idle_inhibit_v1 = wlr_idle_inhibit_v1_create(server.wl_display); + if(!server.idle_inhibit_v1) { + wlr_log(WLR_ERROR, "Cannot create the idle inhibitor"); + ret = 1; + goto end; + } + server.new_idle_inhibitor_v1.notify = handle_idle_inhibitor_v1_new; + wl_signal_add(&server.idle_inhibit_v1->events.new_inhibitor, + &server.new_idle_inhibitor_v1); + wl_list_init(&server.inhibitors); + + xdg_shell = wlr_xdg_shell_create(server.wl_display); + if(!xdg_shell) { + wlr_log(WLR_ERROR, "Unable to create the XDG shell interface"); + ret = 1; + goto end; + } + server.new_xdg_shell_surface.notify = handle_xdg_shell_surface_new; + wl_signal_add(&xdg_shell->events.new_surface, + &server.new_xdg_shell_surface); + + xdg_decoration_manager = + wlr_xdg_decoration_manager_v1_create(server.wl_display); + if(!xdg_decoration_manager) { + wlr_log(WLR_ERROR, "Unable to create the XDG decoration manager"); + ret = 1; + goto end; + } + wl_signal_add(&xdg_decoration_manager->events.new_toplevel_decoration, + &server.xdg_toplevel_decoration); + server.xdg_toplevel_decoration.notify = handle_xdg_toplevel_decoration; + + server_decoration_manager = + wlr_server_decoration_manager_create(server.wl_display); + if(!server_decoration_manager) { + wlr_log(WLR_ERROR, "Unable to create the server decoration manager"); + ret = 1; + goto end; + } + wlr_server_decoration_manager_set_default_mode( + server_decoration_manager, WLR_SERVER_DECORATION_MANAGER_MODE_SERVER); + + export_dmabuf_manager = + wlr_export_dmabuf_manager_v1_create(server.wl_display); + if(!export_dmabuf_manager) { + wlr_log(WLR_ERROR, "Unable to create the export DMABUF manager"); + ret = 1; + goto end; + } + + screencopy_manager = wlr_screencopy_manager_v1_create(server.wl_display); + if(!screencopy_manager) { + wlr_log(WLR_ERROR, "Unable to create the screencopy manager"); + ret = 1; + goto end; + } + + output_manager = wlr_xdg_output_manager_v1_create(server.wl_display, + server.output_layout); + if(!output_manager) { + wlr_log(WLR_ERROR, "Unable to create the output manager"); + ret = 1; + goto end; + } + + gamma_control_manager = + wlr_gamma_control_manager_v1_create(server.wl_display); + if(!gamma_control_manager) { + wlr_log(WLR_ERROR, "Unable to create the gamma control manager"); + ret = 1; + goto end; + } + + if(!compositor) { + wlr_log(WLR_ERROR, "Unable to create the wlroots compositor"); + ret = 1; + goto end; + } + + compositor = wlr_compositor_create(server.wl_display, renderer); + if(!compositor) { + wlr_log(WLR_ERROR, "Unable to create the wlroots compositor"); + ret = 1; + goto end; + } + +#if CG_HAS_XWAYLAND + xwayland = wlr_xwayland_create(server.wl_display, compositor, true); + if(!xwayland) { + wlr_log(WLR_ERROR, "Cannot create XWayland server"); + ret = 1; + goto end; + } + server.new_xwayland_surface.notify = handle_xwayland_surface_new; + wl_signal_add(&xwayland->events.new_surface, &server.new_xwayland_surface); + + xcursor_manager = wlr_xcursor_manager_create(DEFAULT_XCURSOR, XCURSOR_SIZE); + if(!xcursor_manager) { + wlr_log(WLR_ERROR, "Cannot create XWayland XCursor manager"); + ret = 1; + goto end; + } + + if(setenv("DISPLAY", xwayland->display_name, true) < 0) { + wlr_log_errno(WLR_ERROR, "Unable to set DISPLAY for XWayland.", + "Clients may not be able to connect"); + } else { + wlr_log(WLR_DEBUG, "XWayland is running on display %s", + xwayland->display_name); + } + + if(wlr_xcursor_manager_load(xcursor_manager, 1)) { + wlr_log(WLR_ERROR, "Cannot load XWayland XCursor theme"); + } + struct wlr_xcursor *xcursor = + wlr_xcursor_manager_get_xcursor(xcursor_manager, DEFAULT_XCURSOR, 1); + if(xcursor) { + struct wlr_xcursor_image *image = xcursor->images[0]; + wlr_xwayland_set_cursor(xwayland, image->buffer, image->width * 4, + image->width, image->height, image->hotspot_x, + image->hotspot_y); + } + +#endif + + const char *socket = wl_display_add_socket_auto(server.wl_display); + if(!socket) { + wlr_log_errno(WLR_ERROR, "Unable to open Wayland socket"); + ret = 1; + goto end; + } + + if(!wlr_backend_start(backend)) { + wlr_log(WLR_ERROR, "Unable to start the wlroots backend"); + ret = 1; + goto end; + } + + if(setenv("WAYLAND_DISPLAY", socket, true) < 0) { + wlr_log_errno(WLR_ERROR, "Unable to set WAYLAND_DISPLAY.", + "Clients may not be able to connect"); + } else { + wlr_log(WLR_DEBUG, + "Cagebreak " CG_VERSION " is running on Wayland display %s", + socket); + } + + /* Place the cursor to the topl left of the output layout. */ + wlr_cursor_warp(server.seat->cursor, NULL, 0, 0); + atexit(cleanup); + //server.wl_display->run = 1; + return 0; +end: + cleanup(); + return ret; +} + +void +move_cursor(char *line, struct cg_server *server) { + return;//TODO + long del=0; + char *delstr = strtok_r(NULL, ";", &line); + enum wlr_axis_orientation orientation = (*(line++)=='0')? WLR_AXIS_ORIENTATION_VERTICAL:WLR_AXIS_ORIENTATION_HORIZONTAL; + if(delstr == NULL) { + return; + } + del=strtol(delstr,NULL,10); + struct wlr_event_pointer_axis event = { + .device = NULL, + .time_msec = 0, + .source = WLR_AXIS_SOURCE_WHEEL, + .orientation = orientation, + .delta = del * 15, + .delta_discrete = del + }; + //TODO dispatch_cursor_axis(server->seat->cursor, &event); +} + +void add_output_callback(struct wlr_backend *backend, void *data) { + long *dims=data; + wlr_headless_add_output(backend, dims[0], dims[1]); +} + +void +create_output(char *line, struct cg_server *server) { + char *widthstr = strtok_r(NULL, ";", &line); + long dims[2]= {600, 200}; + if(widthstr != NULL) { + dims[0]=strtol(widthstr,NULL,10); + if(line[0] != '\0') { + ++line; + } + } + char *heightstr = strtok_r(NULL, ";", &line); + if(heightstr != NULL) { + dims[1]=strtol(heightstr,NULL,10); + } + long max_dim = 10000; + if (dims[0] > max_dim || dims[0] <= 0 ) { + wlr_log(WLR_ERROR, "height out of range."); + return; + } else if (dims[1] > max_dim || dims[1] <= 0) { + wlr_log(WLR_ERROR, "width out of range."); + return; + } + wlr_multi_for_each_backend(server->backend, add_output_callback, dims); +} + +void add_input_device_callback(struct wlr_backend *backend, void *data) { + enum wlr_input_device_type *type=data; + wlr_headless_add_input_device(backend, *type); +} + +void +create_input_device(char *line, struct cg_server *server) { + enum wlr_input_device_type type; + if(*line != '\0') { + if(strncmp(line,"kbd",3) == 0) { + type = WLR_INPUT_DEVICE_KEYBOARD; + wlr_multi_for_each_backend(server->backend, add_input_device_callback, &type); + } else if(strncmp(line,"ptr",3) == 0) { + type = WLR_INPUT_DEVICE_POINTER; + wlr_multi_for_each_backend(server->backend, add_input_device_callback, &type); + } else if(strncmp(line,"tch",3) == 0) { + type = WLR_INPUT_DEVICE_TOUCH; + wlr_multi_for_each_backend(server->backend, add_input_device_callback, &type); + } + } +} + +void +destroy_input_device(char *line, struct cg_server *server) { + long devn=0; + if(line[0] != '\0') { + devn = strtol(line+1,NULL,10); + } + if(line != NULL) { + if(strncmp(line,"k",1) == 0) { + if(wl_list_empty(&server->seat->keyboard_groups)) { + return; + } + devn = devn % wl_list_length(&server->seat->keyboard_groups); + struct cg_keyboard_group *group, *group_tmp; + wl_list_for_each_safe(group, group_tmp, &server->seat->keyboard_groups, link) { + if(devn == 0) { + wl_list_remove(&group->link); + wlr_keyboard_group_destroy(group->wlr_group); + wl_event_source_remove(group->key_repeat_timer); + free(group); + break; + } + --devn; + } + } else if(strncmp(line,"p",1) == 0) { + if(wl_list_empty(&server->seat->pointers)) { + return; + } + devn = devn % wl_list_length(&server->seat->pointers); + struct cg_pointer *pointer, *pointer_tmp; + wl_list_for_each_safe(pointer, pointer_tmp, &server->seat->pointers, link) { + if(devn == 0) { + pointer->destroy.notify(&pointer->destroy, NULL); + break; + } + --devn; + } + } else if(strncmp(line,"t",1) == 0) { + if(wl_list_empty(&server->seat->touch)) { + return; + } + devn = devn % wl_list_length(&server->seat->touch); + struct cg_touch *touch, *touch_tmp; + wl_list_for_each_safe(touch, touch_tmp, &server->seat->touch, link) { + if(devn == 0) { + touch->destroy.notify(&touch->destroy, NULL); + break; + } + --devn; + } + + } + } +} + +void +destroy_output(char *line, struct cg_server *server) { + if(wl_list_length(&server->outputs)<2) { + return; + } + char *outpnstr = strtok_r(NULL, ";", &line); + long outpn = 0; + if(outpnstr != NULL) { + outpn=strtol(outpnstr,NULL,10); + } + outpn=outpn%wl_list_length(&server->outputs); + struct cg_output *it; + wl_list_for_each(it,&server->outputs,link) { + if(outpn == 0) { + break; + } else { + --outpn; + } + } + it->damage_destroy.notify(&it->damage_destroy,NULL); +} diff --git a/fuzz/fuzz-lib.h b/fuzz/fuzz-lib.h new file mode 100644 index 0000000..95007b3 --- /dev/null +++ b/fuzz/fuzz-lib.h @@ -0,0 +1,42 @@ +/* + * Cagebreak: A Wayland tiling compositor. + * + * Copyright (C) 2018-2020 Jente Hidskes + * + * See the LICENSE file accompanying this file. + */ + +#ifndef CG_FUZZ_LIB_H +#define CG_FUZZ_LIB_H + +#define _POSIX_C_SOURCE 200812L + +#include "../server.h" + +#ifndef WAIT_ANY +#define WAIT_ANY -1 +#endif + +struct cg_server server; +struct wlr_xdg_shell *xdg_shell; + +struct wlr_xwayland *xwayland; +#if CG_HAS_XWAYLAND +struct wlr_xcursor_manager *xcursor_manager; +#endif + +void cleanup(); + +int LLVMFuzzerInitialize(int *argc, char ***argv); + +void move_cursor(char *line, struct cg_server *server); + +void create_output(char *line, struct cg_server *server); + +void create_input_device(char *line, struct cg_server *server); + +void destroy_input_device(char *line, struct cg_server *server); + +void destroy_output(char *line, struct cg_server *server); + +#endif diff --git a/fuzz/fuzz-parse.c b/fuzz/fuzz-parse.c index 45e74da..09ce0c0 100644 --- a/fuzz/fuzz-parse.c +++ b/fuzz/fuzz-parse.c @@ -8,394 +8,46 @@ #define _POSIX_C_SOURCE 200812L -#include "../keybinding.h" -#include "../output.h" -#include "../parse.h" -#include "../seat.h" -#include "../server.h" -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#if CG_HAS_XWAYLAND -#include -#endif -#include -#include +#include #include #include -#if CG_HAS_XWAYLAND -#include -#endif -#include "../idle_inhibit_v1.h" +#include "config.h" #include "../keybinding.h" #include "../message.h" #include "../output.h" #include "../parse.h" #include "../seat.h" #include "../server.h" -#include "../view.h" #include "../workspace.h" -#include "../xdg_shell.h" #if CG_HAS_XWAYLAND #include "../xwayland.h" #endif -#ifndef WAIT_ANY -#define WAIT_ANY -1 -#endif - -static bool -drop_permissions(void) { - if(getuid() != geteuid() || getgid() != getegid()) { - if(setuid(getuid()) != 0 || setgid(getgid()) != 0) { - wlr_log(WLR_ERROR, "Unable to drop root, refusing to start"); - return false; - } - } - - if(setuid(0) != -1) { - wlr_log(WLR_ERROR, "Unable to drop root (we shouldn't be able to " - "restore it after setuid), refusing to start"); - return false; - } - - return true; -} - -static bool -parse_args(struct cg_server *server, int argc, char *argv[]) { - server->output_transform = WL_OUTPUT_TRANSFORM_NORMAL; -#ifdef DEBUG - server->debug_damage_tracking = false; -#endif - return true; -} - -struct cg_server server = {0}; -struct wlr_xwayland *xwayland = NULL; -#if CG_HAS_XWAYLAND -struct wlr_xcursor_manager *xcursor_manager = NULL; -#endif - -void -cleanup() { - server.running = false; -#if CG_HAS_XWAYLAND - if(xwayland != NULL) { - wlr_xwayland_destroy(xwayland); - } - if(xcursor_manager != NULL) { - wlr_xcursor_manager_destroy(xcursor_manager); - } -#endif - wl_display_destroy_clients(server.wl_display); - - for(unsigned int i = 0; server.modes[i] != NULL; ++i) { - free(server.modes[i]); - } - free(server.modes); - - keybinding_list_free(server.keybindings); - - seat_destroy(server.seat); - /* This function is not null-safe, but we only ever get here - with a proper wl_display. */ - wl_display_destroy(server.wl_display); - wlr_output_layout_destroy(server.output_layout); -} +#include "fuzz-lib.h" int -LLVMFuzzerInitialize(int *argc, char ***argv) { - struct wl_event_loop *event_loop = NULL; - struct wlr_backend *backend = NULL; - struct wlr_renderer *renderer = NULL; - struct wlr_compositor *compositor = NULL; - struct wlr_data_device_manager *data_device_manager = NULL; - struct wlr_server_decoration_manager *server_decoration_manager = NULL; - struct wlr_xdg_decoration_manager_v1 *xdg_decoration_manager = NULL; - struct wlr_export_dmabuf_manager_v1 *export_dmabuf_manager = NULL; - struct wlr_screencopy_manager_v1 *screencopy_manager = NULL; - struct wlr_xdg_output_manager_v1 *output_manager = NULL; - struct wlr_gamma_control_manager_v1 *gamma_control_manager = NULL; - struct wlr_xdg_shell *xdg_shell = NULL; - int ret = 0; - - if(!parse_args(&server, *argc, *argv)) { - return 1; +fuzz_cmds(struct cg_server *server, char *line) { + if(strncmp(line, "mcurs",5) == 0) { + move_cursor(&line[5], server); + return 0; + } else if(strncmp(line, "noutp",5) == 0) { + create_output(&line[5], server); + return 0; + } else if(strncmp(line, "doutp",5) == 0) { + destroy_output(&line[5], server); + return 0; + } else if(strncmp(line, "crdev",5) == 0) { + return -1; + create_input_device(&line[5], server); + return 0; + } else if(strncmp(line, "ddev",5) == 0) { + destroy_input_device(&line[5], server); + return 0; } - -#ifdef DEBUG - wlr_log_init(WLR_DEBUG, NULL); -#else - wlr_log_init(WLR_ERROR, NULL); -#endif - - /* Wayland requires XDG_RUNTIME_DIR to be set. */ - if(!getenv("XDG_RUNTIME_DIR")) { - wlr_log(WLR_ERROR, "XDG_RUNTIME_DIR is not set in the environment"); - return 1; - } - - server.wl_display = wl_display_create(); - if(!server.wl_display) { - wlr_log(WLR_ERROR, "Cannot allocate a Wayland display"); - return 1; - } - - server.running = true; - - server.modes = malloc(4 * sizeof(char *)); - server.modes[0] = strdup("top"); - server.modes[1] = strdup("root"); - server.modes[2] = strdup("resize"); - server.modes[3] = NULL; - - server.nws = 1; - server.message_timeout = 2; - - event_loop = wl_display_get_event_loop(server.wl_display); - server.event_loop = event_loop; - - backend = wlr_backend_autocreate(server.wl_display, NULL); - if(!backend) { - wlr_log(WLR_ERROR, "Unable to create the wlroots backend"); - ret = 1; - goto end; - } - server.backend = backend; - - if(!drop_permissions()) { - ret = 1; - goto end; - } - - server.keybindings = keybinding_list_init(); - if(server.keybindings == NULL || server.keybindings->keybindings == NULL) { - wlr_log(WLR_ERROR, "Unable to allocate keybindings"); - ret = 1; - goto end; - } - - wl_list_init(&server.output_config); - - renderer = wlr_backend_get_renderer(backend); - wlr_renderer_init_wl_display(renderer, server.wl_display); - - server.bg_color = malloc(4 * sizeof(float)); - server.bg_color[0] = 0; - server.bg_color[1] = 0; - server.bg_color[2] = 0; - server.bg_color[3] = 1; - wl_list_init(&server.outputs); - - server.output_layout = wlr_output_layout_create(); - if(!server.output_layout) { - wlr_log(WLR_ERROR, "Unable to create output layout"); - ret = 1; - goto end; - } - - compositor = wlr_compositor_create(server.wl_display, renderer); - if(!compositor) { - wlr_log(WLR_ERROR, "Unable to create the wlroots compositor"); - ret = 1; - goto end; - } - - data_device_manager = wlr_data_device_manager_create(server.wl_display); - if(!data_device_manager) { - wlr_log(WLR_ERROR, "Unable to create the data device manager"); - ret = 1; - goto end; - } - - /* Configure a listener to be notified when new outputs are - * available on the backend. We use this only to detect the - * first output and ignore subsequent outputs. */ - server.new_output.notify = handle_new_output; - wl_signal_add(&backend->events.new_output, &server.new_output); - - server.seat = seat_create(&server, backend); - if(!server.seat) { - wlr_log(WLR_ERROR, "Unable to create the seat"); - ret = 1; - goto end; - } - - server.idle = wlr_idle_create(server.wl_display); - if(!server.idle) { - wlr_log(WLR_ERROR, "Unable to create the idle tracker"); - ret = 1; - goto end; - } - - server.idle_inhibit_v1 = wlr_idle_inhibit_v1_create(server.wl_display); - if(!server.idle_inhibit_v1) { - wlr_log(WLR_ERROR, "Cannot create the idle inhibitor"); - ret = 1; - goto end; - } - server.new_idle_inhibitor_v1.notify = handle_idle_inhibitor_v1_new; - wl_signal_add(&server.idle_inhibit_v1->events.new_inhibitor, - &server.new_idle_inhibitor_v1); - wl_list_init(&server.inhibitors); - - xdg_shell = wlr_xdg_shell_create(server.wl_display); - if(!xdg_shell) { - wlr_log(WLR_ERROR, "Unable to create the XDG shell interface"); - ret = 1; - goto end; - } - server.new_xdg_shell_surface.notify = handle_xdg_shell_surface_new; - wl_signal_add(&xdg_shell->events.new_surface, - &server.new_xdg_shell_surface); - - xdg_decoration_manager = - wlr_xdg_decoration_manager_v1_create(server.wl_display); - if(!xdg_decoration_manager) { - wlr_log(WLR_ERROR, "Unable to create the XDG decoration manager"); - ret = 1; - goto end; - } - wl_signal_add(&xdg_decoration_manager->events.new_toplevel_decoration, - &server.xdg_toplevel_decoration); - server.xdg_toplevel_decoration.notify = handle_xdg_toplevel_decoration; - - server_decoration_manager = - wlr_server_decoration_manager_create(server.wl_display); - if(!server_decoration_manager) { - wlr_log(WLR_ERROR, "Unable to create the server decoration manager"); - ret = 1; - goto end; - } - wlr_server_decoration_manager_set_default_mode( - server_decoration_manager, WLR_SERVER_DECORATION_MANAGER_MODE_SERVER); - - export_dmabuf_manager = - wlr_export_dmabuf_manager_v1_create(server.wl_display); - if(!export_dmabuf_manager) { - wlr_log(WLR_ERROR, "Unable to create the export DMABUF manager"); - ret = 1; - goto end; - } - - screencopy_manager = wlr_screencopy_manager_v1_create(server.wl_display); - if(!screencopy_manager) { - wlr_log(WLR_ERROR, "Unable to create the screencopy manager"); - ret = 1; - goto end; - } - - output_manager = wlr_xdg_output_manager_v1_create(server.wl_display, - server.output_layout); - if(!output_manager) { - wlr_log(WLR_ERROR, "Unable to create the output manager"); - ret = 1; - goto end; - } - - gamma_control_manager = - wlr_gamma_control_manager_v1_create(server.wl_display); - if(!gamma_control_manager) { - wlr_log(WLR_ERROR, "Unable to create the gamma control manager"); - ret = 1; - goto end; - } - -#if CG_HAS_XWAYLAND - xwayland = wlr_xwayland_create(server.wl_display, compositor, true); - if(!xwayland) { - wlr_log(WLR_ERROR, "Cannot create XWayland server"); - ret = 1; - goto end; - } - server.new_xwayland_surface.notify = handle_xwayland_surface_new; - wl_signal_add(&xwayland->events.new_surface, &server.new_xwayland_surface); - - xcursor_manager = wlr_xcursor_manager_create(DEFAULT_XCURSOR, XCURSOR_SIZE); - if(!xcursor_manager) { - wlr_log(WLR_ERROR, "Cannot create XWayland XCursor manager"); - ret = 1; - goto end; - } - - if(setenv("DISPLAY", xwayland->display_name, true) < 0) { - wlr_log_errno(WLR_ERROR, "Unable to set DISPLAY for XWayland.", - "Clients may not be able to connect"); - } else { - wlr_log(WLR_DEBUG, "XWayland is running on display %s", - xwayland->display_name); - } - - if(wlr_xcursor_manager_load(xcursor_manager, 1)) { - wlr_log(WLR_ERROR, "Cannot load XWayland XCursor theme"); - } - struct wlr_xcursor *xcursor = - wlr_xcursor_manager_get_xcursor(xcursor_manager, DEFAULT_XCURSOR, 1); - if(xcursor) { - struct wlr_xcursor_image *image = xcursor->images[0]; - wlr_xwayland_set_cursor(xwayland, image->buffer, image->width * 4, - image->width, image->height, image->hotspot_x, - image->hotspot_y); - } -#endif - - const char *socket = wl_display_add_socket_auto(server.wl_display); - if(!socket) { - wlr_log_errno(WLR_ERROR, "Unable to open Wayland socket"); - ret = 1; - goto end; - } - - if(!wlr_backend_start(backend)) { - wlr_log(WLR_ERROR, "Unable to start the wlroots backend"); - ret = 1; - goto end; - } - - if(setenv("WAYLAND_DISPLAY", socket, true) < 0) { - wlr_log_errno(WLR_ERROR, "Unable to set WAYLAND_DISPLAY.", - "Clients may not be able to connect"); - } else { - wlr_log(WLR_DEBUG, - "Cagebreak " CG_VERSION " is running on Wayland display %s", - socket); - } - -#if CG_HAS_XWAYLAND - wlr_xwayland_set_seat(xwayland, server.seat->seat); -#endif - - /* Place the cursor to the topl left of the output layout. */ - wlr_cursor_warp(server.seat->cursor, NULL, 0, 0); - atexit(cleanup); - return 0; -end: - cleanup(); - return ret; + return -1; } /* Parse config file. Lines longer than "max_line_size" are ignored */ @@ -407,6 +59,10 @@ set_configuration(struct cg_server *server, char *content) { line[strcspn(line, "\n")] = '\0'; if(*line != '\0' && *line != '#') { char *errstr; + server->running=true; + if(fuzz_cmds(server, line) == 0) { + continue; + } if(parse_rc_line(server, line, &errstr) != 0) { if(errstr != NULL) { free(errstr); @@ -463,6 +119,25 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { free(output_config->output_name); free(output_config); } + struct cg_keyboard_group *group, *group_tmp; + wl_list_for_each_safe(group, group_tmp, &server.seat->keyboard_groups, link) { + wl_list_remove(&group->link); + wlr_keyboard_group_destroy(group->wlr_group); + wl_event_source_remove(group->key_repeat_timer); + free(group); + } + struct cg_pointer *pointer, *pointer_tmp; + wl_list_for_each_safe(pointer, pointer_tmp, &server.seat->pointers, link) { + pointer->destroy.notify(&pointer->destroy, NULL); + } + struct cg_touch *touch, *touch_tmp; + wl_list_for_each_safe(touch, touch_tmp, &server.seat->touch, link) { + touch->destroy.notify(&touch->destroy, NULL); + } + + while(wl_list_length(&server.outputs) != 1) { + server.curr_output->damage_destroy.notify(&server.curr_output->damage_destroy,NULL); + } return 0; } diff --git a/fuzz/meson.build b/fuzz/meson.build index 8ff982a..b5ba1be 100644 --- a/fuzz/meson.build +++ b/fuzz/meson.build @@ -1,9 +1,11 @@ fuzz_sources = [ 'fuzz-parse.c', + 'fuzz-lib.c', ] fuzz_headers = [ '../parse.h', + 'fuzz-lib.h', ] inc = include_directories(['..','../build/']) From 9a8b6fa600c36635bec0493dbffccfeeee80bd89 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 29 May 2020 14:47:32 +0200 Subject: [PATCH 092/689] Fix fuzzer includes --- fuzz/fuzz-lib.c | 15 ++++++--------- fuzz/fuzz-parse.c | 3 +++ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/fuzz/fuzz-lib.c b/fuzz/fuzz-lib.c index aad54b3..e5fc2a3 100644 --- a/fuzz/fuzz-lib.c +++ b/fuzz/fuzz-lib.c @@ -8,12 +8,8 @@ #define _POSIX_C_SOURCE 200812L -#include "../keybinding.h" -#include "../output.h" -#include "../parse.h" -#include "../seat.h" -#include "../server.h" #include "config.h" + #include #include #include @@ -22,11 +18,7 @@ #include #include -#include -#include -#include #include -#include #include #include #include @@ -53,6 +45,11 @@ #include #endif +#include "../keybinding.h" +#include "../output.h" +#include "../parse.h" +#include "../seat.h" +#include "../server.h" #include "../idle_inhibit_v1.h" #include "../xdg_shell.h" #if CG_HAS_XWAYLAND diff --git a/fuzz/fuzz-parse.c b/fuzz/fuzz-parse.c index 09ce0c0..5dcf837 100644 --- a/fuzz/fuzz-parse.c +++ b/fuzz/fuzz-parse.c @@ -9,10 +9,12 @@ #define _POSIX_C_SOURCE 200812L #include +#include #include #include #include +#include #include "config.h" #include "../keybinding.h" @@ -22,6 +24,7 @@ #include "../seat.h" #include "../server.h" #include "../workspace.h" +#include "../view.h" #if CG_HAS_XWAYLAND #include "../xwayland.h" #endif From c84e2c994e8b124ac5e020ae2ade643513ce49d3 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 29 May 2020 14:57:33 +0200 Subject: [PATCH 093/689] Remove erroneous comment --- fuzz/fuzz-parse.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fuzz/fuzz-parse.c b/fuzz/fuzz-parse.c index 5dcf837..d3870a1 100644 --- a/fuzz/fuzz-parse.c +++ b/fuzz/fuzz-parse.c @@ -53,7 +53,6 @@ fuzz_cmds(struct cg_server *server, char *line) { return -1; } -/* Parse config file. Lines longer than "max_line_size" are ignored */ int set_configuration(struct cg_server *server, char *content) { char *line; From 29da70746303a086b9fae3096e2e3e9d44d5d20b Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 29 May 2020 15:10:30 +0200 Subject: [PATCH 094/689] Fix error in fuzz-lib --- fuzz/fuzz-lib.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/fuzz/fuzz-lib.c b/fuzz/fuzz-lib.c index e5fc2a3..b5376e5 100644 --- a/fuzz/fuzz-lib.c +++ b/fuzz/fuzz-lib.c @@ -20,6 +20,7 @@ #include #include +#include #include #include #include @@ -317,12 +318,6 @@ LLVMFuzzerInitialize(int *argc, char ***argv) { goto end; } - if(!compositor) { - wlr_log(WLR_ERROR, "Unable to create the wlroots compositor"); - ret = 1; - goto end; - } - compositor = wlr_compositor_create(server.wl_display, renderer); if(!compositor) { wlr_log(WLR_ERROR, "Unable to create the wlroots compositor"); From 4de82c076fde42094ab6c5752bd555d86f62ef77 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 29 May 2020 15:10:45 +0200 Subject: [PATCH 095/689] Remove input device creation from fuzz-parse.c --- fuzz/fuzz-parse.c | 56 ----------------------------------------------- 1 file changed, 56 deletions(-) diff --git a/fuzz/fuzz-parse.c b/fuzz/fuzz-parse.c index d3870a1..1403eda 100644 --- a/fuzz/fuzz-parse.c +++ b/fuzz/fuzz-parse.c @@ -31,28 +31,6 @@ #include "fuzz-lib.h" -int -fuzz_cmds(struct cg_server *server, char *line) { - if(strncmp(line, "mcurs",5) == 0) { - move_cursor(&line[5], server); - return 0; - } else if(strncmp(line, "noutp",5) == 0) { - create_output(&line[5], server); - return 0; - } else if(strncmp(line, "doutp",5) == 0) { - destroy_output(&line[5], server); - return 0; - } else if(strncmp(line, "crdev",5) == 0) { - return -1; - create_input_device(&line[5], server); - return 0; - } else if(strncmp(line, "ddev",5) == 0) { - destroy_input_device(&line[5], server); - return 0; - } - return -1; -} - int set_configuration(struct cg_server *server, char *content) { char *line; @@ -62,9 +40,6 @@ set_configuration(struct cg_server *server, char *content) { if(*line != '\0' && *line != '#') { char *errstr; server->running=true; - if(fuzz_cmds(server, line) == 0) { - continue; - } if(parse_rc_line(server, line, &errstr) != 0) { if(errstr != NULL) { free(errstr); @@ -93,20 +68,9 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { (union keybinding_params){.i = 1}); run_action(KEYBINDING_LAYOUT_FULLSCREEN, &server, (union keybinding_params){.c = NULL}); - wl_display_flush_clients(server.wl_display); - wl_display_destroy_clients(server.wl_display); struct cg_output *output; wl_list_for_each(output, &server.outputs, link) { message_clear(output); - struct cg_view *view; - wl_list_for_each(view, &(*output->workspaces)->views, link) { - view_unmap(view); - view_destroy(view); - } - wl_list_for_each(view, &(*output->workspaces)->unmanaged_views, link) { - view_unmap(view); - view_destroy(view); - } } for(unsigned int i = 3; server.modes[i] != NULL; ++i) { free(server.modes[i]); @@ -121,25 +85,5 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { free(output_config->output_name); free(output_config); } - struct cg_keyboard_group *group, *group_tmp; - wl_list_for_each_safe(group, group_tmp, &server.seat->keyboard_groups, link) { - wl_list_remove(&group->link); - wlr_keyboard_group_destroy(group->wlr_group); - wl_event_source_remove(group->key_repeat_timer); - free(group); - } - struct cg_pointer *pointer, *pointer_tmp; - wl_list_for_each_safe(pointer, pointer_tmp, &server.seat->pointers, link) { - pointer->destroy.notify(&pointer->destroy, NULL); - } - struct cg_touch *touch, *touch_tmp; - wl_list_for_each_safe(touch, touch_tmp, &server.seat->touch, link) { - touch->destroy.notify(&touch->destroy, NULL); - } - - while(wl_list_length(&server.outputs) != 1) { - server.curr_output->damage_destroy.notify(&server.curr_output->damage_destroy,NULL); - } - return 0; } From 35a15670eaa512dd3ea64179d8e89df128d69db4 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 29 May 2020 16:13:52 +0200 Subject: [PATCH 096/689] Fix permission dropping --- cagebreak.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index f908117..0591591 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -88,13 +88,14 @@ sig_chld_handler(int signal) { static bool drop_permissions(void) { if(getuid() != geteuid() || getgid() != getegid()) { - if(setuid(getuid()) != 0 || setgid(getgid()) != 0) { + // Set gid before uid + if(setgid(getgid()) != 0 || setuid(getuid()) != 0) { wlr_log(WLR_ERROR, "Unable to drop root, refusing to start"); return false; } } - if(setuid(0) != -1) { + if(setgid(0) != -1 || setuid(0) != -1) { wlr_log(WLR_ERROR, "Unable to drop root (we shouldn't be able to " "restore it after setuid), refusing to start"); return false; From 82093b28436f11f9fc7f2fce5c1cc1933d97d34f Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Fri, 29 May 2020 17:36:38 +0200 Subject: [PATCH 097/689] Improve release documentation --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 19a1f02..eec991b 100644 --- a/README.md +++ b/README.md @@ -108,6 +108,9 @@ git merge --squash development git tag -u keyid version HEAD git tag -v version git push --tags origin master +git checkout development +git merge master +git push --tags origin development ``` and a log message roughly describing the features added in the commit is @@ -119,6 +122,7 @@ In the past, our git history did not always reflect this scheme. Release checklist + * [ ] Check cage for possible code merges * [ ] Cursory testing * [ ] libfuzzer testing * [ ] ninja -C build clang-format @@ -140,8 +144,9 @@ Release checklist * [ ] Signature * [ ] Branching Strategy * [ ] git archive --prefix=cagebreak/ -o release_version.tar.gz tags/version . + * [ ] Extract, build and verify reproducibility of archive * [ ] gpg --detach-sign -u keyid release_version.tar.gz - * [ ] upload build assets + * [ ] Upload archive and signature as build assets ### Signing Key From 95944340258883a91c0cfd1cacc927c859ba1821 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Sun, 31 May 2020 17:14:57 +0200 Subject: [PATCH 098/689] Move fanalyzer section in README --- README.md | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index eec991b..7c5bb8d 100644 --- a/README.md +++ b/README.md @@ -61,33 +61,6 @@ Nonetheless, don't be intimidated by the (slightly lengthy) release checklist or part of this file. Do what you can, open an issue and we will collaborate toward a solution. -### GCC and -fanalyzer - -Cagebreak should compile with any reasonably new gcc or clang. Consider -a gcc version of at least [10.1](https://gcc.gnu.org/gcc-10/changes.html) if -you want to get the benefit of the brand-new -[-fanalyzer](https://gcc.gnu.org/onlinedocs/gcc/Static-Analyzer-Options.html) -flag. However, this new flag sometimes produces false-postives and we -selectively disable warnings for affected code segments as described below. - -Meson is configured to set `CG_HAS_FANALYZE` if `-fanalyzer` is available. -Therefore, to maintain portability, false-positive fanalyzer warnings are to be -disabled using the following syntax: - -``` -#if CG_HAS_FANALYZE -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "WARNING OPTION" -#endif -``` -and after - -``` -#if CG_HAS_FANALYZE -#pragma GCC diagnostic pop -#endif -``` - ### Branching strategy All features are to be developed on feature branches, named after the feature. @@ -220,6 +193,33 @@ For every release after 1.0.5, a GPG signature will be provided in `signatures`. The current signature is called `cagebreak.sig`, whereas all older signatures will be named after their release version. +### GCC and -fanalyzer + +Cagebreak should compile with any reasonably new gcc or clang. Consider +a gcc version of at least [10.1](https://gcc.gnu.org/gcc-10/changes.html) if +you want to get the benefit of the brand-new +[-fanalyzer](https://gcc.gnu.org/onlinedocs/gcc/Static-Analyzer-Options.html) +flag. However, this new flag sometimes produces false-postives and we +selectively disable warnings for affected code segments as described below. + +Meson is configured to set `CG_HAS_FANALYZE` if `-fanalyzer` is available. +Therefore, to maintain portability, false-positive fanalyzer warnings are to be +disabled using the following syntax: + +``` +#if CG_HAS_FANALYZE +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "WARNING OPTION" +#endif +``` +and after + +``` +#if CG_HAS_FANALYZE +#pragma GCC diagnostic pop +#endif +``` + ### Fuzzing Along with the project source code, a fuzzing framework based on `libfuzzer` is From bd43989987c1a62ebc58f6251c4dcb27eee6c4e6 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Sun, 31 May 2020 17:55:13 +0200 Subject: [PATCH 099/689] Add more convenient link to man pages --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7c5bb8d..a396293 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,9 @@ will be implemented, open an issue or get in touch with the development team. This README is only relevant for development resources and instructions. For a description of Cagebreak and installation instructions for end-users, please see -the man page supplied in the `man/` directory and the [Wiki](https://github.com/project-repo/cagebreak/wiki/). +the man pages for [cagebreak](man/cagebreak.1.md) and cagebreak +[configuration](man/cagebreak-config.5.md) and the +[Wiki](https://github.com/project-repo/cagebreak/wiki/). Cagebreak is based on [Cage](https://github.com/Hjdskes/cage), a Wayland kiosk compositor. From 98e57c534139aa6841718c2ce492558c6f0c91a1 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Sun, 31 May 2020 17:57:06 +0200 Subject: [PATCH 100/689] Clarify branching strategy and versioning --- README.md | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index a396293..bf30d62 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ Nonetheless, don't be intimidated by the (slightly lengthy) release checklist or part of this file. Do what you can, open an issue and we will collaborate toward a solution. -### Branching strategy +### Branching Strategy and Versioning All features are to be developed on feature branches, named after the feature. @@ -73,25 +73,9 @@ are merged for final testing. Once `development` is ready for a release, meaning that the release checklist is fulfilled, it is merged into `master`, creating a new release, which is tagged and signed. -Merging into master is always done by +All releases are tagged according to [semantic versioning](https://semver.org) guidelines. -``` -git checkout development -git pull origin development -git checkout master -git merge --squash development -git tag -u keyid version HEAD -git tag -v version -git push --tags origin master -git checkout development -git merge master -git push --tags origin development -``` - -and a log message roughly describing the features added in the commit is -included. - -In the past, our git history did not always reflect this scheme. +In the past, our git history did not perfectly reflect this scheme. ### Releases From f14261d4554c3e72463d78c31c73cbb894ec8058 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Sun, 31 May 2020 17:58:26 +0200 Subject: [PATCH 101/689] Move signing key section --- README.md | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index bf30d62..98b65ee 100644 --- a/README.md +++ b/README.md @@ -107,21 +107,6 @@ Release checklist * [ ] gpg --detach-sign -u keyid release_version.tar.gz * [ ] Upload archive and signature as build assets -### Signing Key - -All releases are signed by at least one of the following collection of -keys. - - * E79F6D9E113529F4B1FFE4D5C4F974D70CEC2C5B - * 4739D329C9187A1C2795C20A02ABFDEC3A40545F - -Should we at any point retire a key, we will only replace it with keys signed -by at least one of the above collection. - -Should we at any point have official mail addresses, their keys will be signed by -a valid key noted above. - -The full public keys can be found in `keys/` along with any revocation certificates. ### Reproducible Builds @@ -179,6 +164,22 @@ For every release after 1.0.5, a GPG signature will be provided in `signatures`. The current signature is called `cagebreak.sig`, whereas all older signatures will be named after their release version. +#### Signing Key + +All releases are signed by at least one of the following collection of +keys. + + * E79F6D9E113529F4B1FFE4D5C4F974D70CEC2C5B + * 4739D329C9187A1C2795C20A02ABFDEC3A40545F + +Should we at any point retire a key, we will only replace it with keys signed +by at least one of the above collection. + +Should we at any point have official mail addresses, their keys will be signed by +a valid key noted above. + +The full public keys can be found in `keys/` along with any revocation certificates. + ### GCC and -fanalyzer Cagebreak should compile with any reasonably new gcc or clang. Consider From 5374b3728e9ca9cd3a7566c819962583237464b2 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Sun, 31 May 2020 17:59:46 +0200 Subject: [PATCH 102/689] Combine release checklist with branching strategy --- README.md | 67 ++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 46 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 98b65ee..ab177d9 100644 --- a/README.md +++ b/README.md @@ -79,34 +79,59 @@ In the past, our git history did not perfectly reflect this scheme. ### Releases -Release checklist +The release checklist has to be completely fullfilled in one run for a release to +occur. Once any failure occurs the entire checklist has to be completed again. + * [ ] `git checkout development` + * [ ] `git pull origin development` + * [ ] `git push origin development` * [ ] Check cage for possible code merges - * [ ] Cursory testing - * [ ] libfuzzer testing * [ ] ninja -C build clang-format + * [ ] Determine new version number according to [semantic versioning](https://semver.org) guidelines + * [ ] Relevant Documentation + * [ ] New features documented + * [ ] man pages + * [ ] man/cagebreak + * [ ] man/cagebreak-config + * [ ] wiki + * [ ] README.md Changelog + * [ ] Document fixed bugs in Bugs.md + * [ ] Testing + * [ ] Manual testing + * [ ] Libfuzzer testing * [ ] Version Number * [ ] meson.build * [ ] git tag * [ ] man pages - * [ ] Relevant Documentation - * [ ] New features documented - * [ ] man page - * [ ] wiki - * [ ] New configuration documented - * [ ] man page - * [ ] wiki - * [ ] Changelog in README - * [ ] Document fixed bugs in Bugs.md - * [ ] Update hashes of the binary - * [ ] Update signature of the binary - * [ ] Signature - * [ ] Branching Strategy - * [ ] git archive --prefix=cagebreak/ -o release_version.tar.gz tags/version . - * [ ] Extract, build and verify reproducibility of archive - * [ ] gpg --detach-sign -u keyid release_version.tar.gz - * [ ] Upload archive and signature as build assets - + * [ ] `git add` relevant files + * [ ] `git commit` + * [ ] `git push origin development` + * [ ] Check reproducibility on multiple machines + * [ ] Document Reproducible Builds Artefacts + * [ ] Add hashes of the binary + * [ ] Rename cagebreak.sig to previous_signature.sig + * [ ] Add signature of the binary as cagebreak.sig + * [ ] Determine commit and tag message (Start with "Release version_number\n\n") + * [ ] `git checkout master` + * [ ] `git merge --squash development` + * [ ] `git commit` and insert message + * [ ] `git tag -u keyid version HEAD` and insert message + * [ ] `git tag -v version` and check signing key + * [ ] `git push --tags origin master` + * [ ] `git checkout development` + * [ ] `git merge master` + * [ ] `git push --tags origin development` + * [ ] `git archive --prefix=cagebreak/ -o release_version.tar.gz tags/version .` + * [ ] Check archive + * [ ] tar -xvf release_version.tar.gz + * [ ] cd cagebreak + * [ ] meson build --buildtype=release + * [ ] ninja -C build + * [ ] gpg --verify ../signatures/cagebreak.sig build/cagebreak + * [ ] cd .. + * [ ] rm -rf cagebreak + * [ ] `gpg --detach-sign -u keyid release_version.tar.gz` + * [ ] Upload archive and signature as release assets ### Reproducible Builds From 78c5b30e81aebfc45771d2c1f5d0bb0c41cf657d Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Sun, 31 May 2020 18:31:12 +0200 Subject: [PATCH 103/689] Add more detailed installation instructions --- README.md | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index ab177d9..eab64c5 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,8 @@ provide a successor to ratpoison for Wayland users. However, this is no reimplementation of ratpoison. Should you like to know if a feature will be implemented, open an issue or get in touch with the development team. -This README is only relevant for development resources and instructions. For a -description of Cagebreak and installation instructions for end-users, please see +This README is only relevant for development resources and instructions. For +documentation of Cagebreak, please see the man pages for [cagebreak](man/cagebreak.1.md) and cagebreak [configuration](man/cagebreak-config.5.md) and the [Wiki](https://github.com/project-repo/cagebreak/wiki/). @@ -14,16 +14,23 @@ the man pages for [cagebreak](man/cagebreak.1.md) and cagebreak Cagebreak is based on [Cage](https://github.com/Hjdskes/cage), a Wayland kiosk compositor. -## Experimenting with Cagebreak +## Installation -Cagebreak is currently being developed under arch linux and uses the libraries -as they are obtained through pacman. However, cagebreak should also work on -other distributions given the proper library versions. +### Obtaining Source Code -You can build Cagebreak with the [meson](https://mesonbuild.com/) build system. It -requires wayland, wlroots and xkbcommon to be installed. Note that Cagebreak is -developed against the latest tag of wlroots, in order not to constantly chase -breaking changes as soon as they occur. +There are different ways to obtain cagebreak source: + + * git clone (for all releases) + * download release asset tarballs (starting at release 1.2.1) + +### Verifying Source Code + +There are corresponding methods of verifying you obtained the correct code: + + * our git history includes signed tags for releases + * release assets starting at release 1.2.1 contain a signature for the tarball + +### Building Cagebreak Simply execute the following steps to build Cagebreak: From a7c51888e1bcfc88ac6ea3c17733448a1f2fbd74 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Sun, 31 May 2020 18:32:06 +0200 Subject: [PATCH 104/689] Add missing section --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index eab64c5..a1d5630 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,17 @@ within an existing X11 or Wayland session, it will open in a virtual output as a window in your existing session. If you run it in a TTY, it'll run with the KMS+DRM backend. For more configuration options, see the man pages. +## Experimenting with Cagebreak + +Cagebreak is currently being developed under arch linux and uses the libraries +as they are obtained through pacman. However, cagebreak should also work on +other distributions given the proper library versions. + +You can build Cagebreak with the [meson](https://mesonbuild.com/) build system. It +requires wayland, wlroots and xkbcommon to be installed. Note that Cagebreak is +developed against the latest tag of wlroots, in order not to constantly chase +breaking changes as soon as they occur. + ## Contributing to Cagebreak Cagebreak is currently developed to fit the needs of its creators. Should you desire From e40fcaf737d11e556a8b887fbce924f427358a17 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Sun, 31 May 2020 18:39:22 +0200 Subject: [PATCH 105/689] Dissolve README section --- README.md | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index a1d5630..76e5718 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,10 @@ the man pages for [cagebreak](man/cagebreak.1.md) and cagebreak Cagebreak is based on [Cage](https://github.com/Hjdskes/cage), a Wayland kiosk compositor. +Cagebreak is currently being developed under arch linux and uses the libraries +as they are obtained through pacman. However, cagebreak should also work on +other distributions given the proper library versions. + ## Installation ### Obtaining Source Code @@ -32,6 +36,11 @@ There are corresponding methods of verifying you obtained the correct code: ### Building Cagebreak +You can build Cagebreak with the [meson](https://mesonbuild.com/) build system. It +requires wayland, wlroots and xkbcommon to be installed. Note that Cagebreak is +developed against the latest tag of wlroots, in order not to constantly chase +breaking changes as soon as they occur. + Simply execute the following steps to build Cagebreak: ``` @@ -59,17 +68,6 @@ within an existing X11 or Wayland session, it will open in a virtual output as a window in your existing session. If you run it in a TTY, it'll run with the KMS+DRM backend. For more configuration options, see the man pages. -## Experimenting with Cagebreak - -Cagebreak is currently being developed under arch linux and uses the libraries -as they are obtained through pacman. However, cagebreak should also work on -other distributions given the proper library versions. - -You can build Cagebreak with the [meson](https://mesonbuild.com/) build system. It -requires wayland, wlroots and xkbcommon to be installed. Note that Cagebreak is -developed against the latest tag of wlroots, in order not to constantly chase -breaking changes as soon as they occur. - ## Contributing to Cagebreak Cagebreak is currently developed to fit the needs of its creators. Should you desire From cc0a97649b4409033a49500b07df31802f207c0b Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 31 May 2020 21:20:59 +0200 Subject: [PATCH 106/689] Improve README --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 76e5718..d31f066 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ the man pages for [cagebreak](man/cagebreak.1.md) and cagebreak Cagebreak is based on [Cage](https://github.com/Hjdskes/cage), a Wayland kiosk compositor. -Cagebreak is currently being developed under arch linux and uses the libraries +Cagebreak is currently being developed under Arch Linux and uses the libraries as they are obtained through pacman. However, cagebreak should also work on other distributions given the proper library versions. @@ -29,7 +29,7 @@ There are different ways to obtain cagebreak source: ### Verifying Source Code -There are corresponding methods of verifying you obtained the correct code: +There are corresponding methods of verifying that you obtained the correct code: * our git history includes signed tags for releases * release assets starting at release 1.2.1 contain a signature for the tarball @@ -95,8 +95,8 @@ In the past, our git history did not perfectly reflect this scheme. ### Releases -The release checklist has to be completely fullfilled in one run for a release to -occur. Once any failure occurs the entire checklist has to be completed again. +The release checklist must be completely fulfilled in one run for a release to +occur. Once any failure occurs the entire checklist must be completed from scratch. * [ ] `git checkout development` * [ ] `git pull origin development` @@ -154,7 +154,7 @@ occur. Once any failure occurs the entire checklist has to be completed again. Cagebreak offers reproducible builds given the exact library versions specified in `meson.build`. Should a version mismatch occur, a warning will be emitted. We have decided on this compromise to allow flexibility and security. In general we will -adapt the versions to the packages available under arch linux at the time of +adapt the versions to the packages available under Arch Linux at the time of release. There are reproducibility issues up to and including release `1.2.0`. See From 7bbf2f330aa0ffe85584f711ab66187e5c156b5b Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Mon, 1 Jun 2020 12:51:26 +0200 Subject: [PATCH 107/689] Improve section hierarchy --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d31f066..50d7ba9 100644 --- a/README.md +++ b/README.md @@ -48,12 +48,12 @@ $ meson build $ ninja -C build ``` -### Release Build +#### Release Build By default, this builds a debug build. To build a release build, use `meson build --buildtype=release`. -### Xwayland Support +#### Xwayland Support Cagebreak comes with compile-time support for XWayland. To enable this, first make sure that your version of wlroots is compiled with this From a68462cb95eb7100e0713b000812f5736a82436d Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Mon, 1 Jun 2020 13:51:04 +0200 Subject: [PATCH 108/689] Add new keys with signatures --- README.md | 28 +++++- keys/cagebreak@project-repo.co.pub | 75 ++++++++++++++++ keys/cagebreak_signing_key_1.asc | 65 -------------- keys/cagebreak_signing_key_1@cagebreak.pub | 88 +++++++++++++++++++ ... => cagebreak_signing_key_2@cagebreak.pub} | 0 ...agebreak_signing_key_3@project-repo.co.pub | 76 ++++++++++++++++ ...agebreak_signing_key_4@project-repo.co.pub | 64 ++++++++++++++ 7 files changed, 328 insertions(+), 68 deletions(-) create mode 100644 keys/cagebreak@project-repo.co.pub delete mode 100644 keys/cagebreak_signing_key_1.asc create mode 100644 keys/cagebreak_signing_key_1@cagebreak.pub rename keys/{cagebreak_signing_key_2.asc => cagebreak_signing_key_2@cagebreak.pub} (100%) create mode 100644 keys/cagebreak_signing_key_3@project-repo.co.pub create mode 100644 keys/cagebreak_signing_key_4@project-repo.co.pub diff --git a/README.md b/README.md index 50d7ba9..9356ad2 100644 --- a/README.md +++ b/README.md @@ -205,19 +205,24 @@ For every release after 1.0.5, a GPG signature will be provided in `signatures`. The current signature is called `cagebreak.sig`, whereas all older signatures will be named after their release version. -#### Signing Key +#### Signing Keys All releases are signed by at least one of the following collection of keys. * E79F6D9E113529F4B1FFE4D5C4F974D70CEC2C5B * 4739D329C9187A1C2795C20A02ABFDEC3A40545F + * 7535AB89220A5C15A728B75F74104CC7DCA5D7A8 + * 827BC2320D535AEAD0540E6E2E66F65D99761A6F Should we at any point retire a key, we will only replace it with keys signed by at least one of the above collection. -Should we at any point have official mail addresses, their keys will be signed by -a valid key noted above. +We registered project-repo.co and added mail addresses after release `1.3.0`. +This allows for verified releases. + +We now have a mail address and its key is signed by signing keys. See Security +Bugs for details. The full public keys can be found in `keys/` along with any revocation certificates. @@ -283,6 +288,23 @@ issue](https://github.com/project-repo/cagebreak/issues/new) on Fixed bugs are to be assigned a number and summarized inside Bugs.md for future reference independent of github, in case this service is unavailable. +### Security Bugs + +Should you want to get in touch with the developers of cagebreak to report a +security vulnerability or a different issue confidentially, contact +`cagebreak @ project-repo . co`. + +We will try to respond to everything that is not obvious spam. + +Please encrypt your email with the appropriate [GPG key](keys/cagebreak@project-repo.co.pub). + + * B15B92642760E11FE002DE168708D42451A94AB5 + +Note that the key is signed by cagebreak signing keys. + +If you want us to answer by GPG-encrypted mail, please include your own +public key or provide the fingerprint and directions to obtain the key. + ## Changelog ### Release 1.0.0 diff --git a/keys/cagebreak@project-repo.co.pub b/keys/cagebreak@project-repo.co.pub new file mode 100644 index 0000000..2642c1e --- /dev/null +++ b/keys/cagebreak@project-repo.co.pub @@ -0,0 +1,75 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +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 +=QlUC +-----END PGP PUBLIC KEY BLOCK----- diff --git a/keys/cagebreak_signing_key_1.asc b/keys/cagebreak_signing_key_1.asc deleted file mode 100644 index 835d485..0000000 --- a/keys/cagebreak_signing_key_1.asc +++ /dev/null @@ -1,65 +0,0 @@ ------BEGIN PGP PUBLIC KEY BLOCK----- - -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 -Rw== -=IZJF ------END PGP PUBLIC KEY BLOCK----- diff --git a/keys/cagebreak_signing_key_1@cagebreak.pub b/keys/cagebreak_signing_key_1@cagebreak.pub new file mode 100644 index 0000000..b6ff569 --- /dev/null +++ b/keys/cagebreak_signing_key_1@cagebreak.pub @@ -0,0 +1,88 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +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 +=Z3hL +-----END PGP PUBLIC KEY BLOCK----- diff --git a/keys/cagebreak_signing_key_2.asc b/keys/cagebreak_signing_key_2@cagebreak.pub similarity index 100% rename from keys/cagebreak_signing_key_2.asc rename to keys/cagebreak_signing_key_2@cagebreak.pub diff --git a/keys/cagebreak_signing_key_3@project-repo.co.pub b/keys/cagebreak_signing_key_3@project-repo.co.pub new file mode 100644 index 0000000..855c32f --- /dev/null +++ b/keys/cagebreak_signing_key_3@project-repo.co.pub @@ -0,0 +1,76 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +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 +vOQMlRsEbbSw+T2OA2gGXUPK7yzF +=kqmE +-----END PGP PUBLIC KEY BLOCK----- diff --git a/keys/cagebreak_signing_key_4@project-repo.co.pub b/keys/cagebreak_signing_key_4@project-repo.co.pub new file mode 100644 index 0000000..50b92c4 --- /dev/null +++ b/keys/cagebreak_signing_key_4@project-repo.co.pub @@ -0,0 +1,64 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +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 +/qf52E0= +=zGAB +-----END PGP PUBLIC KEY BLOCK----- From 46a9bf9e39c7860522bfa40645e050c5bd517136 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Mon, 1 Jun 2020 16:12:43 +0200 Subject: [PATCH 109/689] Improve README --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9356ad2..ca79218 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,10 @@ other distributions given the proper library versions. ## Installation +If you are using archlinux, just use the [PKGBUILD](https://aur.archlinux.org/cagebreak.git) from the aur. + +See [cagebreak-pkgbuild](https://github.com/project-repo/cagebreak-pkgbuild) for details. + ### Obtaining Source Code There are different ways to obtain cagebreak source: @@ -219,7 +223,6 @@ Should we at any point retire a key, we will only replace it with keys signed by at least one of the above collection. We registered project-repo.co and added mail addresses after release `1.3.0`. -This allows for verified releases. We now have a mail address and its key is signed by signing keys. See Security Bugs for details. From 65dfd151779262a2b9a06e636c0086da079ea936 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 1 Date: Mon, 1 Jun 2020 16:22:18 +0200 Subject: [PATCH 110/689] Fix README wording --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ca79218..70f5a75 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ other distributions given the proper library versions. ## Installation -If you are using archlinux, just use the [PKGBUILD](https://aur.archlinux.org/cagebreak.git) from the aur. +If you are using archlinux, just clone the [PKGBUILD](https://aur.archlinux.org/cagebreak.git) from the aur. See [cagebreak-pkgbuild](https://github.com/project-repo/cagebreak-pkgbuild) for details. From d71230cdfeb003eb38cddfbf1f9dcbd39d3d787f Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Wed, 3 Jun 2020 15:27:38 +0200 Subject: [PATCH 111/689] Improve release checklist --- README.md | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 70f5a75..e3eb415 100644 --- a/README.md +++ b/README.md @@ -105,17 +105,17 @@ occur. Once any failure occurs the entire checklist must be completed from scrat * [ ] `git checkout development` * [ ] `git pull origin development` * [ ] `git push origin development` - * [ ] Check cage for possible code merges - * [ ] ninja -C build clang-format - * [ ] Determine new version number according to [semantic versioning](https://semver.org) guidelines - * [ ] Relevant Documentation - * [ ] New features documented + * [ ] Cage has no reasonable code merges + * [ ] `ninja -C build clang-format` makes no changes + * [ ] New version number determined according to [semantic versioning](https://semver.org) guidelines + * [ ] Relevant Documentation completed + * [ ] New features * [ ] man pages * [ ] man/cagebreak * [ ] man/cagebreak-config * [ ] wiki - * [ ] README.md Changelog - * [ ] Document fixed bugs in Bugs.md + * [ ] README.md Changelog for major and minor releases but not patches + * [ ] Fixed bugs documented in Bugs.md * [ ] Testing * [ ] Manual testing * [ ] Libfuzzer testing @@ -126,12 +126,13 @@ occur. Once any failure occurs the entire checklist must be completed from scrat * [ ] `git add` relevant files * [ ] `git commit` * [ ] `git push origin development` - * [ ] Check reproducibility on multiple machines - * [ ] Document Reproducible Builds Artefacts - * [ ] Add hashes of the binary - * [ ] Rename cagebreak.sig to previous_signature.sig - * [ ] Add signature of the binary as cagebreak.sig - * [ ] Determine commit and tag message (Start with "Release version_number\n\n") + * [ ] meson.build reproducible build versions are current archlinux libraries and gcc + * [ ] Cagebreak is reproducible on multiple machines + * [ ] Documented reproducible build artefacts + * [ ] Hashes of the binary + * [ ] Renamed cagebreak.sig to previous_release_tag.sig + * [ ] Signature of the binary as cagebreak.sig with appropriate signing key + * [ ] Determined commit and tag message (Start with "Release version_number\n\n") * [ ] `git checkout master` * [ ] `git merge --squash development` * [ ] `git commit` and insert message @@ -142,7 +143,7 @@ occur. Once any failure occurs the entire checklist must be completed from scrat * [ ] `git merge master` * [ ] `git push --tags origin development` * [ ] `git archive --prefix=cagebreak/ -o release_version.tar.gz tags/version .` - * [ ] Check archive + * [ ] Checked archive * [ ] tar -xvf release_version.tar.gz * [ ] cd cagebreak * [ ] meson build --buildtype=release From b08ec3692fbcc6386bfa1566a35a5eed5a7ced56 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Wed, 3 Jun 2020 15:28:33 +0200 Subject: [PATCH 112/689] Improve README wording --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e3eb415..d348e25 100644 --- a/README.md +++ b/README.md @@ -306,7 +306,7 @@ Please encrypt your email with the appropriate [GPG key](keys/cagebreak@project- Note that the key is signed by cagebreak signing keys. -If you want us to answer by GPG-encrypted mail, please include your own +If you want us to respond via GPG-encrypted mail, please include your own public key or provide the fingerprint and directions to obtain the key. ## Changelog From 1661c449fb1e68654c626151b718f6866be7f142 Mon Sep 17 00:00:00 2001 From: project-repo Date: Wed, 3 Jun 2020 15:50:38 +0200 Subject: [PATCH 113/689] Fix rendering bugs --- render.c | 22 ++++++++++++++++++++++ view.c | 45 +++++++++++++++++++++++++++++++++++++++++++-- view.h | 1 + xdg_shell.c | 24 +++++++++++++++++++++++- 4 files changed, 89 insertions(+), 3 deletions(-) diff --git a/render.c b/render.c index 43da1da..649f9bc 100644 --- a/render.c +++ b/render.c @@ -51,6 +51,7 @@ scissor_output(struct wlr_output *output, pixman_box32_t *rect) { struct render_data { pixman_region32_t *damage; + int tile_width, tile_height; }; static void @@ -101,6 +102,12 @@ render_surface_iterator(struct cg_output *output, struct wlr_surface *surface, wlr_matrix_project_box(matrix, box, transform, 0.0F, wlr_output->transform_matrix); + if(data->tile_width != 0) { + box->width = box->width > data->tile_width ? data->tile_width:box->width; + } + if(data->tile_height != 0) { + box->height = box->height > data->tile_height ? data->tile_height:box->height; + } render_texture(wlr_output, output_damage, texture, box, matrix); } @@ -109,6 +116,8 @@ render_drag_icons(struct cg_output *output, pixman_region32_t *damage, struct wl_list *drag_icons) { struct render_data data = { .damage = damage, + .tile_width = 0, + .tile_height = 0, }; output_drag_icons_for_each_surface(output, drag_icons, render_surface_iterator, &data); @@ -122,7 +131,18 @@ render_view_toplevels(struct cg_view *view, struct cg_output *output, pixman_region32_t *damage) { struct render_data data = { .damage = damage, + .tile_width = 0, + .tile_height = 0, }; + //TODO: improve run time behaviour of view_get_tile + struct cg_tile *view_tile=view_get_tile(view); + if(view_tile != NULL) { + if(view_tile->tile.width != view->wlr_surface->current.width || view_tile->tile.height != view->wlr_surface->current.height) { + view_damage_whole(view); + } + data.tile_width=view_tile->tile.width; + data.tile_height=view_tile->tile.height; + } double ox, oy; ox = view->ox; @@ -147,6 +167,8 @@ render_view_popups(struct cg_view *view, struct cg_output *output, pixman_region32_t *damage) { struct render_data data = { .damage = damage, + .tile_width = 0, + .tile_height = 0, }; output_view_for_each_popup(output, view, render_popup_iterator, &data); } diff --git a/view.c b/view.c index 0bc6dfc..1329e57 100644 --- a/view.c +++ b/view.c @@ -18,6 +18,7 @@ #include #include #include +#include #include "output.h" #include "seat.h" @@ -44,10 +45,15 @@ view_get_prev_view(struct cg_view *view) { return prev; } +void +view_damage_child(struct cg_view_child *child, int x, int y,bool whole); + static void view_child_handle_commit(struct wl_listener *listener, void *_data) { struct cg_view_child *child = wl_container_of(listener, child, commit); - view_damage_part(child->view); + int x,y; + child->get_coords(child, &x, &y); + view_damage_child(child,child->view->ox+x,child->view->oy+y,false); } static void @@ -67,7 +73,9 @@ view_child_finish(struct cg_view_child *child) { return; } - view_damage_whole(child->view); + int x,y; + child->get_coords(child, &x, &y); + view_damage_child(child,child->view->ox+x,child->view->oy+y,true); wl_list_remove(&child->link); wl_list_remove(&child->commit.link); @@ -108,6 +116,28 @@ subsurface_handle_destroy(struct wl_listener *listener, void *_data) { subsurface_destroy(view_child); } +static void +subsurface_get_coords(struct cg_view_child *child, int *x, int *y) { + + struct wlr_surface *surface = child->wlr_surface; + *x = 0; + *y = 0; + + if(!(child->view && child->view->impl)) { + while (surface && wlr_surface_is_subsurface(surface)) { + struct wlr_subsurface *subsurface = + wlr_subsurface_from_wlr_surface(surface); + if (subsurface == NULL) { + break; + } + *x += subsurface->current.x; + *y += subsurface->current.y; + surface = subsurface->parent; + } + } + +} + static void subsurface_create(struct cg_view *view, struct wlr_subsurface *wlr_subsurface) { struct cg_subsurface *subsurface = calloc(1, sizeof(struct cg_subsurface)); @@ -117,6 +147,7 @@ subsurface_create(struct cg_view *view, struct wlr_subsurface *wlr_subsurface) { view_child_init(&subsurface->view_child, view, wlr_subsurface->surface); subsurface->view_child.destroy = subsurface_destroy; + subsurface->view_child.get_coords = subsurface_get_coords; subsurface->wlr_subsurface = wlr_subsurface; subsurface->destroy.notify = subsurface_handle_destroy; @@ -170,10 +201,20 @@ view_is_visible(const struct cg_view *view) { void view_damage(struct cg_view *view, bool whole) { + struct cg_tile *view_tile = view_get_tile(view); + if(view_tile != NULL&&(view->wlr_surface->current.width != view_tile->tile.width || view->wlr_surface->current.height != view_tile->tile.height)) { + view_maximize(view, &view_tile->tile); + } output_damage_surface(view->workspace->output, view->wlr_surface, view->ox, view->oy, whole); } +void +view_damage_child(struct cg_view_child *child, int x, int y,bool whole) { + output_damage_surface(child->view->workspace->output, child->wlr_surface, x, + y, whole); +} + void view_damage_part(struct cg_view *view) { view_damage(view, false); diff --git a/view.h b/view.h index 150e79b..8b405da 100644 --- a/view.h +++ b/view.h @@ -59,6 +59,7 @@ struct cg_view_child { struct wl_listener new_subsurface; void (*destroy)(struct cg_view_child *child); + void (*get_coords)(struct cg_view_child *child, int *x, int *y); }; struct cg_subsurface { diff --git a/xdg_shell.c b/xdg_shell.c index fd9ef3d..ce6d93b 100644 --- a/xdg_shell.c +++ b/xdg_shell.c @@ -7,6 +7,8 @@ * See the LICENSE file accompanying this file. */ +#define _POSIX_C_SOURCE 200809L + #include #include #include @@ -15,6 +17,7 @@ #include #include #include +#include #include "output.h" #include "server.h" @@ -117,6 +120,23 @@ popup_unconstrain(struct cg_xdg_popup *popup) { wlr_xdg_popup_unconstrain_from_box(popup->wlr_popup, &output_toplevel_box); } +static void xdg_popup_get_coords(struct cg_view_child *child, int *x, int *y) { + if(!child) { + return; + } + struct cg_xdg_popup *popup = (struct cg_xdg_popup *)child; + struct wlr_xdg_surface *surface = popup->wlr_popup->base; + + int x_offset = -surface->geometry.x; + int y_offset = -surface->geometry.y; + + wlr_xdg_popup_get_toplevel_coords(surface->popup, + x_offset + surface->popup->geometry.x, + y_offset + surface->popup->geometry.y, + x, y); + +} + static void xdg_popup_create(struct cg_view *view, struct wlr_xdg_popup *wlr_popup) { struct cg_xdg_popup *popup = calloc(1, sizeof(struct cg_xdg_popup)); @@ -125,6 +145,7 @@ xdg_popup_create(struct cg_view *view, struct wlr_xdg_popup *wlr_popup) { } popup->wlr_popup = wlr_popup; + popup->view_child.get_coords = xdg_popup_get_coords; view_child_init(&popup->view_child, view, wlr_popup->base->surface); popup->view_child.destroy = xdg_popup_destroy; popup->destroy.notify = handle_xdg_popup_destroy; @@ -195,7 +216,8 @@ static void maximize(struct cg_view *view, int width, int height) { struct cg_xdg_shell_view *xdg_shell_view = xdg_shell_view_from_view(view); wlr_xdg_toplevel_set_size(xdg_shell_view->xdg_surface, width, height); - wlr_xdg_toplevel_set_maximized(xdg_shell_view->xdg_surface, true); + enum wlr_edges edges = WLR_EDGE_LEFT|WLR_EDGE_RIGHT|WLR_EDGE_TOP|WLR_EDGE_BOTTOM; + wlr_xdg_toplevel_set_tiled(xdg_shell_view->xdg_surface, edges); } static void From 50c1268f5ebf97df7172e70a304928974e0823ae Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Wed, 3 Jun 2020 16:20:02 +0200 Subject: [PATCH 114/689] Apply clang-format --- fuzz/fuzz-lib.c | 112 +++++++++++++++++++++++++--------------------- fuzz/fuzz-lib.h | 21 ++++++--- fuzz/fuzz-parse.c | 12 +++-- render.c | 29 ++++++------ view.c | 33 +++++++------- xdg_shell.c | 16 +++---- 6 files changed, 120 insertions(+), 103 deletions(-) diff --git a/fuzz/fuzz-lib.c b/fuzz/fuzz-lib.c index b5376e5..e99a21f 100644 --- a/fuzz/fuzz-lib.c +++ b/fuzz/fuzz-lib.c @@ -20,21 +20,21 @@ #include #include -#include -#include +#include +#include #include +#include #include #include #include #include #include #include +#include #include #include #include #include -#include -#include #if CG_HAS_XWAYLAND #include #endif @@ -46,12 +46,12 @@ #include #endif +#include "../idle_inhibit_v1.h" #include "../keybinding.h" #include "../output.h" #include "../parse.h" #include "../seat.h" #include "../server.h" -#include "../idle_inhibit_v1.h" #include "../xdg_shell.h" #if CG_HAS_XWAYLAND #include "../xwayland.h" @@ -172,17 +172,18 @@ LLVMFuzzerInitialize(int *argc, char ***argv) { } server.backend = backend; - struct wlr_backend *headless_backend=wlr_headless_backend_create(server.wl_display, NULL); + struct wlr_backend *headless_backend = + wlr_headless_backend_create(server.wl_display, NULL); if(!headless_backend) { wlr_log(WLR_ERROR, "Unable to create the wlroots headless backend"); ret = 1; goto end; } - wlr_headless_add_output(headless_backend,600,300); - + wlr_headless_add_output(headless_backend, 600, 300); if(!wlr_multi_backend_add(backend, headless_backend)) { - wlr_log(WLR_ERROR, "Unable to insert headless backend into multi backend"); + wlr_log(WLR_ERROR, + "Unable to insert headless backend into multi backend"); ret = 1; goto end; }; @@ -389,7 +390,7 @@ LLVMFuzzerInitialize(int *argc, char ***argv) { /* Place the cursor to the topl left of the output layout. */ wlr_cursor_warp(server.seat->cursor, NULL, 0, 0); atexit(cleanup); - //server.wl_display->run = 1; + // server.wl_display->run = 1; return 0; end: cleanup(); @@ -398,57 +399,59 @@ end: void move_cursor(char *line, struct cg_server *server) { - return;//TODO - long del=0; + return; // TODO + long del = 0; char *delstr = strtok_r(NULL, ";", &line); - enum wlr_axis_orientation orientation = (*(line++)=='0')? WLR_AXIS_ORIENTATION_VERTICAL:WLR_AXIS_ORIENTATION_HORIZONTAL; + enum wlr_axis_orientation orientation = + (*(line++) == '0') ? WLR_AXIS_ORIENTATION_VERTICAL + : WLR_AXIS_ORIENTATION_HORIZONTAL; if(delstr == NULL) { return; } - del=strtol(delstr,NULL,10); - struct wlr_event_pointer_axis event = { - .device = NULL, - .time_msec = 0, - .source = WLR_AXIS_SOURCE_WHEEL, - .orientation = orientation, - .delta = del * 15, - .delta_discrete = del - }; - //TODO dispatch_cursor_axis(server->seat->cursor, &event); + del = strtol(delstr, NULL, 10); + struct wlr_event_pointer_axis event = {.device = NULL, + .time_msec = 0, + .source = WLR_AXIS_SOURCE_WHEEL, + .orientation = orientation, + .delta = del * 15, + .delta_discrete = del}; + // TODO dispatch_cursor_axis(server->seat->cursor, &event); } -void add_output_callback(struct wlr_backend *backend, void *data) { - long *dims=data; +void +add_output_callback(struct wlr_backend *backend, void *data) { + long *dims = data; wlr_headless_add_output(backend, dims[0], dims[1]); } void create_output(char *line, struct cg_server *server) { char *widthstr = strtok_r(NULL, ";", &line); - long dims[2]= {600, 200}; + long dims[2] = {600, 200}; if(widthstr != NULL) { - dims[0]=strtol(widthstr,NULL,10); + dims[0] = strtol(widthstr, NULL, 10); if(line[0] != '\0') { ++line; } } char *heightstr = strtok_r(NULL, ";", &line); if(heightstr != NULL) { - dims[1]=strtol(heightstr,NULL,10); + dims[1] = strtol(heightstr, NULL, 10); } long max_dim = 10000; - if (dims[0] > max_dim || dims[0] <= 0 ) { + if(dims[0] > max_dim || dims[0] <= 0) { wlr_log(WLR_ERROR, "height out of range."); return; - } else if (dims[1] > max_dim || dims[1] <= 0) { + } else if(dims[1] > max_dim || dims[1] <= 0) { wlr_log(WLR_ERROR, "width out of range."); return; } wlr_multi_for_each_backend(server->backend, add_output_callback, dims); } -void add_input_device_callback(struct wlr_backend *backend, void *data) { - enum wlr_input_device_type *type=data; +void +add_input_device_callback(struct wlr_backend *backend, void *data) { + enum wlr_input_device_type *type = data; wlr_headless_add_input_device(backend, *type); } @@ -456,33 +459,37 @@ void create_input_device(char *line, struct cg_server *server) { enum wlr_input_device_type type; if(*line != '\0') { - if(strncmp(line,"kbd",3) == 0) { + if(strncmp(line, "kbd", 3) == 0) { type = WLR_INPUT_DEVICE_KEYBOARD; - wlr_multi_for_each_backend(server->backend, add_input_device_callback, &type); - } else if(strncmp(line,"ptr",3) == 0) { + wlr_multi_for_each_backend(server->backend, + add_input_device_callback, &type); + } else if(strncmp(line, "ptr", 3) == 0) { type = WLR_INPUT_DEVICE_POINTER; - wlr_multi_for_each_backend(server->backend, add_input_device_callback, &type); - } else if(strncmp(line,"tch",3) == 0) { + wlr_multi_for_each_backend(server->backend, + add_input_device_callback, &type); + } else if(strncmp(line, "tch", 3) == 0) { type = WLR_INPUT_DEVICE_TOUCH; - wlr_multi_for_each_backend(server->backend, add_input_device_callback, &type); + wlr_multi_for_each_backend(server->backend, + add_input_device_callback, &type); } } } void destroy_input_device(char *line, struct cg_server *server) { - long devn=0; + long devn = 0; if(line[0] != '\0') { - devn = strtol(line+1,NULL,10); + devn = strtol(line + 1, NULL, 10); } if(line != NULL) { - if(strncmp(line,"k",1) == 0) { + if(strncmp(line, "k", 1) == 0) { if(wl_list_empty(&server->seat->keyboard_groups)) { return; } devn = devn % wl_list_length(&server->seat->keyboard_groups); struct cg_keyboard_group *group, *group_tmp; - wl_list_for_each_safe(group, group_tmp, &server->seat->keyboard_groups, link) { + wl_list_for_each_safe(group, group_tmp, + &server->seat->keyboard_groups, link) { if(devn == 0) { wl_list_remove(&group->link); wlr_keyboard_group_destroy(group->wlr_group); @@ -492,55 +499,56 @@ destroy_input_device(char *line, struct cg_server *server) { } --devn; } - } else if(strncmp(line,"p",1) == 0) { + } else if(strncmp(line, "p", 1) == 0) { if(wl_list_empty(&server->seat->pointers)) { return; } devn = devn % wl_list_length(&server->seat->pointers); struct cg_pointer *pointer, *pointer_tmp; - wl_list_for_each_safe(pointer, pointer_tmp, &server->seat->pointers, link) { + wl_list_for_each_safe(pointer, pointer_tmp, &server->seat->pointers, + link) { if(devn == 0) { pointer->destroy.notify(&pointer->destroy, NULL); break; } --devn; } - } else if(strncmp(line,"t",1) == 0) { + } else if(strncmp(line, "t", 1) == 0) { if(wl_list_empty(&server->seat->touch)) { return; } devn = devn % wl_list_length(&server->seat->touch); struct cg_touch *touch, *touch_tmp; - wl_list_for_each_safe(touch, touch_tmp, &server->seat->touch, link) { + wl_list_for_each_safe(touch, touch_tmp, &server->seat->touch, + link) { if(devn == 0) { touch->destroy.notify(&touch->destroy, NULL); break; } --devn; } - } } } void destroy_output(char *line, struct cg_server *server) { - if(wl_list_length(&server->outputs)<2) { + if(wl_list_length(&server->outputs) < 2) { return; } char *outpnstr = strtok_r(NULL, ";", &line); long outpn = 0; if(outpnstr != NULL) { - outpn=strtol(outpnstr,NULL,10); + outpn = strtol(outpnstr, NULL, 10); } - outpn=outpn%wl_list_length(&server->outputs); + outpn = outpn % wl_list_length(&server->outputs); struct cg_output *it; - wl_list_for_each(it,&server->outputs,link) { + wl_list_for_each(it, &server->outputs, link) { if(outpn == 0) { break; } else { --outpn; } } - it->damage_destroy.notify(&it->damage_destroy,NULL); + it->damage_destroy.notify(&it->damage_destroy, NULL); } diff --git a/fuzz/fuzz-lib.h b/fuzz/fuzz-lib.h index 95007b3..0ea499b 100644 --- a/fuzz/fuzz-lib.h +++ b/fuzz/fuzz-lib.h @@ -25,18 +25,25 @@ struct wlr_xwayland *xwayland; struct wlr_xcursor_manager *xcursor_manager; #endif -void cleanup(); +void +cleanup(); -int LLVMFuzzerInitialize(int *argc, char ***argv); +int +LLVMFuzzerInitialize(int *argc, char ***argv); -void move_cursor(char *line, struct cg_server *server); +void +move_cursor(char *line, struct cg_server *server); -void create_output(char *line, struct cg_server *server); +void +create_output(char *line, struct cg_server *server); -void create_input_device(char *line, struct cg_server *server); +void +create_input_device(char *line, struct cg_server *server); -void destroy_input_device(char *line, struct cg_server *server); +void +destroy_input_device(char *line, struct cg_server *server); -void destroy_output(char *line, struct cg_server *server); +void +destroy_output(char *line, struct cg_server *server); #endif diff --git a/fuzz/fuzz-parse.c b/fuzz/fuzz-parse.c index 1403eda..8aded78 100644 --- a/fuzz/fuzz-parse.c +++ b/fuzz/fuzz-parse.c @@ -11,20 +11,20 @@ #include #include +#include #include #include #include -#include -#include "config.h" #include "../keybinding.h" #include "../message.h" #include "../output.h" #include "../parse.h" #include "../seat.h" #include "../server.h" -#include "../workspace.h" #include "../view.h" +#include "../workspace.h" +#include "config.h" #if CG_HAS_XWAYLAND #include "../xwayland.h" #endif @@ -39,7 +39,7 @@ set_configuration(struct cg_server *server, char *content) { line[strcspn(line, "\n")] = '\0'; if(*line != '\0' && *line != '#') { char *errstr; - server->running=true; + server->running = true; if(parse_rc_line(server, line, &errstr) != 0) { if(errstr != NULL) { free(errstr); @@ -69,9 +69,7 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { run_action(KEYBINDING_LAYOUT_FULLSCREEN, &server, (union keybinding_params){.c = NULL}); struct cg_output *output; - wl_list_for_each(output, &server.outputs, link) { - message_clear(output); - } + wl_list_for_each(output, &server.outputs, link) { message_clear(output); } for(unsigned int i = 3; server.modes[i] != NULL; ++i) { free(server.modes[i]); } diff --git a/render.c b/render.c index 649f9bc..e1ca1c1 100644 --- a/render.c +++ b/render.c @@ -103,10 +103,12 @@ render_surface_iterator(struct cg_output *output, struct wlr_surface *surface, wlr_output->transform_matrix); if(data->tile_width != 0) { - box->width = box->width > data->tile_width ? data->tile_width:box->width; + box->width = + box->width > data->tile_width ? data->tile_width : box->width; } if(data->tile_height != 0) { - box->height = box->height > data->tile_height ? data->tile_height:box->height; + box->height = + box->height > data->tile_height ? data->tile_height : box->height; } render_texture(wlr_output, output_damage, texture, box, matrix); } @@ -116,8 +118,8 @@ render_drag_icons(struct cg_output *output, pixman_region32_t *damage, struct wl_list *drag_icons) { struct render_data data = { .damage = damage, - .tile_width = 0, - .tile_height = 0, + .tile_width = 0, + .tile_height = 0, }; output_drag_icons_for_each_surface(output, drag_icons, render_surface_iterator, &data); @@ -131,17 +133,18 @@ render_view_toplevels(struct cg_view *view, struct cg_output *output, pixman_region32_t *damage) { struct render_data data = { .damage = damage, - .tile_width = 0, - .tile_height = 0, + .tile_width = 0, + .tile_height = 0, }; - //TODO: improve run time behaviour of view_get_tile - struct cg_tile *view_tile=view_get_tile(view); + // TODO: improve run time behaviour of view_get_tile + struct cg_tile *view_tile = view_get_tile(view); if(view_tile != NULL) { - if(view_tile->tile.width != view->wlr_surface->current.width || view_tile->tile.height != view->wlr_surface->current.height) { + if(view_tile->tile.width != view->wlr_surface->current.width || + view_tile->tile.height != view->wlr_surface->current.height) { view_damage_whole(view); } - data.tile_width=view_tile->tile.width; - data.tile_height=view_tile->tile.height; + data.tile_width = view_tile->tile.width; + data.tile_height = view_tile->tile.height; } double ox, oy; @@ -167,8 +170,8 @@ render_view_popups(struct cg_view *view, struct cg_output *output, pixman_region32_t *damage) { struct render_data data = { .damage = damage, - .tile_width = 0, - .tile_height = 0, + .tile_width = 0, + .tile_height = 0, }; output_view_for_each_popup(output, view, render_popup_iterator, &data); } diff --git a/view.c b/view.c index 1329e57..142ac36 100644 --- a/view.c +++ b/view.c @@ -14,11 +14,11 @@ #include #include #include +#include #include #include #include #include -#include #include "output.h" #include "seat.h" @@ -46,14 +46,14 @@ view_get_prev_view(struct cg_view *view) { } void -view_damage_child(struct cg_view_child *child, int x, int y,bool whole); +view_damage_child(struct cg_view_child *child, int x, int y, bool whole); static void view_child_handle_commit(struct wl_listener *listener, void *_data) { struct cg_view_child *child = wl_container_of(listener, child, commit); - int x,y; + int x, y; child->get_coords(child, &x, &y); - view_damage_child(child,child->view->ox+x,child->view->oy+y,false); + view_damage_child(child, child->view->ox + x, child->view->oy + y, false); } static void @@ -73,9 +73,9 @@ view_child_finish(struct cg_view_child *child) { return; } - int x,y; + int x, y; child->get_coords(child, &x, &y); - view_damage_child(child,child->view->ox+x,child->view->oy+y,true); + view_damage_child(child, child->view->ox + x, child->view->oy + y, true); wl_list_remove(&child->link); wl_list_remove(&child->commit.link); @@ -124,10 +124,10 @@ subsurface_get_coords(struct cg_view_child *child, int *x, int *y) { *y = 0; if(!(child->view && child->view->impl)) { - while (surface && wlr_surface_is_subsurface(surface)) { + while(surface && wlr_surface_is_subsurface(surface)) { struct wlr_subsurface *subsurface = - wlr_subsurface_from_wlr_surface(surface); - if (subsurface == NULL) { + wlr_subsurface_from_wlr_surface(surface); + if(subsurface == NULL) { break; } *x += subsurface->current.x; @@ -135,7 +135,6 @@ subsurface_get_coords(struct cg_view_child *child, int *x, int *y) { surface = subsurface->parent; } } - } static void @@ -202,7 +201,9 @@ view_is_visible(const struct cg_view *view) { void view_damage(struct cg_view *view, bool whole) { struct cg_tile *view_tile = view_get_tile(view); - if(view_tile != NULL&&(view->wlr_surface->current.width != view_tile->tile.width || view->wlr_surface->current.height != view_tile->tile.height)) { + if(view_tile != NULL && + (view->wlr_surface->current.width != view_tile->tile.width || + view->wlr_surface->current.height != view_tile->tile.height)) { view_maximize(view, &view_tile->tile); } output_damage_surface(view->workspace->output, view->wlr_surface, view->ox, @@ -210,7 +211,7 @@ view_damage(struct cg_view *view, bool whole) { } void -view_damage_child(struct cg_view_child *child, int x, int y,bool whole) { +view_damage_child(struct cg_view_child *child, int x, int y, bool whole) { output_damage_surface(child->view->workspace->output, child->wlr_surface, x, y, whole); } @@ -279,10 +280,10 @@ view_unmap(struct cg_view *view) { .focused_surface == NULL || view->workspace->server->seat->seat->keyboard_state .focused_surface == view->wlr_surface) && - view->workspace->server->curr_output - ->workspaces[view->workspace->server->curr_output - ->curr_workspace] - ->focused_tile == view_tile) { + view->workspace->server->curr_output + ->workspaces[view->workspace->server->curr_output + ->curr_workspace] + ->focused_tile == view_tile) { seat_set_focus(view->workspace->server->seat, prev); } else { view_tile->view = prev; diff --git a/xdg_shell.c b/xdg_shell.c index ce6d93b..59b3334 100644 --- a/xdg_shell.c +++ b/xdg_shell.c @@ -16,8 +16,8 @@ #include #include #include -#include #include +#include #include "output.h" #include "server.h" @@ -120,7 +120,8 @@ popup_unconstrain(struct cg_xdg_popup *popup) { wlr_xdg_popup_unconstrain_from_box(popup->wlr_popup, &output_toplevel_box); } -static void xdg_popup_get_coords(struct cg_view_child *child, int *x, int *y) { +static void +xdg_popup_get_coords(struct cg_view_child *child, int *x, int *y) { if(!child) { return; } @@ -130,11 +131,9 @@ static void xdg_popup_get_coords(struct cg_view_child *child, int *x, int *y) { int x_offset = -surface->geometry.x; int y_offset = -surface->geometry.y; - wlr_xdg_popup_get_toplevel_coords(surface->popup, - x_offset + surface->popup->geometry.x, - y_offset + surface->popup->geometry.y, - x, y); - + wlr_xdg_popup_get_toplevel_coords( + surface->popup, x_offset + surface->popup->geometry.x, + y_offset + surface->popup->geometry.y, x, y); } static void @@ -216,7 +215,8 @@ static void maximize(struct cg_view *view, int width, int height) { struct cg_xdg_shell_view *xdg_shell_view = xdg_shell_view_from_view(view); wlr_xdg_toplevel_set_size(xdg_shell_view->xdg_surface, width, height); - enum wlr_edges edges = WLR_EDGE_LEFT|WLR_EDGE_RIGHT|WLR_EDGE_TOP|WLR_EDGE_BOTTOM; + enum wlr_edges edges = + WLR_EDGE_LEFT | WLR_EDGE_RIGHT | WLR_EDGE_TOP | WLR_EDGE_BOTTOM; wlr_xdg_toplevel_set_tiled(xdg_shell_view->xdg_surface, edges); } From 8c1c317d48442aae9262e028c174b34d77acc850 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Wed, 3 Jun 2020 16:21:05 +0200 Subject: [PATCH 115/689] Increment version number --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index de94fda..c6676ea 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('cagebreak', 'c', - version: '1.3.0', + version: '1.3.1', license: 'MIT', default_options: [ 'c_std=c11', From 8756f4eab35ee0b4a9009f125b2845c16a8b7020 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Wed, 3 Jun 2020 16:26:09 +0200 Subject: [PATCH 116/689] Add fixed bugs --- Bugs.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Bugs.md b/Bugs.md index f39de1c..dc238c4 100644 --- a/Bugs.md +++ b/Bugs.md @@ -97,3 +97,25 @@ difficult to reproduce. Our fuzzing framework up to and including release 1.2.0 does not limit line lengths. This can crash the fuzzing framework with a segfault due to running out of memory. + +### Issue 7 + + * github issue number: N/A + * Fixed: 1.3.1 + +Cagebreak up to and including release 1.3.0 does not ensure that windows +are resized correctly. The download save dialog in firefox +demonstrates this issue, as it may be rendered larger than the current +monitor. As of release 1.3.1 the size of every window is checked on +rendering and adjusted if necessary. + +### Issue 8 + + * github issue number: N/A + * Fixed: 1.3.1 + +Cagebreak up to and including release 1.3.0 does not force windows +to resize to the appropriate size. Calling `vsplit` on inkscape +demonstrates this issue, since it causes adjacent tiles to overlap +(contrary to the idea of a tiling compositor). + From fa10639ec077a9176e78646c723a3a4fb4485b93 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Wed, 3 Jun 2020 16:44:14 +0200 Subject: [PATCH 117/689] Increment man version numbers --- man/cagebreak-config.5.md | 2 +- man/cagebreak.1.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index 96aff5f..4e8f542 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -1,4 +1,4 @@ -% CAGEBREAK-CONFIG(1) Version 1.3.0 | Cagebreak Manual +% CAGEBREAK-CONFIG(1) Version 1.3.1 | Cagebreak Manual # NAME diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index c72323f..6777cd7 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -1,4 +1,4 @@ -% CAGEBREAK(1) Version 1.3.0 | Cagebreak Manual +% CAGEBREAK(1) Version 1.3.1 | Cagebreak Manual # NAME From e98a5318ea81e4217dd732f9bc177d5fa639ccdf Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Wed, 3 Jun 2020 18:05:02 +0200 Subject: [PATCH 118/689] Update hashes and signature --- README.md | 5 +++++ signatures/1.3.0.sig | Bin 0 -> 566 bytes signatures/cagebreak.sig | Bin 566 -> 566 bytes 3 files changed, 5 insertions(+) create mode 100644 signatures/1.3.0.sig diff --git a/README.md b/README.md index d348e25..f4da22e 100644 --- a/README.md +++ b/README.md @@ -178,6 +178,11 @@ ninja -C build For every release after 1.0.5, hashes will be provided. +1.3.1 + + * sha 256: 71be224cd99d20da4f039675ec5c48213dd14ef027b804501fa3241886b2b08b + * sha 512: d094b786e5a74b01699997a85747943e6de3544cc903dd1c5dba449c66bd925b6378de800d3734969dabf8a20c7004dc3402e3c59577db09ce107b68a1f7bd21 + 1.3.0 * sha 256: aecc5292f56f7250d777110cee1f11a92018a9eb2117d7d37cd51d7d3a5cbae0 diff --git a/signatures/1.3.0.sig b/signatures/1.3.0.sig new file mode 100644 index 0000000000000000000000000000000000000000..3c5c35930506e97301e9cae291cc396d25a231cf GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j-ZpKYEIH7WG5|K!!g`E=I|>?~Ua0$$89-2e&+5XAX( z*9`0|TaZ-`|8B19v8nWt+`yQRe_>?zV9R$KNOZ;Ao6nXhbU1&)=v=`5F>DZu{#kbT z6{L}V-K$1hB}cOf3-I#7y8ey(rb(#xaKdnFJwit<~c5^ zy(6d3S7kaKru_arzzNe&FI^df3y^)W4(q7)ut|E4Yd@8gL#=G+%RJ4oYzqQo!Ca*| zYTG657GHJfgsvX1G-WMAdsBmmg5k{0syR#>)?ww$#5RZ1FXzP>NFzzhY!;7zpW1cH zDm(B;8$w2{r%`p^6~{ov5bGl#QYIU^Czo_T=Lv{28SD&bSUw`cD<{9<47AbN4&Bp$ zOMgn_N+2(SmX9}qeQEW8mHy2_5;89c&MZH`z=+Ur5kQk8G3q40f5Ks$Qz_s{x?ikf z8*{BZGRradK@((T({PDy_ROCp)ruC!{oqhVTpQ`xX|kCjE3+XlgG=J~)v{FNR}4FC zt12}>Gi^x`e%zrAdC=4$!aNrj0HVVw&dO13pbKTvHRI^88+Vvtd@{6I5z#EMncg+c zG^gK2^REW3ovSE;Qc01T(ybNn=b(_NwQn1X$z}>-Zi;OjKXZLyfD60pAnR?4bH@OG EH)i?|)&Kwi literal 0 HcmV?d00001 diff --git a/signatures/cagebreak.sig b/signatures/cagebreak.sig index 3c5c35930506e97301e9cae291cc396d25a231cf..288094e0abe6c0c0c5f8f02f02e4b23453297d07 100644 GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j+6HLHmt3S1SZD7Rm95KPD1rPrth0$$h31po>O5Ofes z$K0jYsDzyl|7~X-L$LyQ?Cxv9MrwnDpN7!^p^iuQrsJ(88|V@D3~kLFc}6NeoA9e6 zXW#~a-j?!2tQX)>{Bqlf&!xMiXccM**s^axv7>-p%vdrlDOltSYBe1h5A@GSV#Zj9 zU7X|i|6c0ILEZsxlD@<|GOJfbV!~O^_AF1NJLz(Lj`O?&UNX9_&ZnC_Q3`f{XdT|G zkE*6#Py>LNs1v5|t2w>cIei|%8aP2j4v_-?#=R;LLTA99%}3&U;2{v! zS}{(`TdKe;h!3pno3keDIz@I;NPbSnVVKEPUXVA22pc=(`1kic*<=oR7h+9=1Qam( z(^f(rCukN0@FWpA(2Dg<;usl{;=qMIi=g}Vrz>|XBlUd}&dQ>JUQ>Jis|Y{%Sdp43 EWwj;=*Z=?k literal 566 zcmV-60?GY}0y6{v0SEvc79j-ZpKYEIH7WG5|K!!g`E=I|>?~Ua0$$89-2e&+5XAX( z*9`0|TaZ-`|8B19v8nWt+`yQRe_>?zV9R$KNOZ;Ao6nXhbU1&)=v=`5F>DZu{#kbT z6{L}V-K$1hB}cOf3-I#7y8ey(rb(#xaKdnFJwit<~c5^ zy(6d3S7kaKru_arzzNe&FI^df3y^)W4(q7)ut|E4Yd@8gL#=G+%RJ4oYzqQo!Ca*| zYTG657GHJfgsvX1G-WMAdsBmmg5k{0syR#>)?ww$#5RZ1FXzP>NFzzhY!;7zpW1cH zDm(B;8$w2{r%`p^6~{ov5bGl#QYIU^Czo_T=Lv{28SD&bSUw`cD<{9<47AbN4&Bp$ zOMgn_N+2(SmX9}qeQEW8mHy2_5;89c&MZH`z=+Ur5kQk8G3q40f5Ks$Qz_s{x?ikf z8*{BZGRradK@((T({PDy_ROCp)ruC!{oqhVTpQ`xX|kCjE3+XlgG=J~)v{FNR}4FC zt12}>Gi^x`e%zrAdC=4$!aNrj0HVVw&dO13pbKTvHRI^88+Vvtd@{6I5z#EMncg+c zG^gK2^REW3ovSE;Qc01T(ybNn=b(_NwQn1X$z}>-Zi;OjKXZLyfD60pAnR?4bH@OG EH)i?|)&Kwi From ecd620dd9803c72154b7f3cee1398b5878d3fc10 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 12 Jun 2020 10:01:44 +0200 Subject: [PATCH 119/689] Fix popup rendering bug --- view.c | 50 ++++++++++++++++++++++++-------------------------- view.h | 3 ++- xdg_shell.c | 6 +++--- 3 files changed, 29 insertions(+), 30 deletions(-) diff --git a/view.c b/view.c index 142ac36..5fa4678 100644 --- a/view.c +++ b/view.c @@ -46,25 +46,27 @@ view_get_prev_view(struct cg_view *view) { } void -view_damage_child(struct cg_view_child *child, int x, int y, bool whole); +view_damage_child(struct cg_view_child *child, int x, int y, bool whole) { + output_damage_surface(child->view->workspace->output, child->wlr_surface, x, y, whole); +} static void view_child_handle_commit(struct wl_listener *listener, void *_data) { struct cg_view_child *child = wl_container_of(listener, child, commit); int x, y; child->get_coords(child, &x, &y); - view_damage_child(child, child->view->ox + x, child->view->oy + y, false); + view_damage_child(child, x, y, false); } static void -subsurface_create(struct cg_view *view, struct wlr_subsurface *wlr_subsurface); +subsurface_create(struct cg_view_child *parent, struct cg_view *view, struct wlr_subsurface *wlr_subsurface); static void view_child_handle_new_subsurface(struct wl_listener *listener, void *data) { struct cg_view_child *child = wl_container_of(listener, child, new_subsurface); struct wlr_subsurface *wlr_subsurface = data; - subsurface_create(child->view, wlr_subsurface); + subsurface_create(child, child->view, wlr_subsurface); } void @@ -73,19 +75,16 @@ view_child_finish(struct cg_view_child *child) { return; } - int x, y; - child->get_coords(child, &x, &y); - view_damage_child(child, child->view->ox + x, child->view->oy + y, true); - wl_list_remove(&child->link); wl_list_remove(&child->commit.link); wl_list_remove(&child->new_subsurface.link); } void -view_child_init(struct cg_view_child *child, struct cg_view *view, +view_child_init(struct cg_view_child *child, struct cg_view_child *parent, struct cg_view *view, struct wlr_surface *wlr_surface) { child->view = view; + child->parent = parent; child->wlr_surface = wlr_surface; child->commit.notify = view_child_handle_commit; @@ -118,16 +117,21 @@ subsurface_handle_destroy(struct wl_listener *listener, void *_data) { static void subsurface_get_coords(struct cg_view_child *child, int *x, int *y) { - struct wlr_surface *surface = child->wlr_surface; - *x = 0; - *y = 0; + *x = -child->view->ox; + *y = -child->view->oy; - if(!(child->view && child->view->impl)) { - while(surface && wlr_surface_is_subsurface(surface)) { + if (child->parent && + child->parent->get_coords) { + int sx, sy; + child->parent->get_coords(child->parent, &sx, &sy); + *x += sx; + *y += sy; + } else { + while (surface && wlr_surface_is_subsurface(surface)) { struct wlr_subsurface *subsurface = - wlr_subsurface_from_wlr_surface(surface); - if(subsurface == NULL) { + wlr_subsurface_from_wlr_surface(surface); + if (subsurface == NULL) { break; } *x += subsurface->current.x; @@ -138,13 +142,13 @@ subsurface_get_coords(struct cg_view_child *child, int *x, int *y) { } static void -subsurface_create(struct cg_view *view, struct wlr_subsurface *wlr_subsurface) { +subsurface_create(struct cg_view_child *parent, struct cg_view *view, struct wlr_subsurface *wlr_subsurface) { struct cg_subsurface *subsurface = calloc(1, sizeof(struct cg_subsurface)); if(!subsurface) { return; } - view_child_init(&subsurface->view_child, view, wlr_subsurface->surface); + view_child_init(&subsurface->view_child, parent, view, wlr_subsurface->surface); subsurface->view_child.destroy = subsurface_destroy; subsurface->view_child.get_coords = subsurface_get_coords; subsurface->wlr_subsurface = wlr_subsurface; @@ -157,7 +161,7 @@ static void handle_new_subsurface(struct wl_listener *listener, void *data) { struct cg_view *view = wl_container_of(listener, view, new_subsurface); struct wlr_subsurface *wlr_subsurface = data; - subsurface_create(view, wlr_subsurface); + subsurface_create(NULL, view, wlr_subsurface); } char * @@ -210,12 +214,6 @@ view_damage(struct cg_view *view, bool whole) { view->oy, whole); } -void -view_damage_child(struct cg_view_child *child, int x, int y, bool whole) { - output_damage_surface(child->view->workspace->output, child->wlr_surface, x, - y, whole); -} - void view_damage_part(struct cg_view *view) { view_damage(view, false); @@ -325,7 +323,7 @@ view_map(struct cg_view *view, struct wlr_surface *surface) { struct wlr_subsurface *subsurface; wl_list_for_each(subsurface, &view->wlr_surface->subsurfaces, parent_link) { - subsurface_create(view, subsurface); + subsurface_create(NULL, view, subsurface); } view->new_subsurface.notify = handle_new_subsurface; diff --git a/view.h b/view.h index 8b405da..28315ca 100644 --- a/view.h +++ b/view.h @@ -52,6 +52,7 @@ struct cg_view_impl { struct cg_view_child { struct cg_view *view; + struct cg_view_child *parent; struct wlr_surface *wlr_surface; struct wl_list link; @@ -110,7 +111,7 @@ view_wlr_surface_at(const struct cg_view *view, double sx, double sy, void view_child_finish(struct cg_view_child *child); void -view_child_init(struct cg_view_child *child, struct cg_view *view, +view_child_init(struct cg_view_child *child, struct cg_view_child *parent, struct cg_view *view, struct wlr_surface *wlr_surface); #endif diff --git a/xdg_shell.c b/xdg_shell.c index 59b3334..6aa6bab 100644 --- a/xdg_shell.c +++ b/xdg_shell.c @@ -128,8 +128,8 @@ xdg_popup_get_coords(struct cg_view_child *child, int *x, int *y) { struct cg_xdg_popup *popup = (struct cg_xdg_popup *)child; struct wlr_xdg_surface *surface = popup->wlr_popup->base; - int x_offset = -surface->geometry.x; - int y_offset = -surface->geometry.y; + int x_offset = -surface->geometry.x-child->view->ox; + int y_offset = -surface->geometry.y-child->view->oy; wlr_xdg_popup_get_toplevel_coords( surface->popup, x_offset + surface->popup->geometry.x, @@ -145,7 +145,7 @@ xdg_popup_create(struct cg_view *view, struct wlr_xdg_popup *wlr_popup) { popup->wlr_popup = wlr_popup; popup->view_child.get_coords = xdg_popup_get_coords; - view_child_init(&popup->view_child, view, wlr_popup->base->surface); + view_child_init(&popup->view_child, NULL, view, wlr_popup->base->surface); popup->view_child.destroy = xdg_popup_destroy; popup->destroy.notify = handle_xdg_popup_destroy; wl_signal_add(&wlr_popup->base->events.destroy, &popup->destroy); From b711a4fb0b6825e6938dfd42602afaa6df25b6ea Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Fri, 12 Jun 2020 13:51:12 +0200 Subject: [PATCH 120/689] Add issue 9 --- Bugs.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Bugs.md b/Bugs.md index dc238c4..6dd5307 100644 --- a/Bugs.md +++ b/Bugs.md @@ -119,3 +119,18 @@ to resize to the appropriate size. Calling `vsplit` on inkscape demonstrates this issue, since it causes adjacent tiles to overlap (contrary to the idea of a tiling compositor). +### Issue 9 + + * github issue number: N/A + * Fixed: 1.3.2 + +Cagebreak up to and including release 1.3.1 sometimes does not render +dropdown menus correctly. + +Steps to reproduce: + + * Start firefox with wayland environment variables + * Press `alt` to show dropdown menus + * Move cursor over different menu items + * Rendering will not work correctly + From 7aeb0eca6a21213b0dadda5c307c1135bb6fb47c Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Fri, 12 Jun 2020 22:08:01 +0200 Subject: [PATCH 121/689] Apply clang-format --- view.c | 25 ++++++++++++++----------- view.h | 4 ++-- xdg_shell.c | 4 ++-- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/view.c b/view.c index 5fa4678..1560885 100644 --- a/view.c +++ b/view.c @@ -47,7 +47,8 @@ view_get_prev_view(struct cg_view *view) { void view_damage_child(struct cg_view_child *child, int x, int y, bool whole) { - output_damage_surface(child->view->workspace->output, child->wlr_surface, x, y, whole); + output_damage_surface(child->view->workspace->output, child->wlr_surface, x, + y, whole); } static void @@ -59,7 +60,8 @@ view_child_handle_commit(struct wl_listener *listener, void *_data) { } static void -subsurface_create(struct cg_view_child *parent, struct cg_view *view, struct wlr_subsurface *wlr_subsurface); +subsurface_create(struct cg_view_child *parent, struct cg_view *view, + struct wlr_subsurface *wlr_subsurface); static void view_child_handle_new_subsurface(struct wl_listener *listener, void *data) { @@ -81,8 +83,8 @@ view_child_finish(struct cg_view_child *child) { } void -view_child_init(struct cg_view_child *child, struct cg_view_child *parent, struct cg_view *view, - struct wlr_surface *wlr_surface) { +view_child_init(struct cg_view_child *child, struct cg_view_child *parent, + struct cg_view *view, struct wlr_surface *wlr_surface) { child->view = view; child->parent = parent; child->wlr_surface = wlr_surface; @@ -121,17 +123,16 @@ subsurface_get_coords(struct cg_view_child *child, int *x, int *y) { *x = -child->view->ox; *y = -child->view->oy; - if (child->parent && - child->parent->get_coords) { + if(child->parent && child->parent->get_coords) { int sx, sy; child->parent->get_coords(child->parent, &sx, &sy); *x += sx; *y += sy; } else { - while (surface && wlr_surface_is_subsurface(surface)) { + while(surface && wlr_surface_is_subsurface(surface)) { struct wlr_subsurface *subsurface = - wlr_subsurface_from_wlr_surface(surface); - if (subsurface == NULL) { + wlr_subsurface_from_wlr_surface(surface); + if(subsurface == NULL) { break; } *x += subsurface->current.x; @@ -142,13 +143,15 @@ subsurface_get_coords(struct cg_view_child *child, int *x, int *y) { } static void -subsurface_create(struct cg_view_child *parent, struct cg_view *view, struct wlr_subsurface *wlr_subsurface) { +subsurface_create(struct cg_view_child *parent, struct cg_view *view, + struct wlr_subsurface *wlr_subsurface) { struct cg_subsurface *subsurface = calloc(1, sizeof(struct cg_subsurface)); if(!subsurface) { return; } - view_child_init(&subsurface->view_child, parent, view, wlr_subsurface->surface); + view_child_init(&subsurface->view_child, parent, view, + wlr_subsurface->surface); subsurface->view_child.destroy = subsurface_destroy; subsurface->view_child.get_coords = subsurface_get_coords; subsurface->wlr_subsurface = wlr_subsurface; diff --git a/view.h b/view.h index 28315ca..bcb8908 100644 --- a/view.h +++ b/view.h @@ -111,7 +111,7 @@ view_wlr_surface_at(const struct cg_view *view, double sx, double sy, void view_child_finish(struct cg_view_child *child); void -view_child_init(struct cg_view_child *child, struct cg_view_child *parent, struct cg_view *view, - struct wlr_surface *wlr_surface); +view_child_init(struct cg_view_child *child, struct cg_view_child *parent, + struct cg_view *view, struct wlr_surface *wlr_surface); #endif diff --git a/xdg_shell.c b/xdg_shell.c index 6aa6bab..7d8ee4f 100644 --- a/xdg_shell.c +++ b/xdg_shell.c @@ -128,8 +128,8 @@ xdg_popup_get_coords(struct cg_view_child *child, int *x, int *y) { struct cg_xdg_popup *popup = (struct cg_xdg_popup *)child; struct wlr_xdg_surface *surface = popup->wlr_popup->base; - int x_offset = -surface->geometry.x-child->view->ox; - int y_offset = -surface->geometry.y-child->view->oy; + int x_offset = -surface->geometry.x - child->view->ox; + int y_offset = -surface->geometry.y - child->view->oy; wlr_xdg_popup_get_toplevel_coords( surface->popup, x_offset + surface->popup->geometry.x, From 86b04cd15458d352c76cfc1a7b01268ce971cd4d Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 25 Jun 2020 13:53:11 +0200 Subject: [PATCH 122/689] Remove trailing whitespace --- Bugs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bugs.md b/Bugs.md index 6dd5307..eb05dde 100644 --- a/Bugs.md +++ b/Bugs.md @@ -125,7 +125,7 @@ demonstrates this issue, since it causes adjacent tiles to overlap * Fixed: 1.3.2 Cagebreak up to and including release 1.3.1 sometimes does not render -dropdown menus correctly. +dropdown menus correctly. Steps to reproduce: From 36d1f9bb6d62ca2313ad3f08fdfec84a2d18c5d5 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 26 Jun 2020 11:40:48 +0200 Subject: [PATCH 123/689] Fix drag icon destroying --- seat.c | 1 + 1 file changed, 1 insertion(+) diff --git a/seat.c b/seat.c index ae8e52f..7f3c24f 100644 --- a/seat.c +++ b/seat.c @@ -731,6 +731,7 @@ handle_drag_icon_destroy(struct wl_listener *listener, void *_data) { struct cg_drag_icon *drag_icon = wl_container_of(listener, drag_icon, destroy); + drag_icon_damage(drag_icon); wl_list_remove(&drag_icon->link); wl_list_remove(&drag_icon->destroy.link); free(drag_icon); From be2d9e487748b57c20032157af65f07cb4c4a9de Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Fri, 26 Jun 2020 12:22:15 +0200 Subject: [PATCH 124/689] Add issue 10 description --- Bugs.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Bugs.md b/Bugs.md index eb05dde..9c02f16 100644 --- a/Bugs.md +++ b/Bugs.md @@ -134,3 +134,18 @@ Steps to reproduce: * Move cursor over different menu items * Rendering will not work correctly +### Issue 10 + + * github issue number: N/A + * Fixed: 1.3.2 + +Cagebreak up to and including release 1.3.2 does not render dragged links +correctly. + +Steps to reproduce: + + * Start firefox with wayland environment variables + * Click on a link and drag it over the screen + * Let go of the link + * Rendering will not work correctly + From 41e32aa23ca197c90d1658044cd469a7dcb0fc6c Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 26 Jun 2020 12:24:33 +0200 Subject: [PATCH 125/689] Adjust Bugs.md --- Bugs.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Bugs.md b/Bugs.md index 9c02f16..0d81cd2 100644 --- a/Bugs.md +++ b/Bugs.md @@ -139,7 +139,7 @@ Steps to reproduce: * github issue number: N/A * Fixed: 1.3.2 -Cagebreak up to and including release 1.3.2 does not render dragged links +Cagebreak up to and including release 1.3.2 does not render drag icons correctly. Steps to reproduce: @@ -148,4 +148,3 @@ Steps to reproduce: * Click on a link and drag it over the screen * Let go of the link * Rendering will not work correctly - From b69c360484cb1ab404cc93695b2116fa88728d9a Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Fri, 26 Jun 2020 13:22:08 +0200 Subject: [PATCH 126/689] Update version number for 1.3.2. release --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index c6676ea..decd4b7 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('cagebreak', 'c', - version: '1.3.1', + version: '1.3.2', license: 'MIT', default_options: [ 'c_std=c11', From 91bd8979205d144a30622f80bc5d89b14b7c1bb5 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Fri, 26 Jun 2020 14:56:07 +0200 Subject: [PATCH 127/689] Adjust man version numbers --- man/cagebreak-config.5.md | 2 +- man/cagebreak.1.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index 4e8f542..c063dc5 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -1,4 +1,4 @@ -% CAGEBREAK-CONFIG(1) Version 1.3.1 | Cagebreak Manual +% CAGEBREAK-CONFIG(1) Version 1.3.2 | Cagebreak Manual # NAME diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index 6777cd7..3445932 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -1,4 +1,4 @@ -% CAGEBREAK(1) Version 1.3.1 | Cagebreak Manual +% CAGEBREAK(1) Version 1.3.2 | Cagebreak Manual # NAME From 6557fccf7729cea3c6d1ed9b7f527ddc59d6f802 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Fri, 26 Jun 2020 15:01:17 +0200 Subject: [PATCH 128/689] Add binary signatures --- signatures/1.3.1.sig | Bin 0 -> 566 bytes signatures/cagebreak.sig | Bin 566 -> 566 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 signatures/1.3.1.sig diff --git a/signatures/1.3.1.sig b/signatures/1.3.1.sig new file mode 100644 index 0000000000000000000000000000000000000000..288094e0abe6c0c0c5f8f02f02e4b23453297d07 GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j+6HLHmt3S1SZD7Rm95KPD1rPrth0$$h31po>O5Ofes z$K0jYsDzyl|7~X-L$LyQ?Cxv9MrwnDpN7!^p^iuQrsJ(88|V@D3~kLFc}6NeoA9e6 zXW#~a-j?!2tQX)>{Bqlf&!xMiXccM**s^axv7>-p%vdrlDOltSYBe1h5A@GSV#Zj9 zU7X|i|6c0ILEZsxlD@<|GOJfbV!~O^_AF1NJLz(Lj`O?&UNX9_&ZnC_Q3`f{XdT|G zkE*6#Py>LNs1v5|t2w>cIei|%8aP2j4v_-?#=R;LLTA99%}3&U;2{v! zS}{(`TdKe;h!3pno3keDIz@I;NPbSnVVKEPUXVA22pc=(`1kic*<=oR7h+9=1Qam( z(^f(rCukN0@FWpA(2Dg<;usl{;=qMIi=g}Vrz>|XBlUd}&dQ>JUQ>Jis|Y{%Sdp43 EWwj;=*Z=?k literal 0 HcmV?d00001 diff --git a/signatures/cagebreak.sig b/signatures/cagebreak.sig index 288094e0abe6c0c0c5f8f02f02e4b23453297d07..dad0846c873b64c224e9a51e140c518f9bc94e62 100644 GIT binary patch delta 542 zcmV+(0^$9(1hxc_BY*YrH~5Ofes$K0jYs5jsc0KwCoS&1ud7*mD${XT28C=hWp zRY+Y0#~F~#a9?jv&X>iI!y{A@5T4l|+^|+4cP^doL>kp_?PuNs*4K|hbk?r)SQHqt zgjL({wq8Rg<_|_>A53%%Yr=>g+#-Du2G|%#@(cx(_5I>Agyh zoh*CK5518E)Ph(j=pCyf=r=f+{!YIPI$g8+mOpB9d)IxnIb%xpgJOV z{~m5f3?E-G5!Ok=C8w~fe*MrRj-1n<`MByNz5;p{854Ap)cX$S(6~Q{Ahd=tADAr&czVVjGsZWLvoA#vdMbw zrj=9Ax9>g~0G0u82?GYm9N=oR(^wkAfOY!U zpgzI!dWeE=_$f&^^(#skPd4rMUA%DNFGl_TOAv({F}9j;un&f{@ARK~&!e@`&^~TU gmS%Za?iVO5Ofes$K0jYsDzyl|7~X-L$LyQ?Cxv9MrwnDpN7!^ zp^iuQrsJ(88|V@D3~kLFc}6NeoA9e6XW#~a-j?!2tQX)>{Bqlf&!xMiXccM**s^ax zv7>-p%vdrlDOltSYBe1h5A@GSV#Zj9U7X|i|6c0ILEZsxl7GI$JTj|SMPkBP&-N@& zq&w+yeU9_I170$^uFj{MJy8mFe`p=vtB196O2IvM$9LGiqC`Ix*!tG$RugP7aHW8ulG< z!zYw%GkkZKX@Y+CiVU?6q*_hR?+9{d%U+)V6sW#VKz~^uNJl#>+E_1?MAIi|lZ!~p z4tCD!uKSk`kpln5y($qxXTYA#N8)?nArRJDF;2@{s=zFW53KB)vnK31MRrn1eon?= zn8{UMkT-@18$0Cq_xC;7WDa>3Voiet6fpYJRze;pXch(VBoR5#iuFz67#Wh{z=b}G gp!@cxD;IYxBlUd}&dQ>JUQ>Jis|Y{%Sdp43W&RWclK=n! From 1e8ccdab4db18203f509696de0c9a34c3a7821c2 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Fri, 26 Jun 2020 15:05:14 +0200 Subject: [PATCH 129/689] Add release hashes --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index f4da22e..c3584ab 100644 --- a/README.md +++ b/README.md @@ -178,6 +178,11 @@ ninja -C build For every release after 1.0.5, hashes will be provided. +1.3.2 + + * sha 256: 2cefab73b8d5902b30adb0dda1bd292af2ee808d232abcc4b2a2802d522d5232 + * sha 512: 3789efde2cb6f629c77738dd6c8638646b345d5272868aa9b244b2b19c53e6a0f5911d34744e3a9ff6253c73b2b11f6714f37ae86cc21d6979e0c8539315d659 + 1.3.1 * sha 256: 71be224cd99d20da4f039675ec5c48213dd14ef027b804501fa3241886b2b08b From 1365fc8d54f8ea57b45ce6c31134b2119432a7d3 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 27 Jun 2020 08:20:42 +0200 Subject: [PATCH 130/689] Fix output configuration --- keybinding.c | 16 ++++++++++++++++ keybinding.h | 2 ++ parse.c | 22 +++++++--------------- 3 files changed, 25 insertions(+), 15 deletions(-) diff --git a/keybinding.c b/keybinding.c index 752a434..25e21fa 100644 --- a/keybinding.c +++ b/keybinding.c @@ -825,6 +825,19 @@ keybinding_move_view_to_workspace(struct cg_server *server, uint32_t ws) { } } +void +keybinding_configure_output(struct cg_server *server, struct cg_output_config *cfg) { + struct cg_output_config *it,*tmp; + wl_list_for_each_safe(it, tmp, &server->output_config, + link) { + if(strcmp(cfg->output_name,it->output_name) == 0) { + wl_list_remove(&it->link); + free(it->output_name); + } + } + wl_list_insert(&server->output_config, &cfg->link); +} + /* Hint: see keybinding.h for details on "data" */ int run_action(enum keybinding_action action, struct cg_server *server, @@ -947,6 +960,9 @@ run_action(enum keybinding_action action, struct cg_server *server, case KEYBINDING_WORKSPACES: keybinding_set_nws(server, data.i); break; + case KEYBINDING_CONFIGURE_OUTPUT: + keybinding_configure_output(server, data.o_cfg); + break; default: { wlr_log(WLR_ERROR, "run_action was called with a value not present in \"enum " diff --git a/keybinding.h b/keybinding.h index 24f8af2..b0d99fd 100644 --- a/keybinding.h +++ b/keybinding.h @@ -21,6 +21,7 @@ enum keybinding_action { KEYBINDING_CYCLE_VIEWS, // data.b is 0 if forward, 1 if reverse KEYBINDING_CYCLE_TILES, // data.b is 0 if forward, 1 if reverse KEYBINDING_CYCLE_OUTPUT, // data.b is 0 if forward, 1 if reverse + KEYBINDING_CONFIGURE_OUTPUT, // data.o_cfg is the desired output configuration KEYBINDING_QUIT, KEYBINDING_NOOP, KEYBINDING_SWITCH_WORKSPACE, // data.u is the desired workspace @@ -57,6 +58,7 @@ union keybinding_params { bool b; float color[3]; struct keybinding *kb; + struct cg_output_config *o_cfg; }; struct keybinding { diff --git a/parse.c b/parse.c index 1cdcd0c..59663e9 100644 --- a/parse.c +++ b/parse.c @@ -261,9 +261,8 @@ parse_float(char **saveptr, const char *delim) { } } -int -parse_output_config(struct wl_list *config_list, char **saveptr, - char **errstr) { +struct cg_output_config * +parse_output_config(char **saveptr, char **errstr) { struct cg_output_config *cfg = malloc(sizeof(struct cg_output_config)); if(cfg == NULL) { *errstr = @@ -340,23 +339,14 @@ parse_output_config(struct wl_list *config_list, char **saveptr, goto error; } -#if CG_HAS_FANALYZE -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wanalyzer-malloc-leak" -#endif cfg->output_name = strdup(name); - wl_list_insert(config_list, &cfg->link); - return 0; -#if CG_HAS_FANALYZE -#pragma GCC diagnostic pop -#endif - + return cfg; error: free(cfg); wlr_log(WLR_ERROR, "Output configuration must be of the form \"output pos " " res x rate "); - return -1; + return NULL; } int @@ -546,7 +536,9 @@ parse_command(struct cg_server *server, struct keybinding *keybinding, return -1; } } else if(strcmp(action, "output") == 0) { - if(parse_output_config(&server->output_config, &saveptr, errstr) != 0) { + keybinding->action = KEYBINDING_CONFIGURE_OUTPUT; + keybinding->data.o_cfg=parse_output_config(&saveptr,errstr); + if(keybinding->data.o_cfg == NULL) { return -1; } } else { From 8df8c6f90b646102d98f70f5c39b5d07ff7933ec Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Sat, 27 Jun 2020 18:46:47 +0200 Subject: [PATCH 131/689] Improve README --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index c3584ab..ae0ce24 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,7 @@ provide a successor to ratpoison for Wayland users. However, this is no reimplementation of ratpoison. Should you like to know if a feature will be implemented, open an issue or get in touch with the development team. -This README is only relevant for development resources and instructions. For -documentation of Cagebreak, please see +For documentation of Cagebreak, please see the man pages for [cagebreak](man/cagebreak.1.md) and cagebreak [configuration](man/cagebreak-config.5.md) and the [Wiki](https://github.com/project-repo/cagebreak/wiki/). From 7ede33a3f22bd628ed79643ba629fbf88798dc8a Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Sat, 27 Jun 2020 18:48:03 +0200 Subject: [PATCH 132/689] Add information on AUR PKGBUILDs --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ae0ce24..9e49bf6 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,10 @@ other distributions given the proper library versions. ## Installation -If you are using archlinux, just clone the [PKGBUILD](https://aur.archlinux.org/cagebreak.git) from the aur. +If you are using archlinux, just use the PKGBUILDs from the aur. + + * `cagebreak` is for those who want to build cagebreak themselves (since release 1.3.0) + * `cagebreak-bin` simply extracts files to the appropriate path (since release 1.3.2) See [cagebreak-pkgbuild](https://github.com/project-repo/cagebreak-pkgbuild) for details. From a08b84b381cc452cff2e2fc3b2a36933f84909ae Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 18 Jul 2020 11:48:14 +0200 Subject: [PATCH 133/689] Fix rendering of cg_view_child objects --- view.c | 5 ++--- view.h | 2 ++ xdg_shell.c | 9 ++++++--- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/view.c b/view.c index 1560885..d1483c4 100644 --- a/view.c +++ b/view.c @@ -56,7 +56,7 @@ view_child_handle_commit(struct wl_listener *listener, void *_data) { struct cg_view_child *child = wl_container_of(listener, child, commit); int x, y; child->get_coords(child, &x, &y); - view_damage_child(child, x, y, false); + view_damage_child(child, x+child->view->ox, y+child->view->oy, false); } static void @@ -120,8 +120,7 @@ subsurface_handle_destroy(struct wl_listener *listener, void *_data) { static void subsurface_get_coords(struct cg_view_child *child, int *x, int *y) { struct wlr_surface *surface = child->wlr_surface; - *x = -child->view->ox; - *y = -child->view->oy; + *x=*y=0; if(child->parent && child->parent->get_coords) { int sx, sy; diff --git a/view.h b/view.h index bcb8908..b7cc426 100644 --- a/view.h +++ b/view.h @@ -83,6 +83,8 @@ view_damage_part(struct cg_view *view); void view_damage_whole(struct cg_view *view); void +view_damage_child(struct cg_view_child *view, int x, int y, bool whole); +void view_activate(struct cg_view *view, bool activate); void view_position(struct cg_view *view); diff --git a/xdg_shell.c b/xdg_shell.c index 7d8ee4f..1cd349d 100644 --- a/xdg_shell.c +++ b/xdg_shell.c @@ -59,7 +59,10 @@ xdg_popup_destroy(struct cg_view_child *child) { return; } - struct cg_xdg_popup *popup = (struct cg_xdg_popup *)child; + int x, y; + child->get_coords(child, &x, &y); + view_damage_child(child, x+child->view->ox, y+child->view->oy, true); +struct cg_xdg_popup *popup = (struct cg_xdg_popup *)child; wl_list_remove(&popup->destroy.link); wl_list_remove(&popup->map.link); wl_list_remove(&popup->unmap.link); @@ -128,8 +131,8 @@ xdg_popup_get_coords(struct cg_view_child *child, int *x, int *y) { struct cg_xdg_popup *popup = (struct cg_xdg_popup *)child; struct wlr_xdg_surface *surface = popup->wlr_popup->base; - int x_offset = -surface->geometry.x - child->view->ox; - int y_offset = -surface->geometry.y - child->view->oy; + int x_offset = -surface->geometry.x; + int y_offset = -surface->geometry.y; wlr_xdg_popup_get_toplevel_coords( surface->popup, x_offset + surface->popup->geometry.x, From 46236810302d39fd765427f4f2af9b1f35fc6ffc Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 18 Jul 2020 17:59:27 +0200 Subject: [PATCH 134/689] Preparation for 1.3.3 release - Bump version number - Apply clang-format --- keybinding.c | 10 +++++----- keybinding.h | 9 +++++---- man/cagebreak-config.5.md | 2 +- man/cagebreak.1.md | 2 +- meson.build | 2 +- parse.c | 2 +- view.c | 4 ++-- xdg_shell.c | 4 ++-- 8 files changed, 18 insertions(+), 17 deletions(-) diff --git a/keybinding.c b/keybinding.c index 25e21fa..054f638 100644 --- a/keybinding.c +++ b/keybinding.c @@ -826,11 +826,11 @@ keybinding_move_view_to_workspace(struct cg_server *server, uint32_t ws) { } void -keybinding_configure_output(struct cg_server *server, struct cg_output_config *cfg) { - struct cg_output_config *it,*tmp; - wl_list_for_each_safe(it, tmp, &server->output_config, - link) { - if(strcmp(cfg->output_name,it->output_name) == 0) { +keybinding_configure_output(struct cg_server *server, + struct cg_output_config *cfg) { + struct cg_output_config *it, *tmp; + wl_list_for_each_safe(it, tmp, &server->output_config, link) { + if(strcmp(cfg->output_name, it->output_name) == 0) { wl_list_remove(&it->link); free(it->output_name); } diff --git a/keybinding.h b/keybinding.h index b0d99fd..cd48840 100644 --- a/keybinding.h +++ b/keybinding.h @@ -18,10 +18,11 @@ enum keybinding_action { KEYBINDING_SPLIT_HORIZONTAL, KEYBINDING_CHANGE_TTY, // data.u is the desired tty KEYBINDING_LAYOUT_FULLSCREEN, - KEYBINDING_CYCLE_VIEWS, // data.b is 0 if forward, 1 if reverse - KEYBINDING_CYCLE_TILES, // data.b is 0 if forward, 1 if reverse - KEYBINDING_CYCLE_OUTPUT, // data.b is 0 if forward, 1 if reverse - KEYBINDING_CONFIGURE_OUTPUT, // data.o_cfg is the desired output configuration + KEYBINDING_CYCLE_VIEWS, // data.b is 0 if forward, 1 if reverse + KEYBINDING_CYCLE_TILES, // data.b is 0 if forward, 1 if reverse + KEYBINDING_CYCLE_OUTPUT, // data.b is 0 if forward, 1 if reverse + KEYBINDING_CONFIGURE_OUTPUT, // data.o_cfg is the desired output + // configuration KEYBINDING_QUIT, KEYBINDING_NOOP, KEYBINDING_SWITCH_WORKSPACE, // data.u is the desired workspace diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index c063dc5..969f56d 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -1,4 +1,4 @@ -% CAGEBREAK-CONFIG(1) Version 1.3.2 | Cagebreak Manual +% CAGEBREAK-CONFIG(1) Version 1.3.3 | Cagebreak Manual # NAME diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index 3445932..0ae8733 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -1,4 +1,4 @@ -% CAGEBREAK(1) Version 1.3.2 | Cagebreak Manual +% CAGEBREAK(1) Version 1.3.3 | Cagebreak Manual # NAME diff --git a/meson.build b/meson.build index decd4b7..39876e0 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('cagebreak', 'c', - version: '1.3.2', + version: '1.3.3', license: 'MIT', default_options: [ 'c_std=c11', diff --git a/parse.c b/parse.c index 59663e9..ff1f8c0 100644 --- a/parse.c +++ b/parse.c @@ -537,7 +537,7 @@ parse_command(struct cg_server *server, struct keybinding *keybinding, } } else if(strcmp(action, "output") == 0) { keybinding->action = KEYBINDING_CONFIGURE_OUTPUT; - keybinding->data.o_cfg=parse_output_config(&saveptr,errstr); + keybinding->data.o_cfg = parse_output_config(&saveptr, errstr); if(keybinding->data.o_cfg == NULL) { return -1; } diff --git a/view.c b/view.c index d1483c4..167ed7e 100644 --- a/view.c +++ b/view.c @@ -56,7 +56,7 @@ view_child_handle_commit(struct wl_listener *listener, void *_data) { struct cg_view_child *child = wl_container_of(listener, child, commit); int x, y; child->get_coords(child, &x, &y); - view_damage_child(child, x+child->view->ox, y+child->view->oy, false); + view_damage_child(child, x + child->view->ox, y + child->view->oy, false); } static void @@ -120,7 +120,7 @@ subsurface_handle_destroy(struct wl_listener *listener, void *_data) { static void subsurface_get_coords(struct cg_view_child *child, int *x, int *y) { struct wlr_surface *surface = child->wlr_surface; - *x=*y=0; + *x = *y = 0; if(child->parent && child->parent->get_coords) { int sx, sy; diff --git a/xdg_shell.c b/xdg_shell.c index 1cd349d..a6d850c 100644 --- a/xdg_shell.c +++ b/xdg_shell.c @@ -61,8 +61,8 @@ xdg_popup_destroy(struct cg_view_child *child) { int x, y; child->get_coords(child, &x, &y); - view_damage_child(child, x+child->view->ox, y+child->view->oy, true); -struct cg_xdg_popup *popup = (struct cg_xdg_popup *)child; + view_damage_child(child, x + child->view->ox, y + child->view->oy, true); + struct cg_xdg_popup *popup = (struct cg_xdg_popup *)child; wl_list_remove(&popup->destroy.link); wl_list_remove(&popup->map.link); wl_list_remove(&popup->unmap.link); From 21482cef3c52239e8fd92b1fc7485d4463999579 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Sat, 18 Jul 2020 20:41:10 +0200 Subject: [PATCH 135/689] Fix bug report --- Bugs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bugs.md b/Bugs.md index 0d81cd2..10deaa1 100644 --- a/Bugs.md +++ b/Bugs.md @@ -139,7 +139,7 @@ Steps to reproduce: * github issue number: N/A * Fixed: 1.3.2 -Cagebreak up to and including release 1.3.2 does not render drag icons +Cagebreak up to and including release 1.3.1 does not render drag icons correctly. Steps to reproduce: From 7f5a59f1a7c36fd281a2b956ed7db72aad085a95 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Sat, 18 Jul 2020 20:55:05 +0200 Subject: [PATCH 136/689] Add issue reports --- Bugs.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Bugs.md b/Bugs.md index 10deaa1..b30fe4f 100644 --- a/Bugs.md +++ b/Bugs.md @@ -148,3 +148,26 @@ Steps to reproduce: * Click on a link and drag it over the screen * Let go of the link * Rendering will not work correctly + +### Issue 11 + + * github issue number: N/A + * Fixed: 1.3.3 + +Cagebreak up to and including release 1.3.2 does not parse configuration +"on-keypress" but "on-parse". This does not conform to the documentation. + +### Issue 12 + + * github issue number: N/A + * Fixed: 1.3.3 + +Cagebreak up to and including release 1.3.2 does not render firefox correctly, +given certain splits. + +Steps to reproduce: + + * Open firefox + * Split screen with firefox on the right side of the screen + * Observe firefox freezing and flickering, especially while scrolling + From bcb898238ca37fe15b6a2d8b7265b1a606915991 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 18 Jul 2020 22:58:54 +0200 Subject: [PATCH 137/689] Fix incompatibilities with wlroots 0.11.0 --- output.c | 5 +---- xwayland.c | 1 + 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/output.c b/output.c index 4f40050..53f7b25 100644 --- a/output.c +++ b/output.c @@ -261,10 +261,7 @@ scan_out_primary_view(struct cg_output *output) { return false; } - if(!wlr_output_attach_buffer(wlr_output, surface->buffer)) { - return false; - } - + wlr_output_attach_buffer(wlr_output, &surface->buffer->base); return wlr_output_commit(wlr_output); } diff --git a/xwayland.c b/xwayland.c index f2d6086..9256945 100644 --- a/xwayland.c +++ b/xwayland.c @@ -7,6 +7,7 @@ * See the LICENSE file accompanying this file. */ +#include #include #include #include From 523761fc4692f4fabccf41df3cc51d9e14a97300 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Sun, 19 Jul 2020 10:12:09 +0200 Subject: [PATCH 138/689] Adjust wlroots reproducible builds version --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 39876e0..53edb52 100644 --- a/meson.build +++ b/meson.build @@ -195,7 +195,7 @@ reproducible_build_versions = { 'wayland_server': '1.18.0', 'wayland_client': '1.18.0', 'wayland_cursor': '1.18.0', - 'wlroots': '0.10.1', + 'wlroots': '0.11.0', 'xkbcommon': '0.10.0', 'fontconfig': '2.13.91', 'pixman': '0.40.0', From 578e6e28d7a402ac68417648714b96dcbbb26f71 Mon Sep 17 00:00:00 2001 From: project-repo Date: Tue, 21 Jul 2020 14:34:44 +0200 Subject: [PATCH 139/689] Reword README --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9e49bf6..1121c59 100644 --- a/README.md +++ b/README.md @@ -19,10 +19,10 @@ other distributions given the proper library versions. ## Installation -If you are using archlinux, just use the PKGBUILDs from the aur. +If you are using archlinux, just use the PKGBUILDs from the aur: - * `cagebreak` is for those who want to build cagebreak themselves (since release 1.3.0) - * `cagebreak-bin` simply extracts files to the appropriate path (since release 1.3.2) + * Using the `cagebreak` package, Cagebreak is compiled on the target system(since release 1.3.0) + * Using `cagebreak-bin` package, the pre-built binaries are extracted to the appropriate paths on the target system (since release 1.3.2) See [cagebreak-pkgbuild](https://github.com/project-repo/cagebreak-pkgbuild) for details. From da2d5923cff97e3a095ed4af27fb285caa0655f7 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Tue, 21 Jul 2020 15:17:53 +0200 Subject: [PATCH 140/689] Fix README spacing --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1121c59..b4984d1 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ other distributions given the proper library versions. If you are using archlinux, just use the PKGBUILDs from the aur: - * Using the `cagebreak` package, Cagebreak is compiled on the target system(since release 1.3.0) + * Using the `cagebreak` package, Cagebreak is compiled on the target system (since release 1.3.0) * Using `cagebreak-bin` package, the pre-built binaries are extracted to the appropriate paths on the target system (since release 1.3.2) See [cagebreak-pkgbuild](https://github.com/project-repo/cagebreak-pkgbuild) for details. From 518341869f407778cdc55b24f85ae559c01d6bb6 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Tue, 21 Jul 2020 15:36:52 +0200 Subject: [PATCH 141/689] Update hashes --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index b4984d1..e96c3ba 100644 --- a/README.md +++ b/README.md @@ -180,6 +180,11 @@ ninja -C build For every release after 1.0.5, hashes will be provided. +1.3.3 + + * sha 256: 801851ceb52afac333a1decdd236ddef55555f8b36f865e8b3a831975a496f0d + * sha 512: ce64dd56ab99bba0a83414fecc82d85322e1ca5ca3a2ca77bdc7055b2dd10fd5e20e3ff62809a696d1b04ff0046fed88e2d7538aa447099d7c2d7df8e627b2e0 + 1.3.2 * sha 256: 2cefab73b8d5902b30adb0dda1bd292af2ee808d232abcc4b2a2802d522d5232 From d411a499a57ddfaa76e09b2bc8d685f77e64aa9d Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Tue, 21 Jul 2020 15:40:27 +0200 Subject: [PATCH 142/689] Update signature --- signatures/1.3.2.sig | Bin 0 -> 566 bytes signatures/cagebreak.sig | Bin 566 -> 566 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 signatures/1.3.2.sig diff --git a/signatures/1.3.2.sig b/signatures/1.3.2.sig new file mode 100644 index 0000000000000000000000000000000000000000..dad0846c873b64c224e9a51e140c518f9bc94e62 GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j+6HLHmt3S1SZD7Rm95KPD1rPrth0$%m;H~5Ofes z$K0jYs5jsc0KwCoS&1ud7*mD${XT28C=hWpRY+Y0#~F~#a9?jv&X>iI!y{A@5T4l| z+^|+4cP^doL>kp_?PuNs*4K|hbk?r)SQHqtgjL({wq8Rg<_| z_>A53%%Yr=>g+#-D!%E=l%USK4Lk7bdKMWIbduEj4(HIgKY&{cL&n4ObzDb$aCwo{xIXtmkH@P|;13sk@Z8wHa2K zD!Yh-Omw^;^ndBZAs=T6_=lkcfoUDkQSA|F)cC6;2`2z@!Z0!WLP#M@tpd~(p6>py z(r#E4emoHS3GkhFJLW3FlBaNe1+gj7)6!0oqTMfrC4sw9I$-NuKGz_j{V_Bt&_$WZ zP_fsPpsL9SujWeFtGsELy*4q01wj}V0mzk^xc6HwZ-1IFm!eR4DT|$hj==}hIW+~x>`#DWsdvhr6N9^9^qjD3VZ+n delta 543 zcmV+)0^t3&1hxc_B7a`>@i+hq2@rG;Ovl`%*Qht(5CFl`oLPx0ZWvRA`Tag?wI~pA zG*w7l1;-hX&2V3DPtKRcki#QX5)hu*AKb83Aa^dE?nD~ZaP4Q_0@l}$LUh)y^jH)a zvV>LL)rdc^_|mrSi~$`mQqy!fhECBX%&bkjIBxm2$%FfCCBPK^~7xgu?{ z2AONx71PZl%ztU_MeM&mSlSH;XnFF&U}8&Jw2ulx_qxDbAsoV2Bx5>eH<=C!zHJ%tA72^BaWQYpZU1zB)$TA78w(ClGOVS=g_!6fLjYg#>4b= zTvJ(nQCCg-ZZ?$RpesV%OMlI0=GC8 Date: Fri, 24 Jul 2020 15:29:41 +0200 Subject: [PATCH 143/689] Improve view_unmap algorithmics --- view.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/view.c b/view.c index 167ed7e..e58dafe 100644 --- a/view.c +++ b/view.c @@ -276,15 +276,12 @@ view_unmap(struct cg_view *view) { struct cg_view *prev = view_get_prev_view(view); wlr_output_damage_add_box(view_tile->workspace->output->damage, &view_tile->tile); - if((view->workspace->server->seat->seat->keyboard_state - .focused_surface == NULL || - view->workspace->server->seat->seat->keyboard_state - .focused_surface == view->wlr_surface) && - view->workspace->server->curr_output - ->workspaces[view->workspace->server->curr_output - ->curr_workspace] - ->focused_tile == view_tile) { + if(view == view->workspace->server->seat->focused_view) { seat_set_focus(view->workspace->server->seat, prev); + } else if(view->workspace->server->seat->seat->keyboard_state + .focused_surface == view->wlr_surface) { + wlr_seat_keyboard_clear_focus(view->workspace->server->seat->seat); + seat_set_focus(view->workspace->server->seat, view->workspace->server->seat->focused_view); } else { view_tile->view = prev; if(prev != NULL) { From fd99f55dbaaf01338ff93d4c01cadb7e918dcf64 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 31 Jul 2020 12:07:26 +0200 Subject: [PATCH 144/689] Fix memeory leak --- keybinding.c | 1 + 1 file changed, 1 insertion(+) diff --git a/keybinding.c b/keybinding.c index 054f638..ce80ba5 100644 --- a/keybinding.c +++ b/keybinding.c @@ -833,6 +833,7 @@ keybinding_configure_output(struct cg_server *server, if(strcmp(cfg->output_name, it->output_name) == 0) { wl_list_remove(&it->link); free(it->output_name); + free(it); } } wl_list_insert(&server->output_config, &cfg->link); From 8256bbbefee3f247626ccf30cdcd80933b834a96 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Fri, 14 Aug 2020 17:51:45 +0200 Subject: [PATCH 145/689] Update dependencies --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 53edb52..a00471e 100644 --- a/meson.build +++ b/meson.build @@ -53,7 +53,7 @@ if is_freebsd ) endif -wlroots = dependency('wlroots', version: '>= 0.9.1') +wlroots = dependency('wlroots', version: '>= 0.11.0') wayland_protos = dependency('wayland-protocols', version: '>=1.14') wayland_server = dependency('wayland-server') wayland_cursor = dependency('wayland-cursor') From 79e25dddc64101840bee373b4f060b51bdbd4c55 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Fri, 14 Aug 2020 17:51:57 +0200 Subject: [PATCH 146/689] Update version number --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index a00471e..ce8e844 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('cagebreak', 'c', - version: '1.3.3', + version: '1.3.4', license: 'MIT', default_options: [ 'c_std=c11', From b0c6e54caf35692769d8469f4a251dd547fa5f1c Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Sat, 15 Aug 2020 22:49:33 +0200 Subject: [PATCH 147/689] Apply clang-format --- view.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/view.c b/view.c index e58dafe..a975d73 100644 --- a/view.c +++ b/view.c @@ -279,9 +279,11 @@ view_unmap(struct cg_view *view) { if(view == view->workspace->server->seat->focused_view) { seat_set_focus(view->workspace->server->seat, prev); } else if(view->workspace->server->seat->seat->keyboard_state - .focused_surface == view->wlr_surface) { - wlr_seat_keyboard_clear_focus(view->workspace->server->seat->seat); - seat_set_focus(view->workspace->server->seat, view->workspace->server->seat->focused_view); + .focused_surface == view->wlr_surface) { + wlr_seat_keyboard_clear_focus( + view->workspace->server->seat->seat); + seat_set_focus(view->workspace->server->seat, + view->workspace->server->seat->focused_view); } else { view_tile->view = prev; if(prev != NULL) { From 62b4169d77a0f0a6db00b576828abdcde0582a88 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Sat, 15 Aug 2020 22:49:53 +0200 Subject: [PATCH 148/689] Increment pango version --- meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index ce8e844..23a3ccc 100644 --- a/meson.build +++ b/meson.build @@ -199,9 +199,9 @@ reproducible_build_versions = { 'xkbcommon': '0.10.0', 'fontconfig': '2.13.91', 'pixman': '0.40.0', - 'pango': '1.44.7', + 'pango': '1.46.0', 'cairo': '1.17.3', - 'pangocairo': '1.44.7', + 'pangocairo': '1.46.0', 'math': '-1' } From 54e19b91541d05dc853bede47f0ce53fea0a9650 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Sun, 16 Aug 2020 23:01:57 +0200 Subject: [PATCH 149/689] Update man page version --- man/cagebreak-config.5.md | 2 +- man/cagebreak.1.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index 969f56d..8d4f274 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -1,4 +1,4 @@ -% CAGEBREAK-CONFIG(1) Version 1.3.3 | Cagebreak Manual +% CAGEBREAK-CONFIG(1) Version 1.3.4 | Cagebreak Manual # NAME diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index 0ae8733..b205722 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -1,4 +1,4 @@ -% CAGEBREAK(1) Version 1.3.3 | Cagebreak Manual +% CAGEBREAK(1) Version 1.3.4 | Cagebreak Manual # NAME From 248e7ac25063b896f9eb3e9a3e2e5d3e7c55b932 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Sun, 16 Aug 2020 23:12:20 +0200 Subject: [PATCH 150/689] Add README hashes --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index e96c3ba..fd4dbac 100644 --- a/README.md +++ b/README.md @@ -180,6 +180,11 @@ ninja -C build For every release after 1.0.5, hashes will be provided. +1.3.4 + + * sha 256: ea9f634b8f6e2b9f191745a25abff4969eb7ea19cb3186b79a6138904aedeb1c + * sha 512: 9094f9c92acbff8fd95d38e7458c5184804f8913fa8c405bc2b6a0a220fe478b06cfeadbae41bd5ef84bde8d5642c249df9dada953e39c25926aa650c30a5309 + 1.3.3 * sha 256: 801851ceb52afac333a1decdd236ddef55555f8b36f865e8b3a831975a496f0d From 4280e97b06812614b6494d04dee776a438dbc901 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Sun, 16 Aug 2020 23:17:28 +0200 Subject: [PATCH 151/689] Add binary signatures --- signatures/1.3.3.sig | Bin 0 -> 566 bytes signatures/cagebreak.sig | Bin 566 -> 566 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 signatures/1.3.3.sig diff --git a/signatures/1.3.3.sig b/signatures/1.3.3.sig new file mode 100644 index 0000000000000000000000000000000000000000..467b8fa7d513b4fa4667e7c1be0ccf486b2e93b2 GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j+6HLHmt3S1SZD7Rm95KPD1rPrth0$&#I=l}`{5Ofes z$K0jYs43|X0JV&Jah3qi^*SX#R{o#`6%1*XePQ5pW80&sPtHGIG6QI*>GluOhC+^6 z(Qh%M$hVS;Ga~y@FV4&ZS{3Hw(CuTJw{uIN2gvMK187PfnMYw|hsq9@)2YiXtB>ez zTDeb~-4H7Jiagd(dd&>hRZq}2@1^b`Q;U9m!H^!e@t5rVdiirsAWHpE9<{AhITBKI z42PD5PyDdm%nOR%>}l~K5RFl7o`ei)0%S4q>wT?&CwytMO#7t>E0PEae9T>AF-%kQ zO$>E<6h%`$9+|OsxXc6rS$>uhMQ<6@EMr`w8%!cRS`P!jh+OeFd>8(bLjS zlA_%&g(ZQzQ95AjTt3$zq5Uy5DbPik$WXD@l%T4~2e0Nz*sHv0n7uYJg#|$v76HhW znYi~`E^nGJm!eR4DT|$hj=}8bfX=-2G<_Ltuf)dT+z#SB&B0ilS E;Y_j+V*mgE literal 0 HcmV?d00001 diff --git a/signatures/cagebreak.sig b/signatures/cagebreak.sig index 467b8fa7d513b4fa4667e7c1be0ccf486b2e93b2..6809315d89c19e3a7b1af6367c83dc0ebbf154ab 100644 GIT binary patch delta 542 zcmV+(0^$9(1hxc_BY!!eumB1P5Ofes$K0jYsN4$>0I`>E*IlOG>AV}(GQ0bo_-BZ0|Xadp}l>_lTC0uO#;xpZUo1X^CB2{_79I945jWxv4D36vdh zDfR-XIbGt=@`ZAOUzT)0wpYT#IGdcp*;cFhC<2QRLB|{Jjei?+B*GvfdgCD26c*C! z1Pe{vG;_nE=Eg_;{iZ~TmsS7u#vULKmv!F3PS=aL89vQ4vNU5XjD@&K7WeED4->W;oUs||7oubP;-{qD@A%)Kh!Dx&irV*qM5R39{ry_6^-{W z8+e+`nV{y<+yXyFo6@9K_n9e9x?{pJvYt<@rn=V(VCm*~c@YSQ0f=SL1Tj)gD75)H z#HuVGu{Fi-&)9#d$}RU9oh_$jAxdv=(LyW7Yxt?ea(@IK(V%?nkSXx@jiVQu z!BMUCnF`1u4cQ%2NwL*5D6NCr92o?w#|e>!ju_M6cJl5@ZFMwx+9{Af=^fpKG4sr2?9Zzp2RutSGluOhC+^6(Qh%M$hVS;Ga~y@FV4&ZS{3Hw(CuTJw{uIN z2gvMK187PfnMYw|hsq9@)2YiXtB>ezTDeb~-4H7Jiagd(dVkFf)>Ti?H}9qHAybQf zeZi0(xAB+k{d)OxP9RGCP#(3dR5=n-bPR`3_r_A7=^phoJ<4X&ul}?Gb6z_^TudCjfH7Ffsc=NFhwE0@M_q?*6aR zZdet5JP`W{@SS%%<|@LHr*M4*u_@8h(oT}1-7keDfxA&UVC!5y*C3(&F*GUAMVZJ@ zvDcKKs>uhh=1SPBylI%dHZg?-K^PVR$d#G6_ggM+ntw2tqELA$i=Bgxz~9ARry=;r zPl;lRJ@MNbFPa@bWw(NClaG^nt7GSP`kvHewj<-#13k?wWjHle`_P0~V(5LgN?0?# z|F9FA_dD%Ua{@^tg*&sa-fLS`AYku)8 gG)GPBWfzp}X=-2G<_Ltuf)dT+z#SB&B0ilS;hHiE9RL6T From 73e8db1fa33fbda96c8b970c992f92ef781b5461 Mon Sep 17 00:00:00 2001 From: project-repo Date: Tue, 25 Aug 2020 15:15:31 +0200 Subject: [PATCH 152/689] Add support for closing windows --- keybinding.c | 8 ++++++++ keybinding.h | 1 + parse.c | 2 ++ view.h | 1 + xdg_shell.c | 10 ++++++++++ xwayland.c | 7 +++++++ 6 files changed, 29 insertions(+) diff --git a/keybinding.c b/keybinding.c index ce80ba5..2add7bd 100644 --- a/keybinding.c +++ b/keybinding.c @@ -549,6 +549,11 @@ keybinding_split_output(struct cg_output *output, bool vertical) { } } +static void +keybinding_close_view(struct cg_view *view) { + view->impl->close(view); +} + static void keybinding_split_vertical(struct cg_server *server) { keybinding_split_output(server->curr_output, true); @@ -964,6 +969,9 @@ run_action(enum keybinding_action action, struct cg_server *server, case KEYBINDING_CONFIGURE_OUTPUT: keybinding_configure_output(server, data.o_cfg); break; + case KEYBINDING_CLOSE_VIEW: + keybinding_close_view(server->curr_output->workspaces[server->curr_output->curr_workspace]->focused_tile->view); + break; default: { wlr_log(WLR_ERROR, "run_action was called with a value not present in \"enum " diff --git a/keybinding.h b/keybinding.h index cd48840..03ff491 100644 --- a/keybinding.h +++ b/keybinding.h @@ -14,6 +14,7 @@ struct cg_server; * in keybinding.c */ enum keybinding_action { KEYBINDING_RUN_COMMAND, // data.c is the string to execute + KEYBINDING_CLOSE_VIEW, KEYBINDING_SPLIT_VERTICAL, KEYBINDING_SPLIT_HORIZONTAL, KEYBINDING_CHANGE_TTY, // data.u is the desired tty diff --git a/parse.c b/parse.c index ff1f8c0..c7cccb4 100644 --- a/parse.c +++ b/parse.c @@ -364,6 +364,8 @@ parse_command(struct cg_server *server, struct keybinding *keybinding, keybinding->action = KEYBINDING_SPLIT_HORIZONTAL; } else if(strcmp(action, "quit") == 0) { keybinding->action = KEYBINDING_QUIT; + } else if(strcmp(action, "close") == 0) { + keybinding->action = KEYBINDING_CLOSE_VIEW; } else if(strcmp(action, "focus") == 0) { keybinding->action = KEYBINDING_CYCLE_TILES; keybinding->data.b = false; diff --git a/view.h b/view.h index b7cc426..8ddfa0b 100644 --- a/view.h +++ b/view.h @@ -39,6 +39,7 @@ struct cg_view_impl { int *height_out); bool (*is_primary)(const struct cg_view *view); void (*activate)(struct cg_view *view, bool activate); + void (*close)(struct cg_view *view); void (*maximize)(struct cg_view *view, int width, int height); void (*destroy)(struct cg_view *view); void (*for_each_surface)(struct cg_view *view, diff --git a/xdg_shell.c b/xdg_shell.c index a6d850c..94506a8 100644 --- a/xdg_shell.c +++ b/xdg_shell.c @@ -214,6 +214,15 @@ activate(struct cg_view *view, bool activate) { wlr_xdg_toplevel_set_activated(xdg_shell_view->xdg_surface, activate); } +static void +close(struct cg_view *view) { + struct cg_xdg_shell_view *xdg_shell_view = xdg_shell_view_from_view(view); + struct wlr_xdg_surface *surface=xdg_shell_view->xdg_surface; + if(surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL) { + wlr_xdg_toplevel_send_close(surface); + } +} + static void maximize(struct cg_view *view, int width, int height) { struct cg_xdg_shell_view *xdg_shell_view = xdg_shell_view_from_view(view); @@ -317,6 +326,7 @@ static const struct cg_view_impl xdg_shell_view_impl = { .get_geometry = get_geometry, .is_primary = is_primary, .activate = activate, + .close = close, .maximize = maximize, .destroy = destroy, .for_each_surface = for_each_surface, diff --git a/xwayland.c b/xwayland.c index 9256945..0fece9a 100644 --- a/xwayland.c +++ b/xwayland.c @@ -73,6 +73,12 @@ activate(struct cg_view *view, bool activate) { wlr_xwayland_surface_activate(xwayland_view->xwayland_surface, activate); } +static void +close(struct cg_view *view) { + struct cg_xwayland_view *xwayland_view = xwayland_view_from_view(view); + wlr_xwayland_surface_close(xwayland_view->xwayland_surface); +} + static void maximize(struct cg_view *view, int width, int height) { struct cg_xwayland_view *xwayland_view = xwayland_view_from_view(view); @@ -198,6 +204,7 @@ static const struct cg_view_impl xwayland_view_impl = { .get_geometry = get_geometry, .is_primary = is_primary, .activate = activate, + .close = close, .maximize = maximize, .destroy = destroy, .for_each_surface = for_each_surface, From 3e2f90fa1e3bb26b10140db6168565a5f419564a Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 31 Aug 2020 11:41:45 +0200 Subject: [PATCH 153/689] Handle repositioning of xwayland views --- xwayland.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/xwayland.c b/xwayland.c index 0fece9a..774bb4e 100644 --- a/xwayland.c +++ b/xwayland.c @@ -150,7 +150,15 @@ handle_xwayland_surface_commit(struct wl_listener *listener, void *_data) { struct cg_xwayland_view *xwayland_view = wl_container_of(listener, xwayland_view, commit); struct cg_view *view = &xwayland_view->view; - view_damage_part(view); + /* xwayland surface has moved */ + if(xwayland_view->xwayland_surface->x != view->ox || xwayland_view->xwayland_surface->y != view->oy) { + output_damage_surface(view->workspace->output, view->wlr_surface,view->ox,view->oy,true); + view->ox=xwayland_view->xwayland_surface->x; + view->oy=xwayland_view->xwayland_surface->y; + output_damage_surface(view->workspace->output, view->wlr_surface,view->ox,view->oy,true); + } else { + view_damage_part(view); + } } static void From 8778ace0ce744e01813308770cc13ceb2015979f Mon Sep 17 00:00:00 2001 From: project-repo Date: Tue, 1 Sep 2020 16:57:22 +0200 Subject: [PATCH 154/689] Review header includes --- cagebreak.c | 7 +------ idle_inhibit_v1.c | 1 - idle_inhibit_v1.h | 2 +- ipc_server.h | 4 ++-- keybinding.c | 9 +-------- keybinding.h | 4 ++-- message.c | 4 +--- output.c | 7 ++----- pango.c | 4 ---- pango.h | 1 - parse.c | 4 +--- render.c | 1 - seat.c | 7 ++----- server.c | 12 ------------ view.c | 3 --- view.h | 3 +-- workspace.c | 1 - xdg_shell.c | 1 - xwayland.c | 2 -- xwayland.h | 2 -- 20 files changed, 14 insertions(+), 65 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index 0591591..ef1e145 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -10,17 +10,14 @@ #include "config.h" -#include #include -#include +#include #include #include #include #include #include -#include #include -#include #include #include #include @@ -31,7 +28,6 @@ #include #include #include -#include #include #include #include @@ -54,7 +50,6 @@ #include "parse.h" #include "seat.h" #include "server.h" -#include "view.h" #include "xdg_shell.h" #if CG_HAS_XWAYLAND #include "xwayland.h" diff --git a/idle_inhibit_v1.c b/idle_inhibit_v1.c index 17c0041..7da2dd7 100644 --- a/idle_inhibit_v1.c +++ b/idle_inhibit_v1.c @@ -7,7 +7,6 @@ * See the LICENSE file accompanying this file. */ -#include #include #include #include diff --git a/idle_inhibit_v1.h b/idle_inhibit_v1.h index 04c585f..cd1a58d 100644 --- a/idle_inhibit_v1.h +++ b/idle_inhibit_v1.h @@ -1,7 +1,7 @@ #ifndef CG_IDLE_INHIBIT_H #define CG_IDLE_INHIBIT_H -#include +struct wl_listener; void handle_idle_inhibitor_v1_new(struct wl_listener *listener, void *data); diff --git a/ipc_server.h b/ipc_server.h index 5e66ea4..60339df 100644 --- a/ipc_server.h +++ b/ipc_server.h @@ -3,8 +3,8 @@ #include "config.h" -#include -#include +#include +#include #include struct cg_server; diff --git a/keybinding.c b/keybinding.c index 2add7bd..d750f96 100644 --- a/keybinding.c +++ b/keybinding.c @@ -1,13 +1,7 @@ #define _POSIX_C_SOURCE 200809L -#include -#include -#include -#include -#include -#include -#include #include +#include #include #include #include @@ -22,7 +16,6 @@ #include "server.h" #include "view.h" #include "workspace.h" -#include "xdg_shell.h" int keybinding_resize(struct keybinding_list *list) { diff --git a/keybinding.h b/keybinding.h index 03ff491..705a4ab 100644 --- a/keybinding.h +++ b/keybinding.h @@ -4,8 +4,8 @@ #include "config.h" -#include -#include +#include +#include struct cg_server; diff --git a/message.c b/message.c index 8ada1f8..14e0ba0 100644 --- a/message.c +++ b/message.c @@ -1,7 +1,5 @@ -#include "pango.h" #include #include -#include #include #include #include @@ -9,7 +7,7 @@ #include #include -#include "cairo.h" +#include "pango.h" #include "message.h" #include "output.h" #include "server.h" diff --git a/output.c b/output.c index 53f7b25..f59b42c 100644 --- a/output.c +++ b/output.c @@ -13,25 +13,23 @@ #include "config.h" #include -#include #include +#include #include #include #include #if WLR_HAS_X11_BACKEND #include #endif -#include #include -#include #include #include #include #include #include -#include #include #include +#include #include "keybinding.h" #include "message.h" @@ -40,7 +38,6 @@ #include "seat.h" #include "server.h" #include "util.h" -#include "view.h" #include "workspace.h" #if CG_HAS_XWAYLAND #include "xwayland.h" diff --git a/pango.c b/pango.c index ef3df10..c1ca414 100644 --- a/pango.c +++ b/pango.c @@ -2,11 +2,7 @@ #include #include #include -#include -#include #include -#include -#include #include char * diff --git a/pango.h b/pango.h index b4c6b55..fed8371 100644 --- a/pango.h +++ b/pango.h @@ -1,7 +1,6 @@ #ifndef _SWAY_PANGO_H #define _SWAY_PANGO_H #include -#include void get_text_size(cairo_t *cairo, const char *font, int *width, int *height, diff --git a/parse.c b/parse.c index c7cccb4..940e49e 100644 --- a/parse.c +++ b/parse.c @@ -1,15 +1,13 @@ #define _POSIX_C_SOURCE 200812L -#include -#include #include +#include #include #include "keybinding.h" #include "output.h" #include "parse.h" #include "server.h" -#include "workspace.h" char * malloc_vsprintf(const char *fmt, va_list ap) { diff --git a/render.c b/render.c index e1ca1c1..6aadf50 100644 --- a/render.c +++ b/render.c @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include diff --git a/seat.c b/seat.c index 7f3c24f..9c7739a 100644 --- a/seat.c +++ b/seat.c @@ -12,10 +12,8 @@ #include "config.h" #include -#include -#include -#include -#include +#include +#include #include #include #include @@ -28,7 +26,6 @@ #include #include #include -#include #if CG_HAS_XWAYLAND #include #endif diff --git a/server.c b/server.c index bfb59a7..c82296f 100644 --- a/server.c +++ b/server.c @@ -9,23 +9,11 @@ #define _POSIX_C_SOURCE 200809L -#include -#include #include #include #include -#include -#include -#include "output.h" -#include "seat.h" #include "server.h" -#include "view.h" -#include "workspace.h" -#include "xdg_shell.h" -#if CG_HAS_XWAYLAND -#include "xwayland.h" -#endif void display_terminate(struct cg_server *server) { diff --git a/view.c b/view.c index a975d73..5aadd2a 100644 --- a/view.c +++ b/view.c @@ -10,14 +10,12 @@ #define _POSIX_C_SOURCE 200809L #include -#include #include #include #include #include #include #include -#include #include #include "output.h" @@ -25,7 +23,6 @@ #include "server.h" #include "view.h" #include "workspace.h" -#include "xdg_shell.h" #if CG_HAS_XWAYLAND #include "xwayland.h" #endif diff --git a/view.h b/view.h index 8ddfa0b..c4d6b47 100644 --- a/view.h +++ b/view.h @@ -4,12 +4,11 @@ #include "config.h" #include -#include #include +#include struct cg_server; struct wlr_box; -struct wlr_surface; enum cg_view_type { CG_XDG_SHELL_VIEW, diff --git a/workspace.c b/workspace.c index fcc7650..36bea40 100644 --- a/workspace.c +++ b/workspace.c @@ -17,7 +17,6 @@ #include "message.h" #include "output.h" #include "server.h" -#include "view.h" #include "workspace.h" #if CG_HAS_FANALYZE diff --git a/xdg_shell.c b/xdg_shell.c index 94506a8..5d97272 100644 --- a/xdg_shell.c +++ b/xdg_shell.c @@ -10,7 +10,6 @@ #define _POSIX_C_SOURCE 200809L #include -#include #include #include #include diff --git a/xwayland.c b/xwayland.c index 774bb4e..34b7fba 100644 --- a/xwayland.c +++ b/xwayland.c @@ -9,14 +9,12 @@ #include #include -#include #include #include #include #include #include #include -#include #include "output.h" #include "server.h" diff --git a/xwayland.h b/xwayland.h index 78317ea..4dfaac4 100644 --- a/xwayland.h +++ b/xwayland.h @@ -2,8 +2,6 @@ #define CG_XWAYLAND_H #include "view.h" -#include -#include struct cg_xwayland_view { struct cg_view view; From 3ccf43003056f94f1fb6d516c41fc9b54691473a Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Sat, 5 Sep 2020 11:27:50 +0200 Subject: [PATCH 155/689] Add user documentation of close --- examples/config | 1 + man/cagebreak-config.5.md | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/examples/config b/examples/config index 0f0a5b0..66ce97e 100644 --- a/examples/config +++ b/examples/config @@ -32,6 +32,7 @@ bind j focusdown bind k focusup bind l focusright bind t exec xterm +bind C-k close definekey resize h resizeleft definekey resize l resizeright definekey resize j resizedown diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index 8d4f274..8d51109 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -36,6 +36,11 @@ by prepending a line with the # symbol. > supplied action. `bind ` is equivalent to >> `definekey root ` +**close - Close current window** + +> This command closes the current window. It may be useful for windows of applications which +> do not offer any method of closing them. + **definekey - Bind key to action in arbitrary mode** > This command behaves similarly to the **bind** command with the From b0aa100e3ebdb276ad047410a73b4b02b6d3e5a1 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Sun, 6 Sep 2020 17:41:45 +0200 Subject: [PATCH 156/689] Apply clang-format --- cagebreak.c | 2 +- keybinding.c | 6 ++++-- message.c | 2 +- output.c | 2 +- parse.c | 2 +- view.h | 2 +- xdg_shell.c | 4 ++-- xwayland.c | 13 ++++++++----- 8 files changed, 19 insertions(+), 14 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index ef1e145..c44aab0 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -11,13 +11,13 @@ #include "config.h" #include -#include #include #include #include #include #include #include +#include #include #include #include diff --git a/keybinding.c b/keybinding.c index d750f96..81468ee 100644 --- a/keybinding.c +++ b/keybinding.c @@ -1,7 +1,7 @@ #define _POSIX_C_SOURCE 200809L -#include #include +#include #include #include #include @@ -963,7 +963,9 @@ run_action(enum keybinding_action action, struct cg_server *server, keybinding_configure_output(server, data.o_cfg); break; case KEYBINDING_CLOSE_VIEW: - keybinding_close_view(server->curr_output->workspaces[server->curr_output->curr_workspace]->focused_tile->view); + keybinding_close_view( + server->curr_output->workspaces[server->curr_output->curr_workspace] + ->focused_tile->view); break; default: { wlr_log(WLR_ERROR, diff --git a/message.c b/message.c index 14e0ba0..b88a562 100644 --- a/message.c +++ b/message.c @@ -7,9 +7,9 @@ #include #include -#include "pango.h" #include "message.h" #include "output.h" +#include "pango.h" #include "server.h" cairo_subpixel_order_t diff --git a/output.c b/output.c index f59b42c..fa7bd22 100644 --- a/output.c +++ b/output.c @@ -13,8 +13,8 @@ #include "config.h" #include -#include #include +#include #include #include #include diff --git a/parse.c b/parse.c index 940e49e..043625b 100644 --- a/parse.c +++ b/parse.c @@ -1,7 +1,7 @@ #define _POSIX_C_SOURCE 200812L -#include #include +#include #include #include "keybinding.h" diff --git a/view.h b/view.h index c4d6b47..e9fe6ab 100644 --- a/view.h +++ b/view.h @@ -4,8 +4,8 @@ #include "config.h" #include -#include #include +#include struct cg_server; struct wlr_box; diff --git a/xdg_shell.c b/xdg_shell.c index 5d97272..6b3272c 100644 --- a/xdg_shell.c +++ b/xdg_shell.c @@ -216,7 +216,7 @@ activate(struct cg_view *view, bool activate) { static void close(struct cg_view *view) { struct cg_xdg_shell_view *xdg_shell_view = xdg_shell_view_from_view(view); - struct wlr_xdg_surface *surface=xdg_shell_view->xdg_surface; + struct wlr_xdg_surface *surface = xdg_shell_view->xdg_surface; if(surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL) { wlr_xdg_toplevel_send_close(surface); } @@ -325,7 +325,7 @@ static const struct cg_view_impl xdg_shell_view_impl = { .get_geometry = get_geometry, .is_primary = is_primary, .activate = activate, - .close = close, + .close = close, .maximize = maximize, .destroy = destroy, .for_each_surface = for_each_surface, diff --git a/xwayland.c b/xwayland.c index 34b7fba..294dc0e 100644 --- a/xwayland.c +++ b/xwayland.c @@ -149,11 +149,14 @@ handle_xwayland_surface_commit(struct wl_listener *listener, void *_data) { wl_container_of(listener, xwayland_view, commit); struct cg_view *view = &xwayland_view->view; /* xwayland surface has moved */ - if(xwayland_view->xwayland_surface->x != view->ox || xwayland_view->xwayland_surface->y != view->oy) { - output_damage_surface(view->workspace->output, view->wlr_surface,view->ox,view->oy,true); - view->ox=xwayland_view->xwayland_surface->x; - view->oy=xwayland_view->xwayland_surface->y; - output_damage_surface(view->workspace->output, view->wlr_surface,view->ox,view->oy,true); + if(xwayland_view->xwayland_surface->x != view->ox || + xwayland_view->xwayland_surface->y != view->oy) { + output_damage_surface(view->workspace->output, view->wlr_surface, + view->ox, view->oy, true); + view->ox = xwayland_view->xwayland_surface->x; + view->oy = xwayland_view->xwayland_surface->y; + output_damage_surface(view->workspace->output, view->wlr_surface, + view->ox, view->oy, true); } else { view_damage_part(view); } From d2ba8af36a1d1523a9167c109530aa8e951adf9e Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Sun, 6 Sep 2020 17:47:51 +0200 Subject: [PATCH 157/689] Adapt reproducible versions --- meson.build | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index 23a3ccc..367487c 100644 --- a/meson.build +++ b/meson.build @@ -199,9 +199,9 @@ reproducible_build_versions = { 'xkbcommon': '0.10.0', 'fontconfig': '2.13.91', 'pixman': '0.40.0', - 'pango': '1.46.0', + 'pango': '1.46.1', 'cairo': '1.17.3', - 'pangocairo': '1.46.0', + 'pangocairo': '1.46.1', 'math': '-1' } @@ -220,7 +220,7 @@ foreach name, dep : cagebreak_dependencies_dict endforeach reproducible_build_compiler = 'gcc' -reproducible_build_compiler_version = '10.1.0' +reproducible_build_compiler_version = '10.2.0' if cc.get_id() != reproducible_build_compiler warning('The compiler "' + cc.get_id() + '" differs from the one used to generate to binary specified in the README section "Reproducible Builds" (' + reproducible_build_compiler + ').') From 83f80ca5e6278dbb60a98e61466082fc9c666e16 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Sun, 6 Sep 2020 18:02:11 +0200 Subject: [PATCH 158/689] Add Issue 13 --- Bugs.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Bugs.md b/Bugs.md index b30fe4f..f27debf 100644 --- a/Bugs.md +++ b/Bugs.md @@ -171,3 +171,17 @@ Steps to reproduce: * Split screen with firefox on the right side of the screen * Observe firefox freezing and flickering, especially while scrolling +### Issue 13 + + * github issue number: N/A + * Fixed: 1.4.0 + +Cagebreak up to and including release 1.3.4 does not render xwayland views correctly. + +Steps to reproduce: + + * Open anki + * Add card + * Edit tags + * Observe suggestions not directly above the tags field + From ca0eb25e1f9ce1729c3bfb6a4410bc20b5a6c1d0 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Mon, 7 Sep 2020 10:59:08 +0200 Subject: [PATCH 159/689] Increment version --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 367487c..b9fc209 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('cagebreak', 'c', - version: '1.3.4', + version: '1.4.0', license: 'MIT', default_options: [ 'c_std=c11', From 6594a39a8b03a7195f8049faf464991dad6df0e7 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Mon, 7 Sep 2020 11:01:33 +0200 Subject: [PATCH 160/689] Update man versions --- man/cagebreak-config.5.md | 2 +- man/cagebreak.1.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index 8d51109..db37eeb 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -1,4 +1,4 @@ -% CAGEBREAK-CONFIG(1) Version 1.3.4 | Cagebreak Manual +% CAGEBREAK-CONFIG(1) Version 1.4.0 | Cagebreak Manual # NAME diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index b205722..6efb623 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -1,4 +1,4 @@ -% CAGEBREAK(1) Version 1.3.4 | Cagebreak Manual +% CAGEBREAK(1) Version 1.4.0 | Cagebreak Manual # NAME From c11e73c7528fb62c3beb8cf82a04287ecde75e41 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Mon, 7 Sep 2020 11:03:23 +0200 Subject: [PATCH 161/689] Add release notes --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index fd4dbac..d89600a 100644 --- a/README.md +++ b/README.md @@ -349,6 +349,10 @@ Adds output configuration as described in the man pages. Adds IPC as described in the man pages. +### Release 1.4.0 + +Adds close command for windows as described in the man pages. + ## License Please see [LICENSE](https://github.com/project-repo/cagebreak/blob/master/LICENSE) From becd94e6bafc87baf2ae33eae89c0b5a5a97de01 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 7 Sep 2020 11:49:15 +0200 Subject: [PATCH 162/689] Add missing header --- output.c | 1 + 1 file changed, 1 insertion(+) diff --git a/output.c b/output.c index fa7bd22..fb35ea9 100644 --- a/output.c +++ b/output.c @@ -32,6 +32,7 @@ #include #include "keybinding.h" +#include "view.h" #include "message.h" #include "output.h" #include "render.h" From def72ed84aa3453bbf02e7879926ba67f27a807a Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 7 Sep 2020 13:58:33 +0200 Subject: [PATCH 163/689] Fix potential NPD --- keybinding.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/keybinding.c b/keybinding.c index 81468ee..a061bc2 100644 --- a/keybinding.c +++ b/keybinding.c @@ -544,6 +544,9 @@ keybinding_split_output(struct cg_output *output, bool vertical) { static void keybinding_close_view(struct cg_view *view) { + if(view == NULL) { + return; + } view->impl->close(view); } From 2c28a692215f83f6f65efc511de1ec6a7de2df72 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Thu, 10 Sep 2020 16:03:15 +0200 Subject: [PATCH 164/689] Add note about memory leaks to fuzzing --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index d89600a..a48fd8b 100644 --- a/README.md +++ b/README.md @@ -305,6 +305,12 @@ We have found code path discovery to increase rapidly when the fuzzer is supplie with an initial config file. We are working on improving our fuzzing coverage to find bugs in other areas of the code. +#### Caveat + +Currently, there are memory leaks which do not seem to stem from our code but rather +the code of wl-roots or some other library we depend on. We are working on the problem. +In the meantime, add `-Ddetect-leaks=0` to the meson command to exclude memory leaks. + ## Bugs For any bug, please [create an From 2de543877b438908ffa032bf64b1bf462703e98b Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Thu, 10 Sep 2020 16:07:47 +0200 Subject: [PATCH 165/689] Increment dependency version --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index b9fc209..8f360a8 100644 --- a/meson.build +++ b/meson.build @@ -196,7 +196,7 @@ reproducible_build_versions = { 'wayland_client': '1.18.0', 'wayland_cursor': '1.18.0', 'wlroots': '0.11.0', - 'xkbcommon': '0.10.0', + 'xkbcommon': '1.0.0', 'fontconfig': '2.13.91', 'pixman': '0.40.0', 'pango': '1.46.1', From 91adbb6b0da27cee36e45dad4c6452a5141b580b Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Thu, 10 Sep 2020 17:23:06 +0200 Subject: [PATCH 166/689] Add signatures --- signatures/1.3.4.sig | Bin 0 -> 566 bytes signatures/cagebreak.sig | Bin 566 -> 566 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 signatures/1.3.4.sig diff --git a/signatures/1.3.4.sig b/signatures/1.3.4.sig new file mode 100644 index 0000000000000000000000000000000000000000..6809315d89c19e3a7b1af6367c83dc0ebbf154ab GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j+6HLHmt3S1SZD7Rm95KPD1rPrth0$(|yumB1P5Ofes z$K0jYsN4$>0I`>E*IlOG>AV}(GQ0bo_-BZ0|Xadp}l>_lTC z0uO#;xpZUo1X^CB2{_79I945jWxv4D36vdhDfR-XIbGt=@`ZAOUzT)0wpYT#IGdcp z*;cFhC<2QRLB|{JjT>_$!XP4g;~>}+7Sihk3r*ZKbHk$M#z+1ArbLOCRsZ$I9v}~w zb>6{F*NeCrKFu_;G(n?+Ijb z-D-@!AYg?t%KtNWjRNzj%b^rTk}?e;m}C>{7@leR zydH~WbrC|bvw!UMiJ`JYRm`8uGFP!JVFIVxn=E-Ea%QSTChaX>@0}oR)oEEX?h2)d z{l#H0(C)}Igj-?j4Wu^4G1}8bDp7-==tW(e*L(Adg8(R^6sS|{A-vSHfBWp&;9W(x z-Za|aENuboiUdMgFxb^-;@e6yW_7@(At@muZTl<=8w;6D3TY{0;8^N3 z{^_@fGaPJkpOCLaYe`^5Oj=KGDjLq{4JWt()XbSE-Mj1tKp~pwH<%8-Sb%7 delta 542 zcmV+(0^$9(1hxc_BY!!eumB1P5Ofes$K0jYsN4$>0I`>E*IlOG>AV}(GQ0bo_-BZ0|Xadp}l>_lTC0uO#;xpZUo1X^CB2{_79I945jWxv4D36vdh zDfR-XIbGt=@`ZAOUzT)0wpYT#IGdcp*;cFhC<2QRLB|{Jjei?+B*GvfdgCD26c*C! z1Pe{vG;_nE=Eg_;{iZ~TmsS7u#vULKmv!F3PS=aL89vQ4vNU5XjD@&K7WeED4->W;oUs||7oubP;-{qD@A%)Kh!Dx&irV*qM5R39{ry_6^-{W z8+e+`nV{y<+yXyFo6@9K_n9e9x?{pJvYt<@rn=V(VCm*~c@YSQ0f=SL1Tj)gD75)H z#HuVGu{Fi-&)9#d$}RU9oh_$jAxdv=(LyW7Yxt?ea(@IK(V%?nkSXx@jiVQu z!BMUCnF`1u4cQ%2NwL*5D6NCr92o?w#|e>!ju_M6cJl5@ZFMwx+9{Af=^fpKG4sr2?9Zzp2RutS Date: Thu, 10 Sep 2020 17:23:21 +0200 Subject: [PATCH 167/689] Add release hashes --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index a48fd8b..8ddb6a3 100644 --- a/README.md +++ b/README.md @@ -180,6 +180,11 @@ ninja -C build For every release after 1.0.5, hashes will be provided. +1.4.0 + + * sha 256: 14aa93d890c62cc763b3b546a51ad8560479d5e91fa9f949858ae6bc785e80be + * sha 512: 88f93b49792684c38553b65d2296a0e502a059814a0cfff30d05c89958870d6f66d67aac2074cfd307bad82b0d72d5c4944822a61a68f665dc161407db365fbc + 1.3.4 * sha 256: ea9f634b8f6e2b9f191745a25abff4969eb7ea19cb3186b79a6138904aedeb1c From 2f63535ae5e313ea8a66955d811f2ad8d694ddb4 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 11 Sep 2020 11:31:15 +0200 Subject: [PATCH 168/689] Implement data control manager protocol Prevents screen from flickering when doing wl-copy and paste. --- cagebreak.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cagebreak.c b/cagebreak.c index c44aab0..5185214 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -31,6 +31,7 @@ #include #include #include +#include #if CG_HAS_XWAYLAND #include #endif @@ -243,6 +244,7 @@ main(int argc, char *argv[]) { struct wlr_xdg_decoration_manager_v1 *xdg_decoration_manager = NULL; struct wlr_export_dmabuf_manager_v1 *export_dmabuf_manager = NULL; struct wlr_screencopy_manager_v1 *screencopy_manager = NULL; + struct wlr_data_control_manager_v1 *data_control_manager = NULL; struct wlr_xdg_output_manager_v1 *output_manager = NULL; struct wlr_gamma_control_manager_v1 *gamma_control_manager = NULL; struct wlr_xdg_shell *xdg_shell = NULL; @@ -355,6 +357,13 @@ main(int argc, char *argv[]) { goto end; } + data_control_manager=wlr_data_control_manager_v1_create(server.wl_display); + if(!data_control_manager) { + wlr_log(WLR_ERROR, "Unable to create the data control manager"); + ret = 1; + goto end; + } + /* Configure a listener to be notified when new outputs are * available on the backend. We use this only to detect the * first output and ignore subsequent outputs. */ From 4515ed8574293c9e311f28b2caacd5af6ff1fe43 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 11 Sep 2020 15:04:43 +0200 Subject: [PATCH 169/689] Fix crash when switching workspace Prior to this commit, it was possible that view->workspace was not the same as the workspace on which the view was displayed leading to erroneous behaviour and crashes when closing such a window. --- view.c | 10 ++++++---- view.h | 2 +- xdg_shell.c | 2 +- xwayland.c | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/view.c b/view.c index 5aadd2a..ac06669 100644 --- a/view.c +++ b/view.c @@ -315,8 +315,8 @@ view_unmap(struct cg_view *view) { } void -view_map(struct cg_view *view, struct wlr_surface *surface) { - struct cg_output *output = view->workspace->output; +view_map(struct cg_view *view, struct wlr_surface *surface, struct cg_workspace *ws) { + struct cg_output *output = ws->output; view->wlr_surface = surface; struct wlr_subsurface *subsurface; @@ -328,18 +328,20 @@ view_map(struct cg_view *view, struct wlr_surface *surface) { wl_signal_add(&view->wlr_surface->events.new_subsurface, &view->new_subsurface); + view->workspace=ws; + #if CG_HAS_XWAYLAND /* We shouldn't position override-redirect windows. They set their own (x,y) coordinates in handle_wayland_surface_map. */ if(view->type == CG_XWAYLAND_VIEW && !xwayland_view_should_manage(view)) { wl_list_insert( - &output->workspaces[output->curr_workspace]->unmanaged_views, + &ws->unmanaged_views, &view->link); } else #endif { view_position(view); - wl_list_insert(&output->workspaces[output->curr_workspace]->views, + wl_list_insert(&ws->views, &view->link); } seat_set_focus(output->server->seat, view); diff --git a/view.h b/view.h index e9fe6ab..3623824 100644 --- a/view.h +++ b/view.h @@ -99,7 +99,7 @@ view_unmap(struct cg_view *view); void view_maximize(struct cg_view *view, const struct wlr_box *tile_box); void -view_map(struct cg_view *view, struct wlr_surface *surface); +view_map(struct cg_view *view, struct wlr_surface *surface, struct cg_workspace *ws); void view_destroy(struct cg_view *view); void diff --git a/xdg_shell.c b/xdg_shell.c index 6b3272c..22f911a 100644 --- a/xdg_shell.c +++ b/xdg_shell.c @@ -300,7 +300,7 @@ handle_xdg_shell_surface_map(struct wl_listener *listener, void *_data) { wl_signal_add(&xdg_shell_view->xdg_surface->surface->events.commit, &xdg_shell_view->commit); - view_map(view, xdg_shell_view->xdg_surface->surface); + view_map(view, xdg_shell_view->xdg_surface->surface,view->workspace->server->curr_output->workspaces[view->workspace->server->curr_output->curr_workspace]); view_damage_whole(view); } diff --git a/xwayland.c b/xwayland.c index 294dc0e..bce9a4b 100644 --- a/xwayland.c +++ b/xwayland.c @@ -188,7 +188,7 @@ handle_xwayland_surface_map(struct wl_listener *listener, void *_data) { wl_signal_add(&xwayland_view->xwayland_surface->surface->events.commit, &xwayland_view->commit); - view_map(view, xwayland_view->xwayland_surface->surface); + view_map(view, xwayland_view->xwayland_surface->surface,view->workspace->server->curr_output->workspaces[view->workspace->server->curr_output->curr_workspace]); view_damage_whole(view); } From 530a5417f1b94725ca8086f77393d75bfc0c958a Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Fri, 11 Sep 2020 16:42:03 +0200 Subject: [PATCH 170/689] Increment cagebreak meson version --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 8f360a8..1c10e37 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('cagebreak', 'c', - version: '1.4.0', + version: '1.4.1', license: 'MIT', default_options: [ 'c_std=c11', From 80ada7d14b13d409dd46d46ceb7d61c62ec60ab4 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 11 Sep 2020 17:27:42 +0200 Subject: [PATCH 171/689] Invert wlr_xcursor_manager_load return value --- cagebreak.c | 2 +- output.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index 5185214..6cc2711 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -482,7 +482,7 @@ main(int argc, char *argv[]) { xwayland->display_name); } - if(wlr_xcursor_manager_load(xcursor_manager, 1)) { + if(!wlr_xcursor_manager_load(xcursor_manager, 1)) { wlr_log(WLR_ERROR, "Cannot load XWayland XCursor theme"); } struct wlr_xcursor *xcursor = diff --git a/output.c b/output.c index fb35ea9..2b3d1bd 100644 --- a/output.c +++ b/output.c @@ -594,7 +594,7 @@ handle_new_output(struct wl_listener *listener, void *data) { output->curr_workspace = 0; wl_list_init(&output->messages); - if(wlr_xcursor_manager_load(server->seat->xcursor_manager, + if(!wlr_xcursor_manager_load(server->seat->xcursor_manager, wlr_output->scale)) { wlr_log(WLR_ERROR, "Cannot load XCursor theme for output '%s' with scale %f", From cd03381bc477290c67b720c26aa97281956c1fae Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 12 Sep 2020 09:49:51 +0200 Subject: [PATCH 172/689] Fix rendering bug when closing subsurfaces --- view.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/view.c b/view.c index ac06669..c5f5265 100644 --- a/view.c +++ b/view.c @@ -74,6 +74,10 @@ view_child_finish(struct cg_view_child *child) { return; } + if(child->view != NULL && child->view->wlr_surface != NULL) { + view_damage_whole(child->view); + } + wl_list_remove(&child->link); wl_list_remove(&child->commit.link); wl_list_remove(&child->new_subsurface.link); @@ -305,13 +309,12 @@ view_unmap(struct cg_view *view) { wl_list_remove(&view->link); wl_list_remove(&view->new_subsurface.link); + view->wlr_surface = NULL; struct cg_view_child *child, *tmp; wl_list_for_each_safe(child, tmp, &view->children, link) { child->destroy(child); } - - view->wlr_surface = NULL; } void From 10a09b1d723071ebd4473a68cf424e22e2535548 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Sat, 12 Sep 2020 16:40:35 +0200 Subject: [PATCH 173/689] Increment xkbcommon version --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 1c10e37..9f73e79 100644 --- a/meson.build +++ b/meson.build @@ -196,7 +196,7 @@ reproducible_build_versions = { 'wayland_client': '1.18.0', 'wayland_cursor': '1.18.0', 'wlroots': '0.11.0', - 'xkbcommon': '1.0.0', + 'xkbcommon': '1.0.1', 'fontconfig': '2.13.91', 'pixman': '0.40.0', 'pango': '1.46.1', From df83beaf3984da24cbf0033dbb613b31f5ec0186 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Sat, 12 Sep 2020 16:45:07 +0200 Subject: [PATCH 174/689] Fix typo in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8ddb6a3..643efbf 100644 --- a/README.md +++ b/README.md @@ -314,7 +314,7 @@ find bugs in other areas of the code. Currently, there are memory leaks which do not seem to stem from our code but rather the code of wl-roots or some other library we depend on. We are working on the problem. -In the meantime, add `-Ddetect-leaks=0` to the meson command to exclude memory leaks. +In the meantime, add `-Db_detect-leaks=0` to the meson command to exclude memory leaks. ## Bugs From 20caa1f499125afd6e2d023613b8088e96a2feff Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Sat, 12 Sep 2020 17:14:01 +0200 Subject: [PATCH 175/689] Add Issue descriptions --- Bugs.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/Bugs.md b/Bugs.md index f27debf..65b77ac 100644 --- a/Bugs.md +++ b/Bugs.md @@ -185,3 +185,34 @@ Steps to reproduce: * Edit tags * Observe suggestions not directly above the tags field +### Issue 14 + + * github issue number: N/A + * Fixed: 1.4.1 + +Cagebreak up to and including release 1.4.0 makes the screen flicker, when +invoking wl-copy or wl-paste. + +Steps to reproduce: + + * Open terminal + * Invoke wl-copy + * Observe screen flickering + +### Issue 15 + + * github issue number: N/A + * Fixed: 1.4.1 + +Cagebreak up to and including release 1.4.0 renders certain dropdown +menus incorrectly. + +Steps to reproduce: + + * Open firefox + * Download any file + * Select "save file" such that the file location dialog box appears + * Delete default file name and enter "." into the location bar, such that a long dropdown menu appears + * Click on dialog box (not on the dropdown menu) to make the menu disappear + * Observe flickering of the area, where the dropdown menu used to be + From 70d244892481e8955fa9298c114b75bb31ccd3c0 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Sat, 12 Sep 2020 17:22:16 +0200 Subject: [PATCH 176/689] Apply clang-format --- cagebreak.c | 5 +++-- output.c | 4 ++-- view.c | 12 +++++------- view.h | 3 ++- xdg_shell.c | 5 ++++- xwayland.c | 5 ++++- 6 files changed, 20 insertions(+), 14 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index 6cc2711..4d1bd3b 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -31,7 +32,6 @@ #include #include #include -#include #if CG_HAS_XWAYLAND #include #endif @@ -357,7 +357,8 @@ main(int argc, char *argv[]) { goto end; } - data_control_manager=wlr_data_control_manager_v1_create(server.wl_display); + data_control_manager = + wlr_data_control_manager_v1_create(server.wl_display); if(!data_control_manager) { wlr_log(WLR_ERROR, "Unable to create the data control manager"); ret = 1; diff --git a/output.c b/output.c index 2b3d1bd..a330354 100644 --- a/output.c +++ b/output.c @@ -32,13 +32,13 @@ #include #include "keybinding.h" -#include "view.h" #include "message.h" #include "output.h" #include "render.h" #include "seat.h" #include "server.h" #include "util.h" +#include "view.h" #include "workspace.h" #if CG_HAS_XWAYLAND #include "xwayland.h" @@ -595,7 +595,7 @@ handle_new_output(struct wl_listener *listener, void *data) { wl_list_init(&output->messages); if(!wlr_xcursor_manager_load(server->seat->xcursor_manager, - wlr_output->scale)) { + wlr_output->scale)) { wlr_log(WLR_ERROR, "Cannot load XCursor theme for output '%s' with scale %f", wlr_output->name, wlr_output->scale); diff --git a/view.c b/view.c index c5f5265..a7817cf 100644 --- a/view.c +++ b/view.c @@ -318,7 +318,8 @@ view_unmap(struct cg_view *view) { } void -view_map(struct cg_view *view, struct wlr_surface *surface, struct cg_workspace *ws) { +view_map(struct cg_view *view, struct wlr_surface *surface, + struct cg_workspace *ws) { struct cg_output *output = ws->output; view->wlr_surface = surface; @@ -331,21 +332,18 @@ view_map(struct cg_view *view, struct wlr_surface *surface, struct cg_workspace wl_signal_add(&view->wlr_surface->events.new_subsurface, &view->new_subsurface); - view->workspace=ws; + view->workspace = ws; #if CG_HAS_XWAYLAND /* We shouldn't position override-redirect windows. They set their own (x,y) coordinates in handle_wayland_surface_map. */ if(view->type == CG_XWAYLAND_VIEW && !xwayland_view_should_manage(view)) { - wl_list_insert( - &ws->unmanaged_views, - &view->link); + wl_list_insert(&ws->unmanaged_views, &view->link); } else #endif { view_position(view); - wl_list_insert(&ws->views, - &view->link); + wl_list_insert(&ws->views, &view->link); } seat_set_focus(output->server->seat, view); } diff --git a/view.h b/view.h index 3623824..7474198 100644 --- a/view.h +++ b/view.h @@ -99,7 +99,8 @@ view_unmap(struct cg_view *view); void view_maximize(struct cg_view *view, const struct wlr_box *tile_box); void -view_map(struct cg_view *view, struct wlr_surface *surface, struct cg_workspace *ws); +view_map(struct cg_view *view, struct wlr_surface *surface, + struct cg_workspace *ws); void view_destroy(struct cg_view *view); void diff --git a/xdg_shell.c b/xdg_shell.c index 22f911a..9c076f2 100644 --- a/xdg_shell.c +++ b/xdg_shell.c @@ -300,7 +300,10 @@ handle_xdg_shell_surface_map(struct wl_listener *listener, void *_data) { wl_signal_add(&xdg_shell_view->xdg_surface->surface->events.commit, &xdg_shell_view->commit); - view_map(view, xdg_shell_view->xdg_surface->surface,view->workspace->server->curr_output->workspaces[view->workspace->server->curr_output->curr_workspace]); + view_map( + view, xdg_shell_view->xdg_surface->surface, + view->workspace->server->curr_output + ->workspaces[view->workspace->server->curr_output->curr_workspace]); view_damage_whole(view); } diff --git a/xwayland.c b/xwayland.c index bce9a4b..4a19daf 100644 --- a/xwayland.c +++ b/xwayland.c @@ -188,7 +188,10 @@ handle_xwayland_surface_map(struct wl_listener *listener, void *_data) { wl_signal_add(&xwayland_view->xwayland_surface->surface->events.commit, &xwayland_view->commit); - view_map(view, xwayland_view->xwayland_surface->surface,view->workspace->server->curr_output->workspaces[view->workspace->server->curr_output->curr_workspace]); + view_map( + view, xwayland_view->xwayland_surface->surface, + view->workspace->server->curr_output + ->workspaces[view->workspace->server->curr_output->curr_workspace]); view_damage_whole(view); } From 4392fc57b8bfb8e3613a7140c375ef992115202c Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Sat, 12 Sep 2020 17:24:44 +0200 Subject: [PATCH 177/689] Increment man page version --- man/cagebreak-config.5.md | 2 +- man/cagebreak.1.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index db37eeb..80a5cbc 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -1,4 +1,4 @@ -% CAGEBREAK-CONFIG(1) Version 1.4.0 | Cagebreak Manual +% CAGEBREAK-CONFIG(1) Version 1.4.1 | Cagebreak Manual # NAME diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index 6efb623..6e6df57 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -1,4 +1,4 @@ -% CAGEBREAK(1) Version 1.4.0 | Cagebreak Manual +% CAGEBREAK(1) Version 1.4.1 | Cagebreak Manual # NAME From 09583986d9eb1e4d9719a6786ea7a976fe3dff78 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Sat, 12 Sep 2020 17:38:32 +0200 Subject: [PATCH 178/689] Add binary hashes --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 643efbf..f88dff3 100644 --- a/README.md +++ b/README.md @@ -180,6 +180,11 @@ ninja -C build For every release after 1.0.5, hashes will be provided. +1.4.1 + + * sha 256: c3e0ccceaf1078b91071c40b0ccb7c4f8e53ae38b05ee6637f9f39f7f6ece2cb + * sha 512: fd77f39fc7a7e5376d8505a61d643ed4d8f4cfbbf38d70cf9ef6989645e8cc6cb9d4b1024d241dc689b6fd927a405c97b9c918b6994b8f9ab7406646f37b952d + 1.4.0 * sha 256: 14aa93d890c62cc763b3b546a51ad8560479d5e91fa9f949858ae6bc785e80be From 4dfe431c1c69b61c970981fa526f7c61392c559a Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Sat, 12 Sep 2020 17:40:34 +0200 Subject: [PATCH 179/689] Add binary signatures --- signatures/1.4.0.sig | Bin 0 -> 566 bytes signatures/cagebreak.sig | Bin 566 -> 566 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 signatures/1.4.0.sig diff --git a/signatures/1.4.0.sig b/signatures/1.4.0.sig new file mode 100644 index 0000000000000000000000000000000000000000..5482cbd2ae147cc8790435910d41701a08beb533 GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j+6HLHmt3S1SZD7Rm95KPD1rPrth0$*B0b^r~)Wm6CszPX=Oz*Sr$FZf4_MFc}NES(w{zmFAZT&&afiu71 zQi*L6k0B``B5nID3L6WVO$uo#W8hfoH2&$gh%+2)a-Wc|L~BW4MNC>xZz>wj=nW^h z0o2TyDBZj420$U2=r@=SzFE*;7$BA#O;;7O+z_P8;}PvJLF$@7s5D5CZU)oQ4~yJp EP*S%G_W%F@ literal 0 HcmV?d00001 diff --git a/signatures/cagebreak.sig b/signatures/cagebreak.sig index 5482cbd2ae147cc8790435910d41701a08beb533..07c06c78f75741a4e5e6c2e410d46b57384697ea 100644 GIT binary patch delta 542 zcmV+(0^$9(1hxc_BY#}$%m4}r5Ofes$K0jYs6bB-{TCQKKtZ>?1(52S>x8j>i5{60 z=tNM6*~3j82?KgNxzeY95%$nSayX7!X+Nr^OO?DDtq)Fes*j8}hvXSUU_ zh%&fG(0Kz3BRpNzs${DGYxub6hc7pI7V(pw$bj^asg0BhC0681*ZL>M%Z@8$cIMuckZtZ_g6|4AtQ5qO(m7kD;q zgVmF(v;mO?c};_yUxeX&sot^zq#!J4 zf$_Z$9$7M_H%Mk8_Paz(Va)_t)tqJ*wwgBZIB(7+<9U4nN}&?HAubdd(ugOy3%C1W gMx{G^kQW_03qR%b^rTk}?e;m}C>{7@leR zydH~WbrC|bvw!UMiJ`JYRm`8uGFP!JVFIVxn=E-Ea%QSTChaX>@0}oR)oEEX?h2)d z{l#H0(C)}Igj-?j4Wu^4G1}8bDp7-==tW(e*L(Adg8(R^6sS|{A-vSHfBWp&;9W(x z-Za|aENuboiUdMgFxb^-;@e6yW_7@(At@muZTl<=8w;6D3TY{0;8^N3 z{^_@fGaPJkpOCLaYe`^5Oj=KGDjLq{4JWt()XbSE-Mj1tKp~pwH<%8-Sb%7 From 67b4ecd8430dd521435ea5fb93cc932e43a62a81 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 18 Sep 2020 07:37:27 +0200 Subject: [PATCH 180/689] Fix use-after-free when destroying popups --- view.c | 29 +++++++++++++++++++++-------- view.h | 4 +++- xdg_shell.c | 4 +--- 3 files changed, 25 insertions(+), 12 deletions(-) diff --git a/view.c b/view.c index a7817cf..db5a916 100644 --- a/view.c +++ b/view.c @@ -43,17 +43,17 @@ view_get_prev_view(struct cg_view *view) { } void -view_damage_child(struct cg_view_child *child, int x, int y, bool whole) { - output_damage_surface(child->view->workspace->output, child->wlr_surface, x, - y, whole); +view_damage_child(struct cg_view_child *child, bool whole) { + int x, y; + child->get_coords(child, &x, &y); + output_damage_surface(child->view->workspace->output, child->wlr_surface, x+child->view->ox, + y+child->view->oy, whole); } static void view_child_handle_commit(struct wl_listener *listener, void *_data) { struct cg_view_child *child = wl_container_of(listener, child, commit); - int x, y; - child->get_coords(child, &x, &y); - view_damage_child(child, x + child->view->ox, y + child->view->oy, false); + view_damage_child(child, false); } static void @@ -74,11 +74,20 @@ view_child_finish(struct cg_view_child *child) { return; } - if(child->view != NULL && child->view->wlr_surface != NULL) { - view_damage_whole(child->view); + if(child->view != NULL) { + view_damage_child(child, true); + } + + struct cg_view_child *subchild, *tmpchild; + wl_list_for_each_safe(subchild,tmpchild, &child->children,parent_link) { + subchild->parent=NULL; + wl_list_remove(&subchild->parent_link); } wl_list_remove(&child->link); + if(child->parent != NULL) { + wl_list_remove(&child->parent_link); + } wl_list_remove(&child->commit.link); wl_list_remove(&child->new_subsurface.link); } @@ -88,7 +97,11 @@ view_child_init(struct cg_view_child *child, struct cg_view_child *parent, struct cg_view *view, struct wlr_surface *wlr_surface) { child->view = view; child->parent = parent; + if(parent != NULL) { + wl_list_insert(&parent->children,&child->parent_link); + } child->wlr_surface = wlr_surface; + wl_list_init(&child->children); child->commit.notify = view_child_handle_commit; wl_signal_add(&wlr_surface->events.commit, &child->commit); diff --git a/view.h b/view.h index 7474198..251c00f 100644 --- a/view.h +++ b/view.h @@ -53,8 +53,10 @@ struct cg_view_impl { struct cg_view_child { struct cg_view *view; struct cg_view_child *parent; + struct wl_list children; struct wlr_surface *wlr_surface; struct wl_list link; + struct wl_list parent_link; struct wl_listener commit; struct wl_listener new_subsurface; @@ -83,7 +85,7 @@ view_damage_part(struct cg_view *view); void view_damage_whole(struct cg_view *view); void -view_damage_child(struct cg_view_child *view, int x, int y, bool whole); +view_damage_child(struct cg_view_child *view, bool whole); void view_activate(struct cg_view *view, bool activate); void diff --git a/xdg_shell.c b/xdg_shell.c index 9c076f2..6a65e01 100644 --- a/xdg_shell.c +++ b/xdg_shell.c @@ -58,9 +58,7 @@ xdg_popup_destroy(struct cg_view_child *child) { return; } - int x, y; - child->get_coords(child, &x, &y); - view_damage_child(child, x + child->view->ox, y + child->view->oy, true); + view_damage_child(child, true); struct cg_xdg_popup *popup = (struct cg_xdg_popup *)child; wl_list_remove(&popup->destroy.link); wl_list_remove(&popup->map.link); From 6648ff5f053da79cde063913f21a53f85e738372 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Sat, 19 Sep 2020 19:41:48 +0200 Subject: [PATCH 181/689] Increment version number --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 9f73e79..908a722 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('cagebreak', 'c', - version: '1.4.1', + version: '1.4.2', license: 'MIT', default_options: [ 'c_std=c11', From 2cdffbc285d3d876f22d5cc4b79f053c0886ed22 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Sat, 19 Sep 2020 19:44:27 +0200 Subject: [PATCH 182/689] Increment man page versions --- man/cagebreak-config.5.md | 2 +- man/cagebreak.1.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index 80a5cbc..5198daa 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -1,4 +1,4 @@ -% CAGEBREAK-CONFIG(1) Version 1.4.1 | Cagebreak Manual +% CAGEBREAK-CONFIG(1) Version 1.4.2 | Cagebreak Manual # NAME diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index 6e6df57..f140cc8 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -1,4 +1,4 @@ -% CAGEBREAK(1) Version 1.4.1 | Cagebreak Manual +% CAGEBREAK(1) Version 1.4.2 | Cagebreak Manual # NAME From 256000c6d87bce13dbbb36e54e840c129d2dd4a6 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Sat, 19 Sep 2020 19:55:15 +0200 Subject: [PATCH 183/689] Add Issue 16 --- Bugs.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Bugs.md b/Bugs.md index 65b77ac..08e2d93 100644 --- a/Bugs.md +++ b/Bugs.md @@ -216,3 +216,11 @@ Steps to reproduce: * Click on dialog box (not on the dropdown menu) to make the menu disappear * Observe flickering of the area, where the dropdown menu used to be +### Issue 16 + + * github issue number: N/A + * Fixed: 1.4.2 + +Cagebreak up to and including release 1.4.1 has a difficult-to-reproduce +use-after-free bug, which can sometimes trigger crashes when popups are closed. + From a042ae624a84bac4503a88617aa58823100de2d5 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Sat, 19 Sep 2020 20:01:57 +0200 Subject: [PATCH 184/689] Apply clang-format --- view.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/view.c b/view.c index db5a916..90cc53f 100644 --- a/view.c +++ b/view.c @@ -46,8 +46,8 @@ void view_damage_child(struct cg_view_child *child, bool whole) { int x, y; child->get_coords(child, &x, &y); - output_damage_surface(child->view->workspace->output, child->wlr_surface, x+child->view->ox, - y+child->view->oy, whole); + output_damage_surface(child->view->workspace->output, child->wlr_surface, + x + child->view->ox, y + child->view->oy, whole); } static void @@ -79,8 +79,8 @@ view_child_finish(struct cg_view_child *child) { } struct cg_view_child *subchild, *tmpchild; - wl_list_for_each_safe(subchild,tmpchild, &child->children,parent_link) { - subchild->parent=NULL; + wl_list_for_each_safe(subchild, tmpchild, &child->children, parent_link) { + subchild->parent = NULL; wl_list_remove(&subchild->parent_link); } @@ -98,7 +98,7 @@ view_child_init(struct cg_view_child *child, struct cg_view_child *parent, child->view = view; child->parent = parent; if(parent != NULL) { - wl_list_insert(&parent->children,&child->parent_link); + wl_list_insert(&parent->children, &child->parent_link); } child->wlr_surface = wlr_surface; wl_list_init(&child->children); From a04ec0e76fd9d488791334d9074b2fb4e1543d6b Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Sat, 19 Sep 2020 21:47:34 +0200 Subject: [PATCH 185/689] Fix reproducible build --- meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 908a722..a87fae7 100644 --- a/meson.build +++ b/meson.build @@ -199,9 +199,9 @@ reproducible_build_versions = { 'xkbcommon': '1.0.1', 'fontconfig': '2.13.91', 'pixman': '0.40.0', - 'pango': '1.46.1', + 'pango': '1.46.2', 'cairo': '1.17.3', - 'pangocairo': '1.46.1', + 'pangocairo': '1.46.2', 'math': '-1' } From 275248ad7a82fd6403b4117403b7783cef9b7a4d Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Sun, 20 Sep 2020 10:45:46 +0200 Subject: [PATCH 186/689] Add release hashes --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index f88dff3..5046f2f 100644 --- a/README.md +++ b/README.md @@ -180,6 +180,11 @@ ninja -C build For every release after 1.0.5, hashes will be provided. +1.4.2 + + * sha 256: 27efb9328cf9cab1f81e66627696baf8c7cc2c372339a2890f955b40f3a7c396 + * sha 512: afcdbbce0753aff4770a88ddbd7df5687a7de0c77de3a2d296f85a8b8e01813212be6a0b69548aadef58e0e7da19ffea71c4f3448572656d4b19ff7f2f2fb70a + 1.4.1 * sha 256: c3e0ccceaf1078b91071c40b0ccb7c4f8e53ae38b05ee6637f9f39f7f6ece2cb From 442eaf9f45a4dc8d978e07387c55168c486ef53a Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Sun, 20 Sep 2020 10:48:15 +0200 Subject: [PATCH 187/689] Add release signatures --- signatures/1.4.1.sig | Bin 0 -> 566 bytes signatures/cagebreak.sig | Bin 566 -> 566 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 signatures/1.4.1.sig diff --git a/signatures/1.4.1.sig b/signatures/1.4.1.sig new file mode 100644 index 0000000000000000000000000000000000000000..07c06c78f75741a4e5e6c2e410d46b57384697ea GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j+6HLHmt3S1SZD7Rm95KPD1rPrth0$*I~%m4}r5Ofes z$K0jYs6bB-{TCQKKtZ>?1(52S>x8j>i5{60=tNM6*~3j82?KgNxzeY95%$@b0JYChQWUByc__*kYFE@D> z@spm&fb@{5jg$%{R^*eA@b$?g?Aw9ItzCxg2L#%a3@dcrKdAIs(dRG8QN!r{UEV|( zG?MS-`;|t7YVE9XKmGqnDE$$5n_w4sHg1E}ldH4=kp+28gPdQ4;e4syvI6B(Ev|?? z_4oyM?>tGRzgzUa`lX_pW@LOgIoRf|dzYLNKfnAxPaX_?Wcg!Pj|QML1lIR{yh}Cj zmFI$UPCaJ@(!2-7n&nlgxa5->8VeW<^bTZe!H)KEHGFozRFB`JQvS}p_HRH)@9^gv z0dQal0`kDLWxyk$RpHDG_gAOtVWc1|Xo2y)4<1=Er8h`sBKEsPOkvFgS=F3o7q*%< z@HlVICF6O00ZO3~y&*0X8PbR+xeK@ZVMe7pe2^VG3qR+Bk9L`j8X z3yMje8rWw?`oWm^A^aG&MSL{TYibi5aHL!>ui~gG%z76mOT_k70)0$HsG~eQ@KH`# za&QOP0Qilo@XndwS$#fg#%=}WHSHLuzrzW$a(1YKY+5P&Y=5HVG<+st8kd$Rw|Bhp z>bro;oA!v9?NXlFWsz$13p*!)X~b0C%^^7)$HD@bi?k&2c%11=&$hW6P~}j3MBaK6 z;`!$9VHSUkWho@tS2FN@E2G?1(52S>x8j>i5{60 z=tNM6*~3j82?KgNxzeY95%$nSayX7!X+Nr^OO?DDtq)Fes*j8}hvXSUU_ zh%&fG(0Kz3BRpNzs${DGYxub6hc7pI7V(pw$bj^asg0BhC0681*ZL>M%Z@8$cIMuckZtZ_g6|4AtQ5qO(m7kD;q zgVmF(v;mO?c};_yUxeX&sot^zq#!J4 zf$_Z$9$7M_H%Mk8_Paz(Va)_t)tqJ*wwgBZIB(7+<9U4nN}&?HAubdd(ugOy3%C1W gMx{G^kQW_03qR Date: Fri, 9 Oct 2020 13:13:31 +0200 Subject: [PATCH 188/689] Prevent use-after-free on destroying unmapped views Prior to this commit view->workspace was set on view creation. If the output containing this view was subsequently destroyed, the workspace was freed leading to a use-after-free when the view was destroyed. --- seat.c | 2 +- view.c | 33 +++++++++++++++++++-------------- view.h | 5 +++-- xdg_shell.c | 13 ++++++------- xwayland.c | 9 ++++----- 5 files changed, 33 insertions(+), 29 deletions(-) diff --git a/seat.c b/seat.c index 9c7739a..4315c0c 100644 --- a/seat.c +++ b/seat.c @@ -53,7 +53,7 @@ static bool view_at(const struct cg_view *view, double lx, double ly, struct wlr_surface **surface, double *sx, double *sy) { struct wlr_box *output_layout_box = wlr_output_layout_get_box( - view->workspace->output->server->output_layout, + view->server->output_layout, view->workspace->output->wlr_output); double view_sx = lx - view->ox - output_layout_box->x; diff --git a/view.c b/view.c index 90cc53f..73de884 100644 --- a/view.c +++ b/view.c @@ -281,6 +281,10 @@ view_for_each_popup(struct cg_view *view, wlr_surface_iterator_func_t iterator, void view_unmap(struct cg_view *view) { + /* If the view is not mapped, do nothing */ + if(view->wlr_surface == NULL) { + return; + } #if CG_HAS_XWAYLAND if((view->type != CG_XWAYLAND_VIEW || xwayland_view_should_manage(view))) #endif @@ -290,14 +294,14 @@ view_unmap(struct cg_view *view) { struct cg_view *prev = view_get_prev_view(view); wlr_output_damage_add_box(view_tile->workspace->output->damage, &view_tile->tile); - if(view == view->workspace->server->seat->focused_view) { - seat_set_focus(view->workspace->server->seat, prev); - } else if(view->workspace->server->seat->seat->keyboard_state + if(view == view->server->seat->focused_view) { + seat_set_focus(view->server->seat, prev); + } else if(view->server->seat->seat->keyboard_state .focused_surface == view->wlr_surface) { wlr_seat_keyboard_clear_focus( - view->workspace->server->seat->seat); - seat_set_focus(view->workspace->server->seat, - view->workspace->server->seat->focused_view); + view->server->seat->seat); + seat_set_focus(view->server->seat, + view->server->seat->focused_view); } else { view_tile->view = prev; if(prev != NULL) { @@ -309,12 +313,12 @@ view_unmap(struct cg_view *view) { #if CG_HAS_XWAYLAND else { view_damage_whole(view); - if(view->workspace->server->seat->seat->keyboard_state + if(view->server->seat->seat->keyboard_state .focused_surface == NULL || - view->workspace->server->seat->seat->keyboard_state + view->server->seat->seat->keyboard_state .focused_surface == view->wlr_surface) { - seat_set_focus(view->workspace->server->seat, - view->workspace->server->seat->focused_view); + seat_set_focus(view->server->seat, + view->server->seat->focused_view); } } #endif @@ -363,7 +367,7 @@ view_map(struct cg_view *view, struct wlr_surface *surface, void view_destroy(struct cg_view *view) { - struct cg_output *curr_output = view->workspace->server->curr_output; + struct cg_output *curr_output = view->server->curr_output; if(view->wlr_surface != NULL) { view_unmap(view); } @@ -375,9 +379,10 @@ view_destroy(struct cg_view *view) { } void -view_init(struct cg_view *view, struct cg_workspace *ws, enum cg_view_type type, - const struct cg_view_impl *impl) { - view->workspace = ws; +view_init(struct cg_view *view, enum cg_view_type type, + const struct cg_view_impl *impl,struct cg_server *server) { + view->workspace = NULL; + view->server=server; view->type = type; view->impl = impl; diff --git a/view.h b/view.h index 251c00f..65958b0 100644 --- a/view.h +++ b/view.h @@ -19,6 +19,7 @@ enum cg_view_type { struct cg_view { struct cg_workspace *workspace; + struct cg_server *server; struct wl_list link; // server::views struct wl_list children; // cg_view_child::link struct wlr_surface *wlr_surface; @@ -106,8 +107,8 @@ view_map(struct cg_view *view, struct wlr_surface *surface, void view_destroy(struct cg_view *view); void -view_init(struct cg_view *view, struct cg_workspace *ws, enum cg_view_type type, - const struct cg_view_impl *impl); +view_init(struct cg_view *view, enum cg_view_type type, + const struct cg_view_impl *impl, struct cg_server *server); struct wlr_surface * view_wlr_surface_at(const struct cg_view *view, double sx, double sy, diff --git a/xdg_shell.c b/xdg_shell.c index 6a65e01..4997083 100644 --- a/xdg_shell.c +++ b/xdg_shell.c @@ -103,7 +103,7 @@ popup_unconstrain(struct cg_xdg_popup *popup) { struct wlr_box *popup_box = &popup->wlr_popup->geometry; struct wlr_output_layout *output_layout = - view->workspace->output->server->output_layout; + view->server->output_layout; struct wlr_box *view_output_box = wlr_output_layout_get_box( output_layout, view->workspace->output->wlr_output); struct wlr_output *wlr_output = wlr_output_layout_output_at( @@ -297,11 +297,13 @@ handle_xdg_shell_surface_map(struct wl_listener *listener, void *_data) { xdg_shell_view->commit.notify = handle_xdg_shell_surface_commit; wl_signal_add(&xdg_shell_view->xdg_surface->surface->events.commit, &xdg_shell_view->commit); + xdg_shell_view->new_popup.notify = handle_new_xdg_popup; + wl_signal_add(&xdg_shell_view->xdg_surface->events.new_popup, &xdg_shell_view->new_popup); view_map( view, xdg_shell_view->xdg_surface->surface, - view->workspace->server->curr_output - ->workspaces[view->workspace->server->curr_output->curr_workspace]); + view->server->curr_output + ->workspaces[view->server->curr_output->curr_workspace]); view_damage_whole(view); } @@ -352,8 +354,7 @@ handle_xdg_shell_surface_new(struct wl_listener *listener, void *data) { } view_init( &xdg_shell_view->view, - server->curr_output->workspaces[server->curr_output->curr_workspace], - CG_XDG_SHELL_VIEW, &xdg_shell_view_impl); + CG_XDG_SHELL_VIEW, &xdg_shell_view_impl,server); xdg_shell_view->xdg_surface = xdg_surface; @@ -367,8 +368,6 @@ handle_xdg_shell_surface_new(struct wl_listener *listener, void *data) { handle_xdg_shell_surface_request_fullscreen; wl_signal_add(&xdg_surface->toplevel->events.request_fullscreen, &xdg_shell_view->request_fullscreen); - xdg_shell_view->new_popup.notify = handle_new_xdg_popup; - wl_signal_add(&xdg_surface->events.new_popup, &xdg_shell_view->new_popup); } void diff --git a/xwayland.c b/xwayland.c index 4a19daf..fd4a938 100644 --- a/xwayland.c +++ b/xwayland.c @@ -83,7 +83,7 @@ maximize(struct cg_view *view, int width, int height) { struct cg_output *output = view->workspace->output; struct wlr_box *box = - wlr_output_layout_get_box(view->workspace->server->output_layout, + wlr_output_layout_get_box(view->server->output_layout, view->workspace->output->wlr_output); struct wlr_xwayland_surface_size_hints *hints = xwayland_view->xwayland_surface->size_hints; @@ -190,8 +190,8 @@ handle_xwayland_surface_map(struct wl_listener *listener, void *_data) { view_map( view, xwayland_view->xwayland_surface->surface, - view->workspace->server->curr_output - ->workspaces[view->workspace->server->curr_output->curr_workspace]); + view->server->curr_output + ->workspaces[view->server->curr_output->curr_workspace]); view_damage_whole(view); } @@ -240,8 +240,7 @@ handle_xwayland_surface_new(struct wl_listener *listener, void *data) { view_init( &xwayland_view->view, - server->curr_output->workspaces[server->curr_output->curr_workspace], - CG_XWAYLAND_VIEW, &xwayland_view_impl); + CG_XWAYLAND_VIEW, &xwayland_view_impl,server); xwayland_view->xwayland_surface = xwayland_surface; xwayland_view->map.notify = handle_xwayland_surface_map; From 84d20ca5cb1f021e8f5b080472e2f0e64aa9b704 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 9 Oct 2020 13:58:00 +0200 Subject: [PATCH 189/689] Fix position of xwayland views on multiple outputs --- xwayland.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xwayland.c b/xwayland.c index fd4a938..e544317 100644 --- a/xwayland.c +++ b/xwayland.c @@ -109,7 +109,7 @@ maximize(struct cg_view *view, int width, int height) { } wlr_xwayland_surface_configure(xwayland_view->xwayland_surface, - view->ox + box->x, view->oy + box->y, width, + view->ox, view->oy, width, height); wlr_xwayland_surface_set_maximized(xwayland_view->xwayland_surface, true); } From be9cdca75a5725e51feb01c13f8eb4a400a1356a Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 9 Oct 2020 13:58:41 +0200 Subject: [PATCH 190/689] Fix handling of unmanaged views on output removal --- output.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/output.c b/output.c index a330354..7d1e8a9 100644 --- a/output.c +++ b/output.c @@ -436,7 +436,7 @@ output_destroy(struct cg_output *output) { wl_list_insert( &server->curr_output ->workspaces[server->curr_output->curr_workspace] - ->views, + ->unmanaged_views, &view->link); view->workspace = server->curr_output From cc457cdcfbb7f901e1b59b46001dc0611efe86c0 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 9 Oct 2020 13:58:57 +0200 Subject: [PATCH 191/689] Fix damaging when scanning out views --- output.c | 21 ++++++++++++--------- output.h | 1 + 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/output.c b/output.c index 7d1e8a9..91d06d8 100644 --- a/output.c +++ b/output.c @@ -226,7 +226,7 @@ scan_out_primary_view(struct cg_output *output) { } } - struct cg_view *view = seat_get_focus(server->seat); + struct cg_view *view = output->workspaces[output->curr_workspace]->focused_tile->view; if(view == NULL || view->wlr_surface == NULL) { return false; } @@ -312,20 +312,22 @@ handle_output_damage_frame(struct wl_listener *listener, void *data) { return; } - /* Check if we can scan-out the primary view. */ - static bool last_scanned_out = false; bool scanned_out = scan_out_primary_view(output); - if(scanned_out && !last_scanned_out) { + if(scanned_out && !output->last_scanned_out_view) { wlr_log(WLR_DEBUG, "Scanning out primary view"); } - if(last_scanned_out && !scanned_out) { + if(output->last_scanned_out_view && !scanned_out) { wlr_log(WLR_DEBUG, "Stopping primary view scan out"); - if(seat_get_focus(output->server->seat) != NULL) { - view_damage_whole(seat_get_focus(output->server->seat)); - } + wlr_output_damage_add_whole(output->damage); + output->last_scanned_out_view=NULL; + } + if(output->last_scanned_out_view && output->last_scanned_out_view != seat_get_focus(output->server->seat)) { + wlr_output_damage_add_whole(output->damage); + } + if(scanned_out) { + output->last_scanned_out_view = output->workspaces[output->curr_workspace]->focused_tile->view; } - last_scanned_out = scanned_out; if(scanned_out) { goto frame_done; @@ -563,6 +565,7 @@ handle_new_output(struct wl_listener *listener, void *data) { output->wlr_output = wlr_output; output->server = server; output->damage = wlr_output_damage_create(wlr_output); + output->last_scanned_out_view = NULL; wl_list_insert(&server->outputs, &output->link); output->mode.notify = handle_output_mode; diff --git a/output.h b/output.h index bf9abb4..b114176 100644 --- a/output.h +++ b/output.h @@ -23,6 +23,7 @@ struct cg_output { struct cg_workspace **workspaces; struct wl_list messages; int curr_workspace; + struct cg_view *last_scanned_out_view; struct wl_list link; // cg_server::outputs }; From eab24c31ef6e7401f8b2503b5bd5202d0c336033 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Fri, 9 Oct 2020 18:10:23 +0200 Subject: [PATCH 192/689] Increment cagebreak version --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index a87fae7..ea77b3a 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('cagebreak', 'c', - version: '1.4.2', + version: '1.4.3', license: 'MIT', default_options: [ 'c_std=c11', From e16d118014768f95c6553a6e76601cb8b4278643 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Sat, 10 Oct 2020 11:29:35 +0200 Subject: [PATCH 193/689] Apply clang-format --- output.c | 11 +++++++---- seat.c | 3 +-- view.c | 14 ++++++-------- xdg_shell.c | 18 ++++++++---------- xwayland.c | 22 +++++++++------------- 5 files changed, 31 insertions(+), 37 deletions(-) diff --git a/output.c b/output.c index 91d06d8..a38d65f 100644 --- a/output.c +++ b/output.c @@ -226,7 +226,8 @@ scan_out_primary_view(struct cg_output *output) { } } - struct cg_view *view = output->workspaces[output->curr_workspace]->focused_tile->view; + struct cg_view *view = + output->workspaces[output->curr_workspace]->focused_tile->view; if(view == NULL || view->wlr_surface == NULL) { return false; } @@ -320,13 +321,15 @@ handle_output_damage_frame(struct wl_listener *listener, void *data) { if(output->last_scanned_out_view && !scanned_out) { wlr_log(WLR_DEBUG, "Stopping primary view scan out"); wlr_output_damage_add_whole(output->damage); - output->last_scanned_out_view=NULL; + output->last_scanned_out_view = NULL; } - if(output->last_scanned_out_view && output->last_scanned_out_view != seat_get_focus(output->server->seat)) { + if(output->last_scanned_out_view && + output->last_scanned_out_view != seat_get_focus(output->server->seat)) { wlr_output_damage_add_whole(output->damage); } if(scanned_out) { - output->last_scanned_out_view = output->workspaces[output->curr_workspace]->focused_tile->view; + output->last_scanned_out_view = + output->workspaces[output->curr_workspace]->focused_tile->view; } if(scanned_out) { diff --git a/seat.c b/seat.c index 4315c0c..13ef04e 100644 --- a/seat.c +++ b/seat.c @@ -53,8 +53,7 @@ static bool view_at(const struct cg_view *view, double lx, double ly, struct wlr_surface **surface, double *sx, double *sy) { struct wlr_box *output_layout_box = wlr_output_layout_get_box( - view->server->output_layout, - view->workspace->output->wlr_output); + view->server->output_layout, view->workspace->output->wlr_output); double view_sx = lx - view->ox - output_layout_box->x; double view_sy = ly - view->oy - output_layout_box->y; diff --git a/view.c b/view.c index 73de884..d938526 100644 --- a/view.c +++ b/view.c @@ -298,8 +298,7 @@ view_unmap(struct cg_view *view) { seat_set_focus(view->server->seat, prev); } else if(view->server->seat->seat->keyboard_state .focused_surface == view->wlr_surface) { - wlr_seat_keyboard_clear_focus( - view->server->seat->seat); + wlr_seat_keyboard_clear_focus(view->server->seat->seat); seat_set_focus(view->server->seat, view->server->seat->focused_view); } else { @@ -313,10 +312,9 @@ view_unmap(struct cg_view *view) { #if CG_HAS_XWAYLAND else { view_damage_whole(view); - if(view->server->seat->seat->keyboard_state - .focused_surface == NULL || - view->server->seat->seat->keyboard_state - .focused_surface == view->wlr_surface) { + if(view->server->seat->seat->keyboard_state.focused_surface == NULL || + view->server->seat->seat->keyboard_state.focused_surface == + view->wlr_surface) { seat_set_focus(view->server->seat, view->server->seat->focused_view); } @@ -380,9 +378,9 @@ view_destroy(struct cg_view *view) { void view_init(struct cg_view *view, enum cg_view_type type, - const struct cg_view_impl *impl,struct cg_server *server) { + const struct cg_view_impl *impl, struct cg_server *server) { view->workspace = NULL; - view->server=server; + view->server = server; view->type = type; view->impl = impl; diff --git a/xdg_shell.c b/xdg_shell.c index 4997083..35c170c 100644 --- a/xdg_shell.c +++ b/xdg_shell.c @@ -102,8 +102,7 @@ popup_unconstrain(struct cg_xdg_popup *popup) { struct cg_view *view = popup->view_child.view; struct wlr_box *popup_box = &popup->wlr_popup->geometry; - struct wlr_output_layout *output_layout = - view->server->output_layout; + struct wlr_output_layout *output_layout = view->server->output_layout; struct wlr_box *view_output_box = wlr_output_layout_get_box( output_layout, view->workspace->output->wlr_output); struct wlr_output *wlr_output = wlr_output_layout_output_at( @@ -298,12 +297,12 @@ handle_xdg_shell_surface_map(struct wl_listener *listener, void *_data) { wl_signal_add(&xdg_shell_view->xdg_surface->surface->events.commit, &xdg_shell_view->commit); xdg_shell_view->new_popup.notify = handle_new_xdg_popup; - wl_signal_add(&xdg_shell_view->xdg_surface->events.new_popup, &xdg_shell_view->new_popup); + wl_signal_add(&xdg_shell_view->xdg_surface->events.new_popup, + &xdg_shell_view->new_popup); - view_map( - view, xdg_shell_view->xdg_surface->surface, - view->server->curr_output - ->workspaces[view->server->curr_output->curr_workspace]); + view_map(view, xdg_shell_view->xdg_surface->surface, + view->server->curr_output + ->workspaces[view->server->curr_output->curr_workspace]); view_damage_whole(view); } @@ -352,9 +351,8 @@ handle_xdg_shell_surface_new(struct wl_listener *listener, void *data) { wlr_log(WLR_ERROR, "Failed to allocate XDG Shell view"); return; } - view_init( - &xdg_shell_view->view, - CG_XDG_SHELL_VIEW, &xdg_shell_view_impl,server); + view_init(&xdg_shell_view->view, CG_XDG_SHELL_VIEW, &xdg_shell_view_impl, + server); xdg_shell_view->xdg_surface = xdg_surface; diff --git a/xwayland.c b/xwayland.c index e544317..e5f505b 100644 --- a/xwayland.c +++ b/xwayland.c @@ -82,9 +82,8 @@ maximize(struct cg_view *view, int width, int height) { struct cg_xwayland_view *xwayland_view = xwayland_view_from_view(view); struct cg_output *output = view->workspace->output; - struct wlr_box *box = - wlr_output_layout_get_box(view->server->output_layout, - view->workspace->output->wlr_output); + struct wlr_box *box = wlr_output_layout_get_box( + view->server->output_layout, view->workspace->output->wlr_output); struct wlr_xwayland_surface_size_hints *hints = xwayland_view->xwayland_surface->size_hints; @@ -108,9 +107,8 @@ maximize(struct cg_view *view, int width, int height) { } } - wlr_xwayland_surface_configure(xwayland_view->xwayland_surface, - view->ox, view->oy, width, - height); + wlr_xwayland_surface_configure(xwayland_view->xwayland_surface, view->ox, + view->oy, width, height); wlr_xwayland_surface_set_maximized(xwayland_view->xwayland_surface, true); } @@ -188,10 +186,9 @@ handle_xwayland_surface_map(struct wl_listener *listener, void *_data) { wl_signal_add(&xwayland_view->xwayland_surface->surface->events.commit, &xwayland_view->commit); - view_map( - view, xwayland_view->xwayland_surface->surface, - view->server->curr_output - ->workspaces[view->server->curr_output->curr_workspace]); + view_map(view, xwayland_view->xwayland_surface->surface, + view->server->curr_output + ->workspaces[view->server->curr_output->curr_workspace]); view_damage_whole(view); } @@ -238,9 +235,8 @@ handle_xwayland_surface_new(struct wl_listener *listener, void *data) { return; } - view_init( - &xwayland_view->view, - CG_XWAYLAND_VIEW, &xwayland_view_impl,server); + view_init(&xwayland_view->view, CG_XWAYLAND_VIEW, &xwayland_view_impl, + server); xwayland_view->xwayland_surface = xwayland_surface; xwayland_view->map.notify = handle_xwayland_surface_map; From ef152f9b6354e5e11f6670d0805c4d10bac1d19d Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Sat, 10 Oct 2020 12:56:03 +0200 Subject: [PATCH 194/689] Increment man version numbers --- man/cagebreak-config.5.md | 2 +- man/cagebreak.1.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index 5198daa..b6fbdbc 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -1,4 +1,4 @@ -% CAGEBREAK-CONFIG(1) Version 1.4.2 | Cagebreak Manual +% CAGEBREAK-CONFIG(1) Version 1.4.3 | Cagebreak Manual # NAME diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index f140cc8..f00fe65 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -1,4 +1,4 @@ -% CAGEBREAK(1) Version 1.4.2 | Cagebreak Manual +% CAGEBREAK(1) Version 1.4.3 | Cagebreak Manual # NAME From 38ec452ea71d22ed4c7e66abc44d7ad5a513869a Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Sat, 10 Oct 2020 13:17:08 +0200 Subject: [PATCH 195/689] Add bug documentation --- Bugs.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/Bugs.md b/Bugs.md index 08e2d93..6080e81 100644 --- a/Bugs.md +++ b/Bugs.md @@ -224,3 +224,37 @@ Steps to reproduce: Cagebreak up to and including release 1.4.1 has a difficult-to-reproduce use-after-free bug, which can sometimes trigger crashes when popups are closed. +### Issue 17 + + * github issue number: N/A + * Fixed: 1.4.3 + +Cagebreak up to and including version 1.4.2 might have a use-after-free +on destroying unmapped views. view->workspace was set on view creation. +If the output containing this view was subsequently destroyed, the workspace +was freed, leading to a use-after-free when the view was destroyed. + +### Issue 18 + + * github issue number: N/A + * Fixed: 1.4.3 + +Cagebreak up to and including release 1.4.2 does not handle the position of +xwayland views adequately. + +### Issue 19 + + * github issue number: N/A + * Fixed: 1.4.3 + +Cagebreak up to and including release 1.4.2 does not handle unmanaged views +adequately. + +### Issue 20 + + * github issue number: N/A + * Fixed: 1.4.3 + +Cagebreak up to and including release 1.4.2 does not handle damaging adequately, +when scanning out views. + From 4c3aefa11cf681f395dec850779c77f7e353e47c Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Sat, 10 Oct 2020 13:42:46 +0200 Subject: [PATCH 196/689] Add hashes and signatures --- README.md | 5 +++++ signatures/1.4.2.sig | Bin 0 -> 566 bytes signatures/cagebreak.sig | Bin 566 -> 566 bytes 3 files changed, 5 insertions(+) create mode 100644 signatures/1.4.2.sig diff --git a/README.md b/README.md index 5046f2f..7a5b484 100644 --- a/README.md +++ b/README.md @@ -180,6 +180,11 @@ ninja -C build For every release after 1.0.5, hashes will be provided. +1.4.3 + + * sha 256: 5e29cbaf7c0c5ca74f71a5605bb3d6e302e051798401fee9a79419720b8d8e95 + * sha 512: 8004865f8603648d9ac9bb700f3ee040e6516c222ad3d783b34219c8fa3a7bdbba6abb74fe92c4d0bd4dbbce0ec4d08be12297a8bad5032baeb589eec557e24e + 1.4.2 * sha 256: 27efb9328cf9cab1f81e66627696baf8c7cc2c372339a2890f955b40f3a7c396 diff --git a/signatures/1.4.2.sig b/signatures/1.4.2.sig new file mode 100644 index 0000000000000000000000000000000000000000..af4b2f1de0ed95389b364f13aa922b2757d09c9f GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j+6HLHmt3S1SZD7Rm95KPD1rPrth0$*nq{{RXJ5Ofes z$K0jYsM-7v|5hnG4y+Bk9L`j8X3yMje8rWw?`oWm^A^aG&MSL{TYibi5 zaHL!>ui~gG%z76mOT_k70)0$HsG~eQ@KH`#a&QOP0Qilo@XndwS$#fg#%=}WHSHLu zzrzW$a(1YKY+5P&Y@+2fd?sKTmzF5Ecf9fHyMW7^_K2A6Ql8pnk!th{J12o@#8lqR zAvqk!!UC9!v?TI)oasx?wz(Tnt#y@?^Lx~k!x;WzpHe^3 zB&a>E(vYV~XCdpgn{^!NwS|>dAcs_pTygGQxS|2O<6?^J$gCa(7Q6K#y71rQ4U}sN zY)c8w!+SbC3ag2=qhDIY$+yNw#3ehVmZ^(iX$3DjTwAiyZl|M$+^KYy%gnZuBz=pn zvo|TBetgh?J|8NDJuB(etu9x_g-o85+Ax$U@A)B+Ue;20g8_=nz;W;j{_)aHvSSiq Eig{%a{Qv*} literal 0 HcmV?d00001 diff --git a/signatures/cagebreak.sig b/signatures/cagebreak.sig index af4b2f1de0ed95389b364f13aa922b2757d09c9f..e37900ae5112e1a847f09b2ebb0e6510976205e1 100644 GIT binary patch delta 542 zcmV+(0^$9(1hxc_BY%OM1po>O5Ofes$K0jYsEa5M|4S<4>Nsp7chrSk^nD2_U@uRk zQNx1>=vLoe<9Zg}=*ENj-4!7Bz!paGe6(KE^paDYcA$QlsSD1re4S`Qjyk&4bY{dg z%XPEH&jD?y2|}H|vD69c8R66N)s1$!38gKvI29ExS(yx#hZ$t)<=<6xiB znD>7lzR`n!845o__I|0(jM^p9>@6{&@Z%YwP1x*7n>2a{YkmmZ)Bot2Un zy44@WV#BG00fuzq?WDKtU{q-cbG$loaZ7pfJulu@J26ME&xFPEeCF$9Q=)AFdfo%` z$$*NOMuA=~`G1V{3=)3;ZSzCqg;omRK6A^ zApJ7SDkc0 z-(j&u%c gPaDSy))yFO2F(j+Bk9L`j8X z3yMje8rWw?`oWm^A^aG&MSL{TYibi5aHL!>ui~gG%z76mOT_k70)0$HsG~eQ@KH`# za&QOP0Qilo@XndwS$#fg#%=}WHSHLuzrzW$a(1YKY+5P&Y=5HVG<+st8kd$Rw|Bhp z>bro;oA!v9?NXlFWsz$13p*!)X~b0C%^^7)$HD@bi?k&2c%11=&$hW6P~}j3MBaK6 z;`!$9VHSUkWho@tS2FN@E2G Date: Sat, 24 Oct 2020 09:45:33 +0200 Subject: [PATCH 197/689] Fix potential npd on view destroy. --- xdg_shell.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xdg_shell.c b/xdg_shell.c index 35c170c..514ce97 100644 --- a/xdg_shell.c +++ b/xdg_shell.c @@ -282,6 +282,7 @@ handle_xdg_shell_surface_unmap(struct wl_listener *listener, void *_data) { wl_container_of(listener, xdg_shell_view, unmap); struct cg_view *view = &xdg_shell_view->view; + wl_list_remove(&xdg_shell_view->new_popup.link); wl_list_remove(&xdg_shell_view->commit.link); view_unmap(view); @@ -316,7 +317,6 @@ handle_xdg_shell_surface_destroy(struct wl_listener *listener, void *_data) { wl_list_remove(&xdg_shell_view->unmap.link); wl_list_remove(&xdg_shell_view->destroy.link); wl_list_remove(&xdg_shell_view->request_fullscreen.link); - wl_list_remove(&xdg_shell_view->new_popup.link); xdg_shell_view->xdg_surface = NULL; view_destroy(view); From 937c8983d3eff7b294cc073348b1fd438b702594 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Sat, 14 Nov 2020 18:40:28 +0100 Subject: [PATCH 198/689] Increment dependency versions --- meson.build | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index ea77b3a..64157d5 100644 --- a/meson.build +++ b/meson.build @@ -53,7 +53,7 @@ if is_freebsd ) endif -wlroots = dependency('wlroots', version: '>= 0.11.0') +wlroots = dependency('wlroots', version: '>= 0.12.0') wayland_protos = dependency('wayland-protocols', version: '>=1.14') wayland_server = dependency('wayland-server') wayland_cursor = dependency('wayland-cursor') @@ -195,13 +195,13 @@ reproducible_build_versions = { 'wayland_server': '1.18.0', 'wayland_client': '1.18.0', 'wayland_cursor': '1.18.0', - 'wlroots': '0.11.0', + 'wlroots': '0.12.0', 'xkbcommon': '1.0.1', 'fontconfig': '2.13.91', 'pixman': '0.40.0', - 'pango': '1.46.2', + 'pango': '1.48.0', 'cairo': '1.17.3', - 'pangocairo': '1.46.2', + 'pangocairo': '1.48.0', 'math': '-1' } From e79d5dee3ac743d3361db5fdd5b462959ec61428 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 16 Nov 2020 21:25:07 +0100 Subject: [PATCH 199/689] Fix fuzzing compilation --- fuzz/fuzz-lib.c | 8 ++++++++ fuzz/fuzz-lib.h | 8 ++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/fuzz/fuzz-lib.c b/fuzz/fuzz-lib.c index e99a21f..a32e062 100644 --- a/fuzz/fuzz-lib.c +++ b/fuzz/fuzz-lib.c @@ -59,6 +59,14 @@ #include "fuzz-lib.h" +struct cg_server server; +struct wlr_xdg_shell *xdg_shell; + +struct wlr_xwayland *xwayland; +#if CG_HAS_XWAYLAND +struct wlr_xcursor_manager *xcursor_manager; +#endif + static bool drop_permissions(void) { if(getuid() != geteuid() || getgid() != getegid()) { diff --git a/fuzz/fuzz-lib.h b/fuzz/fuzz-lib.h index 0ea499b..7182a50 100644 --- a/fuzz/fuzz-lib.h +++ b/fuzz/fuzz-lib.h @@ -17,12 +17,12 @@ #define WAIT_ANY -1 #endif -struct cg_server server; -struct wlr_xdg_shell *xdg_shell; +extern struct cg_server server; +extern struct wlr_xdg_shell *xdg_shell; -struct wlr_xwayland *xwayland; +extern struct wlr_xwayland *xwayland; #if CG_HAS_XWAYLAND -struct wlr_xcursor_manager *xcursor_manager; +extern struct wlr_xcursor_manager *xcursor_manager; #endif void From b4d7eac7f0f769b985c812a701ae6390b6fd1495 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Wed, 18 Nov 2020 15:25:58 +0100 Subject: [PATCH 200/689] Increment version numbers --- man/cagebreak-config.5.md | 2 +- man/cagebreak.1.md | 2 +- meson.build | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index b6fbdbc..197c91a 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -1,4 +1,4 @@ -% CAGEBREAK-CONFIG(1) Version 1.4.3 | Cagebreak Manual +% CAGEBREAK-CONFIG(1) Version 1.4.4 | Cagebreak Manual # NAME diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index f00fe65..3640ee3 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -1,4 +1,4 @@ -% CAGEBREAK(1) Version 1.4.3 | Cagebreak Manual +% CAGEBREAK(1) Version 1.4.4 | Cagebreak Manual # NAME diff --git a/meson.build b/meson.build index 64157d5..64bbe40 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('cagebreak', 'c', - version: '1.4.3', + version: '1.4.4', license: 'MIT', default_options: [ 'c_std=c11', From f7365f02fca5c3dd7defa251c433b14f8d62f8cf Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Wed, 18 Nov 2020 15:27:42 +0100 Subject: [PATCH 201/689] Add Issue 21 --- Bugs.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Bugs.md b/Bugs.md index 6080e81..f81d2fc 100644 --- a/Bugs.md +++ b/Bugs.md @@ -258,3 +258,10 @@ adequately. Cagebreak up to and including release 1.4.2 does not handle damaging adequately, when scanning out views. +### Issue 21 + + * github issue number: N/A + * Fixed: 1.4.4 + +Cagebreak up to and including release 1.4.3 sometimes had null pointer +dereferences on view destroy. From 242aea61d66f24822c01d45452a9991728b5f32f Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Wed, 18 Nov 2020 21:51:18 +0100 Subject: [PATCH 202/689] Prepare 1.4.4 release --- README.md | 5 +++++ signatures/1.4.3.sig | Bin 0 -> 566 bytes signatures/cagebreak.sig | Bin 566 -> 566 bytes 3 files changed, 5 insertions(+) create mode 100644 signatures/1.4.3.sig diff --git a/README.md b/README.md index 7a5b484..e5e0d99 100644 --- a/README.md +++ b/README.md @@ -180,6 +180,11 @@ ninja -C build For every release after 1.0.5, hashes will be provided. +1.4.4 + + * sha 256: c6e08e19feb17f768e136cf02f5692ef121ff289763dc60ef8678103803d3307 + * sha 512: aebf27fa9c24f93dfd0b7c96536c253e2ea603d6746c40e8de2163e06367bc57ac4e22d6c07dd1e0963cce5b18b460d373e15b5c12a5a42ae6b70787971960c9 + 1.4.3 * sha 256: 5e29cbaf7c0c5ca74f71a5605bb3d6e302e051798401fee9a79419720b8d8e95 diff --git a/signatures/1.4.3.sig b/signatures/1.4.3.sig new file mode 100644 index 0000000000000000000000000000000000000000..e37900ae5112e1a847f09b2ebb0e6510976205e1 GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j+6HLHmt3S1SZD7Rm95KPD1rPrth0$+ig1po>O5Ofes z$K0jYsEa5M|4S<4>Nsp7chrSk^nD2_U@uRkQNx1>=vLoe<9Zg}=*ENj-4!7Bz!paG ze6(KE^paDYcA$QlsSD1re4S`Qjyk&4bY{dg%XPEH&jD?y2|}H|vD69c8R66N)s1$! z38gKvI29ExS(yx#jeyPrk+9lEKEis|+ z;~Ak%+GrNSF-Nb@gvIlG=IdlrqHO_s-UIW=fQpz#fnF~8jP(o>e*kUto^+;-%}rUI zh4356xsL0X;%?#JFap79CKm@iEpX}<_f;XxofG4#r(VJleemcomu}x)rtyel1z6hq z<-wfnpvMP;uH9aCx(6qYyEew}sr_*i1g$>2uBrCN6@!^L5bi$dlI$au9%rJ?TtAUV8a@U{NR`B-6ffCpziX zM?4W{1|qIO91wp@XaPLt%Uu6`Emxg%LEmJ-O&lHt=d2Y4DOL}^m!64iG%=Q3w$B!_ zKh^z~!FX^-h&#Gpy^!0qG%PMOypD7ZYEK)-3f35B2F(j3~6B146GQNkI)Ue$Y#5Ln+M zH7cbx${R_KMw}MmY3WBfxmFOkO&Ci@pz`PoS^IQIOJZO~>VM6t9l!IQ`F}VtX3T<< zA?f95K5I#7JLt3wAf6n9;kanz%hklJ2%Lv_8r1z_>GGr~ZyyB(@K4mX6;;IROrWG> z;Y#(U3@Dv*sJ`FC*XlKmmNJ#_@25x!D*YA%Lj*pT-EQ!-7Bj!k@|eR|gE#TVxe5HORpNvdQCC zm=$+&;=sV6XMzT(=J9Oj1B;WA>v+|^PjY;!2@Q|b_5s(t{q3$zZa!SbQQ10ydMV+1k-d$|DHtLcv3_vx( g1kXc?9v5RtKcqena5_LQazbyddVE{Khf77F&4n2bkpKVy delta 542 zcmV+(0^$9(1hxc_BY%OM1po>O5Ofes$K0jYsEa5M|4S<4>Nsp7chrSk^nD2_U@uRk zQNx1>=vLoe<9Zg}=*ENj-4!7Bz!paGe6(KE^paDYcA$QlsSD1re4S`Qjyk&4bY{dg z%XPEH&jD?y2|}H|vD69c8R66N)s1$!38gKvI29ExS(yx#hZ$t)<=<6xiB znD>7lzR`n!845o__I|0(jM^p9>@6{&@Z%YwP1x*7n>2a{YkmmZ)Bot2Un zy44@WV#BG00fuzq?WDKtU{q-cbG$loaZ7pfJulu@J26ME&xFPEeCF$9Q=)AFdfo%` z$$*NOMuA=~`G1V{3=)3;ZSzCqg;omRK6A^ zApJ7SDkc0 z-(j&u%c gPaDSy))yFO2F(j Date: Fri, 27 Nov 2020 13:51:44 +0100 Subject: [PATCH 203/689] Fix potential use after free Ensure that the focus is changed when calling seat_set_focus. --- seat.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/seat.c b/seat.c index 13ef04e..7095907 100644 --- a/seat.c +++ b/seat.c @@ -966,10 +966,6 @@ seat_set_focus(struct cg_seat *seat, struct cg_view *view) { } } - if(seat->seat->keyboard_state.focused_surface == view->wlr_surface) { - return; - } - #if CG_HAS_XWAYLAND if(view->type == CG_XWAYLAND_VIEW && !xwayland_view_should_manage(view)) { const struct cg_xwayland_view *xwayland_view = From 90475c24cbe8fb95ec4c0b01e7dbba247c47ea15 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 1 Jan 2021 14:42:50 +0100 Subject: [PATCH 204/689] Fix view_unmap --- view.c | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/view.c b/view.c index d938526..0b51904 100644 --- a/view.c +++ b/view.c @@ -291,21 +291,25 @@ view_unmap(struct cg_view *view) { { struct cg_tile *view_tile = view_get_tile(view); if(view_tile != NULL) { - struct cg_view *prev = view_get_prev_view(view); wlr_output_damage_add_box(view_tile->workspace->output->damage, &view_tile->tile); - if(view == view->server->seat->focused_view) { - seat_set_focus(view->server->seat, prev); - } else if(view->server->seat->seat->keyboard_state - .focused_surface == view->wlr_surface) { - wlr_seat_keyboard_clear_focus(view->server->seat->seat); - seat_set_focus(view->server->seat, - view->server->seat->focused_view); - } else { - view_tile->view = prev; - if(prev != NULL) { - view_maximize(prev, &view_tile->tile); - } + } + struct cg_view *prev = view_get_prev_view(view); + if(view == view->server->seat->focused_view) { + seat_set_focus(view->server->seat, prev); + } else if(view->server->seat->seat->keyboard_state + .focused_surface == view->wlr_surface) { + wlr_seat_keyboard_clear_focus(view->server->seat->seat); + seat_set_focus(view->server->seat, + view->server->seat->focused_view); + } + view_tile = view_get_tile(view); + if(view_tile != NULL) { + wlr_output_damage_add_box(view_tile->workspace->output->damage, + &view_tile->tile); + view_tile->view = prev; + if(prev != NULL) { + view_maximize(prev, &view_tile->tile); } } } From b2193f4c1db42efd8d031f75002317bf43b0a5af Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 9 Jan 2021 09:17:59 +0100 Subject: [PATCH 205/689] Add support for disabling outputs --- cagebreak.c | 6 ++-- keybinding.c | 14 +++++++++ output.c | 80 +++++++++++++++++++++++++++++++--------------------- output.h | 7 +++++ parse.c | 27 ++++++++++++++++-- seat.c | 5 ++++ server.h | 1 + 7 files changed, 103 insertions(+), 37 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index 4d1bd3b..0e3b9bb 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -335,6 +335,7 @@ main(int argc, char *argv[]) { server.bg_color = (float[4]){0, 0, 0, 1}; wl_list_init(&server.outputs); + wl_list_init(&server.disabled_outputs); server.output_layout = wlr_output_layout_create(); if(!server.output_layout) { @@ -544,8 +545,9 @@ main(int argc, char *argv[]) { } { - struct cg_output *output; - wl_list_for_each(output, &server.outputs, link) { + + struct cg_output *output, *output_tmp; + wl_list_for_each_safe(output, output_tmp, &server.outputs, link) { output_configure(&server, output); } } diff --git a/keybinding.c b/keybinding.c index a061bc2..5c1ee9f 100644 --- a/keybinding.c +++ b/keybinding.c @@ -838,6 +838,20 @@ keybinding_configure_output(struct cg_server *server, } } wl_list_insert(&server->output_config, &cfg->link); + + struct cg_output *output, *tmp_output; + wl_list_for_each_safe(output, tmp_output, &server->outputs, link) { + if(strcmp(cfg->output_name, output->wlr_output->name) == 0) { + output_configure(server, output); + return; + } + } + wl_list_for_each_safe(output, tmp_output, &server->disabled_outputs, link) { + if(strcmp(cfg->output_name, output->wlr_output->name) == 0) { + output_configure(server, output); + return; + } + } } /* Hint: see keybinding.h for details on "data" */ diff --git a/output.c b/output.c index a38d65f..38b79a1 100644 --- a/output.c +++ b/output.c @@ -364,7 +364,7 @@ static void handle_output_transform(struct wl_listener *listener, void *data) { struct cg_output *output = wl_container_of(listener, output, transform); - if(!output->wlr_output->enabled) { + if(!output->wlr_output->enabled || output->workspaces==NULL) { return; } @@ -379,7 +379,7 @@ static void handle_output_mode(struct wl_listener *listener, void *data) { struct cg_output *output = wl_container_of(listener, output, mode); - if(!output->wlr_output->enabled) { + if(!output->wlr_output->enabled || output->workspaces==NULL) { return; } @@ -390,22 +390,15 @@ handle_output_mode(struct wl_listener *listener, void *data) { } } -static void -output_destroy(struct cg_output *output) { - struct cg_server *server = output->server; - - wl_list_remove(&output->destroy.link); - wl_list_remove(&output->mode.link); - wl_list_remove(&output->transform.link); - wl_list_remove(&output->damage_frame.link); - wl_list_remove(&output->damage_destroy.link); - +void output_clear(struct cg_output* output) { + struct cg_server *server=output->server; wlr_output_layout_remove(server->output_layout, output->wlr_output); if(server->running && server->curr_output == output && wl_list_length(&server->outputs) > 1) { keybinding_cycle_outputs(server, false); } + wl_list_remove(&output->link); message_clear(output); @@ -413,6 +406,13 @@ output_destroy(struct cg_output *output) { struct cg_view *view, *view_tmp; if(server->running) { for(unsigned int i = 0; i < server->nws; ++i) { + + bool first = true; + for(struct cg_tile *tile = output->workspaces[i]->focused_tile; + first || output->workspaces[i]->focused_tile != tile; tile = tile->next) { + first = false; + tile->view=NULL; + } wl_list_for_each_safe(view, view_tmp, &output->workspaces[i]->views, link) { wl_list_remove(&view->link); @@ -451,6 +451,20 @@ output_destroy(struct cg_output *output) { } } +} + +static void +output_destroy(struct cg_output *output) { + struct cg_server *server = output->server; + + wl_list_remove(&output->destroy.link); + wl_list_remove(&output->mode.link); + wl_list_remove(&output->transform.link); + wl_list_remove(&output->damage_frame.link); + wl_list_remove(&output->damage_destroy.link); + + output_clear(output); + /*Important: due to unfortunate events, "workspace" and "output->workspace" * have nothing in common. The former is the workspace of a single output, * whereas the latter is the workspace of the outputs.*/ @@ -530,11 +544,15 @@ void output_configure(struct cg_server *server, struct cg_output *output) { struct wlr_output *wlr_output = output->wlr_output; struct cg_output_config *config = output_find_config(server, wlr_output); + /* Refuse to disable the only output */ + if(config!=NULL&&config->status == OUTPUT_DISABLE && wl_list_length(&server->outputs)==1) { + return; + } if(output->wlr_output->enabled) { wlr_output_layout_remove(server->output_layout, wlr_output); } - if(config == NULL) { + if(config == NULL || config->status == OUTPUT_ENABLE) { wlr_output_layout_add_auto(server->output_layout, wlr_output); struct wlr_output_mode *preferred_mode = @@ -542,11 +560,24 @@ output_configure(struct cg_server *server, struct cg_output *output) { if(preferred_mode) { wlr_output_set_mode(wlr_output, preferred_mode); } + wl_list_remove(&output->link); + wl_list_insert(&server->outputs,&output->link); + wlr_output_enable(wlr_output, true); + wlr_output_commit(wlr_output); + } else if(config->status == OUTPUT_DISABLE) { + output_clear(output); + wl_list_insert(&server->disabled_outputs,&output->link); + wlr_output_enable(wlr_output, false); + wlr_output_commit(wlr_output); } else { + wl_list_remove(&output->link); + wl_list_insert(&server->outputs,&output->link); output_set_mode(wlr_output, config->pos.width, config->pos.height, config->refresh_rate); wlr_output_layout_add(server->output_layout, wlr_output, config->pos.x, config->pos.y); + wlr_output_enable(wlr_output, true); + wlr_output_commit(wlr_output); } } @@ -569,7 +600,6 @@ handle_new_output(struct wl_listener *listener, void *data) { output->server = server; output->damage = wlr_output_damage_create(wlr_output); output->last_scanned_out_view = NULL; - wl_list_insert(&server->outputs, &output->link); output->mode.notify = handle_output_mode; wl_signal_add(&wlr_output->events.mode, &output->mode); @@ -583,19 +613,7 @@ handle_new_output(struct wl_listener *listener, void *data) { wl_signal_add(&output->damage->events.destroy, &output->damage_destroy); wlr_output_set_transform(wlr_output, server->output_transform); - - output_configure(server, output); - - output->workspaces = malloc(server->nws * sizeof(struct cg_workspace *)); - for(unsigned int i = 0; i < server->nws; ++i) { - output->workspaces[i] = full_screen_workspace(output); - if(!output->workspaces[i]) { - wlr_log(WLR_ERROR, "Failed to allocate workspaces for output"); - return; - } - wl_list_init(&output->workspaces[i]->views); - wl_list_init(&output->workspaces[i]->unmanaged_views); - } + output->workspaces=NULL; output->curr_workspace = 0; wl_list_init(&output->messages); @@ -607,14 +625,12 @@ handle_new_output(struct wl_listener *listener, void *data) { wlr_output->name, wlr_output->scale); } + wl_list_insert(&server->outputs, &output->link); + output_configure(server, output); wlr_output_damage_add_whole(output->damage); - wlr_output_enable(wlr_output, true); - wlr_output_commit(wlr_output); - - /* TODO:If you see a way to circumvent having to loop twice, please do so */ + output->workspaces = malloc(server->nws * sizeof(struct cg_workspace *)); for(unsigned int i = 0; i < server->nws; ++i) { - workspace_free(output->workspaces[i]); output->workspaces[i] = full_screen_workspace(output); if(!output->workspaces[i]) { wlr_log(WLR_ERROR, "Failed to allocate workspaces for output"); diff --git a/output.h b/output.h index b114176..83a79b9 100644 --- a/output.h +++ b/output.h @@ -28,7 +28,14 @@ struct cg_output { struct wl_list link; // cg_server::outputs }; +enum output_status { + OUTPUT_ENABLE, + OUTPUT_DISABLE, + OUTPUT_DEFAULT +}; + struct cg_output_config { + enum output_status status; struct wlr_box pos; char *output_name; float refresh_rate; diff --git a/parse.c b/parse.c index 043625b..895ed71 100644 --- a/parse.c +++ b/parse.c @@ -259,6 +259,23 @@ parse_float(char **saveptr, const char *delim) { } } +int +parse_output_config_keyword(char *key_str,enum output_status *status) { + if(key_str == NULL) { + return -1; + } + if(strcmp(key_str,"pos") == 0) { + *status=OUTPUT_DEFAULT; + } else if(strcmp(key_str, "enable") == 0) { + *status=OUTPUT_ENABLE; + } else if(strcmp(key_str, "disable") == 0) { + *status=OUTPUT_DISABLE; + } else { + return -1; + } + return 0; +} + struct cg_output_config * parse_output_config(char **saveptr, char **errstr) { struct cg_output_config *cfg = malloc(sizeof(struct cg_output_config)); @@ -273,13 +290,17 @@ parse_output_config(char **saveptr, char **errstr) { log_error("Expected name of output to be configured, got none"); goto error; } - char *pos_str = strtok_r(NULL, " ", saveptr); - if(pos_str == NULL || strcmp(pos_str, "pos") != 0) { + char *key_str = strtok_r(NULL, " ", saveptr); + if(parse_output_config_keyword(key_str,&(cfg->status))!=0) { *errstr = log_error( - "Expected keyword \"pos\" in output configuration for output %s", + "Expected keyword \"pos\", \"enable\" or \"disable\" in output configuration for output %s", name); goto error; } + if(cfg->status == OUTPUT_ENABLE || cfg->status == OUTPUT_DISABLE) { + cfg->output_name = strdup(name); + return cfg; + } cfg->pos.x = parse_uint(saveptr, " "); if(cfg->pos.x < 0) { diff --git a/seat.c b/seat.c index 7095907..5c6e379 100644 --- a/seat.c +++ b/seat.c @@ -54,6 +54,11 @@ view_at(const struct cg_view *view, double lx, double ly, struct wlr_surface **surface, double *sx, double *sy) { struct wlr_box *output_layout_box = wlr_output_layout_get_box( view->server->output_layout, view->workspace->output->wlr_output); + if(output_layout_box == NULL) { + fprintf(stderr, "OUTPUT:%d\n",view->workspace->output->wlr_output->enabled); + return output_layout_box->x; + return false; + } double view_sx = lx - view->ox - output_layout_box->x; double view_sy = ly - view->oy - output_layout_box->y; diff --git a/server.h b/server.h index 24c2fb1..4e594b9 100644 --- a/server.h +++ b/server.h @@ -26,6 +26,7 @@ struct cg_server { struct wl_list inhibitors; struct wlr_output_layout *output_layout; + struct wl_list disabled_outputs; struct wl_list outputs; struct cg_output *curr_output; struct wl_listener new_output; From c98d972de152ebcecb50892d4be309a21f8305ac Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Sun, 10 Jan 2021 19:47:12 +0100 Subject: [PATCH 206/689] Increment dependency versions --- meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 64bbe40..fce1165 100644 --- a/meson.build +++ b/meson.build @@ -196,11 +196,11 @@ reproducible_build_versions = { 'wayland_client': '1.18.0', 'wayland_cursor': '1.18.0', 'wlroots': '0.12.0', - 'xkbcommon': '1.0.1', + 'xkbcommon': '1.0.3', 'fontconfig': '2.13.91', 'pixman': '0.40.0', 'pango': '1.48.0', - 'cairo': '1.17.3', + 'cairo': '1.17.4', 'pangocairo': '1.48.0', 'math': '-1' } From 0c4b2c306b563f58ae40f792e195292c56e6a263 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Sun, 10 Jan 2021 19:52:31 +0100 Subject: [PATCH 207/689] Apply clang-format --- output.c | 26 ++++++++++++++------------ output.h | 6 +----- parse.c | 18 +++++++++--------- seat.c | 3 ++- view.c | 4 ++-- 5 files changed, 28 insertions(+), 29 deletions(-) diff --git a/output.c b/output.c index 38b79a1..42ed10e 100644 --- a/output.c +++ b/output.c @@ -364,7 +364,7 @@ static void handle_output_transform(struct wl_listener *listener, void *data) { struct cg_output *output = wl_container_of(listener, output, transform); - if(!output->wlr_output->enabled || output->workspaces==NULL) { + if(!output->wlr_output->enabled || output->workspaces == NULL) { return; } @@ -379,7 +379,7 @@ static void handle_output_mode(struct wl_listener *listener, void *data) { struct cg_output *output = wl_container_of(listener, output, mode); - if(!output->wlr_output->enabled || output->workspaces==NULL) { + if(!output->wlr_output->enabled || output->workspaces == NULL) { return; } @@ -390,8 +390,9 @@ handle_output_mode(struct wl_listener *listener, void *data) { } } -void output_clear(struct cg_output* output) { - struct cg_server *server=output->server; +void +output_clear(struct cg_output *output) { + struct cg_server *server = output->server; wlr_output_layout_remove(server->output_layout, output->wlr_output); if(server->running && server->curr_output == output && @@ -409,9 +410,10 @@ void output_clear(struct cg_output* output) { bool first = true; for(struct cg_tile *tile = output->workspaces[i]->focused_tile; - first || output->workspaces[i]->focused_tile != tile; tile = tile->next) { + first || output->workspaces[i]->focused_tile != tile; + tile = tile->next) { first = false; - tile->view=NULL; + tile->view = NULL; } wl_list_for_each_safe(view, view_tmp, &output->workspaces[i]->views, link) { @@ -450,7 +452,6 @@ void output_clear(struct cg_output* output) { } } } - } static void @@ -545,7 +546,8 @@ output_configure(struct cg_server *server, struct cg_output *output) { struct wlr_output *wlr_output = output->wlr_output; struct cg_output_config *config = output_find_config(server, wlr_output); /* Refuse to disable the only output */ - if(config!=NULL&&config->status == OUTPUT_DISABLE && wl_list_length(&server->outputs)==1) { + if(config != NULL && config->status == OUTPUT_DISABLE && + wl_list_length(&server->outputs) == 1) { return; } if(output->wlr_output->enabled) { @@ -561,17 +563,17 @@ output_configure(struct cg_server *server, struct cg_output *output) { wlr_output_set_mode(wlr_output, preferred_mode); } wl_list_remove(&output->link); - wl_list_insert(&server->outputs,&output->link); + wl_list_insert(&server->outputs, &output->link); wlr_output_enable(wlr_output, true); wlr_output_commit(wlr_output); } else if(config->status == OUTPUT_DISABLE) { output_clear(output); - wl_list_insert(&server->disabled_outputs,&output->link); + wl_list_insert(&server->disabled_outputs, &output->link); wlr_output_enable(wlr_output, false); wlr_output_commit(wlr_output); } else { wl_list_remove(&output->link); - wl_list_insert(&server->outputs,&output->link); + wl_list_insert(&server->outputs, &output->link); output_set_mode(wlr_output, config->pos.width, config->pos.height, config->refresh_rate); wlr_output_layout_add(server->output_layout, wlr_output, config->pos.x, @@ -613,7 +615,7 @@ handle_new_output(struct wl_listener *listener, void *data) { wl_signal_add(&output->damage->events.destroy, &output->damage_destroy); wlr_output_set_transform(wlr_output, server->output_transform); - output->workspaces=NULL; + output->workspaces = NULL; output->curr_workspace = 0; wl_list_init(&output->messages); diff --git a/output.h b/output.h index 83a79b9..a11d4be 100644 --- a/output.h +++ b/output.h @@ -28,11 +28,7 @@ struct cg_output { struct wl_list link; // cg_server::outputs }; -enum output_status { - OUTPUT_ENABLE, - OUTPUT_DISABLE, - OUTPUT_DEFAULT -}; +enum output_status { OUTPUT_ENABLE, OUTPUT_DISABLE, OUTPUT_DEFAULT }; struct cg_output_config { enum output_status status; diff --git a/parse.c b/parse.c index 895ed71..46b275a 100644 --- a/parse.c +++ b/parse.c @@ -260,16 +260,16 @@ parse_float(char **saveptr, const char *delim) { } int -parse_output_config_keyword(char *key_str,enum output_status *status) { +parse_output_config_keyword(char *key_str, enum output_status *status) { if(key_str == NULL) { return -1; } - if(strcmp(key_str,"pos") == 0) { - *status=OUTPUT_DEFAULT; + if(strcmp(key_str, "pos") == 0) { + *status = OUTPUT_DEFAULT; } else if(strcmp(key_str, "enable") == 0) { - *status=OUTPUT_ENABLE; + *status = OUTPUT_ENABLE; } else if(strcmp(key_str, "disable") == 0) { - *status=OUTPUT_DISABLE; + *status = OUTPUT_DISABLE; } else { return -1; } @@ -291,10 +291,10 @@ parse_output_config(char **saveptr, char **errstr) { goto error; } char *key_str = strtok_r(NULL, " ", saveptr); - if(parse_output_config_keyword(key_str,&(cfg->status))!=0) { - *errstr = log_error( - "Expected keyword \"pos\", \"enable\" or \"disable\" in output configuration for output %s", - name); + if(parse_output_config_keyword(key_str, &(cfg->status)) != 0) { + *errstr = log_error("Expected keyword \"pos\", \"enable\" or " + "\"disable\" in output configuration for output %s", + name); goto error; } if(cfg->status == OUTPUT_ENABLE || cfg->status == OUTPUT_DISABLE) { diff --git a/seat.c b/seat.c index 5c6e379..fc22669 100644 --- a/seat.c +++ b/seat.c @@ -55,7 +55,8 @@ view_at(const struct cg_view *view, double lx, double ly, struct wlr_box *output_layout_box = wlr_output_layout_get_box( view->server->output_layout, view->workspace->output->wlr_output); if(output_layout_box == NULL) { - fprintf(stderr, "OUTPUT:%d\n",view->workspace->output->wlr_output->enabled); + fprintf(stderr, "OUTPUT:%d\n", + view->workspace->output->wlr_output->enabled); return output_layout_box->x; return false; } diff --git a/view.c b/view.c index 0b51904..f9bfcc3 100644 --- a/view.c +++ b/view.c @@ -297,8 +297,8 @@ view_unmap(struct cg_view *view) { struct cg_view *prev = view_get_prev_view(view); if(view == view->server->seat->focused_view) { seat_set_focus(view->server->seat, prev); - } else if(view->server->seat->seat->keyboard_state - .focused_surface == view->wlr_surface) { + } else if(view->server->seat->seat->keyboard_state.focused_surface == + view->wlr_surface) { wlr_seat_keyboard_clear_focus(view->server->seat->seat); seat_set_focus(view->server->seat, view->server->seat->focused_view); From dd867f0a7900ce9b82ced3fb9ba93f7c73040a36 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Sun, 10 Jan 2021 19:52:51 +0100 Subject: [PATCH 208/689] Increment version --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index fce1165..2b3afc1 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('cagebreak', 'c', - version: '1.4.4', + version: '1.5.0', license: 'MIT', default_options: [ 'c_std=c11', From 0dc85e635f88386043b859d64a0c4180d7637965 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Sun, 10 Jan 2021 20:43:34 +0100 Subject: [PATCH 209/689] Document disable output --- man/cagebreak-config.5.md | 9 +++++---- man/cagebreak.1.md | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index 197c91a..36a78ac 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -1,4 +1,4 @@ -% CAGEBREAK-CONFIG(1) Version 1.4.4 | Cagebreak Manual +% CAGEBREAK-CONFIG(1) Version 1.5.0 | Cagebreak Manual # NAME @@ -136,12 +136,13 @@ by prepending a line with the # symbol. > Remove all splits and make the current window fill the entire screen -**output pos res x rate ** +**output [[pos res x rate ] | enable | disable]** > Configure the output "". and are the position of the monitor > in pixels. The top-left monitor should have the coordinates 0 0. and > specify the resolution in pixels and sets the refresh rate of -> the monitor (often this is 50 or 60). +> the monitor (often this is 50 or 60). The options enable and disable +> enable or disable the output . **prev** @@ -253,7 +254,7 @@ See GitHub Issues: # LICENSE -Copyright (c) 2020 The Cagebreak authors +Copyright (c) 2020-2021 The Cagebreak authors Copyright (c) 2018-2020 Jente Hidskes Copyright (c) 2019 The Sway authors diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index 3640ee3..7ddec01 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -1,4 +1,4 @@ -% CAGEBREAK(1) Version 1.4.4 | Cagebreak Manual +% CAGEBREAK(1) Version 1.5.0 | Cagebreak Manual # NAME @@ -81,7 +81,7 @@ See GitHub Issues: # LICENSE -Copyright (c) 2020 The Cagebreak authors +Copyright (c) 2020-2021 The Cagebreak authors Copyright (c) 2018-2020 Jente Hidskes Copyright (c) 2019 The Sway authors From 9d0a33c25e8533cd089c1420203989ab939a2e9b Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Sun, 10 Jan 2021 20:44:18 +0100 Subject: [PATCH 210/689] Add output example --- examples/config | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/config b/examples/config index 66ce97e..b6a3ca2 100644 --- a/examples/config +++ b/examples/config @@ -75,4 +75,6 @@ definekey top XF86MonBrightnessUp exec xbacklight -inc 1 ###################### #Output configuration ###################### -#output eDP-1 pos 0 0 res 1366x768 rate 60 +output eDP-1 pos 0 0 res 1366x768 rate 60 +output eDP-1 disable +output eDP-1 enable From 1b51acac49f011506301c048e2b764c05816e03a Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 10 Jan 2021 21:37:17 +0100 Subject: [PATCH 211/689] Initialize disable_outputs in fuzz-lib.c --- fuzz/fuzz-lib.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fuzz/fuzz-lib.c b/fuzz/fuzz-lib.c index a32e062..c916777 100644 --- a/fuzz/fuzz-lib.c +++ b/fuzz/fuzz-lib.c @@ -219,6 +219,7 @@ LLVMFuzzerInitialize(int *argc, char ***argv) { server.bg_color[2] = 0; server.bg_color[3] = 1; wl_list_init(&server.outputs); + wl_list_init(&server.disabled_outputs); server.output_layout = wlr_output_layout_create(); if(!server.output_layout) { From 59d10ee4102a86de2d25065ba456191be88c3732 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 10 Jan 2021 21:42:39 +0100 Subject: [PATCH 212/689] Add notice to output disable documentation --- man/cagebreak-config.5.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index 36a78ac..29907b8 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -142,7 +142,8 @@ by prepending a line with the # symbol. > in pixels. The top-left monitor should have the coordinates 0 0. and > specify the resolution in pixels and sets the refresh rate of > the monitor (often this is 50 or 60). The options enable and disable -> enable or disable the output . +> enable or disable the output . Note that if is the only enabled +> output, `output disable` has no effect. **prev** From 615552b843e24828da19b4a3a4950876e6aecc2a Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 15 Jan 2021 10:46:15 +0100 Subject: [PATCH 213/689] Fix potential memory leaks --- keybinding.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/keybinding.c b/keybinding.c index 5c1ee9f..8f70ffd 100644 --- a/keybinding.c +++ b/keybinding.c @@ -60,6 +60,9 @@ keybinding_free(struct keybinding *keybinding, bool recursive) { keybinding_free(keybinding->data.kb, true); } break; + case KEYBINDING_CONFIGURE_OUTPUT: + free(keybinding->data.o_cfg->output_name); + free(keybinding->data.o_cfg); default: break; } From 0f762c0b53f4d12355e368d329a0ae6433c3a2ad Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Fri, 15 Jan 2021 12:48:14 +0100 Subject: [PATCH 214/689] Prepare 1.5.0 --- Bugs.md | 32 ++++++ README.md | 11 ++ keys/cagebreak@project-repo.co.pub | 62 +++++++----- keys/cagebreak_signing_key_5@project-repo.co | 100 +++++++++++++++++++ keys/cagebreak_signing_key_6@project-repo.co | 88 ++++++++++++++++ 5 files changed, 268 insertions(+), 25 deletions(-) create mode 100644 keys/cagebreak_signing_key_5@project-repo.co create mode 100644 keys/cagebreak_signing_key_6@project-repo.co diff --git a/Bugs.md b/Bugs.md index f81d2fc..580f458 100644 --- a/Bugs.md +++ b/Bugs.md @@ -265,3 +265,35 @@ when scanning out views. Cagebreak up to and including release 1.4.3 sometimes had null pointer dereferences on view destroy. + +### Issue 22 + + * github issue number: #2 + * Fixed: 1.5.0 + +Cagebreak up to and including release 1.4.4 did not offer any means to disable +outputs. This option is now added to output. See cagebreak-config man page for +details. + +Github issue text: + +``` +Hello, I have two outputs (or heads) eDP-1 and HDMA-A-1, and always want to disable eDP-1, how to do it? + +Thank you! +``` + +### Issue 23 + + * github issue number: N/A + * Fixed: 1.5.0 + +Cagebreak up to and including release 1.4.4 had a potential use-after-free bug. + +### Issue 24 + + * github issue number: N/A + * Fixed: 1.5.0 + +Cagebreak up to and including release 1.4.4 could have focussed views without tiles. + diff --git a/README.md b/README.md index e5e0d99..96b1c69 100644 --- a/README.md +++ b/README.md @@ -180,6 +180,11 @@ ninja -C build For every release after 1.0.5, hashes will be provided. +1.5.0 + + * sha 256: 22010e2916493b0d7cfb08c2196f12589509ce11010a7107aed13ddbfd9709cc + * sha 512: 707d6cc01326ba32402f9fb402ff8aceaeaba63ca6ba2eb157e5a4c83123515a3a74da960813479db303eddc2e7f79f39b241dff05b89d47d72d5f1d20ca6d37 + 1.4.4 * sha 256: c6e08e19feb17f768e136cf02f5692ef121ff289763dc60ef8678103803d3307 @@ -266,6 +271,8 @@ keys. * 4739D329C9187A1C2795C20A02ABFDEC3A40545F * 7535AB89220A5C15A728B75F74104CC7DCA5D7A8 * 827BC2320D535AEAD0540E6E2E66F65D99761A6F + * A88D7431E5BAAD0B6EAE550AC8D61D8BD4FA3C46 + * 8F872885968EB8C589A32E9539ACC012896D450F Should we at any point retire a key, we will only replace it with keys signed by at least one of the above collection. @@ -384,6 +391,10 @@ Adds IPC as described in the man pages. Adds close command for windows as described in the man pages. +### Release 1.5.0 + +Adds options to disable or enable outputs. See Issue 22 in Bugs.md and Issue #2 on github. + ## License Please see [LICENSE](https://github.com/project-repo/cagebreak/blob/master/LICENSE) diff --git a/keys/cagebreak@project-repo.co.pub b/keys/cagebreak@project-repo.co.pub index 2642c1e..7ccde5b 100644 --- a/keys/cagebreak@project-repo.co.pub +++ b/keys/cagebreak@project-repo.co.pub @@ -47,29 +47,41 @@ f4FlX7Mn6YAG94h6HN3qRo/c+E47XBqj9XmvFe0e+bWg9oar3rWGkVN+YzUaSgp3 iNXRYQfQZbCHf7vTDzQZ8lWix7IBcAdoBgHl7d0RW4VNqbXISZvKMMTZK8WQVYYz wcW9+Ll/fEwE8PGs5FolnynEg9YLLzj0OADSfaly/woqXUul14mWpM/gFsxQTyuQ 7n7xyAu5PImTjC7WzVMF9OAH35ng9u76bDkmwVfrMzGvKZ2DRsJQeNRUAd4EIM8S -6+ipTKNASzj4mCnURgS2zMplReE30icE8Vpol/ZYgC2qouS89nq29kLOuQINBF7T -e/sBEADSdSZVGEumZeeXzM1uPp1OUWHCkmCiPu6jfP2M2GI4VnSCcsxM4XcbR26O -sqMmMo9f4Fuie/+K6oyqE1LMeGTpasWJrd8w2TME0V5Nqsszp+PtKJBTIskk2c7b -ctQDeZDTcuIGPi03SxLCn+ZeDpVscBKbuc78twNYl0xXM86P67D73cA5WZPqQIKS -Me+8iRzpzB/Hk/lcDun3QlrXq+bMwSPSMD0ikcPdpiGf+RuQH/ZB5JVQqgA92Vt3 -QFA4RAgKyQCdS0DOaScAvXotriFWbZdGt/iTGzzQ8e1O0C9COhgNms4r5bwRVzH5 -k/kQ1BC1S+Me5shNUO8DabRWPh+CgZjtYV5oHY1jik1p72DnTTajIMYwhcLOJXRl -l+zlq20qqqdp05DSloIYEizsgNTQ0F7XP0uXyVaDsUxGv4ZucRHJVuedilEhz9MW -k/iqeQ2hWRuR3vuiknj3F8O/Z7kJNfx8Hi6PgfCMyCv3YZxpkXhXwXRbYndhbQHK -F/9gVvDxx0yw+BCYj+iDdo0mwdI0LFh+ddpwWBFhzJpMdUsDEHmG5yOmbUIZDCmt -GCLSBDPl61FUaGUljSFWtW7b3bgv+a6RUTbkw3ZuvyxV9lMbLDAPSZmRjQHGydZJ -cdRmxX262CjpxP707c51EhlhsL5Q1cBXcBgwlbQ3ltC4VFRI1wARAQABiQI8BBgB -CAAmFiEEsVuSZCdg4R/gAt4WhwjUJFGpSrUFAl7Te/sCGwwFCQHhM4AACgkQhwjU -JFGpSrWLGQ//f07ynATQpyyichXwMQDZhOS2/jocTNHaUfecO2OoPjc69wldyvN6 -wv0HDUmom1rJK/v25KxGnKKKg/UX9XxCSK2G85UX4niT/jTKcI5D9OiOwlFbs917 -VYYU/8u45KDDqDLqhhepAa5QttKXMDU2nx9V82W/gVjEcLIseKeIg4i24bJHi6ax -WySklo1Vwo+RGtwfhT+/UxLv9bDOWRxHRsOnlTZo+PSMgescgWDkYOR33wxmLw6P -Ckv/Sb/kIXrXuFey7bs3zciM1hL4+/iIAr2DSQi5bGUBnBCrwsV4wnVru06Ua013 -sPqHTMgucbhYDS4sTPOXD7szQAzze1dxez55h5ziaf7tFilvaulSs2bubGuAWgKm -VCeZINzEbA4bYUAyuWtMu+vbXWimcg54BGVCS7IdVGF78FjgVTqjH8nkiGtrzGRW -94ebx61EcuNdcRuri3OgrO009fzJy8sswQmuanyF4gyXml9FUVc93HO8mDnNyFZd -O5FHgYFLn+ymd2Ra5cUvFYsJ5b2ydkX7CigcqyyysMoYpc1PpJN1kpX0e1D6JDp9 -Xk02SoUP9t/y6C/h7f14WUefgZnDwK2/YCYogyrgMSSLw54j85kS/Ycr2OlJ3If5 -MHObamGEWsqr6H240IxeT4xrsMUuSFYHEEGnKuPfiSPVF2QjVbOTeSw= -=QlUC +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 +=ZN9o -----END PGP PUBLIC KEY BLOCK----- diff --git a/keys/cagebreak_signing_key_5@project-repo.co b/keys/cagebreak_signing_key_5@project-repo.co new file mode 100644 index 0000000..5fee531 --- /dev/null +++ b/keys/cagebreak_signing_key_5@project-repo.co @@ -0,0 +1,100 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +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 +5w== +=Dm8H +-----END PGP PUBLIC KEY BLOCK----- diff --git a/keys/cagebreak_signing_key_6@project-repo.co b/keys/cagebreak_signing_key_6@project-repo.co new file mode 100644 index 0000000..c9424a8 --- /dev/null +++ b/keys/cagebreak_signing_key_6@project-repo.co @@ -0,0 +1,88 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +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 +qF/GtdHBq8rhkEM= +=c37G +-----END PGP PUBLIC KEY BLOCK----- From 865bb901a4f5b18ea58efb3f65e04a943a6b4345 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Fri, 15 Jan 2021 12:59:57 +0100 Subject: [PATCH 215/689] Add binary signature --- signatures/1.4.4.sig | Bin 0 -> 566 bytes signatures/cagebreak.sig | Bin 566 -> 566 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 signatures/1.4.4.sig diff --git a/signatures/1.4.4.sig b/signatures/1.4.4.sig new file mode 100644 index 0000000000000000000000000000000000000000..6480250dedaee3ea9b933d261d683b551f852d1b GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j+6HLHmt3S1SZD7Rm95KPD1rPrth0$;U3~6B146GQNkI)Ue$Y#5Ln+MH7cbx${R_KMw}MmY3WBfxmFOkO&Ci@ zpz`PoS^IQIOJZO~>dmPgzw@5?e>gB^%z~34>E&rYYe{K4=(G$Vo*aYWxM<|d)x@j_ zoQHTC)cs=V@}wwl9|Z;QPt>**RmAH|prmBsO7*4;D4lbtzTd>x>NSm)GL`V}r$`AZ z{T2g51U{GDZt%1gGr!OBn8R3uH}S{1L&6mbU?mx^#Y2854a$AXmn7xcGS)t}880Pf-Ryx_noGJg?CM_{Y@HyY* zV=t<}Cp8DDHjpuu6Zh+9WHrda0RD1#!=ZifqVsfdd_(1LH8Kr!fM0pflPHW`mAAh9Yt7IaXh7O zD(#aT^vA`kyhWX!0^VJ0xi;#OFbqI7!357kiXLN0Kcqena5_LQazbyddVE{Khf77F E%`NW~*8l(j literal 0 HcmV?d00001 diff --git a/signatures/cagebreak.sig b/signatures/cagebreak.sig index 6480250dedaee3ea9b933d261d683b551f852d1b..4310d30a476cf242a054798e136eeab8c439e000 100644 GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j+vjdU^Px~&Utu2l-i)*Xw~`aDJj0$>4yH~5XjaY zi`4o&M!Sg*{Ta23D`2!oQlb5&THJ~QMnG;R42jNs>EwGjUMUpo;WG?-x!O%PzMc|G zbX(tzC)eyV1u=+2`_aF*@@AvA!VqDyJS_eNv>bi$Z999X{Lqw5e6CQn&^u;LoehoX zl8iwz12jvquI*#m%57T{tu&96*B!9KkhLN#i#T>6qTnB-j?)%!JW+hZB7qPa=H$m# zZ&qq~RPabF=U=yyBcF4Y7tqU==g-5a7xlYO3bE_nI0(pP9E#dh@g1Mz^kyoDHRp=r z>UY(Ejw)YAq5^=ZkJx0?O7HF*fDMII3_|4lX9-NHzYwtzl7Y+Z5(R%kXnX6sA;`UBsb_B<#VJfP?$}^FkI^M zzravs{^CmYE?a#L&RT?_#>91=r#oxJ?PWqJzi$qkiw3~6B146GQNkI)Ue$Y#5Ln+MH7cbx${R_KMw}MmY3WBfxmFOkO&Ci@ zpz`PoS^IQIOJZO~>dmPgzw@5?e>gB^%z~34>E&rYYe{K4=(G$Vo*aYWxM<|d)x@j_ zoQHTC)cs=V@}wwl9|Z;QPt>**RmAH|prmBsO7*4;D4lbtzTd>x>NSm)GL`V}r$`AZ z{T2g51U{GDZt%1gGr!OBn8R3uH}S{1L&6mbU?mx^#Y2854a$AXmn7xcGS)t}880Pf-Ryx_noGJg?CM_{Y@HyY* zV=t<}Cp8DDHjpuu6Zh+9WHrda0RD1#!=ZifqVsfdd_(1LH8Kr!fM0pflPHW`mAAh9Yt7IaXh7O zD(#aT^vA`kyhWX!0^VJ0xi;#OFbqI7!357kiXLN0Kcqena5_LQazbyddVE{Khf77F E%`NW~*8l(j From 9a7ce94546136c266ab2e496a6f6787b9551c04b Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Sun, 24 Jan 2021 11:56:55 +0100 Subject: [PATCH 216/689] Prepare 1.5.1 release --- README.md | 1 - man/cagebreak-config.5.md | 2 +- man/cagebreak.1.md | 2 +- meson.build | 6 +++--- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 96b1c69..f607d39 100644 --- a/README.md +++ b/README.md @@ -107,7 +107,6 @@ occur. Once any failure occurs the entire checklist must be completed from scrat * [ ] `git checkout development` * [ ] `git pull origin development` * [ ] `git push origin development` - * [ ] Cage has no reasonable code merges * [ ] `ninja -C build clang-format` makes no changes * [ ] New version number determined according to [semantic versioning](https://semver.org) guidelines * [ ] Relevant Documentation completed diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index 29907b8..f879352 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -1,4 +1,4 @@ -% CAGEBREAK-CONFIG(1) Version 1.5.0 | Cagebreak Manual +% CAGEBREAK-CONFIG(1) Version 1.5.1 | Cagebreak Manual # NAME diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index 7ddec01..5832a7c 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -1,4 +1,4 @@ -% CAGEBREAK(1) Version 1.5.0 | Cagebreak Manual +% CAGEBREAK(1) Version 1.5.1 | Cagebreak Manual # NAME diff --git a/meson.build b/meson.build index 2b3afc1..80e7035 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('cagebreak', 'c', - version: '1.5.0', + version: '1.5.1', license: 'MIT', default_options: [ 'c_std=c11', @@ -199,9 +199,9 @@ reproducible_build_versions = { 'xkbcommon': '1.0.3', 'fontconfig': '2.13.91', 'pixman': '0.40.0', - 'pango': '1.48.0', + 'pango': '1.48.1', 'cairo': '1.17.4', - 'pangocairo': '1.48.0', + 'pangocairo': '1.48.1', 'math': '-1' } From 759f0ee748f192b0c4692e414ed4e5531e014f2a Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Sun, 24 Jan 2021 16:00:17 +0100 Subject: [PATCH 217/689] Add release artefacts --- README.md | 5 +++++ signatures/1.5.0.sig | Bin 0 -> 566 bytes signatures/cagebreak.sig | Bin 566 -> 566 bytes 3 files changed, 5 insertions(+) create mode 100644 signatures/1.5.0.sig diff --git a/README.md b/README.md index f607d39..e22c300 100644 --- a/README.md +++ b/README.md @@ -179,6 +179,11 @@ ninja -C build For every release after 1.0.5, hashes will be provided. +1.5.1 + + * sha 256: 9c6df4b94c180f5657cb424383aa2bf3aca063c8e7b40af0497be1ef7bdb858a + * sha 512: 219f753347ae64a4dd593568797438742e9ddae380c729598d8eda863080a6ed4e5086d735fc348c48328bb795a5a5b57b0421be5dd45755744d895b24312627 + 1.5.0 * sha 256: 22010e2916493b0d7cfb08c2196f12589509ce11010a7107aed13ddbfd9709cc diff --git a/signatures/1.5.0.sig b/signatures/1.5.0.sig new file mode 100644 index 0000000000000000000000000000000000000000..4310d30a476cf242a054798e136eeab8c439e000 GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j+vjdU^Px~&Utu2l-i)*Xw~`aDJj0$>4yH~5XjaY zi`4o&M!Sg*{Ta23D`2!oQlb5&THJ~QMnG;R42jNs>EwGjUMUpo;WG?-x!O%PzMc|G zbX(tzC)eyV1u=+2`_aF*@@AvA!VqDyJS_eNv>bi$Z999X{Lqw5e6CQn&^u;LoehoX zl8iwz12jvquI*#m%57T{tu&96*B!9KkhLN#i#T>6qTnB-j?)%!JW+hZB7qPa=H$m# zZ&qq~RPabF=U=yyBcF4Y7tqU==g-5a7xlYO3bE_nI0(pP9E#dh@g1Mz^kyoDHRp=r z>UY(Ejw)YAq5^=ZkJx0?O7HF*fDMII3_|4lX9-NHzYwtzl7Y+Z5(R%kXnX6sA;`UBsb_B<#VJfP?$}^FkI^M zzravs{^CmYE?a#L&RT?_#>91=r#oxJ?PWqJzi$qkiw55XjaYi`4o&Mr@o9|6k4`z-t|msi>5D)%KJ8V+2hh zVWgz$wBer3gf$EQOo&8U->tJQcrdWj4_MKMt23mz7;v~${lZnGa5<)SJ^^s87>Je1 zMUC$NP0|39GQt!1% z{%A#h)ykU-osN-NPAD}%oU}%}Wu!y=;POmlTFY&dv((&=vhEIfp!ZJ$X0QBRK7}Y#0s606D z!g8|JP!7z51b@MpE{P55j_KM5G^0Ohaq-J`v*2}+wOgE)pL;>&GL*>(tR1F^67Cq)8qtFb?I14W*b`68sHJy5_oLALL{@tj3(WT&o(LZTknptWo<`+9YoRj gChf0wa~I15XjaYi`4o&M!Sg*{Ta23D`2!oQlb5&THJ~QMnG;R z42jNs>EwGjUMUpo;WG?-x!O%PzMc|GbX(tzC)eyV1u=+2`_aF*@@AvA!VqDyJS_eN zv>bi$Z999X{Lqw5e6CQn&^u;LoehoXl8iwz12jvquI*#m%71NJ6Rk9ll-C`w!;rNi zEQ>gHA)??Pq>j@Ta6D0b!yzI+-Er8TR&~d>`6_nP2jq>1>f(sZT ztiI#04FkML?1>^5Y7J-?mejdSG59hW0fA50Nbp!fdqI?1^=mRCgqdiSOqnHYd#4R zXsbkyElQe5HU7P=VNq<`6y`+B@N-5Krc}i_ZODsV#G#Ai&l#0sshgf(2ehVcaB%A= zmIbRsDfJb&-GPq1?*3opbEGR!m`%bkT8anFf guWK;H-xs-;PWqJzi$qkiw Date: Sat, 30 Jan 2021 12:54:47 +0100 Subject: [PATCH 218/689] Add support for non-build dependencies --- meson.build | 44 +++++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/meson.build b/meson.build index 80e7035..9c9d8fc 100644 --- a/meson.build +++ b/meson.build @@ -175,19 +175,22 @@ endforeach foreach header : cagebreak_header_strings cagebreak_headers += files(header) endforeach +# Dependencies marked with "true" are required to have +# the version specified below in order for the build +# to be reproducible. cagebreak_dependencies_dict = { - 'server_protos': server_protos, - 'wayland_server': wayland_server, - 'wayland_client': wayland_client, - 'wayland_cursor': wayland_cursor, - 'wlroots': wlroots, - 'xkbcommon': xkbcommon, - 'fontconfig': fontconfig, - 'pixman': pixman, - 'pango': pango, - 'cairo': cairo, - 'pangocairo': pangocairo, - 'math': math + 'server_protos': [server_protos,true], + 'wayland_server': [wayland_server,false], + 'wayland_client': [wayland_client,true], + 'wayland_cursor': [wayland_cursor,true], + 'wlroots': [wlroots,true], + 'xkbcommon': [xkbcommon,true], + 'fontconfig': [fontconfig,true], + 'pixman': [pixman,true], + 'pango': [pango,true], + 'cairo': [cairo,true], + 'pangocairo': [pangocairo,true], + 'math': [math,true], } reproducible_build_versions = { @@ -208,14 +211,21 @@ reproducible_build_versions = { cagebreak_dependencies = [] foreach name, dep : cagebreak_dependencies_dict - cagebreak_dependencies += dep + cagebreak_dependencies += dep[0] endforeach foreach name, dep : cagebreak_dependencies_dict - if reproducible_build_versions[name] != '-1' and reproducible_build_versions[name] != dep.version() - warning('The installed version of "' + name + '" on your machine (' + dep.version() + ') differs from the one used to generate the binary specified in the README section "Reproducible Builds" (' + reproducible_build_versions[name] + '). Cagebreak does not guarantee a reproducible build for this configuration.' - ) - break + if reproducible_build_versions[name] != '-1' + if dep[1] == false + if dep[0].version() < reproducible_build_versions[name] + warning('The installed version of "' + name + '" on your machine (' + dep[0].version() + ') is older than the one used to generate the binary specified in the README section "Reproducible Builds" (' + reproducible_build_versions[name] + '). It is recommended to use an up-to-date version for compiling cagebreak.' + ) + endif + elif reproducible_build_versions[name] != dep[0].version() + warning('The installed version of "' + name + '" on your machine (' + dep[0].version() + ') differs from the one used to generate the binary specified in the README section "Reproducible Builds" (' + reproducible_build_versions[name] + '). Cagebreak does not guarantee a reproducible build for this configuration.' + ) + break + endif endif endforeach From 9de597b0c18de5ec573bea6441c79605afebe6c5 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 19 Feb 2021 14:25:13 +0100 Subject: [PATCH 219/689] Fix bug in surface counting iterator --- output.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/output.c b/output.c index 42ed10e..6ec3c11 100644 --- a/output.c +++ b/output.c @@ -207,7 +207,7 @@ static void count_surface_iterator(struct cg_output *output, struct wlr_surface *surface, struct wlr_box *_box, void *data) { size_t *n = data; - n++; + (*n)++; } static bool From 96785a8db53a7fb23499abfd2cfb82644e8e89f6 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 19 Feb 2021 17:04:24 +0100 Subject: [PATCH 220/689] Fix typo --- Bugs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bugs.md b/Bugs.md index 580f458..3c5def0 100644 --- a/Bugs.md +++ b/Bugs.md @@ -76,7 +76,7 @@ workspace 2. Therefore, this change would simplify the code base, while at the same time increasing the feature set. PS: As a side effect, this would allow quirky statements such as -`bind dbind r hsplit` which would bind the d key to binding the r key to +`bind d bind r hsplit` which would bind the d key to binding the r key to split the output... ``` From 103641c35c3e0e2ad047f4eac095af709aef16b1 Mon Sep 17 00:00:00 2001 From: Aisha Tammy Date: Mon, 1 Mar 2021 12:12:25 -0500 Subject: [PATCH 221/689] make man pages optional pandoc is a monster Signed-off-by: Aisha Tammy --- meson.build | 36 +++++++++++++++++++----------------- meson_options.txt | 1 + 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/meson.build b/meson.build index 80e7035..1be8fdc 100644 --- a/meson.build +++ b/meson.build @@ -237,25 +237,27 @@ executable( c_args: fuzz_compile_args, ) -pandoc = find_program('pandoc') -mandir1 = join_paths(get_option('mandir'), 'man1') -mandir5 = join_paths(get_option('mandir'), 'man5') +if get_option('man-pages') + pandoc = find_program('pandoc') + mandir1 = join_paths(get_option('mandir'), 'man1') + mandir5 = join_paths(get_option('mandir'), 'man5') -cagebreak_man = custom_target('cagebreak_man', - output : 'cagebreak.1', - input : 'man/cagebreak.1.md', - command : [pandoc, '-i', '@INPUT@', '-o', '@OUTPUT@', '-f', 'markdown-smart', '-t', 'man', '-s'], - install: true, - install_dir: mandir1 - ) + cagebreak_man = custom_target('cagebreak_man', + output : 'cagebreak.1', + input : 'man/cagebreak.1.md', + command : [pandoc, '-i', '@INPUT@', '-o', '@OUTPUT@', '-f', 'markdown-smart', '-t', 'man', '-s'], + install: true, + install_dir: mandir1 + ) -cagebreak_man = custom_target('cagebreak_config_man', - output : 'cagebreak-config.5', - input : 'man/cagebreak-config.5.md', - command : [pandoc, '-i', '@INPUT@', '-o', '@OUTPUT@', '-f', 'markdown-smart', '-t', 'man', '-s'], - install: true, - install_dir: mandir5 - ) + cagebreak_man = custom_target('cagebreak_config_man', + output : 'cagebreak-config.5', + input : 'man/cagebreak-config.5.md', + command : [pandoc, '-i', '@INPUT@', '-o', '@OUTPUT@', '-f', 'markdown-smart', '-t', 'man', '-s'], + install: true, + install_dir: mandir5 + ) +endif if get_option('fuzz') subdir('fuzz') diff --git a/meson_options.txt b/meson_options.txt index bb96c4f..19d7b86 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,3 +1,4 @@ option('xwayland', type: 'boolean', value: 'false', description: 'Enable support for X11 applications') +option('man-pages', type: 'boolean', value: 'false', description: 'Build man pages using pandoc') option('fuzz', type: 'boolean', value: 'false', description: 'Enable building fuzzer targets') option('version_override', type: 'string', description: 'Set the project version to the string specified. Used for creating hashes for reproducible builds.') From 436c891b202d03f16e0b40f9bf9ea889088956bd Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Fri, 5 Mar 2021 07:33:00 +0100 Subject: [PATCH 222/689] Prepare meson.build for release --- meson.build | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index 9c9d8fc..6d92f7e 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('cagebreak', 'c', - version: '1.5.1', + version: '1.6.0', license: 'MIT', default_options: [ 'c_std=c11', @@ -195,9 +195,9 @@ cagebreak_dependencies_dict = { reproducible_build_versions = { 'server_protos': '-1', - 'wayland_server': '1.18.0', - 'wayland_client': '1.18.0', - 'wayland_cursor': '1.18.0', + 'wayland_server': '1.19.0', + 'wayland_client': '1.19.0', + 'wayland_cursor': '1.19.0', 'wlroots': '0.12.0', 'xkbcommon': '1.0.3', 'fontconfig': '2.13.91', From fb2590afa19d57429eb132323d3f9cae4636ea42 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 5 Mar 2021 07:53:46 +0100 Subject: [PATCH 223/689] Adjust message --- meson_options.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson_options.txt b/meson_options.txt index 19d7b86..b6dcb79 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,4 +1,4 @@ option('xwayland', type: 'boolean', value: 'false', description: 'Enable support for X11 applications') -option('man-pages', type: 'boolean', value: 'false', description: 'Build man pages using pandoc') +option('man-pages', type: 'boolean', value: 'false', description: 'Build man pages (requires pandoc)') option('fuzz', type: 'boolean', value: 'false', description: 'Enable building fuzzer targets') option('version_override', type: 'string', description: 'Set the project version to the string specified. Used for creating hashes for reproducible builds.') From 85408845baa0c3e1cebc64c16bb3d088f4cb7cad Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Fri, 5 Mar 2021 15:25:35 +0100 Subject: [PATCH 224/689] Add Issue 24 --- Bugs.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Bugs.md b/Bugs.md index 3c5def0..2c16f14 100644 --- a/Bugs.md +++ b/Bugs.md @@ -297,3 +297,12 @@ Cagebreak up to and including release 1.4.4 had a potential use-after-free bug. Cagebreak up to and including release 1.4.4 could have focussed views without tiles. +### Issue 24 + + * github issue number: N/A + * Fixed: 1.6.0 + +Cagebreak up to and including release 1.5.1 had an error, where the code +incremented a variable and not a pointer. This resulted in a bug in a +surface counting iterator. + From 4a21c7454162318d8b3e59bd523788fcadc4645f Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Fri, 5 Mar 2021 15:26:25 +0100 Subject: [PATCH 225/689] Add documentation of man page build --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e22c300..eb92a84 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,11 @@ option. Then, add `-Dxwayland=true` to the `meson` command above. Note that you'll need to have the XWayland binary installed on your system for this to work. +#### Man Pages + +Cagebreak has man pages. To use them, make sure that you have `pandoc` +installed. Then, add `-Dman-pages=true to the `meson` command. + ### Running Cagebreak You can start Cagebreak by running `./build/cagebreak`. If you run it from @@ -171,7 +176,7 @@ There are reproducibility issues up to and including release `1.2.0`. See All hashes and signatures are provided for the following build instructions. ``` -meson build -Dxwayland=true --buildtype=release +meson build -Dxwayland=true -Dman-pages=true --buildtype=release ninja -C build ``` From c4a4a9df12eb0f001cee65f920e54584a96e337d Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Fri, 5 Mar 2021 15:27:14 +0100 Subject: [PATCH 226/689] Add 1.6.0 release notes --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index eb92a84..e94ad74 100644 --- a/README.md +++ b/README.md @@ -404,6 +404,10 @@ Adds close command for windows as described in the man pages. Adds options to disable or enable outputs. See Issue 22 in Bugs.md and Issue #2 on github. +### Release 1.6.0 + +Adds support for non-build dependencies and an option for builds without pandoc. + ## License Please see [LICENSE](https://github.com/project-repo/cagebreak/blob/master/LICENSE) From 07856670cd9724cca827d6f5138bd9a1d87dddcd Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Fri, 5 Mar 2021 15:27:39 +0100 Subject: [PATCH 227/689] Add Contributor --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index e94ad74..95fbc33 100644 --- a/README.md +++ b/README.md @@ -408,6 +408,12 @@ Adds options to disable or enable outputs. See Issue 22 in Bugs.md and Issue #2 Adds support for non-build dependencies and an option for builds without pandoc. +## Contribotors + + * Aisha Tammy + * [make man pages optional](https://github.com/project-repo/cagebreak/pull/4), released + in 1.6.0 with slight modifications + ## License Please see [LICENSE](https://github.com/project-repo/cagebreak/blob/master/LICENSE) From 74651ee39f94078ca4a2633abf70df0fb262261b Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Fri, 5 Mar 2021 15:27:56 +0100 Subject: [PATCH 228/689] Increment man version --- man/cagebreak-config.5.md | 2 +- man/cagebreak.1.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index f879352..693215d 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -1,4 +1,4 @@ -% CAGEBREAK-CONFIG(1) Version 1.5.1 | Cagebreak Manual +% CAGEBREAK-CONFIG(1) Version 1.6.0 | Cagebreak Manual # NAME diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index 5832a7c..6b6e381 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -1,4 +1,4 @@ -% CAGEBREAK(1) Version 1.5.1 | Cagebreak Manual +% CAGEBREAK(1) Version 1.6.0 | Cagebreak Manual # NAME From 54afbd29b59ed6f83291a0f093702950f8d5c94c Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Fri, 5 Mar 2021 15:28:09 +0100 Subject: [PATCH 229/689] Increment dependency versions --- meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index accf69f..5a9b963 100644 --- a/meson.build +++ b/meson.build @@ -202,9 +202,9 @@ reproducible_build_versions = { 'xkbcommon': '1.0.3', 'fontconfig': '2.13.91', 'pixman': '0.40.0', - 'pango': '1.48.1', + 'pango': '1.48.2', 'cairo': '1.17.4', - 'pangocairo': '1.48.1', + 'pangocairo': '1.48.2', 'math': '-1' } From dc62580d66a42b4e1b593e2f1d7df746530ff2a1 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 5 Mar 2021 16:18:38 +0100 Subject: [PATCH 230/689] Fix potential use-after-free --- keybinding.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/keybinding.c b/keybinding.c index 8f70ffd..1160477 100644 --- a/keybinding.c +++ b/keybinding.c @@ -832,25 +832,35 @@ keybinding_move_view_to_workspace(struct cg_server *server, uint32_t ws) { void keybinding_configure_output(struct cg_server *server, struct cg_output_config *cfg) { + struct cg_output_config *config; + config=malloc(sizeof(struct cg_output_config)); + if(config == NULL) { + wlr_log(WLR_ERROR, "Could not allocate memory for server configuration."); + return; + } + + *config=*cfg; + config->output_name=strdup(cfg->output_name); + struct cg_output_config *it, *tmp; wl_list_for_each_safe(it, tmp, &server->output_config, link) { - if(strcmp(cfg->output_name, it->output_name) == 0) { + if(strcmp(config->output_name, it->output_name) == 0) { wl_list_remove(&it->link); free(it->output_name); free(it); } } - wl_list_insert(&server->output_config, &cfg->link); + wl_list_insert(&server->output_config, &config->link); struct cg_output *output, *tmp_output; wl_list_for_each_safe(output, tmp_output, &server->outputs, link) { - if(strcmp(cfg->output_name, output->wlr_output->name) == 0) { + if(strcmp(config->output_name, output->wlr_output->name) == 0) { output_configure(server, output); return; } } wl_list_for_each_safe(output, tmp_output, &server->disabled_outputs, link) { - if(strcmp(cfg->output_name, output->wlr_output->name) == 0) { + if(strcmp(config->output_name, output->wlr_output->name) == 0) { output_configure(server, output); return; } From 7aef1c5d12396b1133d8ff2c436612b964022eb9 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 5 Mar 2021 16:21:28 +0100 Subject: [PATCH 231/689] Fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 95fbc33..5868cb8 100644 --- a/README.md +++ b/README.md @@ -408,7 +408,7 @@ Adds options to disable or enable outputs. See Issue 22 in Bugs.md and Issue #2 Adds support for non-build dependencies and an option for builds without pandoc. -## Contribotors +## Contributors * Aisha Tammy * [make man pages optional](https://github.com/project-repo/cagebreak/pull/4), released From b14996d7ee069c56076e124da92c90a0505b753a Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Fri, 5 Mar 2021 16:48:57 +0100 Subject: [PATCH 232/689] Increment dependency version --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 5a9b963..e61eedc 100644 --- a/meson.build +++ b/meson.build @@ -199,7 +199,7 @@ reproducible_build_versions = { 'wayland_client': '1.19.0', 'wayland_cursor': '1.19.0', 'wlroots': '0.12.0', - 'xkbcommon': '1.0.3', + 'xkbcommon': '1.1.0', 'fontconfig': '2.13.91', 'pixman': '0.40.0', 'pango': '1.48.2', From c3c806ae0db6a0560949cce2880b2e0a242313a8 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Fri, 5 Mar 2021 17:34:43 +0100 Subject: [PATCH 233/689] Apply clang-format --- keybinding.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/keybinding.c b/keybinding.c index 1160477..29739a4 100644 --- a/keybinding.c +++ b/keybinding.c @@ -833,14 +833,15 @@ void keybinding_configure_output(struct cg_server *server, struct cg_output_config *cfg) { struct cg_output_config *config; - config=malloc(sizeof(struct cg_output_config)); + config = malloc(sizeof(struct cg_output_config)); if(config == NULL) { - wlr_log(WLR_ERROR, "Could not allocate memory for server configuration."); + wlr_log(WLR_ERROR, + "Could not allocate memory for server configuration."); return; } - *config=*cfg; - config->output_name=strdup(cfg->output_name); + *config = *cfg; + config->output_name = strdup(cfg->output_name); struct cg_output_config *it, *tmp; wl_list_for_each_safe(it, tmp, &server->output_config, link) { From c017bd5138773f77572170ea416a0d5b3ae401b4 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Fri, 5 Mar 2021 17:50:58 +0100 Subject: [PATCH 234/689] Add Issue 25 --- Bugs.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Bugs.md b/Bugs.md index 2c16f14..8072b7e 100644 --- a/Bugs.md +++ b/Bugs.md @@ -306,3 +306,18 @@ Cagebreak up to and including release 1.5.1 had an error, where the code incremented a variable and not a pointer. This resulted in a bug in a surface counting iterator. +### Issue 25 + + * github issue number: N/A + * Fixed: 1.6.0 + +Cagebreak, beginning with release 1.5.0, when a keybinding containing an output +configuration is removed from the list of active keybindings, the output +configuration contained in this keybinding is destroyed in order to +prevent memory leaks. However, after an output configuration was applied, +it was inserted into the list of active output configurations and if it +was later destroyed, this led to a use-after-free memory corruption. +Starting from release 1.6.0, output configurations are copied before +being inserted into the list of active output configurations and +therefore remain valid even if the original is freed. + From a2d82f13842c5670e1760ecb6a0fcbbf8324e127 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Fri, 5 Mar 2021 17:59:50 +0100 Subject: [PATCH 235/689] Add release hashes --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 5868cb8..87ae370 100644 --- a/README.md +++ b/README.md @@ -184,6 +184,11 @@ ninja -C build For every release after 1.0.5, hashes will be provided. +1.6.0 + + * sha 256: aef473eae73454429afb158d66a7bd9aec75ef915845b7508de5448820357aa8 + * sha 512: 17889bc1af9f343598a5ee599b25e702987dd0bd905a9566874e8a0094c57168e413938624949fa214e6e382cbcf89d7342292b44012cd8e692947f6c01a960a + 1.5.1 * sha 256: 9c6df4b94c180f5657cb424383aa2bf3aca063c8e7b40af0497be1ef7bdb858a From f6c103ae7cf4951e24ade3437a2c4adb77a0ba03 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Fri, 5 Mar 2021 18:09:49 +0100 Subject: [PATCH 236/689] Add signatures --- signatures/1.5.1.sig | Bin 0 -> 566 bytes signatures/cagebreak.sig | Bin 566 -> 566 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 signatures/1.5.1.sig diff --git a/signatures/1.5.1.sig b/signatures/1.5.1.sig new file mode 100644 index 0000000000000000000000000000000000000000..0afd9eabddb0f83c8a85296736cfc8f0eaef3e0b GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j+vjdU^Px~&Utu2l-i)*Xw~`aDJj0$>e_M*s>55XjaY zi`4o&Mr@o9|6k4`z-t|msi>5D)%KJ8V+2hhVWgz$wBer3gf$EQOo&8U->tJQcrdWj z4_MKMt23mz7;v~${lZnGa5<)SJ^^s87>Je1MUC$NP0|39GQZYwX&vh`LlxuQll} z@wK4$OoE!I&Q*;gzO5iyqUZE?->LTidE_FQ&eNwQrTP@x;q!2zTJHVsW7bwZMjGG|+7ftd zy+S0j$BZW3jL$YH^IPwZvSn>YfgMEA`6lhJc5}-}X7r&&RVPKJnf-ggnMPGt*D3*0p(`HXEwvI?-C&_%jsJ9c6=v zr0mEE4*xmV{HmGky5~C{YiS?1#qyR@Vt3nCZMANG=^96fVt<@ceBao9#@pi+zq!3W zfo^VfAJh=nOe{xB^chU+z9)Gun}&`^uF)CdEgtH*lj)YBl6n*k#H_VpA^9N1CiYUU z$@$R$%~yfvI=b9|Aluy3*MTPKkZ?#j0QD}mw$a;Ma7`&r|Ps2a| zMFmUq?`b?#VP)9Z9MF0s*rrE%vJ_z4o5p!nSC%MK(zt#H(THNX0*PBtSGRewb>xlt zNl{Z2&Y`DGf{)-0yVP7rM8`KW2)&8N`G%NMs0_@wG0z&t^r5i|1^3h7W(mRpY?OS73Bp>HXR%QZaxF@-gPaVI+`j} gb0?mn8W#?tx9>e2a={N5951sZ=^Lx#C{SLKhIM5GeE55XjaYi`4o&Mr@o9|6k4`z-t|msi>5D)%KJ8V+2hh zVWgz$wBer3gf$EQOo&8U->tJQcrdWj4_MKMt23mz7;v~${lZnGa5<)SJ^^s87>Je1 zMUC$NP0|39GQt!1% z{%A#h)ykU-osN-NPAD}%oU}%}Wu!y=;POmlTFY&dv((&=vhEIfp!ZJ$X0QBRK7}Y#0s606D z!g8|JP!7z51b@MpE{P55j_KM5G^0Ohaq-J`v*2}+wOgE)pL;>&GL*>(tR1F^67Cq)8qtFb?I14W*b`68sHJy5_oLALL{@tj3(WT&o(LZTknptWo<`+9YoRj gChf0wa~I1 Date: Sat, 20 Mar 2021 16:26:38 +0100 Subject: [PATCH 237/689] Adjust focussing algorithm * Make algorithm which picks which view to focus more stable towards repeated insert-remove cycles. * Improve run-time of view_get_tile --- keybinding.c | 65 ++++++++++++++++++++++++++-------------------------- output.c | 6 +++++ render.c | 1 - seat.c | 8 +++++-- view.c | 33 +++++++++++--------------- view.h | 3 ++- 6 files changed, 60 insertions(+), 56 deletions(-) diff --git a/keybinding.c b/keybinding.c index 29739a4..0c628f2 100644 --- a/keybinding.c +++ b/keybinding.c @@ -174,7 +174,7 @@ swap_tile(struct cg_tile *tile, tile->view = swap_tile->view; swap_tile->view = tmp_view; if(tile->view != NULL) { - view_maximize(tile->view, &tile->tile); + view_maximize(tile->view, tile); view_damage_whole(tile->view); } else { wlr_output_damage_add_box(tile->workspace->output->damage, &tile->tile); @@ -183,7 +183,7 @@ swap_tile(struct cg_tile *tile, server->curr_output->workspaces[server->curr_output->curr_workspace], swap_tile); if(swap_tile->view != NULL) { - view_maximize(swap_tile->view, &swap_tile->tile); + view_maximize(swap_tile->view, swap_tile); view_damage_whole(swap_tile->view); } else { wlr_output_damage_add_box(tile->workspace->output->damage, &tile->tile); @@ -342,7 +342,7 @@ resize(struct cg_tile *tile, const struct cg_tile *parent, int coord_offset, .height = tile->tile.y == 0 ? tile->tile.height : coord_offset}; wlr_output_damage_add_box(tile->workspace->output->damage, &damage_box); if(tile->view != NULL) { - view_maximize(tile->view, &tile->tile); + view_maximize(tile->view, tile); } } @@ -456,6 +456,11 @@ keybinding_workspace_fullscreen(struct cg_server *server) { return; } + struct cg_view *it_view; + wl_list_for_each(it_view, &output->workspaces[output->curr_workspace]->views, link) { + it_view->tile=output->workspaces[output->curr_workspace]->focused_tile; + } + seat_set_focus(server->seat, current_view); } @@ -537,11 +542,11 @@ keybinding_split_output(struct cg_output *output, bool vertical) { workspace_focus_tile(curr_workspace, curr_workspace->focused_tile); if(next_view != NULL) { - view_maximize(next_view, &new_tile->tile); + view_maximize(next_view, new_tile); } if(original_view != NULL) { - view_maximize(original_view, &curr_workspace->focused_tile->tile); + view_maximize(original_view, curr_workspace->focused_tile); } } @@ -601,43 +606,39 @@ keybinding_cycle_views(struct cg_server *server, bool reverse) { server->curr_output->workspaces[server->curr_output->curr_workspace]; struct cg_view *current_view = curr_workspace->focused_tile->view; - struct cg_view *new_view; - // We are focused on the desktop - if(current_view == NULL) { - current_view = wl_container_of(&curr_workspace->views, new_view, link); - if(reverse) { - new_view = - wl_container_of(curr_workspace->views.prev, new_view, link); - } else { - new_view = - wl_container_of(curr_workspace->views.next, new_view, link); + struct cg_view *tmp_view, *next_view=NULL; + if(reverse) { + wl_list_for_each_reverse(tmp_view, &curr_workspace->views, link) { + if(tmp_view == current_view) { + continue; + } + if(!view_is_visible(tmp_view)) { + next_view=tmp_view; + break; + } } } else { - if(reverse) { - new_view = wl_container_of(current_view->link.prev, new_view, link); - } else { - new_view = wl_container_of(current_view->link.next, new_view, link); + wl_list_for_each(tmp_view, &curr_workspace->views, link) { + if(tmp_view == current_view) { + continue; + } + if(!view_is_visible(tmp_view)) { + next_view=tmp_view; + break; + } } } - while(&new_view->link != ¤t_view->link && - (&new_view->link == &curr_workspace->views || - view_is_visible(new_view))) { - if(reverse) { - new_view = wl_container_of(new_view->link.prev, new_view, link); - } else { - new_view = wl_container_of(new_view->link.next, new_view, link); - } - } - if(&new_view->link == &curr_workspace->views) { + + if(next_view == NULL) { return; } wlr_output_damage_add_box(curr_workspace->output->damage, &curr_workspace->focused_tile->tile); - seat_set_focus(server->seat, new_view); + seat_set_focus(server->seat, next_view); /* Move the previous view to the end of the list unless we are focused on * the desktop*/ - if(!reverse && ¤t_view->link != &curr_workspace->views) { + if(!reverse && current_view != NULL) { wl_list_remove(¤t_view->link); wl_list_insert(curr_workspace->views.prev, ¤t_view->link); } @@ -824,7 +825,7 @@ keybinding_move_view_to_workspace(struct cg_server *server, uint32_t ws) { view->workspace = ws; wl_list_insert(&ws->views, &view->link); ws->focused_tile->view = view; - view_maximize(view, &ws->focused_tile->tile); + view_maximize(view, ws->focused_tile); seat_set_focus(server->seat, view); } } diff --git a/output.c b/output.c index 6ec3c11..a451e55 100644 --- a/output.c +++ b/output.c @@ -429,6 +429,9 @@ output_clear(struct cg_output *output) { view->workspace = server->curr_output ->workspaces[server->curr_output->curr_workspace]; + view->tile = + server->curr_output + ->workspaces[server->curr_output->curr_workspace]->focused_tile; if(server->seat->focused_view == NULL) { seat_set_focus(server->seat, view); } @@ -448,6 +451,9 @@ output_clear(struct cg_output *output) { view->workspace = server->curr_output ->workspaces[server->curr_output->curr_workspace]; + view->tile = + server->curr_output + ->workspaces[server->curr_output->curr_workspace]->focused_tile; } } } diff --git a/render.c b/render.c index 6aadf50..80c769b 100644 --- a/render.c +++ b/render.c @@ -135,7 +135,6 @@ render_view_toplevels(struct cg_view *view, struct cg_output *output, .tile_width = 0, .tile_height = 0, }; - // TODO: improve run time behaviour of view_get_tile struct cg_tile *view_tile = view_get_tile(view); if(view_tile != NULL) { if(view_tile->tile.width != view->wlr_surface->current.width || diff --git a/seat.c b/seat.c index fc22669..8578bea 100644 --- a/seat.c +++ b/seat.c @@ -965,9 +965,13 @@ seat_set_focus(struct cg_seat *seat, struct cg_view *view) { struct cg_workspace *curr_workspace = server->curr_output ->workspaces[server->curr_output->curr_workspace]; - view_maximize(view, &curr_workspace->focused_tile->tile); + view_maximize(view, curr_workspace->focused_tile); wl_list_remove(&view->link); - wl_list_insert(&curr_workspace->views, &view->link); + if(curr_workspace->focused_tile->view != NULL) { + wl_list_insert(&curr_workspace->focused_tile->view->link,&view->link); + } else { + wl_list_insert(curr_workspace->views.prev,&view->link); + } curr_workspace->focused_tile->view = view; } } diff --git a/view.c b/view.c index f9bfcc3..23d6429 100644 --- a/view.c +++ b/view.c @@ -197,15 +197,11 @@ view_is_primary(const struct cg_view *view) { struct cg_tile * view_get_tile(const struct cg_view *view) { - bool first = true; - for(struct cg_tile *tile = view->workspace->focused_tile; - first || view->workspace->focused_tile != tile; tile = tile->next) { - first = false; - if(tile->view == view) { - return tile; - } + if(view->tile != NULL && view->tile->view == view) { + return view->tile; + } else { + return NULL; } - return NULL; } bool @@ -224,7 +220,7 @@ view_damage(struct cg_view *view, bool whole) { if(view_tile != NULL && (view->wlr_surface->current.width != view_tile->tile.width || view->wlr_surface->current.height != view_tile->tile.height)) { - view_maximize(view, &view_tile->tile); + view_maximize(view, view_tile); } output_damage_surface(view->workspace->output, view->wlr_surface, view->ox, view->oy, whole); @@ -248,20 +244,16 @@ view_activate(struct cg_view *view, bool activate) { } void -view_maximize(struct cg_view *view, const struct wlr_box *tile_box) { - view->ox = tile_box->x; - view->oy = tile_box->y; - view->impl->maximize(view, tile_box->width, tile_box->height); +view_maximize(struct cg_view *view, struct cg_tile *tile) { + view->ox = tile->tile.x; + view->oy = tile->tile.y; + view->impl->maximize(view, tile->tile.width, tile->tile.height); + view->tile=tile; } void view_position(struct cg_view *view) { - struct wlr_box *tile_workspace_box = - &view->workspace->output - ->workspaces[view->workspace->output->curr_workspace] - ->focused_tile->tile; - - view_maximize(view, tile_workspace_box); + view_maximize(view, view->workspace->output->workspaces[view->workspace->output->curr_workspace]->focused_tile); } void @@ -309,7 +301,7 @@ view_unmap(struct cg_view *view) { &view_tile->tile); view_tile->view = prev; if(prev != NULL) { - view_maximize(prev, &view_tile->tile); + view_maximize(prev, view_tile); } } } @@ -384,6 +376,7 @@ void view_init(struct cg_view *view, enum cg_view_type type, const struct cg_view_impl *impl, struct cg_server *server) { view->workspace = NULL; + view->tile = NULL; view->server = server; view->type = type; view->impl = impl; diff --git a/view.h b/view.h index 65958b0..8324ca2 100644 --- a/view.h +++ b/view.h @@ -23,6 +23,7 @@ struct cg_view { struct wl_list link; // server::views struct wl_list children; // cg_view_child::link struct wlr_surface *wlr_surface; + struct cg_tile *tile; /* The view has a position in output coordinates. */ int ox, oy; @@ -100,7 +101,7 @@ view_for_each_popup(struct cg_view *view, wlr_surface_iterator_func_t iterator, void view_unmap(struct cg_view *view); void -view_maximize(struct cg_view *view, const struct wlr_box *tile_box); +view_maximize(struct cg_view *view, struct cg_tile *tile); void view_map(struct cg_view *view, struct wlr_surface *surface, struct cg_workspace *ws); From 0b97338738881c520265f3deb8323cc71069164f Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 20 Mar 2021 16:29:50 +0100 Subject: [PATCH 238/689] Remove obsolete code get_geometry --- view.h | 2 -- xdg_shell.c | 12 ------------ xwayland.c | 9 --------- 3 files changed, 23 deletions(-) diff --git a/view.h b/view.h index 8324ca2..5a7ecd4 100644 --- a/view.h +++ b/view.h @@ -36,8 +36,6 @@ struct cg_view { struct cg_view_impl { char *(*get_title)(const struct cg_view *view); - void (*get_geometry)(const struct cg_view *view, int *width_out, - int *height_out); bool (*is_primary)(const struct cg_view *view); void (*activate)(struct cg_view *view, bool activate); void (*close)(struct cg_view *view); diff --git a/xdg_shell.c b/xdg_shell.c index 514ce97..5a85982 100644 --- a/xdg_shell.c +++ b/xdg_shell.c @@ -183,17 +183,6 @@ get_title(const struct cg_view *view) { return xdg_shell_view->xdg_surface->toplevel->title; } -static void -get_geometry(const struct cg_view *view, int *width_out, int *height_out) { - const struct cg_xdg_shell_view *xdg_shell_view = - xdg_shell_view_from_const_view(view); - struct wlr_box geom; - - wlr_xdg_surface_get_geometry(xdg_shell_view->xdg_surface, &geom); - *width_out = geom.width; - *height_out = geom.height; -} - static bool is_primary(const struct cg_view *view) { const struct cg_xdg_shell_view *xdg_shell_view = @@ -324,7 +313,6 @@ handle_xdg_shell_surface_destroy(struct wl_listener *listener, void *_data) { static const struct cg_view_impl xdg_shell_view_impl = { .get_title = get_title, - .get_geometry = get_geometry, .is_primary = is_primary, .activate = activate, .close = close, diff --git a/xwayland.c b/xwayland.c index e5f505b..b790527 100644 --- a/xwayland.c +++ b/xwayland.c @@ -48,14 +48,6 @@ get_title(const struct cg_view *view) { return xwayland_view->xwayland_surface->title; } -static void -get_geometry(const struct cg_view *view, int *width_out, int *height_out) { - const struct cg_xwayland_view *xwayland_view = - xwayland_view_from_const_view(view); - *width_out = xwayland_view->xwayland_surface->width; - *height_out = xwayland_view->xwayland_surface->height; -} - static bool is_primary(const struct cg_view *view) { const struct cg_xwayland_view *xwayland_view = @@ -210,7 +202,6 @@ handle_xwayland_surface_destroy(struct wl_listener *listener, void *_data) { static const struct cg_view_impl xwayland_view_impl = { .get_title = get_title, - .get_geometry = get_geometry, .is_primary = is_primary, .activate = activate, .close = close, From 24e0681579ed0aaa7741ec2125df71b0c63d134b Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 20 Mar 2021 16:31:11 +0100 Subject: [PATCH 239/689] Apply clang-format --- keybinding.c | 12 +++++++----- output.c | 6 ++++-- seat.c | 5 +++-- view.c | 7 +++++-- 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/keybinding.c b/keybinding.c index 0c628f2..25c4135 100644 --- a/keybinding.c +++ b/keybinding.c @@ -457,8 +457,10 @@ keybinding_workspace_fullscreen(struct cg_server *server) { } struct cg_view *it_view; - wl_list_for_each(it_view, &output->workspaces[output->curr_workspace]->views, link) { - it_view->tile=output->workspaces[output->curr_workspace]->focused_tile; + wl_list_for_each(it_view, + &output->workspaces[output->curr_workspace]->views, link) { + it_view->tile = + output->workspaces[output->curr_workspace]->focused_tile; } seat_set_focus(server->seat, current_view); @@ -606,14 +608,14 @@ keybinding_cycle_views(struct cg_server *server, bool reverse) { server->curr_output->workspaces[server->curr_output->curr_workspace]; struct cg_view *current_view = curr_workspace->focused_tile->view; - struct cg_view *tmp_view, *next_view=NULL; + struct cg_view *tmp_view, *next_view = NULL; if(reverse) { wl_list_for_each_reverse(tmp_view, &curr_workspace->views, link) { if(tmp_view == current_view) { continue; } if(!view_is_visible(tmp_view)) { - next_view=tmp_view; + next_view = tmp_view; break; } } @@ -623,7 +625,7 @@ keybinding_cycle_views(struct cg_server *server, bool reverse) { continue; } if(!view_is_visible(tmp_view)) { - next_view=tmp_view; + next_view = tmp_view; break; } } diff --git a/output.c b/output.c index a451e55..91ba032 100644 --- a/output.c +++ b/output.c @@ -431,7 +431,8 @@ output_clear(struct cg_output *output) { ->workspaces[server->curr_output->curr_workspace]; view->tile = server->curr_output - ->workspaces[server->curr_output->curr_workspace]->focused_tile; + ->workspaces[server->curr_output->curr_workspace] + ->focused_tile; if(server->seat->focused_view == NULL) { seat_set_focus(server->seat, view); } @@ -453,7 +454,8 @@ output_clear(struct cg_output *output) { ->workspaces[server->curr_output->curr_workspace]; view->tile = server->curr_output - ->workspaces[server->curr_output->curr_workspace]->focused_tile; + ->workspaces[server->curr_output->curr_workspace] + ->focused_tile; } } } diff --git a/seat.c b/seat.c index 8578bea..6e90616 100644 --- a/seat.c +++ b/seat.c @@ -968,9 +968,10 @@ seat_set_focus(struct cg_seat *seat, struct cg_view *view) { view_maximize(view, curr_workspace->focused_tile); wl_list_remove(&view->link); if(curr_workspace->focused_tile->view != NULL) { - wl_list_insert(&curr_workspace->focused_tile->view->link,&view->link); + wl_list_insert(&curr_workspace->focused_tile->view->link, + &view->link); } else { - wl_list_insert(curr_workspace->views.prev,&view->link); + wl_list_insert(curr_workspace->views.prev, &view->link); } curr_workspace->focused_tile->view = view; } diff --git a/view.c b/view.c index 23d6429..352f404 100644 --- a/view.c +++ b/view.c @@ -248,12 +248,15 @@ view_maximize(struct cg_view *view, struct cg_tile *tile) { view->ox = tile->tile.x; view->oy = tile->tile.y; view->impl->maximize(view, tile->tile.width, tile->tile.height); - view->tile=tile; + view->tile = tile; } void view_position(struct cg_view *view) { - view_maximize(view, view->workspace->output->workspaces[view->workspace->output->curr_workspace]->focused_tile); + view_maximize(view, + view->workspace->output + ->workspaces[view->workspace->output->curr_workspace] + ->focused_tile); } void From b6ef26fa81cb01a4634de063875fe03fab4c0455 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 20 Mar 2021 17:19:56 +0100 Subject: [PATCH 240/689] Leave list of views invariant under cycling --- keybinding.c | 39 ++++++++++++++++++++++++--------------- seat.c | 8 ++++---- 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/keybinding.c b/keybinding.c index 25c4135..1c379b3 100644 --- a/keybinding.c +++ b/keybinding.c @@ -608,26 +608,39 @@ keybinding_cycle_views(struct cg_server *server, bool reverse) { server->curr_output->workspaces[server->curr_output->curr_workspace]; struct cg_view *current_view = curr_workspace->focused_tile->view; - struct cg_view *tmp_view, *next_view = NULL; + if(current_view == NULL) { + current_view=wl_container_of(&curr_workspace->views,current_view,link); + } + struct cg_view *it_view, *next_view = NULL; if(reverse) { - wl_list_for_each_reverse(tmp_view, &curr_workspace->views, link) { - if(tmp_view == current_view) { + struct wl_list *it; + it=current_view->link.prev; + while(it != ¤t_view->link) { + if(it == &curr_workspace->views) { + it=it->prev; continue; } - if(!view_is_visible(tmp_view)) { - next_view = tmp_view; + it_view=wl_container_of(it,it_view,link); + if(!view_is_visible(it_view)) { + next_view = it_view; break; } + it=it->prev; } } else { - wl_list_for_each(tmp_view, &curr_workspace->views, link) { - if(tmp_view == current_view) { + struct wl_list *it; + it=current_view->link.next; + while(it != ¤t_view->link) { + if(it == &curr_workspace->views) { + it=it->next; continue; } - if(!view_is_visible(tmp_view)) { - next_view = tmp_view; + it_view=wl_container_of(it,it_view,link); + if(!view_is_visible(it_view)) { + next_view = it_view; break; } + it=it->next; } } @@ -637,13 +650,9 @@ keybinding_cycle_views(struct cg_server *server, bool reverse) { wlr_output_damage_add_box(curr_workspace->output->damage, &curr_workspace->focused_tile->tile); + /* Prevent seat_set_focus from reordering the views */ + curr_workspace->focused_tile->view=wl_container_of(next_view->link.prev,curr_workspace->focused_tile->view,link); seat_set_focus(server->seat, next_view); - /* Move the previous view to the end of the list unless we are focused on - * the desktop*/ - if(!reverse && current_view != NULL) { - wl_list_remove(¤t_view->link); - wl_list_insert(curr_workspace->views.prev, ¤t_view->link); - } } void diff --git a/seat.c b/seat.c index 6e90616..8f63c20 100644 --- a/seat.c +++ b/seat.c @@ -961,11 +961,11 @@ seat_set_focus(struct cg_seat *seat, struct cg_view *view) { #endif { /* Always resize the view, even if prev_view == view */ + struct cg_workspace *curr_workspace = + server->curr_output + ->workspaces[server->curr_output->curr_workspace]; + view_maximize(view, curr_workspace->focused_tile); if(!view_is_visible(view)) { - struct cg_workspace *curr_workspace = - server->curr_output - ->workspaces[server->curr_output->curr_workspace]; - view_maximize(view, curr_workspace->focused_tile); wl_list_remove(&view->link); if(curr_workspace->focused_tile->view != NULL) { wl_list_insert(&curr_workspace->focused_tile->view->link, From 2c499e20c32d55ae1615040b33b64415a599a049 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 20 Mar 2021 17:20:40 +0100 Subject: [PATCH 241/689] Apply clang-format --- keybinding.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/keybinding.c b/keybinding.c index 1c379b3..f4c5a5b 100644 --- a/keybinding.c +++ b/keybinding.c @@ -609,38 +609,39 @@ keybinding_cycle_views(struct cg_server *server, bool reverse) { struct cg_view *current_view = curr_workspace->focused_tile->view; if(current_view == NULL) { - current_view=wl_container_of(&curr_workspace->views,current_view,link); + current_view = + wl_container_of(&curr_workspace->views, current_view, link); } struct cg_view *it_view, *next_view = NULL; if(reverse) { struct wl_list *it; - it=current_view->link.prev; + it = current_view->link.prev; while(it != ¤t_view->link) { if(it == &curr_workspace->views) { - it=it->prev; + it = it->prev; continue; } - it_view=wl_container_of(it,it_view,link); + it_view = wl_container_of(it, it_view, link); if(!view_is_visible(it_view)) { next_view = it_view; break; } - it=it->prev; + it = it->prev; } } else { struct wl_list *it; - it=current_view->link.next; + it = current_view->link.next; while(it != ¤t_view->link) { if(it == &curr_workspace->views) { - it=it->next; + it = it->next; continue; } - it_view=wl_container_of(it,it_view,link); + it_view = wl_container_of(it, it_view, link); if(!view_is_visible(it_view)) { next_view = it_view; break; } - it=it->next; + it = it->next; } } @@ -651,7 +652,8 @@ keybinding_cycle_views(struct cg_server *server, bool reverse) { wlr_output_damage_add_box(curr_workspace->output->damage, &curr_workspace->focused_tile->tile); /* Prevent seat_set_focus from reordering the views */ - curr_workspace->focused_tile->view=wl_container_of(next_view->link.prev,curr_workspace->focused_tile->view,link); + curr_workspace->focused_tile->view = wl_container_of( + next_view->link.prev, curr_workspace->focused_tile->view, link); seat_set_focus(server->seat, next_view); } From 98eb1a4be83f27f4daa012033b3f417ddf385deb Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 25 Mar 2021 10:27:28 +0100 Subject: [PATCH 242/689] Fix view_get_prev_view * Fix view_get_prev_view function * Reduce code duplication --- keybinding.c | 15 +-------------- view.c | 13 ++++++++++--- view.h | 2 ++ 3 files changed, 13 insertions(+), 17 deletions(-) diff --git a/keybinding.c b/keybinding.c index f4c5a5b..723437a 100644 --- a/keybinding.c +++ b/keybinding.c @@ -614,20 +614,7 @@ keybinding_cycle_views(struct cg_server *server, bool reverse) { } struct cg_view *it_view, *next_view = NULL; if(reverse) { - struct wl_list *it; - it = current_view->link.prev; - while(it != ¤t_view->link) { - if(it == &curr_workspace->views) { - it = it->prev; - continue; - } - it_view = wl_container_of(it, it_view, link); - if(!view_is_visible(it_view)) { - next_view = it_view; - break; - } - it = it->prev; - } + next_view=view_get_prev_view(current_view); } else { struct wl_list *it; it = current_view->link.next; diff --git a/view.c b/view.c index 352f404..b1c870b 100644 --- a/view.c +++ b/view.c @@ -32,13 +32,20 @@ view_get_prev_view(struct cg_view *view) { struct cg_view *prev = NULL; struct cg_view *it_view; - wl_list_for_each(it_view, &view->workspace->views, link) { - if(!view_is_visible(it_view) && view != it_view) { + struct wl_list *it; + it = view->link.prev; + while(it != &view->link) { + if(it == &view->workspace->views) { + it = it->prev; + continue; + } + it_view = wl_container_of(it, it_view, link); + if(!view_is_visible(it_view)) { prev = it_view; break; } + it = it->prev; } - return prev; } diff --git a/view.h b/view.h index 5a7ecd4..249ce1c 100644 --- a/view.h +++ b/view.h @@ -118,5 +118,7 @@ view_child_finish(struct cg_view_child *child); void view_child_init(struct cg_view_child *child, struct cg_view_child *parent, struct cg_view *view, struct wlr_surface *wlr_surface); +struct cg_view * +view_get_prev_view(struct cg_view *view); #endif From a69cf18f7c0e6118329de2610014520a7c8cdf30 Mon Sep 17 00:00:00 2001 From: project-repo Date: Tue, 6 Apr 2021 19:49:48 +0200 Subject: [PATCH 243/689] Ensure correct focus of keyboard --- seat.c | 1 + 1 file changed, 1 insertion(+) diff --git a/seat.c b/seat.c index 8f63c20..daee188 100644 --- a/seat.c +++ b/seat.c @@ -1002,6 +1002,7 @@ seat_set_focus(struct cg_seat *seat, struct cg_view *view) { free(title); struct wlr_keyboard *keyboard = wlr_seat_get_keyboard(wlr_seat); + wlr_seat_keyboard_end_grab(wlr_seat); if(keyboard) { wlr_seat_keyboard_notify_enter( wlr_seat, view->wlr_surface, keyboard->keycodes, From b989fe50f08d77245b73790f52ea2cc730b94b4e Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 8 Apr 2021 07:39:14 +0200 Subject: [PATCH 244/689] Fix incompatibilities with wlroots 0.13.0 --- cagebreak.c | 2 +- keybinding.c | 2 +- output.c | 10 +++++----- output.h | 2 +- seat.c | 4 +++- xdg_shell.c | 3 ++- 6 files changed, 13 insertions(+), 10 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index 0e3b9bb..6e16dc2 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -308,7 +308,7 @@ main(int argc, char *argv[]) { set_sig_handler(SIGCHLD, sig_chld_handler); - backend = wlr_backend_autocreate(server.wl_display, NULL); + backend = wlr_backend_autocreate(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 723437a..9989d5c 100644 --- a/keybinding.c +++ b/keybinding.c @@ -614,7 +614,7 @@ keybinding_cycle_views(struct cg_server *server, bool reverse) { } struct cg_view *it_view, *next_view = NULL; if(reverse) { - next_view=view_get_prev_view(current_view); + next_view = view_get_prev_view(current_view); } else { struct wl_list *it; it = current_view->link.next; diff --git a/output.c b/output.c index 91ba032..1029d9b 100644 --- a/output.c +++ b/output.c @@ -361,8 +361,8 @@ frame_done: } static void -handle_output_transform(struct wl_listener *listener, void *data) { - struct cg_output *output = wl_container_of(listener, output, transform); +handle_output_commit(struct wl_listener *listener, void *data) { + struct cg_output *output = wl_container_of(listener, output, commit); if(!output->wlr_output->enabled || output->workspaces == NULL) { return; @@ -468,7 +468,7 @@ output_destroy(struct cg_output *output) { wl_list_remove(&output->destroy.link); wl_list_remove(&output->mode.link); - wl_list_remove(&output->transform.link); + wl_list_remove(&output->commit.link); wl_list_remove(&output->damage_frame.link); wl_list_remove(&output->damage_destroy.link); @@ -613,8 +613,8 @@ handle_new_output(struct wl_listener *listener, void *data) { output->mode.notify = handle_output_mode; wl_signal_add(&wlr_output->events.mode, &output->mode); - output->transform.notify = handle_output_transform; - wl_signal_add(&wlr_output->events.transform, &output->transform); + output->commit.notify = handle_output_commit; + wl_signal_add(&wlr_output->events.commit, &output->commit); output->destroy.notify = handle_output_destroy; wl_signal_add(&wlr_output->events.destroy, &output->destroy); output->damage_frame.notify = handle_output_damage_frame; diff --git a/output.h b/output.h index a11d4be..42cb629 100644 --- a/output.h +++ b/output.h @@ -16,7 +16,7 @@ struct cg_output { struct wlr_output_damage *damage; struct wl_listener mode; - struct wl_listener transform; + struct wl_listener commit; struct wl_listener destroy; struct wl_listener damage_frame; struct wl_listener damage_destroy; diff --git a/seat.c b/seat.c index daee188..469bf4e 100644 --- a/seat.c +++ b/seat.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #if CG_HAS_XWAYLAND @@ -333,7 +334,8 @@ handle_key_event(struct cg_keyboard_group *group, struct cg_seat *seat, bool handled = false; for(int i = 0; i < nsyms; ++i) { - if(event->state == WLR_KEY_PRESSED && !key_is_modifier(syms[i])) { + if(event->state == WL_KEYBOARD_KEY_STATE_PRESSED && + !key_is_modifier(syms[i])) { uint32_t modifiers = wlr_keyboard_get_modifiers(device->keyboard); /* Get the consumed_modifiers and remove them from the modifier list */ diff --git a/xdg_shell.c b/xdg_shell.c index 5a85982..0e76dc4 100644 --- a/xdg_shell.c +++ b/xdg_shell.c @@ -235,7 +235,8 @@ static void for_each_popup(struct cg_view *view, wlr_surface_iterator_func_t iterator, void *data) { struct cg_xdg_shell_view *xdg_shell_view = xdg_shell_view_from_view(view); - wlr_xdg_surface_for_each_popup(xdg_shell_view->xdg_surface, iterator, data); + wlr_xdg_surface_for_each_popup_surface(xdg_shell_view->xdg_surface, + iterator, data); } static struct wlr_surface * From 72bcf8f1de8e77b34b8603a9aadfa276ba588413 Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 8 Apr 2021 08:22:10 +0200 Subject: [PATCH 245/689] Fix null-pointer dereference --- message.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/message.c b/message.c index b88a562..acf1ffc 100644 --- a/message.c +++ b/message.c @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -85,7 +86,7 @@ create_message_texture(const char *string, const struct cg_output *output) { int stride = cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, width); struct wlr_renderer *renderer = wlr_backend_get_renderer(output->wlr_output->backend); - texture = wlr_texture_from_pixels(renderer, WL_SHM_FORMAT_ARGB8888, stride, + texture = wlr_texture_from_pixels(renderer, DRM_FORMAT_ARGB8888, stride, width, height, data); cairo_surface_destroy(surface); g_object_unref(pango); From 20ce9ae3a49c5ac11fde140dfb62000ca608956b Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 8 Apr 2021 16:26:49 +0200 Subject: [PATCH 246/689] Fix bugs due to updated wlroots --- keybinding.c | 3 ++- output.c | 28 +++++++++++++++++++++------- seat.c | 3 --- view.c | 11 ++--------- view.h | 2 -- 5 files changed, 25 insertions(+), 22 deletions(-) diff --git a/keybinding.c b/keybinding.c index 9989d5c..d9a8640 100644 --- a/keybinding.c +++ b/keybinding.c @@ -718,7 +718,8 @@ keybinding_move_view_to_next_output(struct cg_server *server) { ->focused_tile->view = view; view->workspace = server->curr_output ->workspaces[server->curr_output->curr_workspace]; - view_position(view); + view->tile=view->workspace->focused_tile; + view_maximize(view,view->tile); seat_set_focus(server->seat, view); } } diff --git a/output.c b/output.c index 1029d9b..75b925e 100644 --- a/output.c +++ b/output.c @@ -226,8 +226,12 @@ scan_out_primary_view(struct cg_output *output) { } } - struct cg_view *view = - output->workspaces[output->curr_workspace]->focused_tile->view; + struct cg_workspace *ws = output->workspaces[output->curr_workspace]; + if(ws->focused_tile->next != ws->focused_tile) { + return false; + } + + struct cg_view *view = ws->focused_tile->view; if(view == NULL || view->wlr_surface == NULL) { return false; } @@ -261,6 +265,9 @@ scan_out_primary_view(struct cg_output *output) { } wlr_output_attach_buffer(wlr_output, &surface->buffer->base); + if(!wlr_output_test(wlr_output)) { + return false; + } return wlr_output_commit(wlr_output); } @@ -363,15 +370,20 @@ frame_done: static void handle_output_commit(struct wl_listener *listener, void *data) { struct cg_output *output = wl_container_of(listener, output, commit); + struct wlr_output_event_commit *event = data; if(!output->wlr_output->enabled || output->workspaces == NULL) { return; } - struct cg_view *view; - wl_list_for_each(view, &output->workspaces[output->curr_workspace]->views, - link) { - view_position(view); + if(event->committed & (WLR_OUTPUT_STATE_TRANSFORM | WLR_OUTPUT_STATE_SCALE)) { + struct cg_view *view; + wl_list_for_each(view, &output->workspaces[output->curr_workspace]->views, + link) { + if(view_is_visible(view)) { + view_maximize(view,view->tile); + } + } } } @@ -386,7 +398,9 @@ handle_output_mode(struct wl_listener *listener, void *data) { struct cg_view *view; wl_list_for_each(view, &output->workspaces[output->curr_workspace]->views, link) { - view_position(view); + if(view_is_visible(view)) { + view_maximize(view,view->tile); + } } } diff --git a/seat.c b/seat.c index 469bf4e..51450ac 100644 --- a/seat.c +++ b/seat.c @@ -56,9 +56,6 @@ view_at(const struct cg_view *view, double lx, double ly, struct wlr_box *output_layout_box = wlr_output_layout_get_box( view->server->output_layout, view->workspace->output->wlr_output); if(output_layout_box == NULL) { - fprintf(stderr, "OUTPUT:%d\n", - view->workspace->output->wlr_output->enabled); - return output_layout_box->x; return false; } diff --git a/view.c b/view.c index b1c870b..a77b8fc 100644 --- a/view.c +++ b/view.c @@ -258,14 +258,6 @@ view_maximize(struct cg_view *view, struct cg_tile *tile) { view->tile = tile; } -void -view_position(struct cg_view *view) { - view_maximize(view, - view->workspace->output - ->workspaces[view->workspace->output->curr_workspace] - ->focused_tile); -} - void view_for_each_surface(struct cg_view *view, wlr_surface_iterator_func_t iterator, void *data) { @@ -363,7 +355,8 @@ view_map(struct cg_view *view, struct wlr_surface *surface, } else #endif { - view_position(view); + view->tile=view->workspace->focused_tile; + view_maximize(view,view->tile); wl_list_insert(&ws->views, &view->link); } seat_set_focus(output->server->seat, view); diff --git a/view.h b/view.h index 249ce1c..add26b0 100644 --- a/view.h +++ b/view.h @@ -89,8 +89,6 @@ view_damage_child(struct cg_view_child *view, bool whole); void view_activate(struct cg_view *view, bool activate); void -view_position(struct cg_view *view); -void view_for_each_surface(struct cg_view *view, wlr_surface_iterator_func_t iterator, void *data); void From 7d175afc072ef5aa2d91abdbaf300584efe1b2d1 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Mon, 19 Apr 2021 20:22:53 +0200 Subject: [PATCH 247/689] Update dependency versions --- meson.build | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/meson.build b/meson.build index e61eedc..c760aec 100644 --- a/meson.build +++ b/meson.build @@ -53,7 +53,7 @@ if is_freebsd ) endif -wlroots = dependency('wlroots', version: '>= 0.12.0') +wlroots = dependency('wlroots', version: '>= 0.13.0') wayland_protos = dependency('wayland-protocols', version: '>=1.14') wayland_server = dependency('wayland-server') wayland_cursor = dependency('wayland-cursor') @@ -198,13 +198,13 @@ reproducible_build_versions = { 'wayland_server': '1.19.0', 'wayland_client': '1.19.0', 'wayland_cursor': '1.19.0', - 'wlroots': '0.12.0', - 'xkbcommon': '1.1.0', - 'fontconfig': '2.13.91', + 'wlroots': '0.13.0', + 'xkbcommon': '1.2.1', + 'fontconfig': '2.13.93', 'pixman': '0.40.0', - 'pango': '1.48.2', + 'pango': '1.48.4', 'cairo': '1.17.4', - 'pangocairo': '1.48.2', + 'pangocairo': '1.48.4', 'math': '-1' } From 9623ccd4d4718831fba20525fa7e26f606e3176d Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Mon, 19 Apr 2021 20:24:03 +0200 Subject: [PATCH 248/689] Apply clang-format --- keybinding.c | 4 ++-- output.c | 17 +++++++++-------- view.c | 4 ++-- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/keybinding.c b/keybinding.c index d9a8640..005b87a 100644 --- a/keybinding.c +++ b/keybinding.c @@ -718,8 +718,8 @@ keybinding_move_view_to_next_output(struct cg_server *server) { ->focused_tile->view = view; view->workspace = server->curr_output ->workspaces[server->curr_output->curr_workspace]; - view->tile=view->workspace->focused_tile; - view_maximize(view,view->tile); + view->tile = view->workspace->focused_tile; + view_maximize(view, view->tile); seat_set_focus(server->seat, view); } } diff --git a/output.c b/output.c index 75b925e..028f8b8 100644 --- a/output.c +++ b/output.c @@ -266,7 +266,7 @@ scan_out_primary_view(struct cg_output *output) { wlr_output_attach_buffer(wlr_output, &surface->buffer->base); if(!wlr_output_test(wlr_output)) { - return false; + return false; } return wlr_output_commit(wlr_output); } @@ -376,12 +376,13 @@ handle_output_commit(struct wl_listener *listener, void *data) { return; } - if(event->committed & (WLR_OUTPUT_STATE_TRANSFORM | WLR_OUTPUT_STATE_SCALE)) { + if(event->committed & + (WLR_OUTPUT_STATE_TRANSFORM | WLR_OUTPUT_STATE_SCALE)) { struct cg_view *view; - wl_list_for_each(view, &output->workspaces[output->curr_workspace]->views, - link) { + wl_list_for_each( + view, &output->workspaces[output->curr_workspace]->views, link) { if(view_is_visible(view)) { - view_maximize(view,view->tile); + view_maximize(view, view->tile); } } } @@ -398,9 +399,9 @@ handle_output_mode(struct wl_listener *listener, void *data) { struct cg_view *view; wl_list_for_each(view, &output->workspaces[output->curr_workspace]->views, link) { - if(view_is_visible(view)) { - view_maximize(view,view->tile); - } + if(view_is_visible(view)) { + view_maximize(view, view->tile); + } } } diff --git a/view.c b/view.c index a77b8fc..410a746 100644 --- a/view.c +++ b/view.c @@ -355,8 +355,8 @@ view_map(struct cg_view *view, struct wlr_surface *surface, } else #endif { - view->tile=view->workspace->focused_tile; - view_maximize(view,view->tile); + view->tile = view->workspace->focused_tile; + view_maximize(view, view->tile); wl_list_insert(&ws->views, &view->link); } seat_set_focus(output->server->seat, view); From 3234691909135d52ffb49026f8f8fdcf70c751fc Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Mon, 19 Apr 2021 20:28:56 +0200 Subject: [PATCH 249/689] Adjust version to 1.6.1 in meson --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index c760aec..09613bb 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('cagebreak', 'c', - version: '1.6.0', + version: '1.6.1', license: 'MIT', default_options: [ 'c_std=c11', From 0eb3111e7742b023dc77008c427e54aee52e5144 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 19 Apr 2021 20:29:14 +0200 Subject: [PATCH 250/689] Fix issues due to new wlroots version --- fuzz/fuzz-lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fuzz/fuzz-lib.c b/fuzz/fuzz-lib.c index c916777..cc7b6a4 100644 --- a/fuzz/fuzz-lib.c +++ b/fuzz/fuzz-lib.c @@ -181,7 +181,7 @@ LLVMFuzzerInitialize(int *argc, char ***argv) { server.backend = backend; struct wlr_backend *headless_backend = - wlr_headless_backend_create(server.wl_display, NULL); + wlr_headless_backend_create(server.wl_display); if(!headless_backend) { wlr_log(WLR_ERROR, "Unable to create the wlroots headless backend"); ret = 1; From a2f8a0c66ed49af18ee33683aaf4abfddb32619f Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Mon, 19 Apr 2021 20:56:23 +0200 Subject: [PATCH 251/689] Adjust version --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 09613bb..5adc690 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('cagebreak', 'c', - version: '1.6.1', + version: '1.7.0', license: 'MIT', default_options: [ 'c_std=c11', From 94c6d970d6a6903619a5481f39a8f98fe08935d4 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Mon, 19 Apr 2021 22:05:56 +0200 Subject: [PATCH 252/689] Prepare 1.7.0 cagebreak release --- README.md | 4 ++++ man/cagebreak-config.5.md | 2 +- man/cagebreak.1.md | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 87ae370..32cc245 100644 --- a/README.md +++ b/README.md @@ -413,6 +413,10 @@ Adds options to disable or enable outputs. See Issue 22 in Bugs.md and Issue #2 Adds support for non-build dependencies and an option for builds without pandoc. +### Release 1.7.0 + +Improve window ordering. + ## Contributors * Aisha Tammy diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index 693215d..94aaa74 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -1,4 +1,4 @@ -% CAGEBREAK-CONFIG(1) Version 1.6.0 | Cagebreak Manual +% CAGEBREAK-CONFIG(1) Version 1.7.0 | Cagebreak Manual # NAME diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index 6b6e381..3485d07 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -1,4 +1,4 @@ -% CAGEBREAK(1) Version 1.6.0 | Cagebreak Manual +% CAGEBREAK(1) Version 1.7.0 | Cagebreak Manual # NAME From 65f2734f7883029cbd6e1531dd89a8f662b83a04 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Mon, 19 Apr 2021 22:13:06 +0200 Subject: [PATCH 253/689] Add release artifacts --- README.md | 5 +++++ signatures/1.6.0.sig | Bin 0 -> 566 bytes signatures/cagebreak.sig | Bin 566 -> 566 bytes 3 files changed, 5 insertions(+) create mode 100644 signatures/1.6.0.sig diff --git a/README.md b/README.md index 32cc245..6648459 100644 --- a/README.md +++ b/README.md @@ -184,6 +184,11 @@ ninja -C build For every release after 1.0.5, hashes will be provided. +1.7.0 + + * sha 256: 5af11b84e61a82a1a276e8f91f6ebc6baafd2c98d22be3da1d01734cc9d55faa + * sha 512: 45474115fb4c28fe1ee91ad54706bfe521b6e70bd8ea619b94a3f50bae426891bf6a0387aa9b2f7f6d18349280c4e84973e4e433d50c090e5a764c64fa67795d + 1.6.0 * sha 256: aef473eae73454429afb158d66a7bd9aec75ef915845b7508de5448820357aa8 diff --git a/signatures/1.6.0.sig b/signatures/1.6.0.sig new file mode 100644 index 0000000000000000000000000000000000000000..3ade030c2119b6e44d46ebc6abfbb2db446925ca GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j+vjdU^Px~&Utu2l-i)*Xw~`aDJj0$@UAJ^%^{5XjaY zi`4o&Mo3!^|9i{jxon zggnMPGt*D3*0p(`HXEwvI?-C&_%jsJ9c6=vr0mEE4*xmV{HmGky5~C{YiS?1#qyR@ zVt3nCZMANG=^96fVw_TZ-`IY}+v63#xxGGtZf6W3AdK3-BthHew`5?t6_EN6N`OyH)SApj`y4-*u+uYRGfj0n57H}+$ ztyB5Y)Y1=GKwcf4FhN$_1fDECT>U*XrXX9dbB?P}OBDPqx9a4+*fU71MJl-Mtkbj( z9y@|k*eh?fQ-@J#f~d%PeGVABql8bxKmSDqOY`q(JXB$2*w`G>I}n-%%3z$g%gHCRvDvF^=5tbG}bBQVECzk;G9{vrE! zZ?kRdCk)dUM?ek0)#a=9pD1MPuQa}*m#r7?SSb~bpGIwmytNDyZLR@F-~TjvCl>ng zZJ+gXy%psJOEw)G0B$}5^4@hVojRH-RC6buq8bjOx9>e2a={N5951sZ=^Lx#C{SLK EhWU#O4*&oF literal 0 HcmV?d00001 diff --git a/signatures/cagebreak.sig b/signatures/cagebreak.sig index 3ade030c2119b6e44d46ebc6abfbb2db446925ca..eebdb6c01632b5259c0205a684c383633f5549ac 100644 GIT binary patch delta 542 zcmV+(0^$9(1hxc_BY%D4tpExM5XjaYi`4o&Mh}e-`T`o4ULXweNtm;eZi*BT+?uxp zBlo2G8nqiK^rW*=>GC*5(XVq4gD2g7dQb2F!&@uUUs{NxuL9~q1q@Qqn9*YS{DV)> zDu|zxbe3gaDIIhlw&S--YpB&Bx*ILL4PgN$(^vR}hb-I-l7C600wn#7c4LVMpwK~Z zBf1S&N|=@T`IMj->%p+O24iXo$cq|?s+I`}x(vDVnWyu4A|txYlxU^>fo5%pD0D*( z#S00~>FZOe5m|K86s~s@w}MUskJ!r>fq&9e;nav;7s%IfRku6WKJ5EyCS#|#*~`#{VbNKe4n>tkTZvdU+d52pn6;u>Om3RLBDCRhVy6cTJ&(gKR#xlk z5o64lL=*eHRPZOg^L!jepLuCF^H#&=S-k+r};;7@#{ zM3zF;e_!AYBV}8c^M~nP&V3+e=ApJhd^HHlVauTf5C#FY)cW>OFcyZ+&FCmR>2gZ` g4l7|VRTpFM^R(YNq;VFJ@1U1pP?1b!OD``lggnMPGt*D3*0p(`HXEwvI?-C&_%jsJ9c6=v zr0mEE4*xmV{HmGky5~C{YiS?1#qyR@Vt3nCZMANG=^96fVt<@ceBao9#@pi+zq!3W zfo^VfAJh=nOe{xB^chU+z9)Gun}&`^uF)CdEgtH*lj)YBl6n*k#H_VpA^9N1CiYUU z$@$R$%~yfvI=b9|Aluy3*MTPKkZ?#j0QD}mw$a;Ma7`&r|Ps2a| zMFmUq?`b?#VP)9Z9MF0s*rrE%vJ_z4o5p!nSC%MK(zt#H(THNX0*PBtSGRewb>xlt zNl{Z2&Y`DGf{)-0yVP7rM8`KW2)&8N`G%NMs0_@wG0z&t^r5i|1^3h7W(mRpY?OS73Bp>HXR%QZaxF@-gPaVI+`j} gb0?mn8W#?tx9>e2a={N5951sZ=^Lx#C{SLKhIM5GeE Date: Sun, 2 May 2021 19:46:59 +0200 Subject: [PATCH 254/689] Increment versions --- man/cagebreak-config.5.md | 2 +- man/cagebreak.1.md | 2 +- meson.build | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index 94aaa74..5480bcb 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -1,4 +1,4 @@ -% CAGEBREAK-CONFIG(1) Version 1.7.0 | Cagebreak Manual +% CAGEBREAK-CONFIG(1) Version 1.7.1 | Cagebreak Manual # NAME diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index 3485d07..1de1e1e 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -1,4 +1,4 @@ -% CAGEBREAK(1) Version 1.7.0 | Cagebreak Manual +% CAGEBREAK(1) Version 1.7.1 | Cagebreak Manual # NAME diff --git a/meson.build b/meson.build index 5adc690..3380e10 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('cagebreak', 'c', - version: '1.7.0', + version: '1.7.1', license: 'MIT', default_options: [ 'c_std=c11', @@ -199,7 +199,7 @@ reproducible_build_versions = { 'wayland_client': '1.19.0', 'wayland_cursor': '1.19.0', 'wlroots': '0.13.0', - 'xkbcommon': '1.2.1', + 'xkbcommon': '1.3.0', 'fontconfig': '2.13.93', 'pixman': '0.40.0', 'pango': '1.48.4', From d675f369dba61f51d20d0381c69ed0ed79e656fa Mon Sep 17 00:00:00 2001 From: project-repo Date: Wed, 5 May 2021 12:09:25 +0200 Subject: [PATCH 255/689] Change to scdoc for man page generation --- man/cagebreak-config.5.md | 288 ++++++++++++++++---------------------- man/cagebreak.1.md | 69 ++++----- meson.build | 9 +- 3 files changed, 159 insertions(+), 207 deletions(-) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index 5480bcb..ef9b11b 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -1,253 +1,211 @@ -% CAGEBREAK-CONFIG(1) Version 1.7.1 | Cagebreak Manual +cagebreak-config(1) # NAME -**cagebreak-config** — Cagebreak config file +*cagebreak-config* — Cagebreak config file # SYNOPSIS -**\$XDG_CONFIG_PATH/cagebreak/config** +*\$XDG_CONFIG_PATH/cagebreak/config* # DESCRIPTION -The `cagebreak` configuration file is a simple plain text file which configures -the way `cagebreak` behaves. +The cagebreak configuration file is a simple plain text file which configures +the way cagebreak behaves. Each line constitutes a separate command which is parsed independently from the rest of the file. Comments can be added by prepending a line with the # symbol. ## COMMANDS -**abort** +*abort* + Return to the default mode without running any command -> Return to the default mode without running any command +*background - Set background color* + Set the background color. This command expects three floating point numbers + between 0 and 1, specifying the r, g and b values respectively. + (e.g. "background 1.0 0.0 0.0" sets to background color to red) + There is no support for specifying a background image. -**background - Set background color** +*bind - Bind key to command in root mode* + This command requires a key (see *KEY DEFINITIONS*) and a command (see *COMMANDS*) as an argument. + Subsequently, pressing this key while in command mode executes the + supplied action. bind is equivalent to + definekey root -> Set the background color. This command expects three floating point numbers -> between 0 and 1, specifying the r, g and b values respectively. -> (e.g. "background 1.0 0.0 0.0" sets to background color to red) -> There is no support for specifying a background image. +*close - Close current window* + This command closes the current window. It may be useful for windows of applications which + do not offer any method of closing them. -**bind - Bind key to command in root mode** +*definekey - Bind key to action in arbitrary mode* + This command behaves similarly to the *bind* command with the + difference that the mode in which the keybinding is activated is + specified by the user. A call to this function is to be structured as follows: -> This command requires a key (see **KEY DEFINITIONS**) and a command (see **COMMANDS**) as an argument. -> Subsequently, pressing this key while in command mode executes the -> supplied action. `bind ` is equivalent to ->> `definekey root ` + definekey -**close - Close current window** +*definemode* + This command requires a single argument; the name of the mode to be defined. + Subsequent to a call to this function, the defined mode may be used along with + the definekey command to create a custom key mapping. Synopsis: -> This command closes the current window. It may be useful for windows of applications which -> do not offer any method of closing them. + definemode -**definekey - Bind key to action in arbitrary mode** +*escape* + Defines the key with which the current mode can be changed to "root". + escape is equivalent to definekey top switch_mode root -> This command behaves similarly to the **bind** command with the -> difference that the mode in which the keybinding is activated is -> specified by the user. A call to this function is to be structured as follows: -> ->> `definekey ` +*exchangedown* + Exchange the current window with the window in the tile to the bottom -**definemode** +*exchangeleft* + Exchange the current window with the window in the tile to the left -> This command requires a single argument; the name of the mode to be defined. -> Subsequent to a call to this function, the defined mode may be used along with -> the definekey command to create a custom key mapping. Synopsis: -> ->> `definemode ` +*exchangeright* + Exchange the current window with the window in the tile to the right -**escape** +*exchangeup* + Exchange the current window with the window in the tile to the top -> Defines the key with which the current mode can be changed to "root". -> `escape ` is equivalent to `definekey top switch_mode root` +*exec* + Executes the supplied shell command using *sh -c ""*. Synopsis: -**exchangedown** + exec -> Exchange the current window with the window in the tile to the bottom +*focus* + Focus next tile -**exchangeleft** +*focusdown* + Focus the tile to the bottom -> Exchange the current window with the window in the tile to the left +*focusleft* + Focus the tile to the left -**exchangeright** +*focusprev* + Focus previous tile -> Exchange the current window with the window in the tile to the right +*focusright* + Focus the tile to the right -**exchangeup** +*focusup* + Focus the tile to the top -> Exchange the current window with the window in the tile to the top +*hsplit* + Split current tile horizontally -**exec** +*mode * + Enter mode "". After a keybinding is processed, return to default mode -> Executes the supplied shell command using *`sh -c ""`*. Synopsis: -> ->> `exec ` +*movetonextscreen* + Move the current window to the next screen -**focus** +*movetoworkspace * + Move the currently focused window to the n-th workspace -> Focus next tile +*next* + Focus next window in current tile -**focusdown** +*nextscreen* + Focus the next screen -> Focus the tile to the bottom +*only* + Remove all splits and make the current window fill the entire screen -**focusleft** +*output [[pos res x rate ] | enable | disable]* + Configure the output "". and are the position of the monitor + in pixels. The top-left monitor should have the coordinates 0 0. and + specify the resolution in pixels and sets the refresh rate of + the monitor (often this is 50 or 60). The options enable and disable + enable or disable the output . Note that if is the only enabled + output, *output disable* has no effect. -> Focus the tile to the left +*prev* + Focus previous window in current tile -**focusprev** +*prevscreen* + Focus the previous screen -> Focus previous tile +*quit* + Exit cagebreak -**focusright** +*resizedown* + Resize the current tile towards the bottom -> Focus the tile to the right +*resizeleft* + Resize the current tile towards the left -**focusup** +*resizeright* + Resize the current tile towards the right -> Focus the tile to the top +*resizeup* + Resize the current tile towards the top -**hsplit** +*setmode * + Set the default mode to -> Split current tile horizontally +*switchvt * + Switch to tty n -**mode ** +*time* + Display time -> Enter mode "``". After a keybinding is processed, return to default mode +*vsplit* + Split current tile vertically -**movetonextscreen** +*workspace * + Change to the n-th workspace -> Move the current window to the next screen - -**movetoworkspace ** - -> Move the currently focused window to the n-th workspace - -**next** - -> Focus next window in current tile - -**nextscreen** - -> Focus the next screen - -**only** - -> Remove all splits and make the current window fill the entire screen - -**output [[pos res x rate ] | enable | disable]** - -> Configure the output "". and are the position of the monitor -> in pixels. The top-left monitor should have the coordinates 0 0. and -> specify the resolution in pixels and sets the refresh rate of -> the monitor (often this is 50 or 60). The options enable and disable -> enable or disable the output . Note that if is the only enabled -> output, `output disable` has no effect. - -**prev** - -> Focus previous window in current tile - -**prevscreen** - -> Focus the previous screen - -**quit** - -> Exit cagebreak - -**resizedown** - -> Resize the current tile towards the bottom - -**resizeleft** - -> Resize the current tile towards the left - -**resizeright** - -> Resize the current tile towards the right - -**resizeup** - -> Resize the current tile towards the top - -**setmode ** - -> Set the default mode to `` - -**switchvt ** - -> Switch to tty n - -**time** - -> Display time - -**vsplit** - -> Split current tile vertically - -**workspace ** - -> Change to the n-th workspace - -**workspaces** - -> Requires a single integer larger than 1 and less than 30 as an argument. Sets the number of -> workspaces to the supplied number +*workspaces* + Requires a single integer larger than 1 and less than 30 as an argument. Sets the number of + workspaces to the supplied number # MODES By default, three modes are defined: -**top** +*top* + The default mode. Keybindings defined in this mode can be accessed + directly, without the use of an escape key. -> The default mode. Keybindings defined in this mode can be accessed -> directly, without the use of an escape key. +*root* + The command mode. Keybindings defined in this mode can be accessed + after pressing the key defined by the *escape* command. -**root** - -> The command mode. Keybindings defined in this mode can be accessed -> after pressing the key defined by the `escape` command. - -**resize** - -> Resize mode. This mode is used for resizing tiles. +*resize* + Resize mode. This mode is used for resizing tiles. # KEY DEFINITIONS -Keys are specified by their names as displayed for example by *`xev`*. +Keys are specified by their names as displayed for example by *xev*. In addition, modifiers can be specified using the following syntax: -> `-` + - The supported modifiers are: -**A - Alt** +*A - Alt* -**C - Control** +*C - Control* -**L - Logo** +*L - Logo* -**S - Shift** +*S - Shift* -**2 - Mod2** +*2 - Mod2* -**3 - Mod 3** +*3 - Mod 3* -**5 - Mod 5** +*5 - Mod 5* For example to specify the keybinding Control+t, the expression: ->`C-t` + C-t is used. # SEE ALSO -**cagebreak(1)** +*cagebreak(1)* # BUGS diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index 1de1e1e..ed23c5f 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -1,79 +1,70 @@ -% CAGEBREAK(1) Version 1.7.1 | Cagebreak Manual +cagebreak(1) # NAME -**cagebreak** — A Wayland tiling compositor to the likes of ratpoison +cagebreak - A Wayland tiling compositor to the likes of ratpoison # SYNOPSIS -| **cagebreak** [OPTIONS] +*cagebreak* [OPTIONS] # DESCRIPTION -`cagebreak` is a slim, keyboard-controlled, tiling compositor for -wayland conceptually based on the X11 window manager `ratpoison`. +cagebreak is a slim, keyboard-controlled, tiling compositor for +wayland conceptually based on the X11 window manager ratpoison. It allows for the screen to be split into non-overlapping tiles and, -in contrast to the original `ratpoison`, has native support for +in contrast to the original ratpoison, has native support for multi-workspace operation. -All interactions between the user and `cagebreak` are done via +All interactions between the user and cagebreak are done via the keyboard. Configuration of this behaviour is specified in the -**\$XDG_CONFIG_PATH/cagebreak/config** file (See **cagebreak-config(5)**). +*\$XDG_CONFIG_PATH/cagebreak/config* file (See *cagebreak-config(5)*). Scripting support is provided through the IPC -socket specified in the environment variable **\$CAGEBREAK_SOCKET**. +socket specified in the environment variable *\$CAGEBREAK_SOCKET*. The syntax accepted through this socket is identical to -that of the configuration file (see **cagebreak-config(5)**). +that of the configuration file (see *cagebreak-config(5)*). Errors which occur during interaction over IPC channel are displayed in a message box at the top right of the screen. # OPTIONS --h +*-h* + Display help message and exit -: Display help message and exit +*-r* + Rotate the output 90 degrees clockwise, can be specified up to three times --r - -: Rotate the output 90 degrees clockwise, can be specified up to three times - --v - -: Show version number and exit +*-v* + Show version number and exit # ENVIRONMENT -`CAGEBREAK_SOCKET` +*CAGEBREAK_SOCKET* + The IPC unix domain socket address accepting + commands as specified in *cagebreak-config(5)* -: The IPC unix domain socket address accepting -commands as specified in **cagebreak-config(5)** +*XKB_DEFAULT_LAYOUT* + The keyboard layout to be used (See *xkeyboard-config(7)*) -`XKB_DEFAULT_LAYOUT` +*XKB_DEFAULT_MODEL* + The keyboard model to be used (See *xkeyboard-config(7)*) -: The keyboard layout to be used (See **xkeyboard-config(7)**) +*XKB_DEFAULT_VARIANT* + The keyboard variant to be used (See *xkeyboard-config(7)*) -`XKB_DEFAULT_MODEL` +*XKB_DEFAULT_RULES* + The xkb rules to be used -: The keyboard model to be used (See **xkeyboard-config(7)**) - -`XKB_DEFAULT_VARIANT` - -: The keyboard variant to be used (See **xkeyboard-config(7)**) - -`XKB_DEFAULT_RULES` - -: The xkb rules to be used - -`XKB_DEFAULT_OPTIONS` - -: The xkb options to be used +*XKB_DEFAULT_OPTIONS* + The xkb options to be used # SEE ALSO -**cagebreak-config(5)** +*cagebreak-config(5)* # BUGS diff --git a/meson.build b/meson.build index 3380e10..6c42fd3 100644 --- a/meson.build +++ b/meson.build @@ -248,14 +248,16 @@ executable( ) if get_option('man-pages') - pandoc = find_program('pandoc') + scdoc = find_program('scdoc') + sh = find_program('sh') mandir1 = join_paths(get_option('mandir'), 'man1') mandir5 = join_paths(get_option('mandir'), 'man5') cagebreak_man = custom_target('cagebreak_man', output : 'cagebreak.1', input : 'man/cagebreak.1.md', - command : [pandoc, '-i', '@INPUT@', '-o', '@OUTPUT@', '-f', 'markdown-smart', '-t', 'man', '-s'], + capture : true, + command : [sh, '-c', '@0@ < @INPUT@'.format(scdoc.path())], install: true, install_dir: mandir1 ) @@ -263,7 +265,8 @@ if get_option('man-pages') cagebreak_man = custom_target('cagebreak_config_man', output : 'cagebreak-config.5', input : 'man/cagebreak-config.5.md', - command : [pandoc, '-i', '@INPUT@', '-o', '@OUTPUT@', '-f', 'markdown-smart', '-t', 'man', '-s'], + capture : true, + command : [sh, '-c', '@0@ < @INPUT@'.format(scdoc.path())], install: true, install_dir: mandir5 ) From 76afb942bd8abfa1b8c994b7493e82b299fe2dc3 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Wed, 5 May 2021 16:28:41 +0200 Subject: [PATCH 256/689] Add version section to man page scd --- man/cagebreak-config.5.md | 4 ++++ man/cagebreak.1.md | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index ef9b11b..0a3a4d0 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -211,6 +211,10 @@ is used. See GitHub Issues: +# VERSION + +1.7.1 + # LICENSE Copyright (c) 2020-2021 The Cagebreak authors diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index ed23c5f..4da4755 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -70,6 +70,10 @@ are displayed in a message box at the top right of the screen. See GitHub Issues: +# VERSION + +1.7.1 + # LICENSE Copyright (c) 2020-2021 The Cagebreak authors From 29de32832295adb9161ab64e8e2d5271dfa5eb8a Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Wed, 5 May 2021 16:40:55 +0200 Subject: [PATCH 257/689] Add version using scdoc syntax --- man/cagebreak-config.5.md | 6 +----- man/cagebreak.1.md | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index 0a3a4d0..ad8887b 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -1,4 +1,4 @@ -cagebreak-config(1) +cagebreak-config(1) "Version 1.7.1" "Cagebreak Manual" # NAME @@ -211,10 +211,6 @@ is used. See GitHub Issues: -# VERSION - -1.7.1 - # LICENSE Copyright (c) 2020-2021 The Cagebreak authors diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index 4da4755..7cb7df8 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -1,4 +1,4 @@ -cagebreak(1) +cagebreak(1) "Version 1.7.1" "Cagebreak Manual" # NAME @@ -70,10 +70,6 @@ are displayed in a message box at the top right of the screen. See GitHub Issues: -# VERSION - -1.7.1 - # LICENSE Copyright (c) 2020-2021 The Cagebreak authors From 907db16ebe8c8b93ccfb1cf48b7c6feef22e55fe Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Wed, 5 May 2021 17:47:26 +0200 Subject: [PATCH 258/689] Change wlroots version to prevent incompatibility --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 6c42fd3..fdabe24 100644 --- a/meson.build +++ b/meson.build @@ -53,7 +53,7 @@ if is_freebsd ) endif -wlroots = dependency('wlroots', version: '>= 0.13.0') +wlroots = dependency('wlroots', version: '< 0.14.0') wayland_protos = dependency('wayland-protocols', version: '>=1.14') wayland_server = dependency('wayland-server') wayland_cursor = dependency('wayland-cursor') From 6a4c0b7d160c2ed32940ccf32a8d24b68b470d73 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Wed, 5 May 2021 17:51:51 +0200 Subject: [PATCH 259/689] Add Issue 26 --- Bugs.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Bugs.md b/Bugs.md index 8072b7e..c9d9197 100644 --- a/Bugs.md +++ b/Bugs.md @@ -321,3 +321,23 @@ Starting from release 1.6.0, output configurations are copied before being inserted into the list of active output configurations and therefore remain valid even if the original is freed. +### Issue 26 + + * github issue number: #5 + * Fixed: 1.7.1 + +``` +Hello! + +I am, huh, a mere package maintainer. This is a simple suggestion: use scdoc to generate manpages, instead of pandoc. + +The advantages are: + + scdoc is tailored to generate manpages from markdown-like sources; + scdoc is smaller + scdoc has less dependencies +``` + +Cagebreak has always used pandoc to compile man pages. Cagebreak now uses scdoc +instead. + From d43094e4401e89da67260f0d5bf7946446177243 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Wed, 5 May 2021 18:44:56 +0200 Subject: [PATCH 260/689] Set wlroots version to 0.13.0 --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index fdabe24..1bd5ad9 100644 --- a/meson.build +++ b/meson.build @@ -53,7 +53,7 @@ if is_freebsd ) endif -wlroots = dependency('wlroots', version: '< 0.14.0') +wlroots = dependency('wlroots', version: '0.13.0') wayland_protos = dependency('wayland-protocols', version: '>=1.14') wayland_server = dependency('wayland-server') wayland_cursor = dependency('wayland-cursor') From d77c10ae5b92c5cdcc7bae1720460e31dd7deb02 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Wed, 5 May 2021 19:16:33 +0200 Subject: [PATCH 261/689] Add release hashes --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index 6648459..281e955 100644 --- a/README.md +++ b/README.md @@ -184,6 +184,23 @@ ninja -C build For every release after 1.0.5, hashes will be provided. +For every release after 1.7.0, hashes will be provided for man pages too. + +1.7.1 cagebreak + + * sha 256: 5a40797e016a2fa32b5bb70a056b35c482bef09f1795bbaf0188dbadaf8197c3 + * sha 512: 2ef327b63ac4651f23517be8d5cb8fbec99bd889f52f8abfd62a09ca6e6c0060347ab8d60e4917d39edd36db34597a673239967533f14457733acb97f6c29a7f + +1.7.1 cagebreak.1 + + * sha 256: 7a86cb8fc164f954b4cb77d9e3ab56eea1e7db54e8250f585cc88f6d64722ef2 + * sha 512: 3568ebdcea0b26130a36f18899c5fee79c93d506a591f91a096b2ddb60abf98b5e0b1a4e98fa7bec62b36c7a1782a0c5de4a36d8dc0f1707a41efff719e0249e + +1.7.1 cagebreak-config.1 + + * sha 256: fce9e53842d60a178361ed7b152ac7e64c75db8b916d8e52aadffecfa28a6e0c + * sha 512: b23591ad1e7f47056b7e05450197ba61435d1115652f560529eb62d93b0d132ae38df8df005010cb3abdf7aa182ba1173024d38d46f7bf170a32d65231f3781e + 1.7.0 * sha 256: 5af11b84e61a82a1a276e8f91f6ebc6baafd2c98d22be3da1d01734cc9d55faa From 090f1ca8f0023b12d6e300a591cfb8989b6e95b7 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Wed, 5 May 2021 20:08:03 +0200 Subject: [PATCH 262/689] Improve release checklist --- README.md | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 281e955..6df1ed9 100644 --- a/README.md +++ b/README.md @@ -122,6 +122,7 @@ occur. Once any failure occurs the entire checklist must be completed from scrat * [ ] wiki * [ ] README.md Changelog for major and minor releases but not patches * [ ] Fixed bugs documented in Bugs.md + * [ ] Include issue description from github * [ ] Testing * [ ] Manual testing * [ ] Libfuzzer testing @@ -129,26 +130,40 @@ occur. Once any failure occurs the entire checklist must be completed from scrat * [ ] meson.build * [ ] git tag * [ ] man pages - * [ ] `git add` relevant files - * [ ] `git commit` - * [ ] `git push origin development` * [ ] meson.build reproducible build versions are current archlinux libraries and gcc * [ ] Cagebreak is reproducible on multiple machines * [ ] Documented reproducible build artefacts - * [ ] Hashes of the binary - * [ ] Renamed cagebreak.sig to previous_release_tag.sig - * [ ] Signature of the binary as cagebreak.sig with appropriate signing key + * [ ] Hashes of the artefacts in README.md + * [ ] Renamed previous signatures + * [ ] Created gpg signature of the artefacts + * [ ] `gpg --detach-sign -u keyid cagebreak` + * [ ] `gpg --detach-sign -u keyid cagebreak.1` + * [ ] `gpg --detach-sign -u keyid cagebreak-config.5` + * [ ] `git add` relevant files + * [ ] `git commit` + * [ ] `git push origin development` * [ ] Determined commit and tag message (Start with "Release version_number\n\n") + * [ ] Mentioned fixed Bugs.md issues ("Fixed Issue n") + * [ ] Mentioned other important changes * [ ] `git checkout master` * [ ] `git merge --squash development` * [ ] `git commit` and insert message * [ ] `git tag -u keyid version HEAD` and insert message - * [ ] `git tag -v version` and check signing key + * [ ] `git tag -v version` and check output * [ ] `git push --tags origin master` * [ ] `git checkout development` * [ ] `git merge master` * [ ] `git push --tags origin development` * [ ] `git archive --prefix=cagebreak/ -o release_version.tar.gz tags/version .` + * [ ] Create release_artefacts_version.tar.gz + * [ ] `mkdir release_artefacts_version` + * [ ] `cp build/cagebreak release_artefacts_version/` + * [ ] `cp build/cagebreak.sig release_artefacts_version/` + * [ ] `cp build/cagebreak.1 release_artefacts_version/` + * [ ] `cp build/cagebreak.1.sig release_artefacts_version/` + * [ ] `cp build/cagebreak-config.5 release_artefacts_version/` + * [ ] `cp build/cagebreak-config.5.sig release_artefacts_version/` + * [ ] `export SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) ; tar --sort=name --mtime= --owner=0 --group=0 --numeric-owner -czf release_artefacts_version.tar.gz release_artefacts_version` * [ ] Checked archive * [ ] tar -xvf release_version.tar.gz * [ ] cd cagebreak @@ -158,7 +173,8 @@ occur. Once any failure occurs the entire checklist must be completed from scrat * [ ] cd .. * [ ] rm -rf cagebreak * [ ] `gpg --detach-sign -u keyid release_version.tar.gz` - * [ ] Upload archive and signature as release assets + * [ ] `gpg --detach-sign -u keyid release-artefacts_version.tar.gz` + * [ ] Upload archives and signatures as release assets ### Reproducible Builds From e299ec0363582b30af57d7ced3b00d0d4f93d682 Mon Sep 17 00:00:00 2001 From: project-repo Date: Wed, 5 May 2021 20:34:46 +0200 Subject: [PATCH 263/689] Restrict wlroots version in meson.build --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 1bd5ad9..446ec7b 100644 --- a/meson.build +++ b/meson.build @@ -53,7 +53,7 @@ if is_freebsd ) endif -wlroots = dependency('wlroots', version: '0.13.0') +wlroots = dependency('wlroots', version: ['>=0.13.0', '< 0.14.0']) wayland_protos = dependency('wayland-protocols', version: '>=1.14') wayland_server = dependency('wayland-server') wayland_cursor = dependency('wayland-cursor') From 5637cd7b6870e9a5ed7d090c6a2d0435289d6a77 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Wed, 5 May 2021 21:32:55 +0200 Subject: [PATCH 264/689] Add new file to README artefact check --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 6df1ed9..933bac5 100644 --- a/README.md +++ b/README.md @@ -163,6 +163,7 @@ occur. Once any failure occurs the entire checklist must be completed from scrat * [ ] `cp build/cagebreak.1.sig release_artefacts_version/` * [ ] `cp build/cagebreak-config.5 release_artefacts_version/` * [ ] `cp build/cagebreak-config.5.sig release_artefacts_version/` + * [ ] `cp LICENSE release_artefacts_version/` * [ ] `export SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) ; tar --sort=name --mtime= --owner=0 --group=0 --numeric-owner -czf release_artefacts_version.tar.gz release_artefacts_version` * [ ] Checked archive * [ ] tar -xvf release_version.tar.gz From 9cc701e2dc8887f832edd07a7391a8d058639cb2 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Wed, 5 May 2021 21:57:33 +0200 Subject: [PATCH 265/689] Add key hashes to README --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 933bac5..d44adaa 100644 --- a/README.md +++ b/README.md @@ -326,6 +326,8 @@ keys. * 827BC2320D535AEAD0540E6E2E66F65D99761A6F * A88D7431E5BAAD0B6EAE550AC8D61D8BD4FA3C46 * 8F872885968EB8C589A32E9539ACC012896D450F + * 896B92AF738C974E0065BF42F2576BD366156BB9 + * AA927AFD50AF7C6810E69FE8274F2C605359E31B Should we at any point retire a key, we will only replace it with keys signed by at least one of the above collection. @@ -413,11 +415,12 @@ security vulnerability or a different issue confidentially, contact We will try to respond to everything that is not obvious spam. -Please encrypt your email with the appropriate [GPG key](keys/cagebreak@project-repo.co.pub). +Please encrypt your email with the appropriate GPG key found in `keys/`. * B15B92642760E11FE002DE168708D42451A94AB5 + * F8DD9F8DD12B85A28F5827C4678E34D2E753AA3C -Note that the key is signed by cagebreak signing keys. +Note that the keys are signed by cagebreak signing keys. If you want us to respond via GPG-encrypted mail, please include your own public key or provide the fingerprint and directions to obtain the key. From da61cb7d2fbca8265047ed8505a1db154532a7d5 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Thu, 6 May 2021 09:44:56 +0200 Subject: [PATCH 266/689] Add new keys --- keys/cagebreak@project-repo.co.pub | 86 ++++++++++---- keys/cagebreak@project-repo.co.pub-legacy | 87 ++++++++++++++ ...gebreak_signing_key_5@project-repo.co.pub} | 0 ...gebreak_signing_key_6@project-repo.co.pub} | 0 ...agebreak_signing_key_7@project-repo.co.pub | 111 ++++++++++++++++++ ...agebreak_signing_key_8@project-repo.co.pub | 100 ++++++++++++++++ 6 files changed, 359 insertions(+), 25 deletions(-) create mode 100644 keys/cagebreak@project-repo.co.pub-legacy rename keys/{cagebreak_signing_key_5@project-repo.co => cagebreak_signing_key_5@project-repo.co.pub} (100%) rename keys/{cagebreak_signing_key_6@project-repo.co => cagebreak_signing_key_6@project-repo.co.pub} (100%) create mode 100644 keys/cagebreak_signing_key_7@project-repo.co.pub create mode 100644 keys/cagebreak_signing_key_8@project-repo.co.pub diff --git a/keys/cagebreak@project-repo.co.pub b/keys/cagebreak@project-repo.co.pub index 7ccde5b..6d23cef 100644 --- a/keys/cagebreak@project-repo.co.pub +++ b/keys/cagebreak@project-repo.co.pub @@ -59,29 +59,65 @@ DD2lecxTYfRIe7//h2TLmYLbLGc2neSMs+XN3DdxCAyJdm+IXGQbPbPmRmFEE+Qv B4QizKG4RK3mNq8yqyCgO2D9L2L8Xw7ASZGbxDD19gvGrbVoDreoc5wS31AJf8rW RT2YZY2fzXVVmUW0qax+TykOZ4yCYe4A3smhFBwjoKYYV69pAKMNVucTYISVc2D8 3ct6YqaObIQ7V0Ook9GEn7AURecEcuB23RUMikPnZAD911D2y6EnyGD5+9pH3ih9 -+rJ9ak1KDiYF505dvUMpEye1EntpctSgSYsTQjYO8H+5Ag0EXtN7+wEQANJ1JlUY -S6Zl55fMzW4+nU5RYcKSYKI+7qN8/YzYYjhWdIJyzEzhdxtHbo6yoyYyj1/gW6J7 -/4rqjKoTUsx4ZOlqxYmt3zDZMwTRXk2qyzOn4+0okFMiySTZztty1AN5kNNy4gY+ -LTdLEsKf5l4OlWxwEpu5zvy3A1iXTFczzo/rsPvdwDlZk+pAgpIx77yJHOnMH8eT -+VwO6fdCWter5szBI9IwPSKRw92mIZ/5G5Af9kHklVCqAD3ZW3dAUDhECArJAJ1L -QM5pJwC9ei2uIVZtl0a3+JMbPNDx7U7QL0I6GA2azivlvBFXMfmT+RDUELVL4x7m -yE1Q7wNptFY+H4KBmO1hXmgdjWOKTWnvYOdNNqMgxjCFws4ldGWX7OWrbSqqp2nT -kNKWghgSLOyA1NDQXtc/S5fJVoOxTEa/hm5xEclW552KUSHP0xaT+Kp5DaFZG5He -+6KSePcXw79nuQk1/HweLo+B8IzIK/dhnGmReFfBdFtid2FtAcoX/2BW8PHHTLD4 -EJiP6IN2jSbB0jQsWH512nBYEWHMmkx1SwMQeYbnI6ZtQhkMKa0YItIEM+XrUVRo -ZSWNIVa1btvduC/5rpFRNuTDdm6/LFX2UxssMA9JmZGNAcbJ1klx1GbFfbrYKOnE -/vTtznUSGWGwvlDVwFdwGDCVtDeW0LhUVEjXABEBAAGJAjwEGAEIACYWIQSxW5Jk -J2DhH+AC3haHCNQkUalKtQUCXtN7+wIbDAUJAeEzgAAKCRCHCNQkUalKtYsZD/9/ -TvKcBNCnLKJyFfAxANmE5Lb+OhxM0dpR95w7Y6g+Nzr3CV3K83rC/QcNSaibWskr -+/bkrEacooqD9Rf1fEJIrYbzlRfieJP+NMpwjkP06I7CUVuz3XtVhhT/y7jkoMOo -MuqGF6kBrlC20pcwNTafH1XzZb+BWMRwsix4p4iDiLbhskeLprFbJKSWjVXCj5Ea -3B+FP79TEu/1sM5ZHEdGw6eVNmj49IyB6xyBYORg5HffDGYvDo8KS/9Jv+Qhete4 -V7LtuzfNyIzWEvj7+IgCvYNJCLlsZQGcEKvCxXjCdWu7TpRrTXew+odMyC5xuFgN -LixM85cPuzNADPN7V3F7PnmHnOJp/u0WKW9q6VKzZu5sa4BaAqZUJ5kg3MRsDhth -QDK5a0y769tdaKZyDngEZUJLsh1UYXvwWOBVOqMfyeSIa2vMZFb3h5vHrURy411x -G6uLc6Cs7TT1/MnLyyzBCa5qfIXiDJeaX0VRVz3cc7yYOc3IVl07kUeBgUuf7KZ3 -ZFrlxS8ViwnlvbJ2RfsKKByrLLKwyhilzU+kk3WSlfR7UPokOn1eTTZKhQ/23/Lo -L+Ht/XhZR5+BmcPArb9gJiiDKuAxJIvDniPzmRL9hyvY6Unch/kwc5tqYYRayqvo -fbjQjF5PjGuwxS5IVgcQQacq49+JI9UXZCNVs5N5LA== -=ZN9o ++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 +LA== +=UJ+r -----END PGP PUBLIC KEY BLOCK----- diff --git a/keys/cagebreak@project-repo.co.pub-legacy b/keys/cagebreak@project-repo.co.pub-legacy new file mode 100644 index 0000000..7ccde5b --- /dev/null +++ b/keys/cagebreak@project-repo.co.pub-legacy @@ -0,0 +1,87 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mQINBF7Te/sBEADhW2ZdermfH8qbOrClJFiH33yrygi/GjcaQ+T+3co6GGpIGne7 +m5+7h2qTBaGkolAv+qIPm7XlWg6spbPynxG3GLqX5/gpvp23yCw9zm56mNXkVxAK +4YiKUVbO7Nq927U3iTM/+wbgeo4wq0gyY9E4wgYo7vjiCPnfpA1WK7KBSr3VwvJc +NxIwmSEkL7UOOsw0t0y01fdiEekHcopISpty70ZzMs0XFx9G5USe4O8W71E7isKx +s7XiG17HDCG46vumuRoBOC1NuWmag3VD7T0XFQtjXyqSObqRKwA3r7S2buakK3tp +FwqxQETTplx+Xo7Z/bO5TfoR0W0rTOaZXigtGVJ1k7nQrq45fqEJVV4vWOHA+Q4a +8CQJsZPWjFj3QujJvp2+l1M0C+h73GEAvw7pvPytAeqzoPgRDjm6SUVVkvG7jNMR +iqjqS6QyuwfK0e88un6Z8/MsYVHvt+dOMnvRKND57BL2ufWMIow1QdOR249/38FA +FP3oXldUJIKKi8emC/JZKqGomZFZtWZCYJtzBqWhnEtr3G9X8VfNdMkOaPRNNRkz +125i2kgzziXgII0rVatTPM+n3LPd9A8VSwXQPHUfd8aVv7uO7v/4LNXYqyjg+rUL +AJCS5dIYhDgHhBSHOxuZ379ZDPSVNBSoy5L1geHpO2lCLNnaCsWwSOkNkQARAQAB +tCVDYWdlYnJlYWsgPGNhZ2VicmVha0Bwcm9qZWN0LXJlcG8uY28+iQJUBBMBCAA+ +FiEEsVuSZCdg4R/gAt4WhwjUJFGpSrUFAl7Te/sCGwMFCQHhM4AFCwkIBwIGFQoJ +CAsCBBYCAwECHgECF4AACgkQhwjUJFGpSrUPERAAvr4fuZqXrM2FOEI1h0n1lUA4 +DpRwdK92VmqhJA1zQ375pXnmorSSWK1RZbxjqGS/PzBldTA/GCRsA+omsD4EC45L +nIabt2dKLmC8CZi8wI1R0nUng6ABs/o97euZ4Srgryi5hc2ViMDxXnJecTS1baoj +ajot9oOZlB0MSF0LIxGaaE8rcq8C26Q/6ibbD9KszS2Khzpsood2Oukx4rN/0VMC +UiN9UsjMH2EcXLzVBKTTDhcCWxJw/z00YS7iQzLrSZer0/+b8UqOy8tC7TRdjoUm +fzr84Ims6HG4GEeb1/OlHPELI8D5BKRAQCVDhOARzW47zrxKQbWfUONq7XaaxZVk +qvwhMXjoQ9SC8NhukCNJqkDZsIdi3e0hQ5HoJbUnS5aTnQnKfhdoYtmW+NB1XPIS +ZvPl0Fj5r5LfDWCalyo8riT8tuMWPy0kkbauYSA1gG6Hv5h8A/+3VD6YSws1e5is +UcY6joPZ0zzjn4RCCdpEmEIbPO8Wa8GsOn+0u+blA9D+mr8kCYBP5Xxtzn8y8uM3 +hVzpxYC872aTtHpq/VNFoQnVK7aKdPpQDak3l8iPrDcMsZwX3SVTI5lsFbxPfiYn +HEkcY0GhNE1hm8CMIrQSF0CiUhCGKTzb6BJXjr9T0GUI9LVPu5rGQSiDDYjrgY/4 +VIwguPJieWDlZMlroliJAjMEEAEIAB0WIQTnn22eETUp9LH/5NXE+XTXDOwsWwUC +XtOAmwAKCRDE+XTXDOwsWxGXD/98QVtd84G8ZOz/I+LE7Lvsz6XxAUJqInuYkQzq +8MGV/U3kVvsr8TF/ACGaktSr7ys/MRN83CYNsjLysJskm2x8uBbEZLgmamR2DoKj +vJH4ZDaMsepoE0qrFl5Sys6XvtG1BkpifCZrsnLtUoSFo9hdnfhkeAYwQdjSTk+Z +Nv4s4hlW4bqHcnV4E7Sy6sgDpyMYVWWuI104vRP7dcjIzv0dWOIc3PRGunB3fNuv +R649RVjCWnAsBAlM5KfhvEYjgA+0+NDayYiOxwKpdHV58BsWu6PXL4vpzOHjwNF1 +lWX3a6J8XSy8EgRP4pN+bGvOfjuMVm1PzHvf4Ij8uIE2piR1n3/BAQLuLSaU82mK +729pR+tuRRndv937rZ5LcfwSeevfzMBlYtef/xPX/H872Pwk9BCjs2ppIDRZWqml +iBde3oQjZl09UIx2GvKFJt5pkhZyP8ybV4qipDcJtHaKxMQ3BzbP6qnSTJbAbwPh +/qV4ysy/10dibxPk77DK7Flmnf5Hqdnf+uiKD1sappe4wuhdZqqPKneh2vCmbVlr +HkrnUpV6YlVHXyZCJw/0B2vBZGHAhgQElg3wvJUFftTTop646MR8NDITnYadyrNF +4DtABCfSMfHFVUyRr4Or/0SBxa0uKftgNy7n4/nFBQ1PicYKr+x25pTqGSbbLXAS +UO1NT4kCMwQQAQgAHRYhBHU1q4kiClwVpyi3X3QQTMfcpdeoBQJe04DRAAoJEHQQ +TMfcpdeoswQP/0BaaeCVFlaCPHTHJnb1I77R2nX8Y4ma/cxLTpKPcbk+yQ2211AL +rC3F6F4ta59l4opQzBBNKpl948Ts3QrOhj0TcIzpULkjipmhXk/kq9dTLudi6q23 +jZC5qaIYmzCI1+a0RL4bPo15/JjKEbWt6N/HoUL/rHfCa0b4mcfkC0iwOBWlUDl9 +tWv1VcEHgZOhtTnkpHnsp41QitTEN2Sr3CSef9/mmmWbwqPVNOjNh9/G/ci41ce1 +p4mz0/f471z5tNIRhOWDkbVo0XDVBvP1y7A47+8L/Ea4ep1f3/i9QwGyBt0Izaon +s8GMRWXI9KSN7SudjBXF8wonxIiIDF7u2PHzhbmdAfZTssr1jbwn7AVlxhDFSR8z +f4FlX7Mn6YAG94h6HN3qRo/c+E47XBqj9XmvFe0e+bWg9oar3rWGkVN+YzUaSgp3 +iNXRYQfQZbCHf7vTDzQZ8lWix7IBcAdoBgHl7d0RW4VNqbXISZvKMMTZK8WQVYYz +wcW9+Ll/fEwE8PGs5FolnynEg9YLLzj0OADSfaly/woqXUul14mWpM/gFsxQTyuQ +7n7xyAu5PImTjC7WzVMF9OAH35ng9u76bDkmwVfrMzGvKZ2DRsJQeNRUAd4EIM8S +6+ipTKNASzj4mCnURgS2zMplReE30icE8Vpol/ZYgC2qouS89nq29kLOiQIzBBAB +CAAdFiEEqI10MeW6rQturlUKyNYdi9T6PEYFAmABfQoACgkQyNYdi9T6PEbXxQ/+ +KUra7z1+lOoLKON0MhOG6TlEyiQNL6xjsnjC4GIo39QJcbGwDVmg3nZtY8gW29R2 +Uf1Ov7pJj0dUcCvyHlmaOD7kN/7KdKiMV3VQ8hBqHVDzd8n1PoF5iCEvMUBaBbmw +vDhSmjLX5B0Qh7Gp1Hn596R9BOtM8yr68m805fSY62HEe8H4eEoBEe/DLpObJwxY +KY2wnQIzsWUzOPmGIqoVDpffza+9wBSopk8feJvwYWtYGSD1PD6HyaQQV9IVcJTQ +SKgv1u/6ZVVnvbgdKBe0EAzaLTOzRDxUvEFbMre4r6v14Br7hNf9Zwi5Oz5yAeil +X54CkwEUkR/Wp8eiMsevQ+MCGIXp/XTDlBokrDt3gBHJ7iSyB92wophyxxm7fwu6 +DD2lecxTYfRIe7//h2TLmYLbLGc2neSMs+XN3DdxCAyJdm+IXGQbPbPmRmFEE+Qv +B4QizKG4RK3mNq8yqyCgO2D9L2L8Xw7ASZGbxDD19gvGrbVoDreoc5wS31AJf8rW +RT2YZY2fzXVVmUW0qax+TykOZ4yCYe4A3smhFBwjoKYYV69pAKMNVucTYISVc2D8 +3ct6YqaObIQ7V0Ook9GEn7AURecEcuB23RUMikPnZAD911D2y6EnyGD5+9pH3ih9 ++rJ9ak1KDiYF505dvUMpEye1EntpctSgSYsTQjYO8H+5Ag0EXtN7+wEQANJ1JlUY +S6Zl55fMzW4+nU5RYcKSYKI+7qN8/YzYYjhWdIJyzEzhdxtHbo6yoyYyj1/gW6J7 +/4rqjKoTUsx4ZOlqxYmt3zDZMwTRXk2qyzOn4+0okFMiySTZztty1AN5kNNy4gY+ +LTdLEsKf5l4OlWxwEpu5zvy3A1iXTFczzo/rsPvdwDlZk+pAgpIx77yJHOnMH8eT ++VwO6fdCWter5szBI9IwPSKRw92mIZ/5G5Af9kHklVCqAD3ZW3dAUDhECArJAJ1L +QM5pJwC9ei2uIVZtl0a3+JMbPNDx7U7QL0I6GA2azivlvBFXMfmT+RDUELVL4x7m +yE1Q7wNptFY+H4KBmO1hXmgdjWOKTWnvYOdNNqMgxjCFws4ldGWX7OWrbSqqp2nT +kNKWghgSLOyA1NDQXtc/S5fJVoOxTEa/hm5xEclW552KUSHP0xaT+Kp5DaFZG5He ++6KSePcXw79nuQk1/HweLo+B8IzIK/dhnGmReFfBdFtid2FtAcoX/2BW8PHHTLD4 +EJiP6IN2jSbB0jQsWH512nBYEWHMmkx1SwMQeYbnI6ZtQhkMKa0YItIEM+XrUVRo +ZSWNIVa1btvduC/5rpFRNuTDdm6/LFX2UxssMA9JmZGNAcbJ1klx1GbFfbrYKOnE +/vTtznUSGWGwvlDVwFdwGDCVtDeW0LhUVEjXABEBAAGJAjwEGAEIACYWIQSxW5Jk +J2DhH+AC3haHCNQkUalKtQUCXtN7+wIbDAUJAeEzgAAKCRCHCNQkUalKtYsZD/9/ +TvKcBNCnLKJyFfAxANmE5Lb+OhxM0dpR95w7Y6g+Nzr3CV3K83rC/QcNSaibWskr ++/bkrEacooqD9Rf1fEJIrYbzlRfieJP+NMpwjkP06I7CUVuz3XtVhhT/y7jkoMOo +MuqGF6kBrlC20pcwNTafH1XzZb+BWMRwsix4p4iDiLbhskeLprFbJKSWjVXCj5Ea +3B+FP79TEu/1sM5ZHEdGw6eVNmj49IyB6xyBYORg5HffDGYvDo8KS/9Jv+Qhete4 +V7LtuzfNyIzWEvj7+IgCvYNJCLlsZQGcEKvCxXjCdWu7TpRrTXew+odMyC5xuFgN +LixM85cPuzNADPN7V3F7PnmHnOJp/u0WKW9q6VKzZu5sa4BaAqZUJ5kg3MRsDhth +QDK5a0y769tdaKZyDngEZUJLsh1UYXvwWOBVOqMfyeSIa2vMZFb3h5vHrURy411x +G6uLc6Cs7TT1/MnLyyzBCa5qfIXiDJeaX0VRVz3cc7yYOc3IVl07kUeBgUuf7KZ3 +ZFrlxS8ViwnlvbJ2RfsKKByrLLKwyhilzU+kk3WSlfR7UPokOn1eTTZKhQ/23/Lo +L+Ht/XhZR5+BmcPArb9gJiiDKuAxJIvDniPzmRL9hyvY6Unch/kwc5tqYYRayqvo +fbjQjF5PjGuwxS5IVgcQQacq49+JI9UXZCNVs5N5LA== +=ZN9o +-----END PGP PUBLIC KEY BLOCK----- diff --git a/keys/cagebreak_signing_key_5@project-repo.co b/keys/cagebreak_signing_key_5@project-repo.co.pub similarity index 100% rename from keys/cagebreak_signing_key_5@project-repo.co rename to keys/cagebreak_signing_key_5@project-repo.co.pub diff --git a/keys/cagebreak_signing_key_6@project-repo.co b/keys/cagebreak_signing_key_6@project-repo.co.pub similarity index 100% rename from keys/cagebreak_signing_key_6@project-repo.co rename to keys/cagebreak_signing_key_6@project-repo.co.pub diff --git a/keys/cagebreak_signing_key_7@project-repo.co.pub b/keys/cagebreak_signing_key_7@project-repo.co.pub new file mode 100644 index 0000000..095a236 --- /dev/null +++ b/keys/cagebreak_signing_key_7@project-repo.co.pub @@ -0,0 +1,111 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +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 +=dSMz +-----END PGP PUBLIC KEY BLOCK----- diff --git a/keys/cagebreak_signing_key_8@project-repo.co.pub b/keys/cagebreak_signing_key_8@project-repo.co.pub new file mode 100644 index 0000000..329266f --- /dev/null +++ b/keys/cagebreak_signing_key_8@project-repo.co.pub @@ -0,0 +1,100 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +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 +Hg== +=Mxxt +-----END PGP PUBLIC KEY BLOCK----- From bfa667503ec303dd09cf9abe4368c34be1c0037d Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Thu, 6 May 2021 10:49:45 +0200 Subject: [PATCH 267/689] Make man pages reproducible --- README.md | 1 + meson.build | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d44adaa..4fbfce5 100644 --- a/README.md +++ b/README.md @@ -119,6 +119,7 @@ occur. Once any failure occurs the entire checklist must be completed from scrat * [ ] man pages * [ ] man/cagebreak * [ ] man/cagebreak-config + * [ ] Set EPOCH to release day in man generation in meson.build * [ ] wiki * [ ] README.md Changelog for major and minor releases but not patches * [ ] Fixed bugs documented in Bugs.md diff --git a/meson.build b/meson.build index 446ec7b..5ab89cb 100644 --- a/meson.build +++ b/meson.build @@ -257,7 +257,7 @@ if get_option('man-pages') output : 'cagebreak.1', input : 'man/cagebreak.1.md', capture : true, - command : [sh, '-c', '@0@ < @INPUT@'.format(scdoc.path())], + command : [sh, '-c', 'export SOURCE_DATE_EPOCH=1620290471 ; @0@ < @INPUT@'.format(scdoc.path())], install: true, install_dir: mandir1 ) @@ -266,7 +266,7 @@ if get_option('man-pages') output : 'cagebreak-config.5', input : 'man/cagebreak-config.5.md', capture : true, - command : [sh, '-c', '@0@ < @INPUT@'.format(scdoc.path())], + command : [sh, '-c', 'export SOURCE_DATE_EPOCH=1620290471 ; @0@ < @INPUT@'.format(scdoc.path())], install: true, install_dir: mandir5 ) From 09571f674395e81444c7d8ff3ea6610ff05f2e78 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Thu, 6 May 2021 11:17:57 +0200 Subject: [PATCH 268/689] Update man page hashes --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4fbfce5..12afc72 100644 --- a/README.md +++ b/README.md @@ -211,13 +211,13 @@ For every release after 1.7.0, hashes will be provided for man pages too. 1.7.1 cagebreak.1 - * sha 256: 7a86cb8fc164f954b4cb77d9e3ab56eea1e7db54e8250f585cc88f6d64722ef2 - * sha 512: 3568ebdcea0b26130a36f18899c5fee79c93d506a591f91a096b2ddb60abf98b5e0b1a4e98fa7bec62b36c7a1782a0c5de4a36d8dc0f1707a41efff719e0249e + * sha 256: 0301f04254ae6e7ada7e22bbe7aee022ec0793fbce434a396868258e6f1ea4cf + * sha 512: f0c0c5de30be907e9ba5c9cfa0bca8cef3e94c0b5f52de9e2c3681c85aa957f75e92b5e26bb894c3a5e251295cfe7a1470653cc7dc05564d7d91c6eb43b7409a 1.7.1 cagebreak-config.1 - * sha 256: fce9e53842d60a178361ed7b152ac7e64c75db8b916d8e52aadffecfa28a6e0c - * sha 512: b23591ad1e7f47056b7e05450197ba61435d1115652f560529eb62d93b0d132ae38df8df005010cb3abdf7aa182ba1173024d38d46f7bf170a32d65231f3781e + * sha 256: 6882330a77f3ff98ea642f47b4090b38d542abf0b7be3f226486c5614899efc6 + * sha 512: a572f97836e4ccc6d67aa21c7f4aaebe06adb066c70038b670ec1ef267e3750764cb53e96b8d7bc24c7f993f24c0cfabee183307b45006d049f7416559bcaca4 1.7.0 From 731f09dc8170b32354ddf9aa26d862cb9a1ac6db Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Thu, 6 May 2021 14:14:49 +0200 Subject: [PATCH 269/689] Add signatures --- signatures/1.7.0.sig | Bin 0 -> 566 bytes signatures/cagebreak-config.5.sig | Bin 0 -> 566 bytes signatures/cagebreak.1.sig | Bin 0 -> 566 bytes signatures/cagebreak.sig | Bin 566 -> 566 bytes 4 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 signatures/1.7.0.sig create mode 100644 signatures/cagebreak-config.5.sig create mode 100644 signatures/cagebreak.1.sig diff --git a/signatures/1.7.0.sig b/signatures/1.7.0.sig new file mode 100644 index 0000000000000000000000000000000000000000..eebdb6c01632b5259c0205a684c383633f5549ac GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j+vjdU^Px~&Utu2l-i)*Xw~`aDJj0$_dPtpExM5XjaY zi`4o&Mh}e-`T`o4ULXweNtm;eZi*BT+?uxpBlo2G8nqiK^rW*=>GC*5(XVq4gD2g7 zdQb2F!&@uUUs{NxuL9~q1q@Qqn9*YS{DV)>Du|zxbe3gaDIIhlw&S--YpB&Bx*ILL z4PgN$(^vR}hb-I-l1ZcjB>jzcV~Gf$&_Qq`x(!!Kn3ehYl%N>v!LYdoV`>S=iyDZk zmI(>E47u}}r}KFtBf89#Xr=vuW^ITlbVCls3klEZ>r<%_S#;ABu6Gl+f=&aE*vl7z zf6`Rp)QDae$k%aIw>#HB>W?#Vbj?@dUe0j^_75+GNZU8p@C0Q>+0MbHCbc8$cCN2( zeK==36@yY3Mc}=PS%E5f8mM7u7JE-T-o)w+eQ_pZr?}b6(1l^qS(^?;l|@^LST@@_ zOnaEMqFPLDn!h5n;c{Z92Mj%r!!A}<>*^9dVeA^!z*2{xpp?Nu#weckIpD;^8W&1@)o_fnbGxt^d|*D0JD`s`x4d7l-MYN zmTk+$z`~MDbFQyDBF1-8wvn~KK;Tb&q(qiN)qh{$4I^b+m-C0|Ue0|WX6B)`L3}j` z%3;f)1rP=Swbc6dQ7{&U&dum3Jn3>u{thc)FI8jk^R(YNq;VFJ@1U1pP?1b!OD``l EXjF(OTWxqo5S8LN|6>GT#0$`Kfg8&K%5b{@R z(`FTGx&0px|9>xu{GD6iVTW~8P}kb-3=HX+F>p!hKhFT!))}4xau~K zT4#YLj}p1#D_6m2=IPtYIg)=hpY7D7xVvX3`&b><{U46v=4a4!biL@jlMtsfUQiTc z_?bfpxdQHcPHJgR=C_wsx)V9{!nh>)d1v_ZgNgcQBFvz=mwB-c`fon$Rt6Z!X*8uQ zk(Mz*S575beXXj$DB;i*CDcDFCB|;Dsw;-&{8ZZbMDH@EW6J0T_D3u9=6KPtM_svzoY#;Dl$kf=`U_7w^Uhj`f^Z;x z4#=u9k}uPLN|hb`ZH=p`pl(($A=WiHo9FO5YBfx>h>;SN@W&v{wYB{vikZiLbFpUC zwYM)&N;~Dt6pVE{jn<99T48fc|C?%kU5W;E-()!@6N6&O(KNJ*-c{Dxdml7&6PuC~ z%%LAx8(=i97k+_qwzc7>d=Mq$dK|<-XD8=;xHvCjHZs&mCR)gH!6zG6ta0Z0fa6$| zX;9IS2{!Vo4AdRvexpx(3x*;3U2`ykvKA)f`LdZ{@mOvAyihx6ZqQ2=((Wn2dqUf* Ekg-4*JOBUy literal 0 HcmV?d00001 diff --git a/signatures/cagebreak.1.sig b/signatures/cagebreak.1.sig new file mode 100644 index 0000000000000000000000000000000000000000..35c9e1fff161db252d357169221ca1efb27a12fb GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j+QYm%>XjF(OTWxqo5S8LN|6>GT#0$`KffB*^!5b{@R z(`FTGxzhI!|6I&i))J**1ZIN%ZT$C`Pe^XB>9;7-8;jFX;e_Lgogk%{BEu%Q4Eddxm-XfW+ zUBYl-ZM)m5J41j*57;YPIu_+r<_1IeEJc{Va5cX6RV`qB(DK$B2%f-S2a zOY&9eNicETY&M38E?(T+I%Z@|XGL4E-$C)}KLq5D@rNr_&qE#-9G)9iFqiSjzcCU2`JZpQc;c|m6;-uJXi@dKV)Ya_ zf5*;o$ru<~#T9==&E{}M8OtM({rcF80@WaCq$Gay6x|o E1;scJBme*a literal 0 HcmV?d00001 diff --git a/signatures/cagebreak.sig b/signatures/cagebreak.sig index eebdb6c01632b5259c0205a684c383633f5549ac..e54765f6c6c28bb2ed7051dae7aa3969664c8233 100644 GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j+QYm%>XjF(OTWxqo5S8LN|6>GT#0$`KfY5)oe5b{@R z(`FTGxeCD#|4k*{A>dJ^GyMV&@)`PVzMF((5;{)zxmH|Mk-jQkg!M5f#|GIF55dwnY9$2(~}XIG>sxz z#5Zy8t>xiRR!JYD_}J>Nv3P_R}I^?#FiXb&ApO$1@g3HjuMI zv&{N3ckF)SoN!86Z-3Ti#cyzTcs5S@0qMci_m_OlK^qR-Ykxf`uN{NUVHv;l^V1>i zNB+V=6AhDE%d5~qCkmv%s4^8sd%hU+a}El^dIP(!*6YnJN#*UpiY@JLVDsDB7SgYD znBo&Tb~nW1iQ_Q@aU4iRa$2^!vVqc#Nq0BtY1(OUGFVz8&9AZ|H=dJ<|N1QbyV%gl z7sLGt)QkG&JJ?C Ey)k$iFaQ7m literal 566 zcmV-60?GY}0y6{v0SEvc79j+vjdU^Px~&Utu2l-i)*Xw~`aDJj0$_dPtpExM5XjaY zi`4o&Mh}e-`T`o4ULXweNtm;eZi*BT+?uxpBlo2G8nqiK^rW*=>GC*5(XVq4gD2g7 zdQb2F!&@uUUs{NxuL9~q1q@Qqn9*YS{DV)>Du|zxbe3gaDIIhlw&S--YpB&Bx*ILL z4PgN$(^vR}hb-I-l1ZcjB>jzcV~Gf$&_Qq`x(!!Kn3ehYl%N>v!LYdoV`>S=iyDZk zmI(>E47u}}r}KFtBf89#Xr=vuW^ITlbVCls3klEZ>r<%_S#;ABu6Gl+f=&aE*vl7z zf6`Rp)QDae$k%aIw>#HB>W?#Vbj?@dUe0j^_75+GNZU8p@C0Q>+0MbHCbc8$cCN2( zeK==36@yY3Mc}=PS%E5f8mM7u7JE-T-o)w+eQ_pZr?}b6(1l^qS(^?;l|@^LST@@_ zOnaEMqFPLDn!h5n;c{Z92Mj%r!!A}<>*^9dVeA^!z*2{xpp?Nu#weckIpD;^8W&1@)o_fnbGxt^d|*D0JD`s`x4d7l-MYN zmTk+$z`~MDbFQyDBF1-8wvn~KK;Tb&q(qiN)qh{$4I^b+m-C0|Ue0|WX6B)`L3}j` z%3;f)1rP=Swbc6dQ7{&U&dum3Jn3>u{thc)FI8jk^R(YNq;VFJ@1U1pP?1b!OD``l E Date: Mon, 10 May 2021 21:43:08 +0200 Subject: [PATCH 270/689] Fix typos in README --- README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 12afc72..888639c 100644 --- a/README.md +++ b/README.md @@ -156,16 +156,16 @@ occur. Once any failure occurs the entire checklist must be completed from scrat * [ ] `git merge master` * [ ] `git push --tags origin development` * [ ] `git archive --prefix=cagebreak/ -o release_version.tar.gz tags/version .` - * [ ] Create release_artefacts_version.tar.gz - * [ ] `mkdir release_artefacts_version` - * [ ] `cp build/cagebreak release_artefacts_version/` - * [ ] `cp build/cagebreak.sig release_artefacts_version/` - * [ ] `cp build/cagebreak.1 release_artefacts_version/` - * [ ] `cp build/cagebreak.1.sig release_artefacts_version/` - * [ ] `cp build/cagebreak-config.5 release_artefacts_version/` - * [ ] `cp build/cagebreak-config.5.sig release_artefacts_version/` - * [ ] `cp LICENSE release_artefacts_version/` - * [ ] `export SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) ; tar --sort=name --mtime= --owner=0 --group=0 --numeric-owner -czf release_artefacts_version.tar.gz release_artefacts_version` + * [ ] Create release-artefacts_version.tar.gz + * [ ] `mkdir release-artefacts_version` + * [ ] `cp build/cagebreak release-artefacts_version/` + * [ ] `cp build/cagebreak.sig release-artefacts_version/` + * [ ] `cp build/cagebreak.1 release-artefacts_version/` + * [ ] `cp build/cagebreak.1.sig release-artefacts_version/` + * [ ] `cp build/cagebreak-config.5 release-artefacts_version/` + * [ ] `cp build/cagebreak-config.5.sig release-artefacts_version/` + * [ ] `cp LICENSE release-artefacts_version/` + * [ ] `export SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) ; tar --sort=name --mtime= --owner=0 --group=0 --numeric-owner -czf release-artefacts_version.tar.gz release-artefacts_version` * [ ] Checked archive * [ ] tar -xvf release_version.tar.gz * [ ] cd cagebreak From a8f2a7940d9eb854217cb47ff6055ad944a5c2cb Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 3 Date: Mon, 10 May 2021 21:43:29 +0200 Subject: [PATCH 271/689] Update LICENSE --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 75d5a15..bd31b7d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2020 The Cagebreak authors +Copyright (c) 2020-2021 The Cagebreak authors Copyright (c) 2018-2020 Jente Hidskes Copyright (c) 2019 The Sway authors From b97ba95ee930bf453eaa6ee41710dc32d9872cc1 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Mon, 17 May 2021 22:03:32 +0200 Subject: [PATCH 272/689] Update compiler dependency --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 5ab89cb..de8db67 100644 --- a/meson.build +++ b/meson.build @@ -230,7 +230,7 @@ foreach name, dep : cagebreak_dependencies_dict endforeach reproducible_build_compiler = 'gcc' -reproducible_build_compiler_version = '10.2.0' +reproducible_build_compiler_version = '11.1.0' if cc.get_id() != reproducible_build_compiler warning('The compiler "' + cc.get_id() + '" differs from the one used to generate to binary specified in the README section "Reproducible Builds" (' + reproducible_build_compiler + ').') From 054a8cc49fa1dec6276000e89da962c1c8f8cf07 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Mon, 17 May 2021 22:03:54 +0200 Subject: [PATCH 273/689] Update meson version --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index de8db67..2fc71e8 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('cagebreak', 'c', - version: '1.7.1', + version: '1.7.2', license: 'MIT', default_options: [ 'c_std=c11', From fec0e24206293e5ef177dba421c0618e902d4da2 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Mon, 17 May 2021 22:06:22 +0200 Subject: [PATCH 274/689] Update man versions --- man/cagebreak-config.5.md | 2 +- man/cagebreak.1.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index ad8887b..557cbac 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -1,4 +1,4 @@ -cagebreak-config(1) "Version 1.7.1" "Cagebreak Manual" +cagebreak-config(1) "Version 1.7.2" "Cagebreak Manual" # NAME diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index 7cb7df8..d0e67db 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -1,4 +1,4 @@ -cagebreak(1) "Version 1.7.1" "Cagebreak Manual" +cagebreak(1) "Version 1.7.2" "Cagebreak Manual" # NAME From ffc922e6b08ae0d26dd6c3b2414a70f701f1d1f9 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Tue, 18 May 2021 10:00:04 +0200 Subject: [PATCH 275/689] Adapt man page epoch --- meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 2fc71e8..2e5c248 100644 --- a/meson.build +++ b/meson.build @@ -257,7 +257,7 @@ if get_option('man-pages') output : 'cagebreak.1', input : 'man/cagebreak.1.md', capture : true, - command : [sh, '-c', 'export SOURCE_DATE_EPOCH=1620290471 ; @0@ < @INPUT@'.format(scdoc.path())], + command : [sh, '-c', 'export SOURCE_DATE_EPOCH=1621324686 ; @0@ < @INPUT@'.format(scdoc.path())], install: true, install_dir: mandir1 ) @@ -266,7 +266,7 @@ if get_option('man-pages') output : 'cagebreak-config.5', input : 'man/cagebreak-config.5.md', capture : true, - command : [sh, '-c', 'export SOURCE_DATE_EPOCH=1620290471 ; @0@ < @INPUT@'.format(scdoc.path())], + command : [sh, '-c', 'export SOURCE_DATE_EPOCH=1621324686 ; @0@ < @INPUT@'.format(scdoc.path())], install: true, install_dir: mandir5 ) From 3f2e386b4bce9f2ff47cc9a8d5cc5dff2eba34a9 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Tue, 18 May 2021 10:11:40 +0200 Subject: [PATCH 276/689] Add release hashes --- README.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 888639c..7b722f4 100644 --- a/README.md +++ b/README.md @@ -204,6 +204,21 @@ For every release after 1.0.5, hashes will be provided. For every release after 1.7.0, hashes will be provided for man pages too. +1.7.2 cagebreak + + * sha 256: 40f4642e8e8caee338055079b046f6e0b790c87226ee307b27a64fcb2a6c6472 + * sha 512: 22c5f1986ca4262a7c08a6c03cffe36eaedd8c3c5e27e12baf12a90f94aea088ac93ee107770f162fc70148be687f6394b8fd64ad3fe14414bdf63b55b33798e + +1.7.2 cagebreak.1 + + * sha 256: 3253e592c40c78fd3733c761163acc2efaaf5865627cf51fd33cc0bc5d9cc6e7 + * sha 512: 901305e166c10aa7e4a26b721a69e0ba4779f4f8ee690551438ceadae65929f13949457872b9397dd46c5b7bad6a6f2638d6fd6df9bc5567c914c798cbf3e9a4 + +1.7.2 cagebreak-config.5 + + * sha 256: 148ec4d80dc9a86485fe77f8daf1f7fa4cb3d1b6aaa709bb012005583779e1f7 + * sha 512: d5732572e47dd07078ac2f6d589522e6007188fc05ac79520c93442212d5c0341459f135191b88c608a75b2f56c2de4065566bd869fbc24e475936d32a54a7f8 + 1.7.1 cagebreak * sha 256: 5a40797e016a2fa32b5bb70a056b35c482bef09f1795bbaf0188dbadaf8197c3 @@ -214,7 +229,7 @@ For every release after 1.7.0, hashes will be provided for man pages too. * sha 256: 0301f04254ae6e7ada7e22bbe7aee022ec0793fbce434a396868258e6f1ea4cf * sha 512: f0c0c5de30be907e9ba5c9cfa0bca8cef3e94c0b5f52de9e2c3681c85aa957f75e92b5e26bb894c3a5e251295cfe7a1470653cc7dc05564d7d91c6eb43b7409a -1.7.1 cagebreak-config.1 +1.7.1 cagebreak-config.5 * sha 256: 6882330a77f3ff98ea642f47b4090b38d542abf0b7be3f226486c5614899efc6 * sha 512: a572f97836e4ccc6d67aa21c7f4aaebe06adb066c70038b670ec1ef267e3750764cb53e96b8d7bc24c7f993f24c0cfabee183307b45006d049f7416559bcaca4 From 6db4c0edd398c6b0122d1812247669a73a3422dd Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Tue, 18 May 2021 10:26:00 +0200 Subject: [PATCH 277/689] Add release signatures --- signatures/cagebreak-config.5.sig | Bin 566 -> 566 bytes signatures/cagebreak.1.sig | Bin 566 -> 566 bytes signatures/cagebreak.sig | Bin 566 -> 566 bytes 3 files changed, 0 insertions(+), 0 deletions(-) diff --git a/signatures/cagebreak-config.5.sig b/signatures/cagebreak-config.5.sig index 048473eac0b262e824d8812c1ca7fa06c0184947..a6facb1580b1819d97dd3764826ac1821d2886ea 100644 GIT binary patch delta 542 zcmV+(0^$9(1hxc_BY&fLq5ujB5b{@R(`FTGxlm&e0Ezk^P>5zd!hf!r@yeS>jieWa zc0Cpb-e<~&!YgQ{AI?`Cxg*T7SamE(z=7VpF$v=?t$}oh4>7A?y2WYhYIL91sR6gg zgb4t|cDvVmUo_YB^fIgCky6KtC;l{WeJZ?)QcqYN^9hH%M433Pp@4h%{$`iE^`~ zSOYIEzkLrk3y`Bf*C592JRJ z^->cF(CT;>htKJkn1j5ly6b8RQA>U0kmXVohZqUl(M1zgcg!H;ZN6%8*(46*{IMOw z&l+CgcPv6#e@1LUrTp7R?MPmhI$bve*2 z<{lv|{8Qj}uNd4)%k!jbxu{GD6iVTW~8P}kb-3=HX+ zF>p!hKhFT!))}4xau~KT4#YLj}p1#D_6m2=6~ti$~lsMHJ|O&q`13h zC;M0(*Zm)k;^t@2bacJwyps^8GhR>>WB8dv2)P38droR;PUg3lRk{;7^uo9#`FUsf z^Mi@{XClm?x|eye4*G9C>{bRC$!RpDERmKmL03*CT79jmzbN6*6(!U^D<#HmvgJ;- zK{rm;b1iU=GJjCr#I{{~X~e(UC(0Lu?usm1OL(d)hUNTJ+W188GN)t8=mz#jEA-}g z(XdBdxrvjA2f3lo01dEp&wWqU^K25et~kfwc)3H5GCV!9K=Cq zC+B>)I4@#0GSo;WTF7$2CmUC+apwAf<5-nxP|=VHHu9mOJkr-Z?d~gk0g|<4FM%hgD@Iw!n=Mn>-pt%8kLu<_8Ay zye|Z`Vk#~0-S_~Psw-Vyj5yg?Nc!|(mpWZ;^aHThe3}U_y9NiCbj<&p4#<-m@SRj- zgC5ok#}tEJ1 zDU<@2NL8E}uRYf5i16?+SNj)m=lk7b4DtW;ybek>mq%F$h*!nf52?R{OghwX|B#^u go+M3}-WNrBT^!ho@~;C2lKp7BobEu~5FXkL`FO+#kN^Mx delta 542 zcmV+(0^$9(1hxc_BY%_KfB*^!5b{@R(`FTGxzhI!|6I&i))J**1ZIN%ZT$C`Pe^XB>9;7-8 z;jFX;e_Lgogk%{BEu%Q4Eddxm-XfW+UBYl-ZM)m5J41j*5`RG26*b|P1K~!s1^8mu z#skTo{CPGqBX@D3Kl;)PGeDD2a)K?Z9!v67=}9ng+-x?6i7sB;+&X4tO=m@0u-}#X zNl#C%D+&Zc&DZ@kQD)9_LIL~uV9--dQI?{7Dn<>c_mCzI0e|Gb%xue`T6q9w9huCoEr6wN%5xAvgtf)SV zp&sn{N_e0as0`mMR%%E!trj zM0H-64|AS9zmsN7wD6WkpvPSx{boIgzd-GxqMq{L+=dVl`83pWRw+Z2PWG92bwp-m gh71Pa1Q#&^)j<0ubuBB{>0@WaCq$Gay6x|o1&PoJF8}}l diff --git a/signatures/cagebreak.sig b/signatures/cagebreak.sig index e54765f6c6c28bb2ed7051dae7aa3969664c8233..5fd3ee9f60a885a1a5422ca86c7945f77100e011 100644 GIT binary patch delta 542 zcmV+(0^$9(1hxc_BY&fLm;ee15b{@R(`FTGxpxW={yodLLp2tJkG}*QcXVHQU?pSP z#N@hP(M_C(waaF}hk4>#h&O>`Du)l)OPkaqvom1YM4_yW;uvV+t>I9&KOU+CeYW)C z(`i?UVF3$yKNkkrel|6yo2z^B%Kve_`!99pAjXuJ*!rh8zkj#So4WPbH`Jlc0X

gC4FS%@;2l-1`hkf~1Wq>ut45xqzasU7T delta 542 zcmV+(0^$9(1hxc_BY%_KY5)oe5b{@R(`FTGxeCD#|4k*{A>dJ^GyMV&@)`PVzMF((5;{)zxmH|Mk-jQ zkg!M5f#|GIF55dwnY9$2(~}XIG>sxz#5Zy8t>xiRR!JYD_F9mKdft5(zB4wV%e+!7>5RlW7y}T6c{l&{MW@qdeNLbJ^JGI#8Lc-FS|iP`vLZL0lZyZPEd9IK(8(9W{Rz~J4S%hFlwhkEpF}(+MXU(Rz}pfx zpwN|^3tgc~FuDG&JJ?Cy%+)$I{*Lx From d57869d43add58331386fc8e89c14bb2b74afe17 Mon Sep 17 00:00:00 2001 From: project-repo Date: Wed, 23 Jun 2021 20:53:48 +0200 Subject: [PATCH 278/689] Add fixes for wlroots 0.14.0 --- meson.build | 2 +- message.c | 10 ++++++++-- view.c | 6 +++++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index 2e5c248..b123f0b 100644 --- a/meson.build +++ b/meson.build @@ -53,7 +53,7 @@ if is_freebsd ) endif -wlroots = dependency('wlroots', version: ['>=0.13.0', '< 0.14.0']) +wlroots = dependency('wlroots', version: ['>=0.14.0', '< 0.15.0']) wayland_protos = dependency('wayland-protocols', version: '>=1.14') wayland_server = dependency('wayland-server') wayland_cursor = dependency('wayland-cursor') diff --git a/message.c b/message.c index acf1ffc..e90593d 100644 --- a/message.c +++ b/message.c @@ -108,11 +108,17 @@ message_set_output(struct cg_output *output, const char *string, return; } message->message = create_message_texture(string, output); + if(!message->message) { + wlr_log(WLR_ERROR, "Could not create message texture"); + free(box); + free(message); + return; + } message->position = box; wl_list_insert(&output->messages, &message->link); - int width, height; - wlr_texture_get_size(message->message, &width, &height); + int width=message->message->width; + int height=message->message->height; message->position->width = width; message->position->height = height; switch(align) { diff --git a/view.c b/view.c index 410a746..a7116b6 100644 --- a/view.c +++ b/view.c @@ -337,7 +337,11 @@ view_map(struct cg_view *view, struct wlr_surface *surface, view->wlr_surface = surface; struct wlr_subsurface *subsurface; - wl_list_for_each(subsurface, &view->wlr_surface->subsurfaces, parent_link) { + wl_list_for_each(subsurface, &view->wlr_surface->subsurfaces_above, parent_link) { + subsurface_create(NULL, view, subsurface); + } + + wl_list_for_each(subsurface, &view->wlr_surface->subsurfaces_below, parent_link) { subsurface_create(NULL, view, subsurface); } From e4ebc1e292d553d6ceb4e9469596ce541c823efa Mon Sep 17 00:00:00 2001 From: project-repo Date: Wed, 23 Jun 2021 20:58:42 +0200 Subject: [PATCH 279/689] Apply clang-format --- message.c | 4 ++-- view.c | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/message.c b/message.c index e90593d..2ff2075 100644 --- a/message.c +++ b/message.c @@ -117,8 +117,8 @@ message_set_output(struct cg_output *output, const char *string, message->position = box; wl_list_insert(&output->messages, &message->link); - int width=message->message->width; - int height=message->message->height; + int width = message->message->width; + int height = message->message->height; message->position->width = width; message->position->height = height; switch(align) { diff --git a/view.c b/view.c index a7116b6..19ae2ad 100644 --- a/view.c +++ b/view.c @@ -337,11 +337,13 @@ view_map(struct cg_view *view, struct wlr_surface *surface, view->wlr_surface = surface; struct wlr_subsurface *subsurface; - wl_list_for_each(subsurface, &view->wlr_surface->subsurfaces_above, parent_link) { + wl_list_for_each(subsurface, &view->wlr_surface->subsurfaces_above, + parent_link) { subsurface_create(NULL, view, subsurface); } - wl_list_for_each(subsurface, &view->wlr_surface->subsurfaces_below, parent_link) { + wl_list_for_each(subsurface, &view->wlr_surface->subsurfaces_below, + parent_link) { subsurface_create(NULL, view, subsurface); } From cb049d7ab55ad8a17f90ff5d9620c6670ad73848 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Fri, 25 Jun 2021 22:54:26 +0200 Subject: [PATCH 280/689] Prepare 1.7.3 --- README.md | 7 +++++++ man/cagebreak-config.5.md | 2 +- man/cagebreak.1.md | 2 +- meson.build | 6 +++--- signatures/1.7.1-cagebreak-config.5.sig | Bin 0 -> 566 bytes signatures/1.7.1-cagebreak.1.sig | Bin 0 -> 566 bytes signatures/1.7.1.sig | Bin 0 -> 566 bytes ...-config.5.sig => 1.7.2-cagebreak-config.5.sig} | Bin .../{cagebreak.1.sig => 1.7.2-cagebreak.1.sig} | Bin signatures/{cagebreak.sig => 1.7.2.sig} | Bin 10 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 signatures/1.7.1-cagebreak-config.5.sig create mode 100644 signatures/1.7.1-cagebreak.1.sig create mode 100644 signatures/1.7.1.sig rename signatures/{cagebreak-config.5.sig => 1.7.2-cagebreak-config.5.sig} (100%) rename signatures/{cagebreak.1.sig => 1.7.2-cagebreak.1.sig} (100%) rename signatures/{cagebreak.sig => 1.7.2.sig} (100%) diff --git a/README.md b/README.md index 7b722f4..63f1543 100644 --- a/README.md +++ b/README.md @@ -331,6 +331,13 @@ For every release after 1.0.5, a GPG signature will be provided in `signatures`. The current signature is called `cagebreak.sig`, whereas all older signatures will be named after their release version. +Due to errors in the release process, the releases 1.7.1 and 1.7.2 did not include the release +signatures in the appropriate folder of the git repository. However, signatures were provided +as release-artefacts at the time of release. The signatures were introduced into the +repository with 1.7.3. The integrity of cagebreak is still the same because the signatures were +provided as release-artefacts (which were themselves signed) and the hashes in README.md +are part of a signed release tag. + #### Signing Keys All releases are signed by at least one of the following collection of diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index 557cbac..c3447fd 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -1,4 +1,4 @@ -cagebreak-config(1) "Version 1.7.2" "Cagebreak Manual" +cagebreak-config(1) "Version 1.7.3" "Cagebreak Manual" # NAME diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index d0e67db..2b4514f 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -1,4 +1,4 @@ -cagebreak(1) "Version 1.7.2" "Cagebreak Manual" +cagebreak(1) "Version 1.7.3" "Cagebreak Manual" # NAME diff --git a/meson.build b/meson.build index 2e5c248..82d2eab 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('cagebreak', 'c', - version: '1.7.2', + version: '1.7.3', license: 'MIT', default_options: [ 'c_std=c11', @@ -202,9 +202,9 @@ reproducible_build_versions = { 'xkbcommon': '1.3.0', 'fontconfig': '2.13.93', 'pixman': '0.40.0', - 'pango': '1.48.4', + 'pango': '1.48.5', 'cairo': '1.17.4', - 'pangocairo': '1.48.4', + 'pangocairo': '1.48.5', 'math': '-1' } diff --git a/signatures/1.7.1-cagebreak-config.5.sig b/signatures/1.7.1-cagebreak-config.5.sig new file mode 100644 index 0000000000000000000000000000000000000000..048473eac0b262e824d8812c1ca7fa06c0184947 GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j+QYm%>XjF(OTWxqo5S8LN|6>GT#0$`Kfg8&K%5b{@R z(`FTGx&0px|9>xu{GD6iVTW~8P}kb-3=HX+F>p!hKhFT!))}4xau~K zT4#YLj}p1#D_6m2=IPtYIg)=hpY7D7xVvX3`&b><{U46v=4a4!biL@jlMtsfUQiTc z_?bfpxdQHcPHJgR=C_wsx)V9{!nh>)d1v_ZgNgcQBFvz=mwB-c`fon$Rt6Z!X*8uQ zk(Mz*S575beXXj$DB;i*CDcDFCB|;Dsw;-&{8ZZbMDH@EW6J0T_D3u9=6KPtM_svzoY#;Dl$kf=`U_7w^Uhj`f^Z;x z4#=u9k}uPLN|hb`ZH=p`pl(($A=WiHo9FO5YBfx>h>;SN@W&v{wYB{vikZiLbFpUC zwYM)&N;~Dt6pVE{jn<99T48fc|C?%kU5W;E-()!@6N6&O(KNJ*-c{Dxdml7&6PuC~ z%%LAx8(=i97k+_qwzc7>d=Mq$dK|<-XD8=;xHvCjHZs&mCR)gH!6zG6ta0Z0fa6$| zX;9IS2{!Vo4AdRvexpx(3x*;3U2`ykvKA)f`LdZ{@mOvAyihx6ZqQ2=((Wn2dqUf* Ekg-4*JOBUy literal 0 HcmV?d00001 diff --git a/signatures/1.7.1-cagebreak.1.sig b/signatures/1.7.1-cagebreak.1.sig new file mode 100644 index 0000000000000000000000000000000000000000..35c9e1fff161db252d357169221ca1efb27a12fb GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j+QYm%>XjF(OTWxqo5S8LN|6>GT#0$`KffB*^!5b{@R z(`FTGxzhI!|6I&i))J**1ZIN%ZT$C`Pe^XB>9;7-8;jFX;e_Lgogk%{BEu%Q4Eddxm-XfW+ zUBYl-ZM)m5J41j*57;YPIu_+r<_1IeEJc{Va5cX6RV`qB(DK$B2%f-S2a zOY&9eNicETY&M38E?(T+I%Z@|XGL4E-$C)}KLq5D@rNr_&qE#-9G)9iFqiSjzcCU2`JZpQc;c|m6;-uJXi@dKV)Ya_ zf5*;o$ru<~#T9==&E{}M8OtM({rcF80@WaCq$Gay6x|o E1;scJBme*a literal 0 HcmV?d00001 diff --git a/signatures/1.7.1.sig b/signatures/1.7.1.sig new file mode 100644 index 0000000000000000000000000000000000000000..e54765f6c6c28bb2ed7051dae7aa3969664c8233 GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j+QYm%>XjF(OTWxqo5S8LN|6>GT#0$`KfY5)oe5b{@R z(`FTGxeCD#|4k*{A>dJ^GyMV&@)`PVzMF((5;{)zxmH|Mk-jQkg!M5f#|GIF55dwnY9$2(~}XIG>sxz z#5Zy8t>xiRR!JYD_}J>Nv3P_R}I^?#FiXb&ApO$1@g3HjuMI zv&{N3ckF)SoN!86Z-3Ti#cyzTcs5S@0qMci_m_OlK^qR-Ykxf`uN{NUVHv;l^V1>i zNB+V=6AhDE%d5~qCkmv%s4^8sd%hU+a}El^dIP(!*6YnJN#*UpiY@JLVDsDB7SgYD znBo&Tb~nW1iQ_Q@aU4iRa$2^!vVqc#Nq0BtY1(OUGFVz8&9AZ|H=dJ<|N1QbyV%gl z7sLGt)QkG&JJ?C Ey)k$iFaQ7m literal 0 HcmV?d00001 diff --git a/signatures/cagebreak-config.5.sig b/signatures/1.7.2-cagebreak-config.5.sig similarity index 100% rename from signatures/cagebreak-config.5.sig rename to signatures/1.7.2-cagebreak-config.5.sig diff --git a/signatures/cagebreak.1.sig b/signatures/1.7.2-cagebreak.1.sig similarity index 100% rename from signatures/cagebreak.1.sig rename to signatures/1.7.2-cagebreak.1.sig diff --git a/signatures/cagebreak.sig b/signatures/1.7.2.sig similarity index 100% rename from signatures/cagebreak.sig rename to signatures/1.7.2.sig From addd8a0710249d0b6ace52acd42ded3da90328e1 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Fri, 25 Jun 2021 23:07:43 +0200 Subject: [PATCH 281/689] Prepare 1.7.3 --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index b19b09b..9fec430 100644 --- a/meson.build +++ b/meson.build @@ -198,7 +198,7 @@ reproducible_build_versions = { 'wayland_server': '1.19.0', 'wayland_client': '1.19.0', 'wayland_cursor': '1.19.0', - 'wlroots': '0.13.0', + 'wlroots': '0.14.0', 'xkbcommon': '1.3.0', 'fontconfig': '2.13.93', 'pixman': '0.40.0', From 71dc42cc250efec56d20f9ede38aafa2c08e6752 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Tue, 29 Jun 2021 19:55:38 +0200 Subject: [PATCH 282/689] Update man page build time --- meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 9fec430..9e73902 100644 --- a/meson.build +++ b/meson.build @@ -257,7 +257,7 @@ if get_option('man-pages') output : 'cagebreak.1', input : 'man/cagebreak.1.md', capture : true, - command : [sh, '-c', 'export SOURCE_DATE_EPOCH=1621324686 ; @0@ < @INPUT@'.format(scdoc.path())], + command : [sh, '-c', 'export SOURCE_DATE_EPOCH=1624989203 ; @0@ < @INPUT@'.format(scdoc.path())], install: true, install_dir: mandir1 ) @@ -266,7 +266,7 @@ if get_option('man-pages') output : 'cagebreak-config.5', input : 'man/cagebreak-config.5.md', capture : true, - command : [sh, '-c', 'export SOURCE_DATE_EPOCH=1621324686 ; @0@ < @INPUT@'.format(scdoc.path())], + command : [sh, '-c', 'export SOURCE_DATE_EPOCH=1624989203 ; @0@ < @INPUT@'.format(scdoc.path())], install: true, install_dir: mandir5 ) From 839e2cba099f1c0c35860a25d94387a1f957ee69 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Wed, 30 Jun 2021 12:58:19 +0200 Subject: [PATCH 283/689] Add signatures and hashes --- README.md | 15 +++++++++++++++ signatures/cagebreak-config.5.sig | Bin 0 -> 566 bytes signatures/cagebreak.1.sig | Bin 0 -> 566 bytes signatures/cagebreak.sig | Bin 0 -> 566 bytes 4 files changed, 15 insertions(+) create mode 100644 signatures/cagebreak-config.5.sig create mode 100644 signatures/cagebreak.1.sig create mode 100644 signatures/cagebreak.sig diff --git a/README.md b/README.md index 63f1543..169431b 100644 --- a/README.md +++ b/README.md @@ -204,6 +204,21 @@ For every release after 1.0.5, hashes will be provided. For every release after 1.7.0, hashes will be provided for man pages too. +1.7.3 cagebreak + + * sha 256: 8adb4911d9603fec5b8eb4f67a09be95b8f0b37e50d4ab579191da78df18f70b + * sha 512: eddaecd7b577b9fe77b1ed4d341074f7f860967568392d0479543ea8860b4289df3eb5645885e18e35260b14843663ae50f98103f8016e857237a397632322a6 + +1.7.3 cagebreak.1 + + * sha 256: bcc623e42c86ab65bc2f8cb7e4377ca0d816ddc281527b7caeded62753e943b8 + * sha 512: b4290e1040bd6a299d478ad6b695de75cf030d0d274340b43d3ed4382cf6877f824cd4ed9d7020bfb55afe276c62de7fc07c3fbee6f6485c6440a024115afe12 + +1.7.3 cagebreak-config.5 + + * sha 256: b9789b6abd473e9afb33d4e2c7822f7d8f3c10e9eb3fb70c47b713f6331c626a + * sha 512: c49e01cfc4a4ed272f054bea8f2845f0e3f1609cf85d1a0ce14c1b67dc207df153b11bc20ceef09c855d467f0e013e54623ce9f70c217c4278607fc54d0e3206 + 1.7.2 cagebreak * sha 256: 40f4642e8e8caee338055079b046f6e0b790c87226ee307b27a64fcb2a6c6472 diff --git a/signatures/cagebreak-config.5.sig b/signatures/cagebreak-config.5.sig new file mode 100644 index 0000000000000000000000000000000000000000..7461360a82d12acd110d6d03098aac099701a629 GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j+QYm%>XjF(OTWxqo5S8LN|6>GT#0$|)t<^T!_5b{@R z(`FTGxkif*|8cRnxlLWoTBuYIvXLKuJ`Xb2)%D9#d}?NDFgUNM5`PaO`LIV_Bt}Ev zB+6A@qBCQ(WJ`tuw2nD0apV0URS@Qs*~7Tb<(CzOOtj(g6r~&lX-&;b^~y87)%kDx z*xSrkcn&^Y=>Y)C!2gby5~wGY(;LZL57E6qtHNDD5y9D%!ih8i%-eeO_f^|VYhQy?>_NGh_+U`77 zy3Di;*=y_=3&`y=Mis%sUpv{K&!Qw(T^RADOh?|RJ1?28e_Z-diwa<+FEGC391xuy zI1M!ZxuFMbegwCv_a8m<(d9^k2=ebn0ve$|pq;C>^o-3LJECY#Qje+-+|;+(qXdLz Ekw7dHhyVZp literal 0 HcmV?d00001 diff --git a/signatures/cagebreak.1.sig b/signatures/cagebreak.1.sig new file mode 100644 index 0000000000000000000000000000000000000000..95b9fadb791d1760f961274cc0c80b6599482ff6 GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j+QYm%>XjF(OTWxqo5S8LN|6>GT#0$|)t;{XZ?5b{@R z(`FTGxino5{U5IssK#MSGkCUk+ER0)cXy}hse(%Q^QOG*-`xiR5VW7n3WW)#haR~) z@fnpjaKmxLl&OJn7wNqxNOv0Z)<$t?v+`q10EDEb#DafwNNjqfE$px_CsL7y$4i>_ zhiL~|X}bvo89oyq9=rgcbz&#&JTV9Uxru?fzehK!c!Lf+&~O}VIcAtLVxdXMu^_dU zkz(R6<1Tglv(DHcx^s7|w>1_D+bIo$`fh=+WM-9FI0lj~MH(JrgEwVt+E~N<_f#;N z-GVFOj2&l!l`+915Pkn!dd4HOA{9T#i6!G4A6y$Wx(vmlA=&|3vdY*ov2PD-Tlfa8 z@#95YHGnHJ3AO6Owimv1Nld#L%kOA^bj9Z~>tk28THhH#xzjNfp?vC zq5Uf(`;&K5=PVxe4xAqRBsAhL$m&;eVUVpaSq@K6Ler9GL^JLZ$1>Ddds9~*d*QSk zs;XF_h)0&(eaJO|MWO=rEiFQ+4cEjWmMd)wQe+i3b8XjF(OTWxqo5S8LN|6>GT#0$|)t;Q$H=5b{@R z(`FTGx#c_${0PT^F-8b3g<0mOdZRIjg9K|tDqfG?knfmy80O3&MD{o&rQ2Tt^In&n zzEu4ePNT~VFve;cWJ8Y84b!2Tf{O3}Fm7$1jFWkQ%mCaS4EPICsEeo-vki<69JCmn zUy@=iQ0o#XAPpw}1SQa?fT(qimr$rN-3TwY^OzONWmiAMKqT!_KURnRVIle!0b>d_E8Q~zE0xLgqvs7J*aFRMLu`r6ycwn#-ej#MV!C0}mgk<+q%VHpCf=uj zsS~?1r+@`}3y^A(e$4G3J-_zYL5}7d{#!M@g8ck5c%=B{lt}ue>sv&F=z-KS(#5?S z;A{fYh`2*-%`3wXNj~9V(#h0~N_cy}tgPhv&i!{3m0TC&rWTwULJHV&2cL~V^iFYY zxj%M;n?}PgRJrv^nii+gG7nt>L;mPBLd-PckLsLhCZKHXH_fkH2&s7dyiU~1(%GpZ z6F$AtKboLEuRp;>1{)ORV Date: Wed, 30 Jun 2021 16:49:58 +0200 Subject: [PATCH 284/689] Prepare 1.7.4 release --- man/cagebreak-config.5.md | 2 +- man/cagebreak.1.md | 2 +- meson.build | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index c3447fd..a4a1049 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -1,4 +1,4 @@ -cagebreak-config(1) "Version 1.7.3" "Cagebreak Manual" +cagebreak-config(1) "Version 1.7.4" "Cagebreak Manual" # NAME diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index 2b4514f..aa66b7e 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -1,4 +1,4 @@ -cagebreak(1) "Version 1.7.3" "Cagebreak Manual" +cagebreak(1) "Version 1.7.4" "Cagebreak Manual" # NAME diff --git a/meson.build b/meson.build index 9e73902..4f76677 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('cagebreak', 'c', - version: '1.7.3', + version: '1.7.4', license: 'MIT', default_options: [ 'c_std=c11', @@ -200,11 +200,11 @@ reproducible_build_versions = { 'wayland_cursor': '1.19.0', 'wlroots': '0.14.0', 'xkbcommon': '1.3.0', - 'fontconfig': '2.13.93', + 'fontconfig': '2.13.94', 'pixman': '0.40.0', - 'pango': '1.48.5', + 'pango': '1.48.6', 'cairo': '1.17.4', - 'pangocairo': '1.48.5', + 'pangocairo': '1.48.6', 'math': '-1' } @@ -257,7 +257,7 @@ if get_option('man-pages') output : 'cagebreak.1', input : 'man/cagebreak.1.md', capture : true, - command : [sh, '-c', 'export SOURCE_DATE_EPOCH=1624989203 ; @0@ < @INPUT@'.format(scdoc.path())], + command : [sh, '-c', 'export SOURCE_DATE_EPOCH=1625064321 ; @0@ < @INPUT@'.format(scdoc.path())], install: true, install_dir: mandir1 ) @@ -266,7 +266,7 @@ if get_option('man-pages') output : 'cagebreak-config.5', input : 'man/cagebreak-config.5.md', capture : true, - command : [sh, '-c', 'export SOURCE_DATE_EPOCH=1624989203 ; @0@ < @INPUT@'.format(scdoc.path())], + command : [sh, '-c', 'export SOURCE_DATE_EPOCH=1625064321 ; @0@ < @INPUT@'.format(scdoc.path())], install: true, install_dir: mandir5 ) From b3058d68914b783a95f8d886ab69391bf7037332 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Wed, 30 Jun 2021 17:55:23 +0200 Subject: [PATCH 285/689] Prepare 1.7.4 --- README.md | 15 +++++++++++++++ signatures/1.7.3-cagebreak-config.5.sig | Bin 0 -> 566 bytes signatures/1.7.3-cagebreak.1.sig | Bin 0 -> 566 bytes signatures/1.7.3.sig | Bin 0 -> 566 bytes signatures/cagebreak-config.5.sig | Bin 566 -> 566 bytes signatures/cagebreak.1.sig | Bin 566 -> 566 bytes signatures/cagebreak.sig | Bin 566 -> 566 bytes 7 files changed, 15 insertions(+) create mode 100644 signatures/1.7.3-cagebreak-config.5.sig create mode 100644 signatures/1.7.3-cagebreak.1.sig create mode 100644 signatures/1.7.3.sig diff --git a/README.md b/README.md index 169431b..1e86164 100644 --- a/README.md +++ b/README.md @@ -204,6 +204,21 @@ For every release after 1.0.5, hashes will be provided. For every release after 1.7.0, hashes will be provided for man pages too. +1.7.4 cagebreak + + * sha 256: c7442db906239b13f8d09e91cbe01f9e47b2a2c75bbb4b52adefd15dfbfa820f + * sha 512: 9c36ce706f31e1b8afacd8f9cd216c460d66030e0b2736a3dd929902b0d5fc52c5e69dbf6787205b8c495d960e00b6e7f633da86ab6e31613f1b4a9fd47c9f0e + +1.7.4 cagebreak.1 + + * sha 256: 3dacc521e5e9b963cceeefeed6a10104c7c415d86826a72788aba5b33ce320f1 + * sha 512: 0a4c4fbff09dd403fed61056ae3211ad2b4370b4e9ed07806fc22624e5312b4a25e469dc0eef1ca4556cbb8efabb0127e7519df79852e110faa98fb17ca377de + +1.7.4 cagebreak-config.5 + + * sha 256: ed22fed1818172f31d3fb3efbe5e66b49f135cb2367b1c85209fd880ff7532ab + * sha 512: cc634c63962ae50b4de20a3aad8ca0970175b53156690d69e6a69fd8f370ad20d84db783cc7e94c61d4d4d89f1205d43622690e58afba549ed57ddad009e3bac + 1.7.3 cagebreak * sha 256: 8adb4911d9603fec5b8eb4f67a09be95b8f0b37e50d4ab579191da78df18f70b diff --git a/signatures/1.7.3-cagebreak-config.5.sig b/signatures/1.7.3-cagebreak-config.5.sig new file mode 100644 index 0000000000000000000000000000000000000000..7461360a82d12acd110d6d03098aac099701a629 GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j+QYm%>XjF(OTWxqo5S8LN|6>GT#0$|)t<^T!_5b{@R z(`FTGxkif*|8cRnxlLWoTBuYIvXLKuJ`Xb2)%D9#d}?NDFgUNM5`PaO`LIV_Bt}Ev zB+6A@qBCQ(WJ`tuw2nD0apV0URS@Qs*~7Tb<(CzOOtj(g6r~&lX-&;b^~y87)%kDx z*xSrkcn&^Y=>Y)C!2gby5~wGY(;LZL57E6qtHNDD5y9D%!ih8i%-eeO_f^|VYhQy?>_NGh_+U`77 zy3Di;*=y_=3&`y=Mis%sUpv{K&!Qw(T^RADOh?|RJ1?28e_Z-diwa<+FEGC391xuy zI1M!ZxuFMbegwCv_a8m<(d9^k2=ebn0ve$|pq;C>^o-3LJECY#Qje+-+|;+(qXdLz Ekw7dHhyVZp literal 0 HcmV?d00001 diff --git a/signatures/1.7.3-cagebreak.1.sig b/signatures/1.7.3-cagebreak.1.sig new file mode 100644 index 0000000000000000000000000000000000000000..95b9fadb791d1760f961274cc0c80b6599482ff6 GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j+QYm%>XjF(OTWxqo5S8LN|6>GT#0$|)t;{XZ?5b{@R z(`FTGxino5{U5IssK#MSGkCUk+ER0)cXy}hse(%Q^QOG*-`xiR5VW7n3WW)#haR~) z@fnpjaKmxLl&OJn7wNqxNOv0Z)<$t?v+`q10EDEb#DafwNNjqfE$px_CsL7y$4i>_ zhiL~|X}bvo89oyq9=rgcbz&#&JTV9Uxru?fzehK!c!Lf+&~O}VIcAtLVxdXMu^_dU zkz(R6<1Tglv(DHcx^s7|w>1_D+bIo$`fh=+WM-9FI0lj~MH(JrgEwVt+E~N<_f#;N z-GVFOj2&l!l`+915Pkn!dd4HOA{9T#i6!G4A6y$Wx(vmlA=&|3vdY*ov2PD-Tlfa8 z@#95YHGnHJ3AO6Owimv1Nld#L%kOA^bj9Z~>tk28THhH#xzjNfp?vC zq5Uf(`;&K5=PVxe4xAqRBsAhL$m&;eVUVpaSq@K6Ler9GL^JLZ$1>Ddds9~*d*QSk zs;XF_h)0&(eaJO|MWO=rEiFQ+4cEjWmMd)wQe+i3b8XjF(OTWxqo5S8LN|6>GT#0$|)t;Q$H=5b{@R z(`FTGx#c_${0PT^F-8b3g<0mOdZRIjg9K|tDqfG?knfmy80O3&MD{o&rQ2Tt^In&n zzEu4ePNT~VFve;cWJ8Y84b!2Tf{O3}Fm7$1jFWkQ%mCaS4EPICsEeo-vki<69JCmn zUy@=iQ0o#XAPpw}1SQa?fT(qimr$rN-3TwY^OzONWmiAMKqT!_KURnRVIle!0b>d_E8Q~zE0xLgqvs7J*aFRMLu`r6ycwn#-ej#MV!C0}mgk<+q%VHpCf=uj zsS~?1r+@`}3y^A(e$4G3J-_zYL5}7d{#!M@g8ck5c%=B{lt}ue>sv&F=z-KS(#5?S z;A{fYh`2*-%`3wXNj~9V(#h0~N_cy}tgPhv&i!{3m0TC&rWTwULJHV&2cL~V^iFYY zxj%M;n?}PgRJrv^nii+gG7nt>L;mPBLd-PckLsLhCZKHXH_fkH2&s7dyiU~1(%GpZ z6F$AtKboLEuRp;>1{)ORVgrqW)*9>h4c^rw5&3o(3W@TM1O^U#nOs#Z4k6y_JHP% z@I_d%p_@Am-W4D(hQ?=PCPEOIy#BS~WXMn5ccPfHLP|lTa|0+izsqSs!aZWILo{&5 z!On0$mHsmWmhV9xb;C>4-}u&)x+S4?TkG_>z$JH|k`POdCKWaV#nU{VjP6Ve9J=4e zvlME8%NIw0-+y@ix)HLEJ%JjK0oAf`#Iygp`6^3!fuE}9_aP7?2s!_u!;s!*wX#Iv z+Q9N@=+B}BwbIEn*6MO9#RWZ3r>ubD^#j)4CUeHI80cq@_F?xaDJ%zxfWMr#p=b#Kw01jLm=U(!!n zq?FJ*!+CS;Px7JV#!FiB&`DMhG0R11g2H?-O+l`l*$Iw?-WE-YxgA}ktAHOG^z$n| zmoD^paKeeS6k#AQ>xw083*@h2+2n2d{&vRR^voB8itKIS+|pFxS2@z_PDMsdhpIMJ fuE85hMi$;;&p;`>c7+@7LPVhY^4;0Z)r%k${O=t= delta 541 zcmV+&0^grqW)*9>MvD*sak03$OH%) z^~+LxYG!IMIIpM@e-9%0ut!}aMnm8v%2i&XGh?)5ONIipjyW!I=+Bk?K4Id!NXrW*`Lp%Bv)M+ z@uf^h-l#h-nXZ3a`cR7sV5KiGzT_MbogFw0H2%4v2W@@?x2g9ZJ@nD#NP`IS??wU| fp+BIVs}{EOjLjQ6qG(Q1kE#&d)VJBA1cYXhLgrqW)*9>NT?71nD8zX76D8h6K>W6FeLo1P1ShO zODVty7lTGUW(dbT^#OGvH>m2u*Ellt`_H7;TIpvEVxoUiPu=dLW8f{A-jj@?x`%ar z68j84BVj9c`6z&*axk#8z2<{a;NqnnkgwlB%uXnGdIxn=mwy4wj_&rcUVv^{N%47Q zyj4u(92)s0N(CMFHei`htmn)#1&)tvHJ^SwDgR{X*h?KY{E3;F@3pF@cn)HLdcEyW zf>4j=h?MY^`0*1(l$Xd?Jmqa4JM&hFVDbag=E>so4D`CAkHS?;>8CX6w+v{mo={ZC}!~rR$+EGRBShN%l9S&YQ7rRF@#8CY?;<8)V zYVMf#20>qY`QXX!IqJrXwt$9k5pHeme8)MveWHb426mB6cR5@#_oWa>Ee_U?Qr1V1 z=WiK1h)oT5#UptvrTP*Sl~*J*O}gAK?d)qb@m$Qh?SHxP(N0naD}a5etTVZ-55_B> z5|wPzXRHEAmxLwfM0(T#oV<8$>6&$fnxUZ%Hv$+4rb%)LTy2l&VS#9CoCv< f1?p(M8y3Bl*VmTh4D4@+uDNRfG{Ljh#C^LFTj2*m delta 541 zcmV+&0^grqW)*9>G+htw4clhg$bsI9=SU48I?D1!*Rrvsey49>AfdNcN+87MsaAf@?%T@ zgrug#f`4;JY1_D+bIo$`fh=+ zWM-9FI0lj~MH(JrgEwVt+E~N<_f#;N-GVFOj2&l!l`+915Pkn!dd4HOA{9T#i6!G4 zA6y$Wx(vmlA%EHdTe8a7F|ltCY+LvSt?}bUTs43zG6}Wn!?qW`bV*FR8O!fze{{v? zGV5bkwp!mALAlmM4h>^73C&q5aDjK7b)o$$Bm0wgQ|Bxm^$wgK{3JBuFUaawa$%6I zFIf&xPeRj@XGAmZ62~&sSbI}fAA8}n9IC2Vp@>J8;(snxfpk0v(F;vyy}2)^BY`bA zh<$t8+n?KL`X1!e>K<3JA3RBG&wp5t5KU{ewP|*mbjb&b^ic_xu`RZo%?tq>$m#Dg z!Qds1Z#={q<|>@IK6MJJDn-CYT=v2z=QnKfsg!H{dCcK!rn{?D;bu`9FAyC{-F`p| fWGS61s1_d-9arw<9m2ZOSUr1G6JUZ+@ypxr0Vn+~ diff --git a/signatures/cagebreak.sig b/signatures/cagebreak.sig index c0e34973f2a7c6665db0a15fb578d8fa37356ac2..22e1818ab09d095c08f005169e584fd605ad2096 100644 GIT binary patch delta 541 zcmV+&0^grqW)*9>q!bVSJPrRo74-4*Q*!-sjk>5vgYGj0 z@#<3&P~=G)f6X!8LQ3QJCCThea;I335TFrnvQ37fDG%zf+sv{MkPE1q_1(bO2#~mW zj}6vV!9m46^tk~#$ijr6+dG+n3yzDtpMO<0T^AJ86UH zlABr!X(sFbCBjOCn4vGN13r%PM5k>ZM6tKYvC`qL5>SaHu>R9}Gsy>)anS^cafQ1Q zh_iJc$P^$)j}b72?!?}&)DIO;i-}tX4RSC5bYYAI%#ntf2km57LDlelrU91B8rpyt z94ETUyCy$J7=L-@Rk?z{wpgEJC=6Lt-P`(}3ZlTE6O8rkW+242pjLS7Mrg*WEr4NO z-AnbJ!|g+o5;x~KTJ{O#_1mCyU3lXCf$&j;f@_%62|xs{=JwILb?*}I{hRD-lC@Tu zeaY``RcJ2DBatHUHuNdgSacvV-J$3*Bl|{}`NSaNSAR|*Cm7I=Z{-VOyZ=;Ia*;@Ut(K4D59Rn-FI9fgC%!5*2OdZX%kLsN+5!Pp=Hv fM6q01R2KR?q0kp6@`ZYt)kb(I+{_g)O1Ph9`iKla delta 541 zcmV+&0^grqW)*9>~sDqcMns1ZzYp zUXR|8@0fTP=FA~P_BbS^+g}0mUYDG{RQ(rDqst61#%da5Lypl6)1jJzitqq1Zf&28 zlX-y50Nfo6_zO{}i>MW|4U7&Pv>2UVl431T>k=p+4JQ8tC4bPTfT(qimr$rN-3TwY z^OzONWmiAMKqT!_KURnRVIle!0b>d_E8Q~zE0xLgqvs7J*aFRMLu`r6 zycwn#-ej#MVt=|})RyO-)1)tc;3nRufTogPTUfFMm|I^-7u+r_nMGT>?Y?=ruyj zG~$oyoM|SYZ0$GAuUrVJc>KIh)XUP@sUj0Tz0yCLpgylZ!9@le6y;+hDZKACBlFF4 z>Dhawyf-5kNes#e7LaaRa#HoxJOxY2L> fhjyG|W)`t%0nr#kczRA&^)HBDmK-f6&gk+xojnO! From 57719a2c2d39688f1d5f5b83377f9a22b81a171e Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Sat, 10 Jul 2021 14:48:58 +0200 Subject: [PATCH 286/689] Prepare 1.7.5 release --- man/cagebreak-config.5.md | 2 +- man/cagebreak.1.md | 2 +- meson.build | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index a4a1049..45afd8f 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -1,4 +1,4 @@ -cagebreak-config(1) "Version 1.7.4" "Cagebreak Manual" +cagebreak-config(1) "Version 1.7.5" "Cagebreak Manual" # NAME diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index aa66b7e..97f2ac4 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -1,4 +1,4 @@ -cagebreak(1) "Version 1.7.4" "Cagebreak Manual" +cagebreak(1) "Version 1.7.5" "Cagebreak Manual" # NAME diff --git a/meson.build b/meson.build index 4f76677..474a2c2 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('cagebreak', 'c', - version: '1.7.4', + version: '1.7.5', license: 'MIT', default_options: [ 'c_std=c11', @@ -53,7 +53,7 @@ if is_freebsd ) endif -wlroots = dependency('wlroots', version: ['>=0.14.0', '< 0.15.0']) +wlroots = dependency('wlroots', version: ['>=0.14.1', '< 0.15.0']) wayland_protos = dependency('wayland-protocols', version: '>=1.14') wayland_server = dependency('wayland-server') wayland_cursor = dependency('wayland-cursor') @@ -198,13 +198,13 @@ reproducible_build_versions = { 'wayland_server': '1.19.0', 'wayland_client': '1.19.0', 'wayland_cursor': '1.19.0', - 'wlroots': '0.14.0', + 'wlroots': '0.14.1', 'xkbcommon': '1.3.0', 'fontconfig': '2.13.94', 'pixman': '0.40.0', - 'pango': '1.48.6', + 'pango': '1.48.7', 'cairo': '1.17.4', - 'pangocairo': '1.48.6', + 'pangocairo': '1.48.7', 'math': '-1' } @@ -257,7 +257,7 @@ if get_option('man-pages') output : 'cagebreak.1', input : 'man/cagebreak.1.md', capture : true, - command : [sh, '-c', 'export SOURCE_DATE_EPOCH=1625064321 ; @0@ < @INPUT@'.format(scdoc.path())], + command : [sh, '-c', 'export SOURCE_DATE_EPOCH=1625921119 ; @0@ < @INPUT@'.format(scdoc.path())], install: true, install_dir: mandir1 ) @@ -266,7 +266,7 @@ if get_option('man-pages') output : 'cagebreak-config.5', input : 'man/cagebreak-config.5.md', capture : true, - command : [sh, '-c', 'export SOURCE_DATE_EPOCH=1625064321 ; @0@ < @INPUT@'.format(scdoc.path())], + command : [sh, '-c', 'export SOURCE_DATE_EPOCH=1625921119 ; @0@ < @INPUT@'.format(scdoc.path())], install: true, install_dir: mandir5 ) From 25bb1fbe4af63da70548585c546399bbc16635bd Mon Sep 17 00:00:00 2001 From: project-repo Date: Wed, 11 Aug 2021 13:22:11 +0200 Subject: [PATCH 287/689] Fix typo in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1e86164..ed2c2e6 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ for this to work. #### Man Pages Cagebreak has man pages. To use them, make sure that you have `pandoc` -installed. Then, add `-Dman-pages=true to the `meson` command. +installed. Then, add `-Dman-pages=true` to the `meson` command. ### Running Cagebreak From 985b5f65dba43dc49817c720576bd089787249cc Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 11 Sep 2021 13:48:08 +0200 Subject: [PATCH 288/689] Add input_manager capabilities --- cagebreak.c | 9 +- input.h | 14 ++ input_manager.c | 267 ++++++++++++++++++++++++++++++++++++ input_manager.h | 108 +++++++++++++++ keybinding.c | 6 + libinput.c | 349 ++++++++++++++++++++++++++++++++++++++++++++++++ meson.build | 8 ++ seat.c | 136 +++++++++++-------- seat.h | 20 +-- server.h | 3 + 10 files changed, 858 insertions(+), 62 deletions(-) create mode 100644 input.h create mode 100644 input_manager.c create mode 100644 input_manager.h create mode 100644 libinput.c diff --git a/cagebreak.c b/cagebreak.c index 6e16dc2..7794b40 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -1,4 +1,4 @@ -/* + * * Cagebreak: A Wayland tiling compositor. * * Copyright (C) 2018-2020 Jente Hidskes @@ -49,6 +49,7 @@ #include "message.h" #include "output.h" #include "parse.h" +#include "input_manager.h" #include "seat.h" #include "server.h" #include "xdg_shell.h" @@ -264,6 +265,8 @@ main(int argc, char *argv[]) { wlr_log_init(WLR_ERROR, NULL); #endif + wl_list_init(&server.input_config); + server.modes = malloc(4 * sizeof(char *)); if(!server.modes) { wlr_log(WLR_ERROR, "Error allocating mode array"); @@ -358,6 +361,10 @@ main(int argc, char *argv[]) { goto end; } + server.input = input_manager_create(&server); + fprintf(stderr, "input_manager_create:%d\n",wl_list_length(&server.input->devices)); + + data_control_manager = wlr_data_control_manager_v1_create(server.wl_display); if(!data_control_manager) { diff --git a/input.h b/input.h new file mode 100644 index 0000000..c2ba243 --- /dev/null +++ b/input.h @@ -0,0 +1,14 @@ +#ifndef _LIBINPUT_H +#define _LIBINPUT_H + +#include + +struct cg_input_device; + +void cg_input_configure_libinput_device(struct cg_input_device *device); + +void cg_input_reset_libinput_device(struct cg_input_device *device); + +bool cg_libinput_device_is_builtin(struct cg_input_device *device); + +#endif diff --git a/input_manager.c b/input_manager.c new file mode 100644 index 0000000..8232891 --- /dev/null +++ b/input_manager.c @@ -0,0 +1,267 @@ +/* + * Cagebreak: A Wayland tiling compositor. + * + * Copyright (C) 2020 The Cagebreak Authors + * Copyright (C) 2018-2020 Jente Hidskes + * + * See the LICENSE file accompanying this file. + */ + +#define _POSIX_C_SOURCE 200812L + +#include "config.h" +#include "server.h" +#include "seat.h" +#include "input_manager.h" +#include "input.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +void strip_whitespace(char *str) { + static const char whitespace[] = " \f\n\r\t\v"; + size_t len = strlen(str); + size_t start = strspn(str, whitespace); + memmove(str, &str[start], len + 1 - start); + + if (*str) { + for (len -= start + 1; isspace(str[len]); --len) {} + str[len + 1] = '\0'; + } +} + +char *input_device_get_identifier(struct wlr_input_device *device) { + int vendor = device->vendor; + int product = device->product; + char *name = strdup(device->name ? device->name : ""); + strip_whitespace(name); + + char *p = name; + for (; *p; ++p) { + // There are in fact input devices with unprintable characters in its name + if (*p == ' ' || !isprint(*p)) { + *p = '_'; + } + } + + const char *fmt = "%d:%d:%s"; + int len = snprintf(NULL, 0, fmt, vendor, product, name) + 1; + char *identifier = malloc(len); + if (!identifier) { + wlr_log(WLR_ERROR, "Unable to allocate unique input device name"); + return NULL; + } + + snprintf(identifier, len, fmt, vendor, product, name); + free(name); + return identifier; +} + +void input_manager_handle_device_destroy(struct wl_listener *listener, void *data) { + struct cg_input_device *input_device = + wl_container_of(listener, input_device, device_destroy); + + if (!input_device) { + wlr_log(WLR_ERROR, "Could not find cagebreak input device to destroy"); + return; + } + + seat_remove_device(input_device->server->seat, input_device); + + wl_list_remove(&input_device->link); + wl_list_remove(&input_device->device_destroy.link); + free(input_device->identifier); + free(input_device); +} + +static void handle_new_input(struct wl_listener *listener, void *data) { + struct cg_input_manager *input = + wl_container_of(listener, input, new_input); + struct cg_server *server= input->server; + struct wlr_input_device *device = data; + + struct cg_input_device *input_device = + calloc(1, sizeof(struct cg_input_device)); + if (!input_device) { + wlr_log(WLR_ERROR,"Could not allocate input device"); + return; + } + device->data = input_device; + + input_device->wlr_device = device; + input_device->identifier = input_device_get_identifier(device); + input_device->server=server; + input_device->pointer=NULL; + input_device->touch=NULL; + + wl_list_insert(&input->devices, &input_device->link); + + cg_input_configure_libinput_device(input_device); + + wl_signal_add(&device->events.destroy, &input_device->device_destroy); + input_device->device_destroy.notify = input_manager_handle_device_destroy; + + struct cg_seat *seat = server->seat; + seat_add_device(seat, input_device); +} + +void handle_virtual_keyboard(struct wl_listener *listener, void *data) { + struct cg_input_manager *input_manager = + wl_container_of(listener, input_manager, virtual_keyboard_new); + struct wlr_virtual_keyboard_v1 *keyboard = data; + struct wlr_input_device *device = &keyboard->input_device; + + struct cg_seat *seat = input_manager->server->seat; + + struct cg_input_device *input_device = + calloc(1, sizeof(struct cg_input_device)); + if (!input_device) { + wlr_log(WLR_ERROR, "could not allocate input device"); + return; + } + device->data = input_device; + + input_device->is_virtual = true; + input_device->wlr_device = device; + input_device->identifier = input_device_get_identifier(device); + wl_list_insert(&input_manager->devices, &input_device->link); + input_device->server=input_manager->server; + input_device->pointer=NULL; + input_device->touch=NULL; + + wl_signal_add(&device->events.destroy, &input_device->device_destroy); + input_device->device_destroy.notify = input_manager_handle_device_destroy; + + seat_add_device(seat, input_device); +} + +void handle_virtual_pointer(struct wl_listener *listener, void *data) { + struct cg_input_manager *input_manager = + wl_container_of(listener, input_manager, virtual_pointer_new); + struct wlr_virtual_pointer_v1_new_pointer_event *event = data; + struct wlr_virtual_pointer_v1 *pointer = event->new_pointer; + struct wlr_input_device *device = &pointer->input_device; + + struct cg_seat *seat = input_manager->server->seat; + + struct cg_input_device *input_device = + calloc(1, sizeof(struct cg_input_device)); + if (!input_device) { + wlr_log(WLR_ERROR, "could not allocate input device"); + return; + } + device->data = input_device; + + input_device->is_virtual = true; + input_device->wlr_device = device; + input_device->identifier = input_device_get_identifier(device); + wl_list_insert(&input_manager->devices, &input_device->link); + input_device->server=input_manager->server; + input_device->pointer=NULL; + input_device->touch=NULL; + + wl_signal_add(&device->events.destroy, &input_device->device_destroy); + input_device->device_destroy.notify = input_manager_handle_device_destroy; + + seat_add_device(seat, input_device); + + if (event->suggested_output) { + wlr_cursor_map_input_to_output(seat->cursor, device, + event->suggested_output); + } +} + +struct cg_input_manager *input_manager_create(struct cg_server *server) { + struct cg_input_manager *input = + calloc(1, sizeof(struct cg_input_manager)); + if (!input) { + return NULL; + } + + wl_list_init(&input->devices); + input->server=server; + + input->new_input.notify = handle_new_input; + wl_signal_add(&server->backend->events.new_input, &input->new_input); + + input->virtual_keyboard = wlr_virtual_keyboard_manager_v1_create( + server->wl_display); + wl_signal_add(&input->virtual_keyboard->events.new_virtual_keyboard, + &input->virtual_keyboard_new); + input->virtual_keyboard_new.notify = handle_virtual_keyboard; + + input->virtual_pointer = wlr_virtual_pointer_manager_v1_create( + server->wl_display + ); + wl_signal_add(&input->virtual_pointer->events.new_virtual_pointer, + &input->virtual_pointer_new); + input->virtual_pointer_new.notify = handle_virtual_pointer; + + return input; +} + +static bool device_is_touchpad(struct cg_input_device *device) { + if (device->wlr_device->type != WLR_INPUT_DEVICE_POINTER || + !wlr_input_device_is_libinput(device->wlr_device)) { + return false; + } + + struct libinput_device *libinput_device = + wlr_libinput_get_device_handle(device->wlr_device); + + return libinput_device_config_tap_get_finger_count(libinput_device) > 0; +} + +const char *input_device_get_type(struct cg_input_device *device) { + switch (device->wlr_device->type) { + case WLR_INPUT_DEVICE_POINTER: + if (device_is_touchpad(device)) { + return "touchpad"; + } else { + return "pointer"; + } + case WLR_INPUT_DEVICE_KEYBOARD: + return "keyboard"; + case WLR_INPUT_DEVICE_TOUCH: + return "touch"; + case WLR_INPUT_DEVICE_TABLET_TOOL: + return "tablet_tool"; + case WLR_INPUT_DEVICE_TABLET_PAD: + return "tablet_pad"; + case WLR_INPUT_DEVICE_SWITCH: + return "switch"; + } + return "unknown"; +} + +struct cg_input_config *input_device_get_config(struct cg_input_device *device) { + struct cg_server *server=device->server; + struct cg_input_config *wildcard_config = NULL; + struct cg_input_config *config = NULL; + wl_list_for_each(config, &server->input_config, link) { + if (strcmp(config->identifier, device->identifier) == 0) { + return config; + } else if (strcmp(config->identifier, "*") == 0) { + wildcard_config = config; + } + } + + const char *device_type = input_device_get_type(device); + wl_list_for_each(config, &server->input_config, link) { + if (strncmp(config->identifier,"type:",5)&&strcmp(config->identifier + 5, device_type) == 0) { + return config; + } + } + + return wildcard_config; +} diff --git a/input_manager.h b/input_manager.h new file mode 100644 index 0000000..d0bd3ff --- /dev/null +++ b/input_manager.h @@ -0,0 +1,108 @@ +#ifndef CG_INPUT_MANAGER_H +#define CG_INPUT_MANAGER_H + +#include "seat.h" +#include "server.h" +#include +#include + + +struct cg_input_manager *input_manager_create(struct cg_server *server); +struct cg_input_config *input_device_get_config(struct cg_input_device *device); +void input_manager_handle_device_destroy(struct wl_listener *listener, void *data); + +struct cg_input_manager { + struct wl_list devices; + struct cg_server *server; + + struct wlr_virtual_keyboard_manager_v1 *virtual_keyboard; + struct wlr_virtual_pointer_manager_v1 *virtual_pointer; + + struct wl_listener new_input; + struct wl_listener virtual_keyboard_new; + struct wl_listener virtual_pointer_new; +}; + + +struct cg_input_config_mapped_from_region { + double x1, y1; + double x2, y2; + bool mm; +}; + +struct calibration_matrix { + bool configured; + float matrix[6]; +}; + +enum cg_input_config_mapped_to { + MAPPED_TO_DEFAULT, + MAPPED_TO_OUTPUT, + MAPPED_TO_REGION, +}; + +/** + * options for input devices + */ +struct cg_input_config { + char *identifier; + const char *input_type; + + int accel_profile; + struct calibration_matrix calibration_matrix; + int click_method; + int drag; + int drag_lock; + int dwt; + int left_handed; + int middle_emulation; + int natural_scroll; + float pointer_accel; + float scroll_factor; + int repeat_delay; + int repeat_rate; + int scroll_button; + int scroll_method; + int send_events; + int tap; + int tap_button_map; + + char *xkb_layout; + char *xkb_model; + char *xkb_options; + char *xkb_rules; + char *xkb_variant; + char *xkb_file; + + bool xkb_file_is_set; + + int xkb_numlock; + int xkb_capslock; + + struct wl_list link; + struct cg_input_config_mapped_from_region *mapped_from_region; + + enum cg_input_config_mapped_to mapped_to; + char *mapped_to_output; + struct wlr_box *mapped_to_region; + + struct wl_list tools; + + bool capturable; + struct wlr_box region; +}; + +struct cg_input_device { + char *identifier; + struct cg_server *server; + struct wlr_input_device *wlr_device; + struct wl_list link; + struct wl_listener device_destroy; + bool is_virtual; + + /* Only one of the following is non-NULL depending on the type of the input device */ + struct cg_pointer *pointer; + struct cg_touch *touch; +}; + +#endif diff --git a/keybinding.c b/keybinding.c index 005b87a..4eec370 100644 --- a/keybinding.c +++ b/keybinding.c @@ -12,6 +12,7 @@ #include "keybinding.h" #include "message.h" #include "output.h" +#include "input_manager.h" #include "seat.h" #include "server.h" #include "view.h" @@ -870,6 +871,11 @@ keybinding_configure_output(struct cg_server *server, } } +void +keybinding_configure_input_dev(struct cg_server *server, struct cg_input_config *cfg) { + +} + /* Hint: see keybinding.h for details on "data" */ int run_action(enum keybinding_action action, struct cg_server *server, diff --git a/libinput.c b/libinput.c new file mode 100644 index 0000000..d5a3bba --- /dev/null +++ b/libinput.c @@ -0,0 +1,349 @@ +#include +#include +#include +#include +#include +#include +#include +#include "input.h" +#include "output.h" +#include "input_manager.h" + +static void log_status(enum libinput_config_status status) { + if (status != LIBINPUT_CONFIG_STATUS_SUCCESS) { + wlr_log(WLR_ERROR, "Failed to apply libinput config: %s", + libinput_config_status_to_str(status)); + } +} + +static bool set_send_events(struct libinput_device *device, uint32_t mode) { + if (libinput_device_config_send_events_get_mode(device) == mode) { + return false; + } + wlr_log(WLR_DEBUG, "send_events_set_mode(%" PRIu32 ")", mode); + log_status(libinput_device_config_send_events_set_mode(device, mode)); + return true; +} + +static bool set_tap(struct libinput_device *device, + enum libinput_config_tap_state tap) { + if (libinput_device_config_tap_get_finger_count(device) <= 0 || + libinput_device_config_tap_get_enabled(device) == tap) { + return false; + } + wlr_log(WLR_DEBUG, "tap_set_enabled(%d)", tap); + log_status(libinput_device_config_tap_set_enabled(device, tap)); + return true; +} + +static bool set_tap_button_map(struct libinput_device *device, + enum libinput_config_tap_button_map map) { + if (libinput_device_config_tap_get_finger_count(device) <= 0 || + libinput_device_config_tap_get_button_map(device) == map) { + return false; + } + wlr_log(WLR_DEBUG, "tap_set_button_map(%d)", map); + log_status(libinput_device_config_tap_set_button_map(device, map)); + return true; +} + +static bool set_tap_drag(struct libinput_device *device, + enum libinput_config_drag_state drag) { + if (libinput_device_config_tap_get_finger_count(device) <= 0 || + libinput_device_config_tap_get_drag_enabled(device) == drag) { + return false; + } + wlr_log(WLR_DEBUG, "tap_set_drag_enabled(%d)", drag); + log_status(libinput_device_config_tap_set_drag_enabled(device, drag)); + return true; +} + +static bool set_tap_drag_lock(struct libinput_device *device, + enum libinput_config_drag_lock_state lock) { + if (libinput_device_config_tap_get_finger_count(device) <= 0 || + libinput_device_config_tap_get_drag_lock_enabled(device) == lock) { + return false; + } + wlr_log(WLR_DEBUG, "tap_set_drag_lock_enabled(%d)", lock); + log_status(libinput_device_config_tap_set_drag_lock_enabled(device, lock)); + return true; +} + +static bool set_accel_speed(struct libinput_device *device, double speed) { + if (!libinput_device_config_accel_is_available(device) || + libinput_device_config_accel_get_speed(device) == speed) { + return false; + } + wlr_log(WLR_DEBUG, "accel_set_speed(%f)", speed); + log_status(libinput_device_config_accel_set_speed(device, speed)); + return true; +} + +static bool set_accel_profile(struct libinput_device *device, + enum libinput_config_accel_profile profile) { + if (!libinput_device_config_accel_is_available(device) || + libinput_device_config_accel_get_profile(device) == profile) { + return false; + } + wlr_log(WLR_DEBUG, "accel_set_profile(%d)", profile); + log_status(libinput_device_config_accel_set_profile(device, profile)); + return true; +} + +static bool set_natural_scroll(struct libinput_device *d, bool n) { + if (!libinput_device_config_scroll_has_natural_scroll(d) || + libinput_device_config_scroll_get_natural_scroll_enabled(d) == n) { + return false; + } + wlr_log(WLR_DEBUG, "scroll_set_natural_scroll(%d)", n); + log_status(libinput_device_config_scroll_set_natural_scroll_enabled(d, n)); + return true; +} + +static bool set_left_handed(struct libinput_device *device, bool left) { + if (!libinput_device_config_left_handed_is_available(device) || + libinput_device_config_left_handed_get(device) == left) { + return false; + } + wlr_log(WLR_DEBUG, "left_handed_set(%d)", left); + log_status(libinput_device_config_left_handed_set(device, left)); + return true; +} + +static bool set_click_method(struct libinput_device *device, + enum libinput_config_click_method method) { + uint32_t click = libinput_device_config_click_get_methods(device); + if ((click & ~LIBINPUT_CONFIG_CLICK_METHOD_NONE) == 0 || + libinput_device_config_click_get_method(device) == method) { + return false; + } + wlr_log(WLR_DEBUG, "click_set_method(%d)", method); + log_status(libinput_device_config_click_set_method(device, method)); + return true; +} + +static bool set_middle_emulation(struct libinput_device *dev, + enum libinput_config_middle_emulation_state mid) { + if (!libinput_device_config_middle_emulation_is_available(dev) || + libinput_device_config_middle_emulation_get_enabled(dev) == mid) { + return false; + } + wlr_log(WLR_DEBUG, "middle_emulation_set_enabled(%d)", mid); + log_status(libinput_device_config_middle_emulation_set_enabled(dev, mid)); + return true; +} + +static bool set_scroll_method(struct libinput_device *device, + enum libinput_config_scroll_method method) { + uint32_t scroll = libinput_device_config_scroll_get_methods(device); + if ((scroll & ~LIBINPUT_CONFIG_SCROLL_NO_SCROLL) == 0 || + libinput_device_config_scroll_get_method(device) == method) { + return false; + } + wlr_log(WLR_DEBUG, "scroll_set_method(%d)", method); + log_status(libinput_device_config_scroll_set_method(device, method)); + return true; +} + +static bool set_scroll_button(struct libinput_device *dev, uint32_t button) { + uint32_t scroll = libinput_device_config_scroll_get_methods(dev); + if ((scroll & ~LIBINPUT_CONFIG_SCROLL_NO_SCROLL) == 0 || + libinput_device_config_scroll_get_button(dev) == button) { + return false; + } + wlr_log(WLR_DEBUG, "scroll_set_button(%" PRIu32 ")", button); + log_status(libinput_device_config_scroll_set_button(dev, button)); + return true; +} + +static bool set_dwt(struct libinput_device *device, bool dwt) { + if (!libinput_device_config_dwt_is_available(device) || + libinput_device_config_dwt_get_enabled(device) == dwt) { + return false; + } + wlr_log(WLR_DEBUG, "dwt_set_enabled(%d)", dwt); + log_status(libinput_device_config_dwt_set_enabled(device, dwt)); + return true; +} + +static bool set_calibration_matrix(struct libinput_device *dev, float mat[6]) { + if (!libinput_device_config_calibration_has_matrix(dev)) { + return false; + } + bool changed = false; + float current[6]; + libinput_device_config_calibration_get_matrix(dev, current); + for (int i = 0; i < 6; i++) { + if (current[i] != mat[i]) { + changed = true; + break; + } + } + if (changed) { + wlr_log(WLR_DEBUG, "calibration_set_matrix(%f, %f, %f, %f, %f, %f)", + mat[0], mat[1], mat[2], mat[3], mat[4], mat[5]); + log_status(libinput_device_config_calibration_set_matrix(dev, mat)); + } + return changed; +} + +void output_get_identifier(char *identifier, size_t len, + struct cg_output *output) { + struct wlr_output *wlr_output = output->wlr_output; + snprintf(identifier, len, "%s %s %s", wlr_output->make, wlr_output->model, + wlr_output->serial); +} + +struct cg_output *output_by_name_or_id(const char *name_or_id, struct cg_server *server) { + struct cg_output *output=NULL; + wl_list_for_each(output,&server->outputs,link) { + char identifier[128]; + output_get_identifier(identifier, sizeof(identifier), output); + if (strcasecmp(identifier, name_or_id) == 0 + || strcasecmp(output->wlr_output->name, name_or_id) == 0) { + return output; + } + } + return NULL; +} + +void cg_input_configure_libinput_device(struct cg_input_device *input_device) { + struct cg_input_config *ic = input_device_get_config(input_device); + if (!ic || !wlr_input_device_is_libinput(input_device->wlr_device)) { + return; + } + + struct libinput_device *device = + wlr_libinput_get_device_handle(input_device->wlr_device); + wlr_log(WLR_DEBUG, "cg_input_configure_libinput_device('%s' on '%s')", + ic->identifier, input_device->identifier); + + bool changed = false; + if (ic->mapped_to_output && + !output_by_name_or_id(ic->mapped_to_output,input_device->server)) { + wlr_log(WLR_DEBUG, + "%s '%s' is mapped to offline output '%s'; disabling input", + ic->input_type, ic->identifier, ic->mapped_to_output); + changed |= set_send_events(device, + LIBINPUT_CONFIG_SEND_EVENTS_DISABLED); + } else if (ic->send_events != INT_MIN) { + changed |= set_send_events(device, ic->send_events); + } else { + // Have to reset to the default mode here, otherwise if ic->send_events + // is unset and a mapped output just came online after being disabled, + // we'd remain stuck sending no events. + changed |= set_send_events(device, + libinput_device_config_send_events_get_default_mode(device)); + } + + if (ic->tap != INT_MIN) { + changed |= set_tap(device, ic->tap); + } + if (ic->tap_button_map != INT_MIN) { + changed |= set_tap_button_map(device, ic->tap_button_map); + } + if (ic->drag != INT_MIN) { + changed |= set_tap_drag(device, ic->drag); + } + if (ic->drag_lock != INT_MIN) { + changed |= set_tap_drag_lock(device, ic->drag_lock); + } + if (ic->pointer_accel != FLT_MIN) { + changed |= set_accel_speed(device, ic->pointer_accel); + } + if (ic->accel_profile != INT_MIN) { + changed |= set_accel_profile(device, ic->accel_profile); + } + if (ic->natural_scroll != INT_MIN) { + changed |= set_natural_scroll(device, ic->natural_scroll); + } + if (ic->left_handed != INT_MIN) { + changed |= set_left_handed(device, ic->left_handed); + } + if (ic->click_method != INT_MIN) { + changed |= set_click_method(device, ic->click_method); + } + if (ic->middle_emulation != INT_MIN) { + changed |= set_middle_emulation(device, ic->middle_emulation); + } + if (ic->scroll_method != INT_MIN) { + changed |= set_scroll_method(device, ic->scroll_method); + } + if (ic->scroll_button != INT_MIN) { + changed |= set_scroll_button(device, ic->scroll_button); + } + if (ic->dwt != INT_MIN) { + changed |= set_dwt(device, ic->dwt); + } + if (ic->calibration_matrix.configured) { + changed |= set_calibration_matrix(device, ic->calibration_matrix.matrix); + } +} + +void cg_input_reset_libinput_device(struct cg_input_device *input_device) { + if (!wlr_input_device_is_libinput(input_device->wlr_device)) { + return; + } + + struct libinput_device *device = + wlr_libinput_get_device_handle(input_device->wlr_device); + wlr_log(WLR_DEBUG, "cg_input_reset_libinput_device(%s)", + input_device->identifier); + bool changed = false; + + changed |= set_send_events(device, + libinput_device_config_send_events_get_default_mode(device)); + changed |= set_tap(device, + libinput_device_config_tap_get_default_enabled(device)); + changed |= set_tap_button_map(device, + libinput_device_config_tap_get_default_button_map(device)); + changed |= set_tap_drag(device, + libinput_device_config_tap_get_default_drag_enabled(device)); + changed |= set_tap_drag_lock(device, + libinput_device_config_tap_get_default_drag_lock_enabled(device)); + changed |= set_accel_speed(device, + libinput_device_config_accel_get_default_speed(device)); + changed |= set_accel_profile(device, + libinput_device_config_accel_get_default_profile(device)); + changed |= set_natural_scroll(device, + libinput_device_config_scroll_get_default_natural_scroll_enabled( + device)); + changed |= set_left_handed(device, + libinput_device_config_left_handed_get_default(device)); + changed |= set_click_method(device, + libinput_device_config_click_get_default_method(device)); + changed |= set_middle_emulation(device, + libinput_device_config_middle_emulation_get_default_enabled(device)); + changed |= set_scroll_method(device, + libinput_device_config_scroll_get_default_method(device)); + changed |= set_scroll_button(device, + libinput_device_config_scroll_get_default_button(device)); + changed |= set_dwt(device, + libinput_device_config_dwt_get_default_enabled(device)); + + float matrix[6]; + libinput_device_config_calibration_get_default_matrix(device, matrix); + changed |= set_calibration_matrix(device, matrix); +} + +bool cg_libinput_device_is_builtin(struct cg_input_device *cg_device) { + if (!wlr_input_device_is_libinput(cg_device->wlr_device)) { + return false; + } + + struct libinput_device *device = + wlr_libinput_get_device_handle(cg_device->wlr_device); + struct udev_device *udev_device = + libinput_device_get_udev_device(device); + if (!udev_device) { + return false; + } + + const char *id_path = udev_device_get_property_value(udev_device, "ID_PATH"); + if (!id_path) { + return false; + } + + const char prefix[] = "platform-"; + return strncmp(id_path, prefix, strlen(prefix)) == 0; +} diff --git a/meson.build b/meson.build index 474a2c2..872ae1b 100644 --- a/meson.build +++ b/meson.build @@ -64,6 +64,8 @@ cairo = dependency('cairo') pango = dependency('pango') pangocairo = dependency('pangocairo') fontconfig = dependency('fontconfig') +libinput = dependency('libinput') +libudev = dependency('libudev') math = cc.find_library('m') wl_protocol_dir = wayland_protos.get_pkgconfig_variable('pkgdatadir') @@ -123,6 +125,7 @@ conf_data.set_quoted('CG_VERSION', version) cagebreak_main_file = [ 'cagebreak.c', ] cagebreak_source_strings = [ 'idle_inhibit_v1.c', + 'input_manager.c', 'ipc_server.c', 'keybinding.c', 'workspace.c', @@ -133,6 +136,7 @@ cagebreak_source_strings = [ 'util.c', 'view.c', 'xdg_shell.c', + 'libinput.c', 'server.c', 'message.c', 'pango.c', @@ -186,6 +190,8 @@ cagebreak_dependencies_dict = { 'wlroots': [wlroots,true], 'xkbcommon': [xkbcommon,true], 'fontconfig': [fontconfig,true], + 'libinput': [libinput,true], + 'libudev': [libudev,true], 'pixman': [pixman,true], 'pango': [pango,true], 'cairo': [cairo,true], @@ -201,6 +207,8 @@ reproducible_build_versions = { 'wlroots': '0.14.1', 'xkbcommon': '1.3.0', 'fontconfig': '2.13.94', + 'libinput': '2.13.94', + 'libudev': '2.13.94', 'pixman': '0.40.0', 'pango': '1.48.7', 'cairo': '1.17.4', diff --git a/seat.c b/seat.c index 51450ac..ae2f748 100644 --- a/seat.c +++ b/seat.c @@ -32,6 +32,7 @@ #endif #include "keybinding.h" +#include "input_manager.h" #include "message.h" #include "output.h" #include "seat.h" @@ -112,13 +113,13 @@ static void update_capabilities(const struct cg_seat *seat) { uint32_t caps = 0; - if(!wl_list_empty(&seat->keyboard_groups)) { + if(seat->num_keyboards>0) { caps |= WL_SEAT_CAPABILITY_KEYBOARD; } - if(!wl_list_empty(&seat->pointers)) { + if(seat->num_pointers>0) { caps |= WL_SEAT_CAPABILITY_POINTER; } - if(!wl_list_empty(&seat->touch)) { + if(seat->num_touch>0) { caps |= WL_SEAT_CAPABILITY_TOUCH; } wlr_seat_set_capabilities(seat->seat, caps); @@ -133,20 +134,21 @@ update_capabilities(const struct cg_seat *seat) { } static void -handle_touch_destroy(struct wl_listener *listener, void *_data) { - struct cg_touch *touch = wl_container_of(listener, touch, destroy); - struct cg_seat *seat = touch->seat; - +remove_touch(struct cg_seat *seat, struct cg_touch *touch) { + if(!touch) { + return; + } wl_list_remove(&touch->link); - wlr_cursor_detach_input_device(seat->cursor, touch->device); - wl_list_remove(&touch->destroy.link); + wlr_cursor_detach_input_device(seat->cursor, touch->device->wlr_device); + --seat->num_touch; free(touch); update_capabilities(seat); } static void -handle_new_touch(struct cg_seat *seat, struct wlr_input_device *device) { +new_touch(struct cg_seat *seat, struct cg_input_device *input_device) { + struct wlr_input_device *device=input_device->wlr_device; struct cg_touch *touch = calloc(1, sizeof(struct cg_touch)); if(!touch) { wlr_log(WLR_ERROR, "Cannot allocate touch"); @@ -154,12 +156,10 @@ handle_new_touch(struct cg_seat *seat, struct wlr_input_device *device) { } touch->seat = seat; - touch->device = device; + touch->device = input_device; wlr_cursor_attach_input_device(seat->cursor, device); - - wl_list_insert(&seat->touch, &touch->link); - touch->destroy.notify = handle_touch_destroy; - wl_signal_add(&touch->device->events.destroy, &touch->destroy); + input_device->touch=touch; + ++seat->num_touch; if(device->output_name != NULL) { struct cg_output *output; @@ -174,20 +174,20 @@ handle_new_touch(struct cg_seat *seat, struct wlr_input_device *device) { } static void -handle_pointer_destroy(struct wl_listener *listener, void *_data) { - struct cg_pointer *pointer = wl_container_of(listener, pointer, destroy); - struct cg_seat *seat = pointer->seat; - - wl_list_remove(&pointer->link); - wlr_cursor_detach_input_device(seat->cursor, pointer->device); - wl_list_remove(&pointer->destroy.link); +remove_pointer(struct cg_seat *seat, struct cg_pointer *pointer) { + if(!pointer) { + return; + } + wlr_cursor_detach_input_device(seat->cursor, pointer->device->wlr_device); + --seat->num_pointers; free(pointer); update_capabilities(seat); } static void -handle_new_pointer(struct cg_seat *seat, struct wlr_input_device *device) { +new_pointer(struct cg_seat *seat, struct cg_input_device *input_device) { + struct wlr_input_device *device=input_device->wlr_device; struct cg_pointer *pointer = calloc(1, sizeof(struct cg_pointer)); if(!pointer) { wlr_log(WLR_ERROR, "Cannot allocate pointer"); @@ -195,12 +195,10 @@ handle_new_pointer(struct cg_seat *seat, struct wlr_input_device *device) { } pointer->seat = seat; - pointer->device = device; + pointer->device = input_device; wlr_cursor_attach_input_device(seat->cursor, device); - - wl_list_insert(&seat->pointers, &pointer->link); - pointer->destroy.notify = handle_pointer_destroy; - wl_signal_add(&device->events.destroy, &pointer->destroy); + input_device->pointer=pointer; + ++seat->num_pointers; if(device->output_name != NULL) { struct cg_output *output; @@ -431,10 +429,11 @@ cleanup: } static void -handle_new_keyboard(struct cg_seat *seat, struct wlr_input_device *device) { +new_keyboard(struct cg_seat *seat, struct cg_input_device *input_device) { + struct wlr_input_device *device= input_device->wlr_device; struct xkb_context *context = xkb_context_new(XKB_CONTEXT_NO_FLAGS); if(!context) { - wlr_log(WLR_ERROR, "Unable to create XBK context"); + wlr_log(WLR_ERROR, "Unable to create XKB context"); return; } @@ -460,24 +459,63 @@ handle_new_keyboard(struct cg_seat *seat, struct wlr_input_device *device) { wlr_keyboard_set_repeat_info(device->keyboard, 25, 600); cg_keyboard_group_add(device, seat); + ++seat->num_keyboards; wlr_seat_set_keyboard(seat->seat, device); } -static void -handle_new_input(struct wl_listener *listener, void *data) { - struct cg_seat *seat = wl_container_of(listener, seat, new_input); - struct wlr_input_device *device = data; - - switch(device->type) { +void +seat_add_device(struct cg_seat *seat, struct cg_input_device *device) { + switch(device->wlr_device->type) { case WLR_INPUT_DEVICE_KEYBOARD: - handle_new_keyboard(seat, device); + new_keyboard(seat, device); break; case WLR_INPUT_DEVICE_POINTER: - handle_new_pointer(seat, device); + new_pointer(seat, device); break; case WLR_INPUT_DEVICE_TOUCH: - handle_new_touch(seat, device); + new_touch(seat, device); + break; + case WLR_INPUT_DEVICE_SWITCH: + wlr_log(WLR_DEBUG, "Switch input is not implemented"); + return; + case WLR_INPUT_DEVICE_TABLET_TOOL: + case WLR_INPUT_DEVICE_TABLET_PAD: + wlr_log(WLR_DEBUG, "Tablet input is not implemented"); + return; + } + + update_capabilities(seat); +} + +void remove_keyboard(struct cg_seat *seat, struct cg_input_device *keyboard) { + if (!keyboard) { + return; + } + struct wlr_seat *wlr_seat = seat->seat; + struct wlr_keyboard *wlr_keyboard = keyboard->wlr_device->keyboard; + if (keyboard->wlr_device->keyboard->group) { + wlr_keyboard_group_remove_keyboard(wlr_keyboard->group,wlr_keyboard); + } + if (wlr_seat_get_keyboard(wlr_seat) == wlr_keyboard) { + wlr_seat_set_keyboard(wlr_seat, NULL); + } + --seat->num_keyboards; +} + +void +seat_remove_device(struct cg_seat *seat, struct cg_input_device *device) { + switch(device->wlr_device->type) { + case WLR_INPUT_DEVICE_KEYBOARD: + remove_keyboard(seat, device); + break; + case WLR_INPUT_DEVICE_POINTER: + remove_pointer(seat, device->pointer); + device->pointer=NULL; + break; + case WLR_INPUT_DEVICE_TOUCH: + remove_touch(seat, device->touch); + device->touch=NULL; break; case WLR_INPUT_DEVICE_SWITCH: wlr_log(WLR_DEBUG, "Switch input is not implemented"); @@ -801,15 +839,11 @@ handle_destroy(struct wl_listener *listener, void *_data) { wl_event_source_remove(group->key_repeat_timer); free(group); } - struct cg_pointer *pointer, *pointer_tmp; - wl_list_for_each_safe(pointer, pointer_tmp, &seat->pointers, link) { - handle_pointer_destroy(&pointer->destroy, NULL); + + struct cg_input_device *it, *it_tmp; + wl_list_for_each_safe(it, it_tmp, &seat->server->input->devices, link) { + input_manager_handle_device_destroy(&it->device_destroy,NULL); } - struct cg_touch *touch, *touch_tmp; - wl_list_for_each_safe(touch, touch_tmp, &seat->touch, link) { - handle_touch_destroy(&touch->destroy, NULL); - } - wl_list_remove(&seat->new_input.link); wlr_xcursor_manager_destroy(seat->xcursor_manager); if(seat->cursor) { @@ -898,11 +932,9 @@ seat_create(struct cg_server *server, struct wlr_backend *backend) { &seat->request_set_primary_selection); wl_list_init(&seat->keyboard_groups); - wl_list_init(&seat->pointers); - wl_list_init(&seat->touch); - - seat->new_input.notify = handle_new_input; - wl_signal_add(&backend->events.new_input, &seat->new_input); + seat->num_keyboards=0; + seat->num_pointers=0; + seat->num_touch=0; wl_list_init(&seat->drag_icons); seat->request_start_drag.notify = handle_request_start_drag; diff --git a/seat.h b/seat.h index a7632d7..9331042 100644 --- a/seat.h +++ b/seat.h @@ -7,6 +7,7 @@ struct cg_server; struct cg_view; struct wlr_cursor; struct wlr_input_device; +struct cg_input_device; struct wlr_seat; struct wlr_xcursor_manager; struct wlr_backend; @@ -20,9 +21,10 @@ struct cg_seat { struct wl_listener destroy; struct wl_list keyboard_groups; - struct wl_list pointers; - struct wl_list touch; - struct wl_listener new_input; + + uint16_t num_keyboards; + uint16_t num_pointers; + uint16_t num_touch; struct wlr_cursor *cursor; struct wlr_xcursor_manager *xcursor_manager; @@ -70,17 +72,13 @@ struct cg_keyboard_group { struct cg_pointer { struct wl_list link; // seat::pointers struct cg_seat *seat; - struct wlr_input_device *device; - - struct wl_listener destroy; + struct cg_input_device *device; }; struct cg_touch { struct wl_list link; // seat::touch struct cg_seat *seat; - struct wlr_input_device *device; - - struct wl_listener destroy; + struct cg_input_device *device; }; struct cg_drag_icon { @@ -102,5 +100,9 @@ struct cg_view * seat_get_focus(const struct cg_seat *seat); void seat_set_focus(struct cg_seat *seat, struct cg_view *view); +void +seat_add_device(struct cg_seat *seat, struct cg_input_device *device); +void +seat_remove_device(struct cg_seat *seat, struct cg_input_device *device); #endif diff --git a/server.h b/server.h index 4e594b9..79bb408 100644 --- a/server.h +++ b/server.h @@ -13,12 +13,14 @@ struct keybinding_list; struct wlr_output_layout; struct wlr_idle_inhibit_manager_v1; struct cg_output_config; +struct cg_input_manager; struct cg_server { struct wl_display *wl_display; struct wl_event_loop *event_loop; struct cg_seat *seat; + struct cg_input_manager *input; struct wlr_backend *backend; struct wlr_idle *idle; struct wlr_idle_inhibit_manager_v1 *idle_inhibit_v1; @@ -39,6 +41,7 @@ struct cg_server { struct keybinding_list *keybindings; struct wl_list output_config; + struct wl_list input_config; enum wl_output_transform output_transform; From f9efd40c9de45bf74a870d9a029c1ffac9ef187c Mon Sep 17 00:00:00 2001 From: project-repo Date: Wed, 15 Sep 2021 08:37:50 +0200 Subject: [PATCH 289/689] Implement libinput device configuration --- cagebreak.c | 5 +- input.h | 8 +- input_manager.c | 87 ++++++++-------- input_manager.h | 10 +- keybinding.c | 20 ++++ keybinding.h | 4 + libinput.c | 147 +++++++++++++++++++-------- meson.build | 3 + parse.c | 264 ++++++++++++++++++++++++++++++++++++++++++++---- 9 files changed, 430 insertions(+), 118 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index 7794b40..90e767b 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -1,4 +1,4 @@ - * + /* * Cagebreak: A Wayland tiling compositor. * * Copyright (C) 2018-2020 Jente Hidskes @@ -362,8 +362,6 @@ main(int argc, char *argv[]) { } server.input = input_manager_create(&server); - fprintf(stderr, "input_manager_create:%d\n",wl_list_length(&server.input->devices)); - data_control_manager = wlr_data_control_manager_v1_create(server.wl_display); @@ -599,6 +597,7 @@ end: wl_display_destroy(server.wl_display); wlr_output_layout_destroy(server.output_layout); + free(server.input); pango_cairo_font_map_set_default(NULL); cairo_debug_reset_static_data(); FcFini(); diff --git a/input.h b/input.h index c2ba243..139fadf 100644 --- a/input.h +++ b/input.h @@ -1,12 +1,16 @@ -#ifndef _LIBINPUT_H -#define _LIBINPUT_H +#ifndef _CG_INPUT_H +#define _CG_INPUT_H #include struct cg_input_device; +struct cg_input_config; +struct cg_server; void cg_input_configure_libinput_device(struct cg_input_device *device); +void cg_input_apply_config(struct cg_input_config *config, struct cg_server *server); + void cg_input_reset_libinput_device(struct cg_input_device *device); bool cg_libinput_device_is_builtin(struct cg_input_device *device); diff --git a/input_manager.c b/input_manager.c index 8232891..1a2646d 100644 --- a/input_manager.c +++ b/input_manager.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -210,58 +211,50 @@ struct cg_input_manager *input_manager_create(struct cg_server *server) { return input; } -static bool device_is_touchpad(struct cg_input_device *device) { - if (device->wlr_device->type != WLR_INPUT_DEVICE_POINTER || - !wlr_input_device_is_libinput(device->wlr_device)) { - return false; +uint32_t get_mouse_bindsym(const char *name, char **error) { + // Get event code from name + int code = libevdev_event_code_from_name(EV_KEY, name); + if (code == -1) { + size_t len = snprintf(NULL, 0, "Unknown event %s", name) + 1; + *error = malloc(len); + if (*error) { + snprintf(*error, len, "Unknown event %s", name); + } + return 0; } - - struct libinput_device *libinput_device = - wlr_libinput_get_device_handle(device->wlr_device); - - return libinput_device_config_tap_get_finger_count(libinput_device) > 0; + return code; } -const char *input_device_get_type(struct cg_input_device *device) { - switch (device->wlr_device->type) { - case WLR_INPUT_DEVICE_POINTER: - if (device_is_touchpad(device)) { - return "touchpad"; - } else { - return "pointer"; - } - case WLR_INPUT_DEVICE_KEYBOARD: - return "keyboard"; - case WLR_INPUT_DEVICE_TOUCH: - return "touch"; - case WLR_INPUT_DEVICE_TABLET_TOOL: - return "tablet_tool"; - case WLR_INPUT_DEVICE_TABLET_PAD: - return "tablet_pad"; - case WLR_INPUT_DEVICE_SWITCH: - return "switch"; +uint32_t get_mouse_bindcode(const char *name, char **error) { + // Validate event code + errno = 0; + char *endptr; + int code = strtol(name, &endptr, 10); + if (endptr == name && code <= 0) { + *error = strdup("Button event code must be a positive integer."); + return 0; + } else if (errno == ERANGE) { + *error = strdup("Button event code out of range."); + return 0; } - return "unknown"; + const char *event = libevdev_event_code_get_name(EV_KEY, code); + if (!event || strncmp(event, "BTN_", strlen("BTN_")) != 0) { + size_t len = snprintf(NULL, 0, "Event code %d (%s) is not a button", + code, event ? event : "(null)") + 1; + *error = malloc(len); + if (*error) { + snprintf(*error, len, "Event code %d (%s) is not a button", + code, event ? event : "(null)"); + } + return 0; + } + return code; } -struct cg_input_config *input_device_get_config(struct cg_input_device *device) { - struct cg_server *server=device->server; - struct cg_input_config *wildcard_config = NULL; - struct cg_input_config *config = NULL; - wl_list_for_each(config, &server->input_config, link) { - if (strcmp(config->identifier, device->identifier) == 0) { - return config; - } else if (strcmp(config->identifier, "*") == 0) { - wildcard_config = config; - } +uint32_t input_manager_get_mouse_button(const char *name, char **error) { + uint32_t button = get_mouse_bindsym(name, error); + if (!button && !*error) { + button = get_mouse_bindcode(name, error); } - - const char *device_type = input_device_get_type(device); - wl_list_for_each(config, &server->input_config, link) { - if (strncmp(config->identifier,"type:",5)&&strcmp(config->identifier + 5, device_type) == 0) { - return config; - } - } - - return wildcard_config; + return button; } diff --git a/input_manager.h b/input_manager.h index d0bd3ff..de8e69b 100644 --- a/input_manager.h +++ b/input_manager.h @@ -10,6 +10,7 @@ struct cg_input_manager *input_manager_create(struct cg_server *server); struct cg_input_config *input_device_get_config(struct cg_input_device *device); void input_manager_handle_device_destroy(struct wl_listener *listener, void *data); +uint32_t input_manager_get_mouse_button(const char *name, char **error); struct cg_input_manager { struct wl_list devices; @@ -46,7 +47,6 @@ enum cg_input_config_mapped_to { */ struct cg_input_config { char *identifier; - const char *input_type; int accel_profile; struct calibration_matrix calibration_matrix; @@ -67,7 +67,7 @@ struct cg_input_config { int tap; int tap_button_map; - char *xkb_layout; +/* char *xkb_layout; char *xkb_model; char *xkb_options; char *xkb_rules; @@ -77,16 +77,16 @@ struct cg_input_config { bool xkb_file_is_set; int xkb_numlock; - int xkb_capslock; + int xkb_capslock;*/ struct wl_list link; struct cg_input_config_mapped_from_region *mapped_from_region; enum cg_input_config_mapped_to mapped_to; char *mapped_to_output; - struct wlr_box *mapped_to_region; + /*struct wlr_box *mapped_to_region;*/ - struct wl_list tools; + /*struct wl_list tools;*/ bool capturable; struct wlr_box region; diff --git a/keybinding.c b/keybinding.c index 4eec370..5ffee81 100644 --- a/keybinding.c +++ b/keybinding.c @@ -12,6 +12,7 @@ #include "keybinding.h" #include "message.h" #include "output.h" +#include "input.h" #include "input_manager.h" #include "seat.h" #include "server.h" @@ -64,6 +65,16 @@ keybinding_free(struct keybinding *keybinding, bool recursive) { case KEYBINDING_CONFIGURE_OUTPUT: free(keybinding->data.o_cfg->output_name); free(keybinding->data.o_cfg); + break; + case KEYBINDING_CONFIGURE_INPUT: + free(keybinding->data.i_cfg->identifier); + if(keybinding->data.i_cfg->mapped_from_region) { + free(keybinding->data.i_cfg->mapped_from_region); + } + if(keybinding->data.i_cfg->mapped_to_output) { + free(keybinding->data.i_cfg->mapped_to_output); + } + free(keybinding->data.o_cfg); default: break; } @@ -871,6 +882,12 @@ keybinding_configure_output(struct cg_server *server, } } +void +keybinding_configure_input(struct cg_server *server, + struct cg_input_config *cfg) { + cg_input_apply_config(cfg,server); +} + void keybinding_configure_input_dev(struct cg_server *server, struct cg_input_config *cfg) { @@ -1001,6 +1018,9 @@ run_action(enum keybinding_action action, struct cg_server *server, case KEYBINDING_CONFIGURE_OUTPUT: keybinding_configure_output(server, data.o_cfg); break; + case KEYBINDING_CONFIGURE_INPUT: + keybinding_configure_input(server, data.i_cfg); + break; case KEYBINDING_CLOSE_VIEW: keybinding_close_view( server->curr_output->workspaces[server->curr_output->curr_workspace] diff --git a/keybinding.h b/keybinding.h index 705a4ab..8db9de4 100644 --- a/keybinding.h +++ b/keybinding.h @@ -5,6 +5,7 @@ #include "config.h" #include +#include #include struct cg_server; @@ -24,6 +25,8 @@ enum keybinding_action { KEYBINDING_CYCLE_OUTPUT, // data.b is 0 if forward, 1 if reverse KEYBINDING_CONFIGURE_OUTPUT, // data.o_cfg is the desired output // configuration + KEYBINDING_CONFIGURE_INPUT, // data.i_cfg is the desired input + // configuration KEYBINDING_QUIT, KEYBINDING_NOOP, KEYBINDING_SWITCH_WORKSPACE, // data.u is the desired workspace @@ -61,6 +64,7 @@ union keybinding_params { float color[3]; struct keybinding *kb; struct cg_output_config *o_cfg; + struct cg_input_config *i_cfg; }; struct keybinding { diff --git a/libinput.c b/libinput.c index d5a3bba..fd9ce4c 100644 --- a/libinput.c +++ b/libinput.c @@ -207,76 +207,137 @@ struct cg_output *output_by_name_or_id(const char *name_or_id, struct cg_server return NULL; } -void cg_input_configure_libinput_device(struct cg_input_device *input_device) { - struct cg_input_config *ic = input_device_get_config(input_device); - if (!ic || !wlr_input_device_is_libinput(input_device->wlr_device)) { +static bool device_is_touchpad(struct cg_input_device *device) { + if (device->wlr_device->type != WLR_INPUT_DEVICE_POINTER || + !wlr_input_device_is_libinput(device->wlr_device)) { + return false; + } + + struct libinput_device *libinput_device = + wlr_libinput_get_device_handle(device->wlr_device); + + return libinput_device_config_tap_get_finger_count(libinput_device) > 0; +} + +const char *input_device_get_type(struct cg_input_device *device) { + switch (device->wlr_device->type) { + case WLR_INPUT_DEVICE_POINTER: + if (device_is_touchpad(device)) { + return "touchpad"; + } else { + return "pointer"; + } + case WLR_INPUT_DEVICE_KEYBOARD: + return "keyboard"; + case WLR_INPUT_DEVICE_TOUCH: + return "touch"; + case WLR_INPUT_DEVICE_TABLET_TOOL: + return "tablet_tool"; + case WLR_INPUT_DEVICE_TABLET_PAD: + return "tablet_pad"; + case WLR_INPUT_DEVICE_SWITCH: + return "switch"; + } + return "unknown"; +} + +void apply_config_to_device(struct cg_input_config *config, struct cg_input_device *input_device) { + if (!wlr_input_device_is_libinput(input_device->wlr_device)) { return; } struct libinput_device *device = wlr_libinput_get_device_handle(input_device->wlr_device); - wlr_log(WLR_DEBUG, "cg_input_configure_libinput_device('%s' on '%s')", - ic->identifier, input_device->identifier); - - bool changed = false; - if (ic->mapped_to_output && - !output_by_name_or_id(ic->mapped_to_output,input_device->server)) { + if (config->mapped_to_output && + !output_by_name_or_id(config->mapped_to_output,input_device->server)) { wlr_log(WLR_DEBUG, - "%s '%s' is mapped to offline output '%s'; disabling input", - ic->input_type, ic->identifier, ic->mapped_to_output); - changed |= set_send_events(device, + "'%s' is mapped to offline output '%s'; disabling input", + config->identifier, config->mapped_to_output); + set_send_events(device, LIBINPUT_CONFIG_SEND_EVENTS_DISABLED); - } else if (ic->send_events != INT_MIN) { - changed |= set_send_events(device, ic->send_events); + } else if (config->send_events != INT_MIN) { + set_send_events(device, config->send_events); } else { // Have to reset to the default mode here, otherwise if ic->send_events // is unset and a mapped output just came online after being disabled, // we'd remain stuck sending no events. - changed |= set_send_events(device, + set_send_events(device, libinput_device_config_send_events_get_default_mode(device)); } - if (ic->tap != INT_MIN) { - changed |= set_tap(device, ic->tap); + if (config->tap != INT_MIN) { + set_tap(device, config->tap); } - if (ic->tap_button_map != INT_MIN) { - changed |= set_tap_button_map(device, ic->tap_button_map); + if (config->tap_button_map != INT_MIN) { + set_tap_button_map(device, config->tap_button_map); } - if (ic->drag != INT_MIN) { - changed |= set_tap_drag(device, ic->drag); + if (config->drag != INT_MIN) { + set_tap_drag(device, config->drag); } - if (ic->drag_lock != INT_MIN) { - changed |= set_tap_drag_lock(device, ic->drag_lock); + if (config->drag_lock != INT_MIN) { + set_tap_drag_lock(device, config->drag_lock); } - if (ic->pointer_accel != FLT_MIN) { - changed |= set_accel_speed(device, ic->pointer_accel); + if (config->pointer_accel != FLT_MIN) { + set_accel_speed(device, config->pointer_accel); } - if (ic->accel_profile != INT_MIN) { - changed |= set_accel_profile(device, ic->accel_profile); + if (config->accel_profile != INT_MIN) { + set_accel_profile(device, config->accel_profile); } - if (ic->natural_scroll != INT_MIN) { - changed |= set_natural_scroll(device, ic->natural_scroll); + if (config->natural_scroll != INT_MIN) { + set_natural_scroll(device, config->natural_scroll); } - if (ic->left_handed != INT_MIN) { - changed |= set_left_handed(device, ic->left_handed); + if (config->left_handed != INT_MIN) { + set_left_handed(device, config->left_handed); } - if (ic->click_method != INT_MIN) { - changed |= set_click_method(device, ic->click_method); + if (config->click_method != INT_MIN) { + set_click_method(device, config->click_method); } - if (ic->middle_emulation != INT_MIN) { - changed |= set_middle_emulation(device, ic->middle_emulation); + if (config->middle_emulation != INT_MIN) { + set_middle_emulation(device, config->middle_emulation); } - if (ic->scroll_method != INT_MIN) { - changed |= set_scroll_method(device, ic->scroll_method); + if (config->scroll_method != INT_MIN) { + set_scroll_method(device, config->scroll_method); } - if (ic->scroll_button != INT_MIN) { - changed |= set_scroll_button(device, ic->scroll_button); + if (config->scroll_button != INT_MIN) { + set_scroll_button(device, config->scroll_button); } - if (ic->dwt != INT_MIN) { - changed |= set_dwt(device, ic->dwt); + if (config->dwt != INT_MIN) { + set_dwt(device, config->dwt); } - if (ic->calibration_matrix.configured) { - changed |= set_calibration_matrix(device, ic->calibration_matrix.matrix); + if (config->calibration_matrix.configured) { + set_calibration_matrix(device, config->calibration_matrix.matrix); + } +} + +void cg_input_apply_config(struct cg_input_config *config, struct cg_server *server) { + struct cg_input_device *device=NULL; + wl_list_for_each(device,&server->input->devices,link) { + if (strcmp(config->identifier, device->identifier) != 0&&strcmp(config->identifier, "*") != 0) { + continue; + } + + const char *device_type = input_device_get_type(device); + if (strncmp(config->identifier,"type:",5)==0&&strcmp(config->identifier + 5, device_type) != 0) { + continue; + } + apply_config_to_device(config,device); + } +} + +void cg_input_configure_libinput_device(struct cg_input_device *input_device) { + struct cg_server *server=input_device->server; + struct cg_input_config *config = NULL; + + wl_list_for_each(config, &server->input_config, link) { + if (strcmp(config->identifier, input_device->identifier) != 0&&strcmp(config->identifier, "*") != 0) { + continue; + } + + const char *device_type = input_device_get_type(input_device); + if (!(strncmp(config->identifier,"type:",5)&&strcmp(config->identifier + 5, device_type) == 0)) { + continue; + } + apply_config_to_device(config,input_device); } } diff --git a/meson.build b/meson.build index 872ae1b..7ab216b 100644 --- a/meson.build +++ b/meson.build @@ -65,6 +65,7 @@ pango = dependency('pango') pangocairo = dependency('pangocairo') fontconfig = dependency('fontconfig') libinput = dependency('libinput') +libevdev = dependency('libevdev') libudev = dependency('libudev') math = cc.find_library('m') @@ -191,6 +192,7 @@ cagebreak_dependencies_dict = { 'xkbcommon': [xkbcommon,true], 'fontconfig': [fontconfig,true], 'libinput': [libinput,true], + 'libevdev': [libevdev,true], 'libudev': [libudev,true], 'pixman': [pixman,true], 'pango': [pango,true], @@ -208,6 +210,7 @@ reproducible_build_versions = { 'xkbcommon': '1.3.0', 'fontconfig': '2.13.94', 'libinput': '2.13.94', + 'libevdev': '2.13.94', 'libudev': '2.13.94', 'pixman': '0.40.0', 'pango': '1.48.7', diff --git a/parse.c b/parse.c index 46b275a..3faccbd 100644 --- a/parse.c +++ b/parse.c @@ -1,11 +1,14 @@ #define _POSIX_C_SOURCE 200812L #include +#include #include #include +#include #include "keybinding.h" #include "output.h" +#include "input_manager.h" #include "parse.h" #include "server.h" @@ -106,6 +109,242 @@ parse_keybinding(struct cg_server *server, char **saveptr, char **errstr) { return keybinding; } +float +parse_float(char **saveptr, const char *delim) { + char *uint_str = strtok_r(NULL, delim, saveptr); + if(uint_str == NULL) { + wlr_log(WLR_ERROR, "Expected a float, got nothing"); + return -1; + } + float ufloat = strtof(uint_str, NULL); + if(ufloat != NAN && ufloat != INFINITY && errno!=ERANGE) { + return ufloat; + } else { + wlr_log(WLR_ERROR, "Error parsing float"); + return FLT_MIN; + } +} + +struct cg_input_config * +parse_input_config(char **saveptr, char **errstr) { + struct cg_input_config *cfg = calloc(1,sizeof(struct cg_input_config)); + char *value=NULL; + char *ident = NULL; + if(cfg == NULL) { + *errstr = + log_error("Failed to allocate memory for output configuration"); + goto error; + } + + cfg->tap = INT_MIN; + cfg->tap_button_map = INT_MIN; + cfg->drag = INT_MIN; + cfg->drag_lock = INT_MIN; + cfg->dwt = INT_MIN; + cfg->send_events = INT_MIN; + cfg->click_method = INT_MIN; + cfg->middle_emulation = INT_MIN; + cfg->natural_scroll = INT_MIN; + cfg->accel_profile = INT_MIN; + cfg->pointer_accel = FLT_MIN; + cfg->scroll_factor = FLT_MIN; + cfg->scroll_button = INT_MIN; + cfg->scroll_method = INT_MIN; + cfg->left_handed = INT_MIN; + cfg->repeat_delay = INT_MIN; + cfg->repeat_rate = INT_MIN; + /*cfg->xkb_numlock = INT_MIN; + cfg->xkb_capslock = INT_MIN; + cfg->xkb_file_is_set = false; + wl_list_init(&cfg->tools);*/ + + ident = strtok_r(NULL, " ", saveptr); + + if(ident == NULL) { + *errstr = log_error("Expected identifier of input device to configure, got none"); + goto error; + } + cfg->identifier=strdup(ident); + + char *setting = strtok_r(NULL, " ", saveptr); + if(setting == NULL) { + *errstr = + log_error("Expected setting to be set on input device, got none"); + goto error; + } + + value = strdup(*saveptr); + + if(value == NULL) { + *errstr = + log_error("Failed to obtain value for input device configuration of device \"%s\"",ident); + goto error; + } + + if(strcmp(setting,"accel_profile") == 0) { + if(strcmp(value,"adaptive") == 0) { + cfg->accel_profile=LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE; + } else if(strcmp(value,"flat") == 0) { + cfg->accel_profile=LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT; + } else { + *errstr = log_error("Invalid profile \"%s\" for accel_profile configuration", value); + goto error; + } + } else if(strcmp(setting,"calibration_matrix") == 0) { + cfg->calibration_matrix.configured=true; + for(int i=0;i<6;++i) { + cfg->calibration_matrix.matrix[i]=parse_float(saveptr," "); + if(cfg->calibration_matrix.matrix[i]==FLT_MIN) { + *errstr = log_error("Failed to read calibration matrix, expected 6 floating point values separated by spaces"); + goto error; + } + } + } else if(strcmp(setting,"click_method") == 0) { + if(strcmp(value,"none")) { + cfg->click_method=LIBINPUT_CONFIG_CLICK_METHOD_NONE; + } else if(strcmp(value,"button_areas")) { + cfg->click_method=LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS; + } else if(strcmp(value,"clickfinger")) { + cfg->click_method=LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER; + } else { + *errstr = log_error("Invalid method \"%s\" for click_method configuration", value); + goto error; + } + } else if(strcmp(setting,"drag") == 0) { + if(strcmp(value,"enabled") == 0) { + cfg->drag=LIBINPUT_CONFIG_DRAG_ENABLED; + } else if(strcmp(value,"disabled") == 0) { + cfg->drag=LIBINPUT_CONFIG_DRAG_DISABLED; + } else { + *errstr = log_error("Invalid option \"%s\" to setting \"drag\"", value); + goto error; + } + } else if(strcmp(setting,"drag_lock") == 0) { + if(strcmp(value,"enabled") == 0) { + cfg->drag_lock=LIBINPUT_CONFIG_DRAG_LOCK_ENABLED; + } else if(strcmp(value,"disabled") == 0) { + cfg->drag_lock=LIBINPUT_CONFIG_DRAG_LOCK_DISABLED; + } else { + *errstr = log_error("Invalid option \"%s\" to setting \"drag_lock\"", value); + goto error; + } + } else if(strcmp(setting,"dwt") == 0) { + if(strcmp(value,"enabled") == 0) { + cfg->dwt=LIBINPUT_CONFIG_DWT_ENABLED; + } else if(strcmp(value,"disabled") == 0) { + cfg->dwt=LIBINPUT_CONFIG_DWT_DISABLED; + } else { + *errstr = log_error("Invalid option \"%s\" to setting \"dwt\"", value); + goto error; + } + } else if(strcmp(setting,"events") == 0) { + if(strcmp(value,"enabled") == 0) { + cfg->send_events=LIBINPUT_CONFIG_SEND_EVENTS_ENABLED; + } else if(strcmp(value,"disabled") == 0) { + cfg->send_events=LIBINPUT_CONFIG_SEND_EVENTS_DISABLED; + } else if(strcmp(value,"disabled_on_external_mouse") == 0) { + cfg->send_events=LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE; + } else { + *errstr = log_error("Invalid option \"%s\" to setting \"events\"", value); + goto error; + } + } else if(strcmp(setting,"left_handed") == 0) { + if(strcmp(value,"enabled") == 0) { + cfg->left_handed=true; + } else if(strcmp(value,"disabled") == 0) { + cfg->left_handed=false; + } else { + *errstr = log_error("Invalid option \"%s\" to setting \"left_handed\"", value); + goto error; + } + } else if(strcmp(setting,"middle_emulation") == 0) { + if(strcmp(value,"enabled") == 0) { + cfg->middle_emulation=LIBINPUT_CONFIG_MIDDLE_EMULATION_ENABLED; + } else if(strcmp(value,"disabled") == 0) { + cfg->middle_emulation=LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED; + } else { + *errstr = log_error("Invalid option \"%s\" to setting \"middle_emulation\"", value); + goto error; + } + } else if(strcmp(setting,"natural_scroll") == 0) { + if(strcmp(value,"enabled") == 0) { + cfg->natural_scroll=true; + } else if(strcmp(value,"disabled") == 0) { + cfg->natural_scroll=false; + } else { + *errstr = log_error("Invalid option \"%s\" to setting \"natural_scroll\"", value); + goto error; + } + } else if(strcmp(setting,"pointer_accel") == 0) { + cfg->pointer_accel=parse_float(saveptr, " "); + if(cfg->pointer_accel==FLT_MIN) { + *errstr = log_error("Invalid option \"%s\" to setting \"pointer_accel\", expected float value", value); + goto error; + } + } else if(strcmp(setting,"scroll_button") == 0) { + char *err=NULL; + cfg->scroll_button=input_manager_get_mouse_button(value,&err); + if(err) { + *errstr = log_error("Error parsing button for \"scroll_button\" setting. Returned error \"%s\"", err); + goto error; + } + } else if(strcmp(setting,"scroll_factor") == 0) { + cfg->scroll_factor=parse_float(saveptr, " "); + if(cfg->scroll_factor==FLT_MIN) { + *errstr = log_error("Invalid option \"%s\" to setting \"scroll_factor\", expected float value", value); + goto error; + } + } else if(strcmp(setting,"scroll_method") == 0) { + if(strcmp(value,"none") == 0) { + cfg->scroll_method=LIBINPUT_CONFIG_SCROLL_NO_SCROLL; + } else if(strcmp(value,"two_finger") == 0) { + cfg->scroll_method=LIBINPUT_CONFIG_SCROLL_2FG; + } else if(strcmp(value,"edge") == 0) { + cfg->scroll_method=LIBINPUT_CONFIG_SCROLL_EDGE; + } else if(strcmp(value,"on_button_down") == 0) { + cfg->scroll_method=LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN; + } else { + *errstr = log_error("Invalid option \"%s\" to setting \"scroll_method\"", value); + goto error; + } + } else if(strcmp(setting,"tap") == 0) { + if(strcmp(value,"enabled") == 0) { + cfg->tap=LIBINPUT_CONFIG_TAP_ENABLED; + } else if(strcmp(value,"disabled") == 0) { + cfg->tap=LIBINPUT_CONFIG_TAP_DISABLED; + } else { + *errstr = log_error("Invalid option \"%s\" to setting \"tap\"", value); + goto error; + } + } else if(strcmp(setting,"tap_button_map") == 0) { + if(strcmp(value,"lrm") == 0) { + cfg->tap=LIBINPUT_CONFIG_TAP_MAP_LRM; + } else if(strcmp(value,"lmr") == 0) { + cfg->tap=LIBINPUT_CONFIG_TAP_MAP_LMR; + } else { + *errstr = log_error("Invalid option \"%s\" to setting \"tap_button_map\"", value); + goto error; + } + } + + free(value); + return cfg; + +error: + if(cfg) { + if(cfg->identifier) { + free(cfg->identifier); + } + free(cfg); + } + if(value) { + free(value); + } + wlr_log(WLR_ERROR, + "Input configuration must be of the form 'input \"\" '"); + return NULL; +} + struct keybinding * parse_bind(struct cg_server *server, char **saveptr, char **errstr) { struct keybinding *keybinding = parse_keybinding(server, saveptr, errstr); @@ -242,23 +481,6 @@ parse_uint(char **saveptr, const char *delim) { } } -float -parse_float(char **saveptr, const char *delim) { - char *uint_str = strtok_r(NULL, delim, saveptr); - if(uint_str == NULL) { - wlr_log(WLR_ERROR, "Expected a non-negative float, got nothing"); - return -1; - } - float ufloat = strtof(uint_str, NULL); - if(ufloat >= 0) { - return ufloat; - } else { - wlr_log(WLR_ERROR, "Error parsing non-negative float. Must be a number " - "larger or equal to 0"); - return -1; - } -} - int parse_output_config_keyword(char *key_str, enum output_status *status) { if(key_str == NULL) { @@ -353,7 +575,7 @@ parse_output_config(char **saveptr, char **errstr) { cfg->refresh_rate = parse_float(saveptr, " "); if(cfg->refresh_rate <= 0.0) { *errstr = log_error( - "Error parsing refresh rate of output configuration for output %s", + "Error parsing refresh rate of output configuration for output %s, expected positive float", name); goto error; } @@ -562,6 +784,12 @@ parse_command(struct cg_server *server, struct keybinding *keybinding, if(keybinding->data.o_cfg == NULL) { return -1; } + } else if(strcmp(action, "input") == 0) { + keybinding->action = KEYBINDING_CONFIGURE_INPUT; + keybinding->data.i_cfg = parse_input_config(&saveptr, errstr); + if(keybinding->data.i_cfg == NULL) { + return -1; + } } else { *errstr = log_error("Error, unsupported action \"%s\".", action); return -1; From c149918026c589baf248f90ec7bd4fe7a2a99bbc Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 16 Sep 2021 13:50:56 +0200 Subject: [PATCH 290/689] Fix memory leak --- parse.c | 1 + 1 file changed, 1 insertion(+) diff --git a/parse.c b/parse.c index 3faccbd..17b0e3d 100644 --- a/parse.c +++ b/parse.c @@ -286,6 +286,7 @@ parse_input_config(char **saveptr, char **errstr) { cfg->scroll_button=input_manager_get_mouse_button(value,&err); if(err) { *errstr = log_error("Error parsing button for \"scroll_button\" setting. Returned error \"%s\"", err); + free(err); goto error; } } else if(strcmp(setting,"scroll_factor") == 0) { From 54107a6876c0f4075ac0796f1d37c546a4a0ff85 Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 16 Sep 2021 13:51:15 +0200 Subject: [PATCH 291/689] Fix fuzzer --- fuzz/fuzz-lib.c | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/fuzz/fuzz-lib.c b/fuzz/fuzz-lib.c index cc7b6a4..c651add 100644 --- a/fuzz/fuzz-lib.c +++ b/fuzz/fuzz-lib.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -48,6 +49,7 @@ #include "../idle_inhibit_v1.h" #include "../keybinding.h" +#include "../input_manager.h" #include "../output.h" #include "../parse.h" #include "../seat.h" @@ -132,6 +134,7 @@ LLVMFuzzerInitialize(int *argc, char ***argv) { struct wlr_xdg_decoration_manager_v1 *xdg_decoration_manager = NULL; struct wlr_export_dmabuf_manager_v1 *export_dmabuf_manager = NULL; struct wlr_screencopy_manager_v1 *screencopy_manager = NULL; + struct wlr_data_control_manager_v1 *data_control_manager = NULL; struct wlr_xdg_output_manager_v1 *output_manager = NULL; struct wlr_gamma_control_manager_v1 *gamma_control_manager = NULL; int ret = 0; @@ -146,6 +149,8 @@ LLVMFuzzerInitialize(int *argc, char ***argv) { wlr_log_init(WLR_ERROR, NULL); #endif + wl_list_init(&server.input_config); + /* Wayland requires XDG_RUNTIME_DIR to be set. */ if(!getenv("XDG_RUNTIME_DIR")) { wlr_log(WLR_ERROR, "XDG_RUNTIME_DIR is not set in the environment"); @@ -235,6 +240,16 @@ LLVMFuzzerInitialize(int *argc, char ***argv) { goto end; } + server.input = input_manager_create(&server); + + data_control_manager = + wlr_data_control_manager_v1_create(server.wl_display); + if(!data_control_manager) { + wlr_log(WLR_ERROR, "Unable to create the data control manager"); + ret = 1; + goto end; + } + /* Configure a listener to be notified when new outputs are * available on the backend. We use this only to detect the * first output and ignore subsequent outputs. */ @@ -509,29 +524,15 @@ destroy_input_device(char *line, struct cg_server *server) { --devn; } } else if(strncmp(line, "p", 1) == 0) { - if(wl_list_empty(&server->seat->pointers)) { + if(wl_list_empty(&server->input->devices)) { return; } - devn = devn % wl_list_length(&server->seat->pointers); - struct cg_pointer *pointer, *pointer_tmp; - wl_list_for_each_safe(pointer, pointer_tmp, &server->seat->pointers, + devn = devn % wl_list_length(&server->input->devices); + struct cg_input_device *dev, *dev_tmp; + wl_list_for_each_safe(dev, dev_tmp, &server->input->devices, link) { if(devn == 0) { - pointer->destroy.notify(&pointer->destroy, NULL); - break; - } - --devn; - } - } else if(strncmp(line, "t", 1) == 0) { - if(wl_list_empty(&server->seat->touch)) { - return; - } - devn = devn % wl_list_length(&server->seat->touch); - struct cg_touch *touch, *touch_tmp; - wl_list_for_each_safe(touch, touch_tmp, &server->seat->touch, - link) { - if(devn == 0) { - touch->destroy.notify(&touch->destroy, NULL); + dev->device_destroy.notify(&dev->device_destroy, NULL); break; } --devn; From b878e48619495e0b307d93ef1989fa5a78d923ce Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 16 Sep 2021 14:06:15 +0200 Subject: [PATCH 292/689] Do not parse XKB_* env vars manually --- seat.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/seat.c b/seat.c index ae2f748..1694a7f 100644 --- a/seat.c +++ b/seat.c @@ -437,14 +437,8 @@ new_keyboard(struct cg_seat *seat, struct cg_input_device *input_device) { return; } - struct xkb_rule_names rules = {0}; - rules.rules = getenv("XKB_DEFAULT_RULES"); - rules.model = getenv("XKB_DEFAULT_MODEL"); - rules.layout = getenv("XKB_DEFAULT_LAYOUT"); - rules.variant = getenv("XKB_DEFAULT_VARIANT"); - rules.options = getenv("XKB_DEFAULT_OPTIONS"); struct xkb_keymap *keymap = - xkb_map_new_from_names(context, &rules, XKB_KEYMAP_COMPILE_NO_FLAGS); + xkb_map_new_from_names(context, NULL, XKB_KEYMAP_COMPILE_NO_FLAGS); if(!keymap) { wlr_log(WLR_ERROR, "Unable to configure keyboard: keymap does not exist"); From dec38bd8f01c65010481c7c29a1ac63fa91a1db7 Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 16 Sep 2021 14:08:58 +0200 Subject: [PATCH 293/689] Remove unused fields --- input_manager.h | 4 ++-- parse.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/input_manager.h b/input_manager.h index de8e69b..5aac953 100644 --- a/input_manager.h +++ b/input_manager.h @@ -59,8 +59,8 @@ struct cg_input_config { int natural_scroll; float pointer_accel; float scroll_factor; - int repeat_delay; - int repeat_rate; + /*int repeat_delay; + int repeat_rate;*/ int scroll_button; int scroll_method; int send_events; diff --git a/parse.c b/parse.c index 17b0e3d..5758e1e 100644 --- a/parse.c +++ b/parse.c @@ -151,9 +151,9 @@ parse_input_config(char **saveptr, char **errstr) { cfg->scroll_button = INT_MIN; cfg->scroll_method = INT_MIN; cfg->left_handed = INT_MIN; - cfg->repeat_delay = INT_MIN; + /*cfg->repeat_delay = INT_MIN; cfg->repeat_rate = INT_MIN; - /*cfg->xkb_numlock = INT_MIN; + cfg->xkb_numlock = INT_MIN; cfg->xkb_capslock = INT_MIN; cfg->xkb_file_is_set = false; wl_list_init(&cfg->tools);*/ From e684a81efb6c8e871d2607a5b3c5b2a77817d6d2 Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 16 Sep 2021 14:31:20 +0200 Subject: [PATCH 294/689] Apply clang-format --- cagebreak.c | 4 +- fuzz/fuzz-lib.c | 7 +- input.h | 12 +- input_manager.c | 157 +++++++++++----------- input_manager.h | 19 +-- keybinding.c | 13 +- keybinding.h | 4 +- libinput.c | 342 ++++++++++++++++++++++++++---------------------- parse.c | 255 ++++++++++++++++++++---------------- seat.c | 41 +++--- 10 files changed, 464 insertions(+), 390 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index 90e767b..df8cde1 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -1,4 +1,4 @@ - /* +/* * Cagebreak: A Wayland tiling compositor. * * Copyright (C) 2018-2020 Jente Hidskes @@ -44,12 +44,12 @@ #endif #include "idle_inhibit_v1.h" +#include "input_manager.h" #include "ipc_server.h" #include "keybinding.h" #include "message.h" #include "output.h" #include "parse.h" -#include "input_manager.h" #include "seat.h" #include "server.h" #include "xdg_shell.h" diff --git a/fuzz/fuzz-lib.c b/fuzz/fuzz-lib.c index c651add..7f9eb78 100644 --- a/fuzz/fuzz-lib.c +++ b/fuzz/fuzz-lib.c @@ -25,8 +25,8 @@ #include #include #include -#include #include +#include #include #include #include @@ -48,8 +48,8 @@ #endif #include "../idle_inhibit_v1.h" -#include "../keybinding.h" #include "../input_manager.h" +#include "../keybinding.h" #include "../output.h" #include "../parse.h" #include "../seat.h" @@ -529,8 +529,7 @@ destroy_input_device(char *line, struct cg_server *server) { } devn = devn % wl_list_length(&server->input->devices); struct cg_input_device *dev, *dev_tmp; - wl_list_for_each_safe(dev, dev_tmp, &server->input->devices, - link) { + wl_list_for_each_safe(dev, dev_tmp, &server->input->devices, link) { if(devn == 0) { dev->device_destroy.notify(&dev->device_destroy, NULL); break; diff --git a/input.h b/input.h index 139fadf..7cec2ca 100644 --- a/input.h +++ b/input.h @@ -7,12 +7,16 @@ struct cg_input_device; struct cg_input_config; struct cg_server; -void cg_input_configure_libinput_device(struct cg_input_device *device); +void +cg_input_configure_libinput_device(struct cg_input_device *device); -void cg_input_apply_config(struct cg_input_config *config, struct cg_server *server); +void +cg_input_apply_config(struct cg_input_config *config, struct cg_server *server); -void cg_input_reset_libinput_device(struct cg_input_device *device); +void +cg_input_reset_libinput_device(struct cg_input_device *device); -bool cg_libinput_device_is_builtin(struct cg_input_device *device); +bool +cg_libinput_device_is_builtin(struct cg_input_device *device); #endif diff --git a/input_manager.c b/input_manager.c index 1a2646d..10f94fa 100644 --- a/input_manager.c +++ b/input_manager.c @@ -9,48 +9,52 @@ #define _POSIX_C_SOURCE 200812L -#include "config.h" -#include "server.h" -#include "seat.h" #include "input_manager.h" +#include "config.h" #include "input.h" +#include "seat.h" +#include "server.h" +#include +#include +#include +#include +#include +#include #include #include #include -#include +#include #include #include -#include -#include -#include -#include -#include -#include -#include +#include -void strip_whitespace(char *str) { +void +strip_whitespace(char *str) { static const char whitespace[] = " \f\n\r\t\v"; size_t len = strlen(str); size_t start = strspn(str, whitespace); memmove(str, &str[start], len + 1 - start); - if (*str) { - for (len -= start + 1; isspace(str[len]); --len) {} + if(*str) { + for(len -= start + 1; isspace(str[len]); --len) { + } str[len + 1] = '\0'; } } -char *input_device_get_identifier(struct wlr_input_device *device) { +char * +input_device_get_identifier(struct wlr_input_device *device) { int vendor = device->vendor; int product = device->product; char *name = strdup(device->name ? device->name : ""); strip_whitespace(name); char *p = name; - for (; *p; ++p) { - // There are in fact input devices with unprintable characters in its name - if (*p == ' ' || !isprint(*p)) { + for(; *p; ++p) { + // There are in fact input devices with unprintable characters in its + // name + if(*p == ' ' || !isprint(*p)) { *p = '_'; } } @@ -58,7 +62,7 @@ char *input_device_get_identifier(struct wlr_input_device *device) { const char *fmt = "%d:%d:%s"; int len = snprintf(NULL, 0, fmt, vendor, product, name) + 1; char *identifier = malloc(len); - if (!identifier) { + if(!identifier) { wlr_log(WLR_ERROR, "Unable to allocate unique input device name"); return NULL; } @@ -68,11 +72,12 @@ char *input_device_get_identifier(struct wlr_input_device *device) { return identifier; } -void input_manager_handle_device_destroy(struct wl_listener *listener, void *data) { +void +input_manager_handle_device_destroy(struct wl_listener *listener, void *data) { struct cg_input_device *input_device = - wl_container_of(listener, input_device, device_destroy); + wl_container_of(listener, input_device, device_destroy); - if (!input_device) { + if(!input_device) { wlr_log(WLR_ERROR, "Could not find cagebreak input device to destroy"); return; } @@ -85,26 +90,27 @@ void input_manager_handle_device_destroy(struct wl_listener *listener, void *dat free(input_device); } -static void handle_new_input(struct wl_listener *listener, void *data) { +static void +handle_new_input(struct wl_listener *listener, void *data) { struct cg_input_manager *input = - wl_container_of(listener, input, new_input); - struct cg_server *server= input->server; + wl_container_of(listener, input, new_input); + struct cg_server *server = input->server; struct wlr_input_device *device = data; struct cg_input_device *input_device = - calloc(1, sizeof(struct cg_input_device)); - if (!input_device) { - wlr_log(WLR_ERROR,"Could not allocate input device"); + calloc(1, sizeof(struct cg_input_device)); + if(!input_device) { + wlr_log(WLR_ERROR, "Could not allocate input device"); return; } device->data = input_device; input_device->wlr_device = device; input_device->identifier = input_device_get_identifier(device); - input_device->server=server; - input_device->pointer=NULL; - input_device->touch=NULL; - + input_device->server = server; + input_device->pointer = NULL; + input_device->touch = NULL; + wl_list_insert(&input->devices, &input_device->link); cg_input_configure_libinput_device(input_device); @@ -116,17 +122,18 @@ static void handle_new_input(struct wl_listener *listener, void *data) { seat_add_device(seat, input_device); } -void handle_virtual_keyboard(struct wl_listener *listener, void *data) { +void +handle_virtual_keyboard(struct wl_listener *listener, void *data) { struct cg_input_manager *input_manager = - wl_container_of(listener, input_manager, virtual_keyboard_new); + wl_container_of(listener, input_manager, virtual_keyboard_new); struct wlr_virtual_keyboard_v1 *keyboard = data; struct wlr_input_device *device = &keyboard->input_device; struct cg_seat *seat = input_manager->server->seat; struct cg_input_device *input_device = - calloc(1, sizeof(struct cg_input_device)); - if (!input_device) { + calloc(1, sizeof(struct cg_input_device)); + if(!input_device) { wlr_log(WLR_ERROR, "could not allocate input device"); return; } @@ -136,9 +143,9 @@ void handle_virtual_keyboard(struct wl_listener *listener, void *data) { input_device->wlr_device = device; input_device->identifier = input_device_get_identifier(device); wl_list_insert(&input_manager->devices, &input_device->link); - input_device->server=input_manager->server; - input_device->pointer=NULL; - input_device->touch=NULL; + input_device->server = input_manager->server; + input_device->pointer = NULL; + input_device->touch = NULL; wl_signal_add(&device->events.destroy, &input_device->device_destroy); input_device->device_destroy.notify = input_manager_handle_device_destroy; @@ -146,9 +153,10 @@ void handle_virtual_keyboard(struct wl_listener *listener, void *data) { seat_add_device(seat, input_device); } -void handle_virtual_pointer(struct wl_listener *listener, void *data) { +void +handle_virtual_pointer(struct wl_listener *listener, void *data) { struct cg_input_manager *input_manager = - wl_container_of(listener, input_manager, virtual_pointer_new); + wl_container_of(listener, input_manager, virtual_pointer_new); struct wlr_virtual_pointer_v1_new_pointer_event *event = data; struct wlr_virtual_pointer_v1 *pointer = event->new_pointer; struct wlr_input_device *device = &pointer->input_device; @@ -156,8 +164,8 @@ void handle_virtual_pointer(struct wl_listener *listener, void *data) { struct cg_seat *seat = input_manager->server->seat; struct cg_input_device *input_device = - calloc(1, sizeof(struct cg_input_device)); - if (!input_device) { + calloc(1, sizeof(struct cg_input_device)); + if(!input_device) { wlr_log(WLR_ERROR, "could not allocate input device"); return; } @@ -167,57 +175,57 @@ void handle_virtual_pointer(struct wl_listener *listener, void *data) { input_device->wlr_device = device; input_device->identifier = input_device_get_identifier(device); wl_list_insert(&input_manager->devices, &input_device->link); - input_device->server=input_manager->server; - input_device->pointer=NULL; - input_device->touch=NULL; + input_device->server = input_manager->server; + input_device->pointer = NULL; + input_device->touch = NULL; wl_signal_add(&device->events.destroy, &input_device->device_destroy); input_device->device_destroy.notify = input_manager_handle_device_destroy; seat_add_device(seat, input_device); - if (event->suggested_output) { + if(event->suggested_output) { wlr_cursor_map_input_to_output(seat->cursor, device, - event->suggested_output); + event->suggested_output); } } -struct cg_input_manager *input_manager_create(struct cg_server *server) { - struct cg_input_manager *input = - calloc(1, sizeof(struct cg_input_manager)); - if (!input) { +struct cg_input_manager * +input_manager_create(struct cg_server *server) { + struct cg_input_manager *input = calloc(1, sizeof(struct cg_input_manager)); + if(!input) { return NULL; } wl_list_init(&input->devices); - input->server=server; + input->server = server; input->new_input.notify = handle_new_input; wl_signal_add(&server->backend->events.new_input, &input->new_input); - input->virtual_keyboard = wlr_virtual_keyboard_manager_v1_create( - server->wl_display); + input->virtual_keyboard = + wlr_virtual_keyboard_manager_v1_create(server->wl_display); wl_signal_add(&input->virtual_keyboard->events.new_virtual_keyboard, - &input->virtual_keyboard_new); + &input->virtual_keyboard_new); input->virtual_keyboard_new.notify = handle_virtual_keyboard; - input->virtual_pointer = wlr_virtual_pointer_manager_v1_create( - server->wl_display - ); + input->virtual_pointer = + wlr_virtual_pointer_manager_v1_create(server->wl_display); wl_signal_add(&input->virtual_pointer->events.new_virtual_pointer, - &input->virtual_pointer_new); + &input->virtual_pointer_new); input->virtual_pointer_new.notify = handle_virtual_pointer; return input; } -uint32_t get_mouse_bindsym(const char *name, char **error) { +uint32_t +get_mouse_bindsym(const char *name, char **error) { // Get event code from name int code = libevdev_event_code_from_name(EV_KEY, name); - if (code == -1) { + if(code == -1) { size_t len = snprintf(NULL, 0, "Unknown event %s", name) + 1; *error = malloc(len); - if (*error) { + if(*error) { snprintf(*error, len, "Unknown event %s", name); } return 0; @@ -225,35 +233,38 @@ uint32_t get_mouse_bindsym(const char *name, char **error) { return code; } -uint32_t get_mouse_bindcode(const char *name, char **error) { +uint32_t +get_mouse_bindcode(const char *name, char **error) { // Validate event code errno = 0; char *endptr; int code = strtol(name, &endptr, 10); - if (endptr == name && code <= 0) { + if(endptr == name && code <= 0) { *error = strdup("Button event code must be a positive integer."); return 0; - } else if (errno == ERANGE) { + } else if(errno == ERANGE) { *error = strdup("Button event code out of range."); return 0; } const char *event = libevdev_event_code_get_name(EV_KEY, code); - if (!event || strncmp(event, "BTN_", strlen("BTN_")) != 0) { + if(!event || strncmp(event, "BTN_", strlen("BTN_")) != 0) { size_t len = snprintf(NULL, 0, "Event code %d (%s) is not a button", - code, event ? event : "(null)") + 1; + code, event ? event : "(null)") + + 1; *error = malloc(len); - if (*error) { - snprintf(*error, len, "Event code %d (%s) is not a button", - code, event ? event : "(null)"); + if(*error) { + snprintf(*error, len, "Event code %d (%s) is not a button", code, + event ? event : "(null)"); } return 0; } return code; } -uint32_t input_manager_get_mouse_button(const char *name, char **error) { +uint32_t +input_manager_get_mouse_button(const char *name, char **error) { uint32_t button = get_mouse_bindsym(name, error); - if (!button && !*error) { + if(!button && !*error) { button = get_mouse_bindcode(name, error); } return button; diff --git a/input_manager.h b/input_manager.h index 5aac953..6a2cdc3 100644 --- a/input_manager.h +++ b/input_manager.h @@ -6,11 +6,14 @@ #include #include - -struct cg_input_manager *input_manager_create(struct cg_server *server); -struct cg_input_config *input_device_get_config(struct cg_input_device *device); -void input_manager_handle_device_destroy(struct wl_listener *listener, void *data); -uint32_t input_manager_get_mouse_button(const char *name, char **error); +struct cg_input_manager * +input_manager_create(struct cg_server *server); +struct cg_input_config * +input_device_get_config(struct cg_input_device *device); +void +input_manager_handle_device_destroy(struct wl_listener *listener, void *data); +uint32_t +input_manager_get_mouse_button(const char *name, char **error); struct cg_input_manager { struct wl_list devices; @@ -24,7 +27,6 @@ struct cg_input_manager { struct wl_listener virtual_pointer_new; }; - struct cg_input_config_mapped_from_region { double x1, y1; double x2, y2; @@ -67,7 +69,7 @@ struct cg_input_config { int tap; int tap_button_map; -/* char *xkb_layout; + /*char *xkb_layout; char *xkb_model; char *xkb_options; char *xkb_rules; @@ -100,7 +102,8 @@ struct cg_input_device { struct wl_listener device_destroy; bool is_virtual; - /* Only one of the following is non-NULL depending on the type of the input device */ + /* Only one of the following is non-NULL depending on the type of the input + * device */ struct cg_pointer *pointer; struct cg_touch *touch; }; diff --git a/keybinding.c b/keybinding.c index 5ffee81..536e13c 100644 --- a/keybinding.c +++ b/keybinding.c @@ -9,11 +9,11 @@ #include #include +#include "input.h" +#include "input_manager.h" #include "keybinding.h" #include "message.h" #include "output.h" -#include "input.h" -#include "input_manager.h" #include "seat.h" #include "server.h" #include "view.h" @@ -884,14 +884,13 @@ keybinding_configure_output(struct cg_server *server, void keybinding_configure_input(struct cg_server *server, - struct cg_input_config *cfg) { - cg_input_apply_config(cfg,server); + struct cg_input_config *cfg) { + cg_input_apply_config(cfg, server); } void -keybinding_configure_input_dev(struct cg_server *server, struct cg_input_config *cfg) { - -} +keybinding_configure_input_dev(struct cg_server *server, + struct cg_input_config *cfg) {} /* Hint: see keybinding.h for details on "data" */ int diff --git a/keybinding.h b/keybinding.h index 8db9de4..dcc696f 100644 --- a/keybinding.h +++ b/keybinding.h @@ -4,8 +4,8 @@ #include "config.h" -#include #include +#include #include struct cg_server; @@ -25,7 +25,7 @@ enum keybinding_action { KEYBINDING_CYCLE_OUTPUT, // data.b is 0 if forward, 1 if reverse KEYBINDING_CONFIGURE_OUTPUT, // data.o_cfg is the desired output // configuration - KEYBINDING_CONFIGURE_INPUT, // data.i_cfg is the desired input + KEYBINDING_CONFIGURE_INPUT, // data.i_cfg is the desired input // configuration KEYBINDING_QUIT, KEYBINDING_NOOP, diff --git a/libinput.c b/libinput.c index fd9ce4c..f6dd957 100644 --- a/libinput.c +++ b/libinput.c @@ -1,23 +1,25 @@ +#include "input.h" +#include "input_manager.h" +#include "output.h" #include #include #include #include +#include #include #include -#include -#include "input.h" -#include "output.h" -#include "input_manager.h" -static void log_status(enum libinput_config_status status) { - if (status != LIBINPUT_CONFIG_STATUS_SUCCESS) { +static void +log_status(enum libinput_config_status status) { + if(status != LIBINPUT_CONFIG_STATUS_SUCCESS) { wlr_log(WLR_ERROR, "Failed to apply libinput config: %s", - libinput_config_status_to_str(status)); + libinput_config_status_to_str(status)); } } -static bool set_send_events(struct libinput_device *device, uint32_t mode) { - if (libinput_device_config_send_events_get_mode(device) == mode) { +static bool +set_send_events(struct libinput_device *device, uint32_t mode) { + if(libinput_device_config_send_events_get_mode(device) == mode) { return false; } wlr_log(WLR_DEBUG, "send_events_set_mode(%" PRIu32 ")", mode); @@ -25,10 +27,10 @@ static bool set_send_events(struct libinput_device *device, uint32_t mode) { return true; } -static bool set_tap(struct libinput_device *device, - enum libinput_config_tap_state tap) { - if (libinput_device_config_tap_get_finger_count(device) <= 0 || - libinput_device_config_tap_get_enabled(device) == tap) { +static bool +set_tap(struct libinput_device *device, enum libinput_config_tap_state tap) { + if(libinput_device_config_tap_get_finger_count(device) <= 0 || + libinput_device_config_tap_get_enabled(device) == tap) { return false; } wlr_log(WLR_DEBUG, "tap_set_enabled(%d)", tap); @@ -36,10 +38,11 @@ static bool set_tap(struct libinput_device *device, return true; } -static bool set_tap_button_map(struct libinput_device *device, - enum libinput_config_tap_button_map map) { - if (libinput_device_config_tap_get_finger_count(device) <= 0 || - libinput_device_config_tap_get_button_map(device) == map) { +static bool +set_tap_button_map(struct libinput_device *device, + enum libinput_config_tap_button_map map) { + if(libinput_device_config_tap_get_finger_count(device) <= 0 || + libinput_device_config_tap_get_button_map(device) == map) { return false; } wlr_log(WLR_DEBUG, "tap_set_button_map(%d)", map); @@ -47,10 +50,11 @@ static bool set_tap_button_map(struct libinput_device *device, return true; } -static bool set_tap_drag(struct libinput_device *device, - enum libinput_config_drag_state drag) { - if (libinput_device_config_tap_get_finger_count(device) <= 0 || - libinput_device_config_tap_get_drag_enabled(device) == drag) { +static bool +set_tap_drag(struct libinput_device *device, + enum libinput_config_drag_state drag) { + if(libinput_device_config_tap_get_finger_count(device) <= 0 || + libinput_device_config_tap_get_drag_enabled(device) == drag) { return false; } wlr_log(WLR_DEBUG, "tap_set_drag_enabled(%d)", drag); @@ -58,10 +62,11 @@ static bool set_tap_drag(struct libinput_device *device, return true; } -static bool set_tap_drag_lock(struct libinput_device *device, - enum libinput_config_drag_lock_state lock) { - if (libinput_device_config_tap_get_finger_count(device) <= 0 || - libinput_device_config_tap_get_drag_lock_enabled(device) == lock) { +static bool +set_tap_drag_lock(struct libinput_device *device, + enum libinput_config_drag_lock_state lock) { + if(libinput_device_config_tap_get_finger_count(device) <= 0 || + libinput_device_config_tap_get_drag_lock_enabled(device) == lock) { return false; } wlr_log(WLR_DEBUG, "tap_set_drag_lock_enabled(%d)", lock); @@ -69,9 +74,10 @@ static bool set_tap_drag_lock(struct libinput_device *device, return true; } -static bool set_accel_speed(struct libinput_device *device, double speed) { - if (!libinput_device_config_accel_is_available(device) || - libinput_device_config_accel_get_speed(device) == speed) { +static bool +set_accel_speed(struct libinput_device *device, double speed) { + if(!libinput_device_config_accel_is_available(device) || + libinput_device_config_accel_get_speed(device) == speed) { return false; } wlr_log(WLR_DEBUG, "accel_set_speed(%f)", speed); @@ -79,10 +85,11 @@ static bool set_accel_speed(struct libinput_device *device, double speed) { return true; } -static bool set_accel_profile(struct libinput_device *device, - enum libinput_config_accel_profile profile) { - if (!libinput_device_config_accel_is_available(device) || - libinput_device_config_accel_get_profile(device) == profile) { +static bool +set_accel_profile(struct libinput_device *device, + enum libinput_config_accel_profile profile) { + if(!libinput_device_config_accel_is_available(device) || + libinput_device_config_accel_get_profile(device) == profile) { return false; } wlr_log(WLR_DEBUG, "accel_set_profile(%d)", profile); @@ -90,9 +97,10 @@ static bool set_accel_profile(struct libinput_device *device, return true; } -static bool set_natural_scroll(struct libinput_device *d, bool n) { - if (!libinput_device_config_scroll_has_natural_scroll(d) || - libinput_device_config_scroll_get_natural_scroll_enabled(d) == n) { +static bool +set_natural_scroll(struct libinput_device *d, bool n) { + if(!libinput_device_config_scroll_has_natural_scroll(d) || + libinput_device_config_scroll_get_natural_scroll_enabled(d) == n) { return false; } wlr_log(WLR_DEBUG, "scroll_set_natural_scroll(%d)", n); @@ -100,9 +108,10 @@ static bool set_natural_scroll(struct libinput_device *d, bool n) { return true; } -static bool set_left_handed(struct libinput_device *device, bool left) { - if (!libinput_device_config_left_handed_is_available(device) || - libinput_device_config_left_handed_get(device) == left) { +static bool +set_left_handed(struct libinput_device *device, bool left) { + if(!libinput_device_config_left_handed_is_available(device) || + libinput_device_config_left_handed_get(device) == left) { return false; } wlr_log(WLR_DEBUG, "left_handed_set(%d)", left); @@ -110,11 +119,12 @@ static bool set_left_handed(struct libinput_device *device, bool left) { return true; } -static bool set_click_method(struct libinput_device *device, - enum libinput_config_click_method method) { +static bool +set_click_method(struct libinput_device *device, + enum libinput_config_click_method method) { uint32_t click = libinput_device_config_click_get_methods(device); - if ((click & ~LIBINPUT_CONFIG_CLICK_METHOD_NONE) == 0 || - libinput_device_config_click_get_method(device) == method) { + if((click & ~LIBINPUT_CONFIG_CLICK_METHOD_NONE) == 0 || + libinput_device_config_click_get_method(device) == method) { return false; } wlr_log(WLR_DEBUG, "click_set_method(%d)", method); @@ -122,10 +132,11 @@ static bool set_click_method(struct libinput_device *device, return true; } -static bool set_middle_emulation(struct libinput_device *dev, - enum libinput_config_middle_emulation_state mid) { - if (!libinput_device_config_middle_emulation_is_available(dev) || - libinput_device_config_middle_emulation_get_enabled(dev) == mid) { +static bool +set_middle_emulation(struct libinput_device *dev, + enum libinput_config_middle_emulation_state mid) { + if(!libinput_device_config_middle_emulation_is_available(dev) || + libinput_device_config_middle_emulation_get_enabled(dev) == mid) { return false; } wlr_log(WLR_DEBUG, "middle_emulation_set_enabled(%d)", mid); @@ -133,11 +144,12 @@ static bool set_middle_emulation(struct libinput_device *dev, return true; } -static bool set_scroll_method(struct libinput_device *device, - enum libinput_config_scroll_method method) { +static bool +set_scroll_method(struct libinput_device *device, + enum libinput_config_scroll_method method) { uint32_t scroll = libinput_device_config_scroll_get_methods(device); - if ((scroll & ~LIBINPUT_CONFIG_SCROLL_NO_SCROLL) == 0 || - libinput_device_config_scroll_get_method(device) == method) { + if((scroll & ~LIBINPUT_CONFIG_SCROLL_NO_SCROLL) == 0 || + libinput_device_config_scroll_get_method(device) == method) { return false; } wlr_log(WLR_DEBUG, "scroll_set_method(%d)", method); @@ -145,10 +157,11 @@ static bool set_scroll_method(struct libinput_device *device, return true; } -static bool set_scroll_button(struct libinput_device *dev, uint32_t button) { +static bool +set_scroll_button(struct libinput_device *dev, uint32_t button) { uint32_t scroll = libinput_device_config_scroll_get_methods(dev); - if ((scroll & ~LIBINPUT_CONFIG_SCROLL_NO_SCROLL) == 0 || - libinput_device_config_scroll_get_button(dev) == button) { + if((scroll & ~LIBINPUT_CONFIG_SCROLL_NO_SCROLL) == 0 || + libinput_device_config_scroll_get_button(dev) == button) { return false; } wlr_log(WLR_DEBUG, "scroll_set_button(%" PRIu32 ")", button); @@ -156,9 +169,10 @@ static bool set_scroll_button(struct libinput_device *dev, uint32_t button) { return true; } -static bool set_dwt(struct libinput_device *device, bool dwt) { - if (!libinput_device_config_dwt_is_available(device) || - libinput_device_config_dwt_get_enabled(device) == dwt) { +static bool +set_dwt(struct libinput_device *device, bool dwt) { + if(!libinput_device_config_dwt_is_available(device) || + libinput_device_config_dwt_get_enabled(device) == dwt) { return false; } wlr_log(WLR_DEBUG, "dwt_set_enabled(%d)", dwt); @@ -166,63 +180,67 @@ static bool set_dwt(struct libinput_device *device, bool dwt) { return true; } -static bool set_calibration_matrix(struct libinput_device *dev, float mat[6]) { - if (!libinput_device_config_calibration_has_matrix(dev)) { +static bool +set_calibration_matrix(struct libinput_device *dev, float mat[6]) { + if(!libinput_device_config_calibration_has_matrix(dev)) { return false; } bool changed = false; float current[6]; libinput_device_config_calibration_get_matrix(dev, current); - for (int i = 0; i < 6; i++) { - if (current[i] != mat[i]) { + for(int i = 0; i < 6; i++) { + if(current[i] != mat[i]) { changed = true; break; } } - if (changed) { + if(changed) { wlr_log(WLR_DEBUG, "calibration_set_matrix(%f, %f, %f, %f, %f, %f)", - mat[0], mat[1], mat[2], mat[3], mat[4], mat[5]); + mat[0], mat[1], mat[2], mat[3], mat[4], mat[5]); log_status(libinput_device_config_calibration_set_matrix(dev, mat)); } return changed; } -void output_get_identifier(char *identifier, size_t len, - struct cg_output *output) { +void +output_get_identifier(char *identifier, size_t len, struct cg_output *output) { struct wlr_output *wlr_output = output->wlr_output; snprintf(identifier, len, "%s %s %s", wlr_output->make, wlr_output->model, - wlr_output->serial); + wlr_output->serial); } -struct cg_output *output_by_name_or_id(const char *name_or_id, struct cg_server *server) { - struct cg_output *output=NULL; - wl_list_for_each(output,&server->outputs,link) { +struct cg_output * +output_by_name_or_id(const char *name_or_id, struct cg_server *server) { + struct cg_output *output = NULL; + wl_list_for_each(output, &server->outputs, link) { char identifier[128]; output_get_identifier(identifier, sizeof(identifier), output); - if (strcasecmp(identifier, name_or_id) == 0 - || strcasecmp(output->wlr_output->name, name_or_id) == 0) { + if(strcasecmp(identifier, name_or_id) == 0 || + strcasecmp(output->wlr_output->name, name_or_id) == 0) { return output; } } return NULL; } -static bool device_is_touchpad(struct cg_input_device *device) { - if (device->wlr_device->type != WLR_INPUT_DEVICE_POINTER || - !wlr_input_device_is_libinput(device->wlr_device)) { +static bool +device_is_touchpad(struct cg_input_device *device) { + if(device->wlr_device->type != WLR_INPUT_DEVICE_POINTER || + !wlr_input_device_is_libinput(device->wlr_device)) { return false; } struct libinput_device *libinput_device = - wlr_libinput_get_device_handle(device->wlr_device); + wlr_libinput_get_device_handle(device->wlr_device); return libinput_device_config_tap_get_finger_count(libinput_device) > 0; } -const char *input_device_get_type(struct cg_input_device *device) { - switch (device->wlr_device->type) { +const char * +input_device_get_type(struct cg_input_device *device) { + switch(device->wlr_device->type) { case WLR_INPUT_DEVICE_POINTER: - if (device_is_touchpad(device)) { + if(device_is_touchpad(device)) { return "touchpad"; } else { return "pointer"; @@ -241,167 +259,181 @@ const char *input_device_get_type(struct cg_input_device *device) { return "unknown"; } -void apply_config_to_device(struct cg_input_config *config, struct cg_input_device *input_device) { - if (!wlr_input_device_is_libinput(input_device->wlr_device)) { +void +apply_config_to_device(struct cg_input_config *config, + struct cg_input_device *input_device) { + if(!wlr_input_device_is_libinput(input_device->wlr_device)) { return; } struct libinput_device *device = - wlr_libinput_get_device_handle(input_device->wlr_device); - if (config->mapped_to_output && - !output_by_name_or_id(config->mapped_to_output,input_device->server)) { + wlr_libinput_get_device_handle(input_device->wlr_device); + if(config->mapped_to_output && + !output_by_name_or_id(config->mapped_to_output, input_device->server)) { wlr_log(WLR_DEBUG, - "'%s' is mapped to offline output '%s'; disabling input", - config->identifier, config->mapped_to_output); - set_send_events(device, - LIBINPUT_CONFIG_SEND_EVENTS_DISABLED); - } else if (config->send_events != INT_MIN) { + "'%s' is mapped to offline output '%s'; disabling input", + config->identifier, config->mapped_to_output); + set_send_events(device, LIBINPUT_CONFIG_SEND_EVENTS_DISABLED); + } else if(config->send_events != INT_MIN) { set_send_events(device, config->send_events); } else { // Have to reset to the default mode here, otherwise if ic->send_events // is unset and a mapped output just came online after being disabled, // we'd remain stuck sending no events. - set_send_events(device, - libinput_device_config_send_events_get_default_mode(device)); + set_send_events( + device, + libinput_device_config_send_events_get_default_mode(device)); } - if (config->tap != INT_MIN) { + if(config->tap != INT_MIN) { set_tap(device, config->tap); } - if (config->tap_button_map != INT_MIN) { + if(config->tap_button_map != INT_MIN) { set_tap_button_map(device, config->tap_button_map); } - if (config->drag != INT_MIN) { + if(config->drag != INT_MIN) { set_tap_drag(device, config->drag); } - if (config->drag_lock != INT_MIN) { + if(config->drag_lock != INT_MIN) { set_tap_drag_lock(device, config->drag_lock); } - if (config->pointer_accel != FLT_MIN) { + if(config->pointer_accel != FLT_MIN) { set_accel_speed(device, config->pointer_accel); } - if (config->accel_profile != INT_MIN) { + if(config->accel_profile != INT_MIN) { set_accel_profile(device, config->accel_profile); } - if (config->natural_scroll != INT_MIN) { + if(config->natural_scroll != INT_MIN) { set_natural_scroll(device, config->natural_scroll); } - if (config->left_handed != INT_MIN) { + if(config->left_handed != INT_MIN) { set_left_handed(device, config->left_handed); } - if (config->click_method != INT_MIN) { + if(config->click_method != INT_MIN) { set_click_method(device, config->click_method); } - if (config->middle_emulation != INT_MIN) { + if(config->middle_emulation != INT_MIN) { set_middle_emulation(device, config->middle_emulation); } - if (config->scroll_method != INT_MIN) { + if(config->scroll_method != INT_MIN) { set_scroll_method(device, config->scroll_method); } - if (config->scroll_button != INT_MIN) { + if(config->scroll_button != INT_MIN) { set_scroll_button(device, config->scroll_button); } - if (config->dwt != INT_MIN) { + if(config->dwt != INT_MIN) { set_dwt(device, config->dwt); } - if (config->calibration_matrix.configured) { + if(config->calibration_matrix.configured) { set_calibration_matrix(device, config->calibration_matrix.matrix); } } -void cg_input_apply_config(struct cg_input_config *config, struct cg_server *server) { - struct cg_input_device *device=NULL; - wl_list_for_each(device,&server->input->devices,link) { - if (strcmp(config->identifier, device->identifier) != 0&&strcmp(config->identifier, "*") != 0) { +void +cg_input_apply_config(struct cg_input_config *config, + struct cg_server *server) { + struct cg_input_device *device = NULL; + wl_list_for_each(device, &server->input->devices, link) { + if(strcmp(config->identifier, device->identifier) != 0 && + strcmp(config->identifier, "*") != 0) { continue; } const char *device_type = input_device_get_type(device); - if (strncmp(config->identifier,"type:",5)==0&&strcmp(config->identifier + 5, device_type) != 0) { + if(strncmp(config->identifier, "type:", 5) == 0 && + strcmp(config->identifier + 5, device_type) != 0) { continue; } - apply_config_to_device(config,device); + apply_config_to_device(config, device); } } -void cg_input_configure_libinput_device(struct cg_input_device *input_device) { - struct cg_server *server=input_device->server; +void +cg_input_configure_libinput_device(struct cg_input_device *input_device) { + struct cg_server *server = input_device->server; struct cg_input_config *config = NULL; wl_list_for_each(config, &server->input_config, link) { - if (strcmp(config->identifier, input_device->identifier) != 0&&strcmp(config->identifier, "*") != 0) { + if(strcmp(config->identifier, input_device->identifier) != 0 && + strcmp(config->identifier, "*") != 0) { continue; } const char *device_type = input_device_get_type(input_device); - if (!(strncmp(config->identifier,"type:",5)&&strcmp(config->identifier + 5, device_type) == 0)) { + if(!(strncmp(config->identifier, "type:", 5) && + strcmp(config->identifier + 5, device_type) == 0)) { continue; } - apply_config_to_device(config,input_device); + apply_config_to_device(config, input_device); } } -void cg_input_reset_libinput_device(struct cg_input_device *input_device) { - if (!wlr_input_device_is_libinput(input_device->wlr_device)) { +void +cg_input_reset_libinput_device(struct cg_input_device *input_device) { + if(!wlr_input_device_is_libinput(input_device->wlr_device)) { return; } struct libinput_device *device = - wlr_libinput_get_device_handle(input_device->wlr_device); + wlr_libinput_get_device_handle(input_device->wlr_device); wlr_log(WLR_DEBUG, "cg_input_reset_libinput_device(%s)", - input_device->identifier); + input_device->identifier); bool changed = false; - changed |= set_send_events(device, - libinput_device_config_send_events_get_default_mode(device)); - changed |= set_tap(device, - libinput_device_config_tap_get_default_enabled(device)); - changed |= set_tap_button_map(device, - libinput_device_config_tap_get_default_button_map(device)); - changed |= set_tap_drag(device, - libinput_device_config_tap_get_default_drag_enabled(device)); - changed |= set_tap_drag_lock(device, - libinput_device_config_tap_get_default_drag_lock_enabled(device)); - changed |= set_accel_speed(device, - libinput_device_config_accel_get_default_speed(device)); - changed |= set_accel_profile(device, - libinput_device_config_accel_get_default_profile(device)); - changed |= set_natural_scroll(device, - libinput_device_config_scroll_get_default_natural_scroll_enabled( - device)); - changed |= set_left_handed(device, - libinput_device_config_left_handed_get_default(device)); - changed |= set_click_method(device, - libinput_device_config_click_get_default_method(device)); - changed |= set_middle_emulation(device, - libinput_device_config_middle_emulation_get_default_enabled(device)); - changed |= set_scroll_method(device, - libinput_device_config_scroll_get_default_method(device)); - changed |= set_scroll_button(device, - libinput_device_config_scroll_get_default_button(device)); - changed |= set_dwt(device, - libinput_device_config_dwt_get_default_enabled(device)); + changed |= set_send_events( + device, libinput_device_config_send_events_get_default_mode(device)); + changed |= + set_tap(device, libinput_device_config_tap_get_default_enabled(device)); + changed |= set_tap_button_map( + device, libinput_device_config_tap_get_default_button_map(device)); + changed |= set_tap_drag( + device, libinput_device_config_tap_get_default_drag_enabled(device)); + changed |= set_tap_drag_lock( + device, + libinput_device_config_tap_get_default_drag_lock_enabled(device)); + changed |= set_accel_speed( + device, libinput_device_config_accel_get_default_speed(device)); + changed |= set_accel_profile( + device, libinput_device_config_accel_get_default_profile(device)); + changed |= set_natural_scroll( + device, + libinput_device_config_scroll_get_default_natural_scroll_enabled( + device)); + changed |= set_left_handed( + device, libinput_device_config_left_handed_get_default(device)); + changed |= set_click_method( + device, libinput_device_config_click_get_default_method(device)); + changed |= set_middle_emulation( + device, + libinput_device_config_middle_emulation_get_default_enabled(device)); + changed |= set_scroll_method( + device, libinput_device_config_scroll_get_default_method(device)); + changed |= set_scroll_button( + device, libinput_device_config_scroll_get_default_button(device)); + changed |= + set_dwt(device, libinput_device_config_dwt_get_default_enabled(device)); float matrix[6]; libinput_device_config_calibration_get_default_matrix(device, matrix); changed |= set_calibration_matrix(device, matrix); } -bool cg_libinput_device_is_builtin(struct cg_input_device *cg_device) { - if (!wlr_input_device_is_libinput(cg_device->wlr_device)) { +bool +cg_libinput_device_is_builtin(struct cg_input_device *cg_device) { + if(!wlr_input_device_is_libinput(cg_device->wlr_device)) { return false; } struct libinput_device *device = - wlr_libinput_get_device_handle(cg_device->wlr_device); - struct udev_device *udev_device = - libinput_device_get_udev_device(device); - if (!udev_device) { + wlr_libinput_get_device_handle(cg_device->wlr_device); + struct udev_device *udev_device = libinput_device_get_udev_device(device); + if(!udev_device) { return false; } - const char *id_path = udev_device_get_property_value(udev_device, "ID_PATH"); - if (!id_path) { + const char *id_path = + udev_device_get_property_value(udev_device, "ID_PATH"); + if(!id_path) { return false; } diff --git a/parse.c b/parse.c index 5758e1e..f38f761 100644 --- a/parse.c +++ b/parse.c @@ -1,14 +1,14 @@ #define _POSIX_C_SOURCE 200812L -#include #include +#include +#include #include #include -#include +#include "input_manager.h" #include "keybinding.h" #include "output.h" -#include "input_manager.h" #include "parse.h" #include "server.h" @@ -117,7 +117,7 @@ parse_float(char **saveptr, const char *delim) { return -1; } float ufloat = strtof(uint_str, NULL); - if(ufloat != NAN && ufloat != INFINITY && errno!=ERANGE) { + if(ufloat != NAN && ufloat != INFINITY && errno != ERANGE) { return ufloat; } else { wlr_log(WLR_ERROR, "Error parsing float"); @@ -127,8 +127,8 @@ parse_float(char **saveptr, const char *delim) { struct cg_input_config * parse_input_config(char **saveptr, char **errstr) { - struct cg_input_config *cfg = calloc(1,sizeof(struct cg_input_config)); - char *value=NULL; + struct cg_input_config *cfg = calloc(1, sizeof(struct cg_input_config)); + char *value = NULL; char *ident = NULL; if(cfg == NULL) { *errstr = @@ -161,10 +161,11 @@ parse_input_config(char **saveptr, char **errstr) { ident = strtok_r(NULL, " ", saveptr); if(ident == NULL) { - *errstr = log_error("Expected identifier of input device to configure, got none"); + *errstr = log_error( + "Expected identifier of input device to configure, got none"); goto error; } - cfg->identifier=strdup(ident); + cfg->identifier = strdup(ident); char *setting = strtok_r(NULL, " ", saveptr); if(setting == NULL) { @@ -176,154 +177,177 @@ parse_input_config(char **saveptr, char **errstr) { value = strdup(*saveptr); if(value == NULL) { - *errstr = - log_error("Failed to obtain value for input device configuration of device \"%s\"",ident); + *errstr = log_error("Failed to obtain value for input device " + "configuration of device \"%s\"", + ident); goto error; } - if(strcmp(setting,"accel_profile") == 0) { - if(strcmp(value,"adaptive") == 0) { - cfg->accel_profile=LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE; - } else if(strcmp(value,"flat") == 0) { - cfg->accel_profile=LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT; + if(strcmp(setting, "accel_profile") == 0) { + if(strcmp(value, "adaptive") == 0) { + cfg->accel_profile = LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE; + } else if(strcmp(value, "flat") == 0) { + cfg->accel_profile = LIBINPUT_CONFIG_ACCEL_PROFILE_FLAT; } else { - *errstr = log_error("Invalid profile \"%s\" for accel_profile configuration", value); + *errstr = log_error( + "Invalid profile \"%s\" for accel_profile configuration", + value); goto error; } - } else if(strcmp(setting,"calibration_matrix") == 0) { - cfg->calibration_matrix.configured=true; - for(int i=0;i<6;++i) { - cfg->calibration_matrix.matrix[i]=parse_float(saveptr," "); - if(cfg->calibration_matrix.matrix[i]==FLT_MIN) { - *errstr = log_error("Failed to read calibration matrix, expected 6 floating point values separated by spaces"); - goto error; - } + } else if(strcmp(setting, "calibration_matrix") == 0) { + cfg->calibration_matrix.configured = true; + for(int i = 0; i < 6; ++i) { + cfg->calibration_matrix.matrix[i] = parse_float(saveptr, " "); + if(cfg->calibration_matrix.matrix[i] == FLT_MIN) { + *errstr = + log_error("Failed to read calibration matrix, expected 6 " + "floating point values separated by spaces"); + goto error; + } } - } else if(strcmp(setting,"click_method") == 0) { - if(strcmp(value,"none")) { - cfg->click_method=LIBINPUT_CONFIG_CLICK_METHOD_NONE; - } else if(strcmp(value,"button_areas")) { - cfg->click_method=LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS; - } else if(strcmp(value,"clickfinger")) { - cfg->click_method=LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER; + } else if(strcmp(setting, "click_method") == 0) { + if(strcmp(value, "none")) { + cfg->click_method = LIBINPUT_CONFIG_CLICK_METHOD_NONE; + } else if(strcmp(value, "button_areas")) { + cfg->click_method = LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS; + } else if(strcmp(value, "clickfinger")) { + cfg->click_method = LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER; } else { - *errstr = log_error("Invalid method \"%s\" for click_method configuration", value); + *errstr = log_error( + "Invalid method \"%s\" for click_method configuration", value); goto error; } - } else if(strcmp(setting,"drag") == 0) { - if(strcmp(value,"enabled") == 0) { - cfg->drag=LIBINPUT_CONFIG_DRAG_ENABLED; - } else if(strcmp(value,"disabled") == 0) { - cfg->drag=LIBINPUT_CONFIG_DRAG_DISABLED; + } else if(strcmp(setting, "drag") == 0) { + if(strcmp(value, "enabled") == 0) { + cfg->drag = LIBINPUT_CONFIG_DRAG_ENABLED; + } else if(strcmp(value, "disabled") == 0) { + cfg->drag = LIBINPUT_CONFIG_DRAG_DISABLED; } else { - *errstr = log_error("Invalid option \"%s\" to setting \"drag\"", value); + *errstr = + log_error("Invalid option \"%s\" to setting \"drag\"", value); goto error; } - } else if(strcmp(setting,"drag_lock") == 0) { - if(strcmp(value,"enabled") == 0) { - cfg->drag_lock=LIBINPUT_CONFIG_DRAG_LOCK_ENABLED; - } else if(strcmp(value,"disabled") == 0) { - cfg->drag_lock=LIBINPUT_CONFIG_DRAG_LOCK_DISABLED; + } else if(strcmp(setting, "drag_lock") == 0) { + if(strcmp(value, "enabled") == 0) { + cfg->drag_lock = LIBINPUT_CONFIG_DRAG_LOCK_ENABLED; + } else if(strcmp(value, "disabled") == 0) { + cfg->drag_lock = LIBINPUT_CONFIG_DRAG_LOCK_DISABLED; } else { - *errstr = log_error("Invalid option \"%s\" to setting \"drag_lock\"", value); + *errstr = log_error( + "Invalid option \"%s\" to setting \"drag_lock\"", value); goto error; } - } else if(strcmp(setting,"dwt") == 0) { - if(strcmp(value,"enabled") == 0) { - cfg->dwt=LIBINPUT_CONFIG_DWT_ENABLED; - } else if(strcmp(value,"disabled") == 0) { - cfg->dwt=LIBINPUT_CONFIG_DWT_DISABLED; + } else if(strcmp(setting, "dwt") == 0) { + if(strcmp(value, "enabled") == 0) { + cfg->dwt = LIBINPUT_CONFIG_DWT_ENABLED; + } else if(strcmp(value, "disabled") == 0) { + cfg->dwt = LIBINPUT_CONFIG_DWT_DISABLED; } else { - *errstr = log_error("Invalid option \"%s\" to setting \"dwt\"", value); + *errstr = + log_error("Invalid option \"%s\" to setting \"dwt\"", value); goto error; } - } else if(strcmp(setting,"events") == 0) { - if(strcmp(value,"enabled") == 0) { - cfg->send_events=LIBINPUT_CONFIG_SEND_EVENTS_ENABLED; - } else if(strcmp(value,"disabled") == 0) { - cfg->send_events=LIBINPUT_CONFIG_SEND_EVENTS_DISABLED; - } else if(strcmp(value,"disabled_on_external_mouse") == 0) { - cfg->send_events=LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE; + } else if(strcmp(setting, "events") == 0) { + if(strcmp(value, "enabled") == 0) { + cfg->send_events = LIBINPUT_CONFIG_SEND_EVENTS_ENABLED; + } else if(strcmp(value, "disabled") == 0) { + cfg->send_events = LIBINPUT_CONFIG_SEND_EVENTS_DISABLED; + } else if(strcmp(value, "disabled_on_external_mouse") == 0) { + cfg->send_events = + LIBINPUT_CONFIG_SEND_EVENTS_DISABLED_ON_EXTERNAL_MOUSE; } else { - *errstr = log_error("Invalid option \"%s\" to setting \"events\"", value); + *errstr = + log_error("Invalid option \"%s\" to setting \"events\"", value); goto error; } - } else if(strcmp(setting,"left_handed") == 0) { - if(strcmp(value,"enabled") == 0) { - cfg->left_handed=true; - } else if(strcmp(value,"disabled") == 0) { - cfg->left_handed=false; + } else if(strcmp(setting, "left_handed") == 0) { + if(strcmp(value, "enabled") == 0) { + cfg->left_handed = true; + } else if(strcmp(value, "disabled") == 0) { + cfg->left_handed = false; } else { - *errstr = log_error("Invalid option \"%s\" to setting \"left_handed\"", value); + *errstr = log_error( + "Invalid option \"%s\" to setting \"left_handed\"", value); goto error; } - } else if(strcmp(setting,"middle_emulation") == 0) { - if(strcmp(value,"enabled") == 0) { - cfg->middle_emulation=LIBINPUT_CONFIG_MIDDLE_EMULATION_ENABLED; - } else if(strcmp(value,"disabled") == 0) { - cfg->middle_emulation=LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED; + } else if(strcmp(setting, "middle_emulation") == 0) { + if(strcmp(value, "enabled") == 0) { + cfg->middle_emulation = LIBINPUT_CONFIG_MIDDLE_EMULATION_ENABLED; + } else if(strcmp(value, "disabled") == 0) { + cfg->middle_emulation = LIBINPUT_CONFIG_MIDDLE_EMULATION_DISABLED; } else { - *errstr = log_error("Invalid option \"%s\" to setting \"middle_emulation\"", value); + *errstr = log_error( + "Invalid option \"%s\" to setting \"middle_emulation\"", value); goto error; } - } else if(strcmp(setting,"natural_scroll") == 0) { - if(strcmp(value,"enabled") == 0) { - cfg->natural_scroll=true; - } else if(strcmp(value,"disabled") == 0) { - cfg->natural_scroll=false; + } else if(strcmp(setting, "natural_scroll") == 0) { + if(strcmp(value, "enabled") == 0) { + cfg->natural_scroll = true; + } else if(strcmp(value, "disabled") == 0) { + cfg->natural_scroll = false; } else { - *errstr = log_error("Invalid option \"%s\" to setting \"natural_scroll\"", value); + *errstr = log_error( + "Invalid option \"%s\" to setting \"natural_scroll\"", value); goto error; } - } else if(strcmp(setting,"pointer_accel") == 0) { - cfg->pointer_accel=parse_float(saveptr, " "); - if(cfg->pointer_accel==FLT_MIN) { - *errstr = log_error("Invalid option \"%s\" to setting \"pointer_accel\", expected float value", value); + } else if(strcmp(setting, "pointer_accel") == 0) { + cfg->pointer_accel = parse_float(saveptr, " "); + if(cfg->pointer_accel == FLT_MIN) { + *errstr = log_error("Invalid option \"%s\" to setting " + "\"pointer_accel\", expected float value", + value); goto error; } - } else if(strcmp(setting,"scroll_button") == 0) { - char *err=NULL; - cfg->scroll_button=input_manager_get_mouse_button(value,&err); + } else if(strcmp(setting, "scroll_button") == 0) { + char *err = NULL; + cfg->scroll_button = input_manager_get_mouse_button(value, &err); if(err) { - *errstr = log_error("Error parsing button for \"scroll_button\" setting. Returned error \"%s\"", err); + *errstr = log_error("Error parsing button for \"scroll_button\" " + "setting. Returned error \"%s\"", + err); free(err); goto error; } - } else if(strcmp(setting,"scroll_factor") == 0) { - cfg->scroll_factor=parse_float(saveptr, " "); - if(cfg->scroll_factor==FLT_MIN) { - *errstr = log_error("Invalid option \"%s\" to setting \"scroll_factor\", expected float value", value); + } else if(strcmp(setting, "scroll_factor") == 0) { + cfg->scroll_factor = parse_float(saveptr, " "); + if(cfg->scroll_factor == FLT_MIN) { + *errstr = log_error("Invalid option \"%s\" to setting " + "\"scroll_factor\", expected float value", + value); goto error; } - } else if(strcmp(setting,"scroll_method") == 0) { - if(strcmp(value,"none") == 0) { - cfg->scroll_method=LIBINPUT_CONFIG_SCROLL_NO_SCROLL; - } else if(strcmp(value,"two_finger") == 0) { - cfg->scroll_method=LIBINPUT_CONFIG_SCROLL_2FG; - } else if(strcmp(value,"edge") == 0) { - cfg->scroll_method=LIBINPUT_CONFIG_SCROLL_EDGE; - } else if(strcmp(value,"on_button_down") == 0) { - cfg->scroll_method=LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN; + } else if(strcmp(setting, "scroll_method") == 0) { + if(strcmp(value, "none") == 0) { + cfg->scroll_method = LIBINPUT_CONFIG_SCROLL_NO_SCROLL; + } else if(strcmp(value, "two_finger") == 0) { + cfg->scroll_method = LIBINPUT_CONFIG_SCROLL_2FG; + } else if(strcmp(value, "edge") == 0) { + cfg->scroll_method = LIBINPUT_CONFIG_SCROLL_EDGE; + } else if(strcmp(value, "on_button_down") == 0) { + cfg->scroll_method = LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN; } else { - *errstr = log_error("Invalid option \"%s\" to setting \"scroll_method\"", value); + *errstr = log_error( + "Invalid option \"%s\" to setting \"scroll_method\"", value); goto error; } - } else if(strcmp(setting,"tap") == 0) { - if(strcmp(value,"enabled") == 0) { - cfg->tap=LIBINPUT_CONFIG_TAP_ENABLED; - } else if(strcmp(value,"disabled") == 0) { - cfg->tap=LIBINPUT_CONFIG_TAP_DISABLED; + } else if(strcmp(setting, "tap") == 0) { + if(strcmp(value, "enabled") == 0) { + cfg->tap = LIBINPUT_CONFIG_TAP_ENABLED; + } else if(strcmp(value, "disabled") == 0) { + cfg->tap = LIBINPUT_CONFIG_TAP_DISABLED; } else { - *errstr = log_error("Invalid option \"%s\" to setting \"tap\"", value); + *errstr = + log_error("Invalid option \"%s\" to setting \"tap\"", value); goto error; } - } else if(strcmp(setting,"tap_button_map") == 0) { - if(strcmp(value,"lrm") == 0) { - cfg->tap=LIBINPUT_CONFIG_TAP_MAP_LRM; - } else if(strcmp(value,"lmr") == 0) { - cfg->tap=LIBINPUT_CONFIG_TAP_MAP_LMR; + } else if(strcmp(setting, "tap_button_map") == 0) { + if(strcmp(value, "lrm") == 0) { + cfg->tap = LIBINPUT_CONFIG_TAP_MAP_LRM; + } else if(strcmp(value, "lmr") == 0) { + cfg->tap = LIBINPUT_CONFIG_TAP_MAP_LMR; } else { - *errstr = log_error("Invalid option \"%s\" to setting \"tap_button_map\"", value); + *errstr = log_error( + "Invalid option \"%s\" to setting \"tap_button_map\"", value); goto error; } } @@ -341,8 +365,8 @@ error: if(value) { free(value); } - wlr_log(WLR_ERROR, - "Input configuration must be of the form 'input \"\" '"); + wlr_log(WLR_ERROR, "Input configuration must be of the form 'input " + "\"\" '"); return NULL; } @@ -575,9 +599,10 @@ parse_output_config(char **saveptr, char **errstr) { cfg->refresh_rate = parse_float(saveptr, " "); if(cfg->refresh_rate <= 0.0) { - *errstr = log_error( - "Error parsing refresh rate of output configuration for output %s, expected positive float", - name); + *errstr = + log_error("Error parsing refresh rate of output configuration for " + "output %s, expected positive float", + name); goto error; } diff --git a/seat.c b/seat.c index 1694a7f..91ab374 100644 --- a/seat.c +++ b/seat.c @@ -31,8 +31,8 @@ #include #endif -#include "keybinding.h" #include "input_manager.h" +#include "keybinding.h" #include "message.h" #include "output.h" #include "seat.h" @@ -113,13 +113,13 @@ static void update_capabilities(const struct cg_seat *seat) { uint32_t caps = 0; - if(seat->num_keyboards>0) { + if(seat->num_keyboards > 0) { caps |= WL_SEAT_CAPABILITY_KEYBOARD; } - if(seat->num_pointers>0) { + if(seat->num_pointers > 0) { caps |= WL_SEAT_CAPABILITY_POINTER; } - if(seat->num_touch>0) { + if(seat->num_touch > 0) { caps |= WL_SEAT_CAPABILITY_TOUCH; } wlr_seat_set_capabilities(seat->seat, caps); @@ -148,7 +148,7 @@ remove_touch(struct cg_seat *seat, struct cg_touch *touch) { static void new_touch(struct cg_seat *seat, struct cg_input_device *input_device) { - struct wlr_input_device *device=input_device->wlr_device; + struct wlr_input_device *device = input_device->wlr_device; struct cg_touch *touch = calloc(1, sizeof(struct cg_touch)); if(!touch) { wlr_log(WLR_ERROR, "Cannot allocate touch"); @@ -158,7 +158,7 @@ new_touch(struct cg_seat *seat, struct cg_input_device *input_device) { touch->seat = seat; touch->device = input_device; wlr_cursor_attach_input_device(seat->cursor, device); - input_device->touch=touch; + input_device->touch = touch; ++seat->num_touch; if(device->output_name != NULL) { @@ -187,7 +187,7 @@ remove_pointer(struct cg_seat *seat, struct cg_pointer *pointer) { static void new_pointer(struct cg_seat *seat, struct cg_input_device *input_device) { - struct wlr_input_device *device=input_device->wlr_device; + struct wlr_input_device *device = input_device->wlr_device; struct cg_pointer *pointer = calloc(1, sizeof(struct cg_pointer)); if(!pointer) { wlr_log(WLR_ERROR, "Cannot allocate pointer"); @@ -197,7 +197,7 @@ new_pointer(struct cg_seat *seat, struct cg_input_device *input_device) { pointer->seat = seat; pointer->device = input_device; wlr_cursor_attach_input_device(seat->cursor, device); - input_device->pointer=pointer; + input_device->pointer = pointer; ++seat->num_pointers; if(device->output_name != NULL) { @@ -430,7 +430,7 @@ cleanup: static void new_keyboard(struct cg_seat *seat, struct cg_input_device *input_device) { - struct wlr_input_device *device= input_device->wlr_device; + struct wlr_input_device *device = input_device->wlr_device; struct xkb_context *context = xkb_context_new(XKB_CONTEXT_NO_FLAGS); if(!context) { wlr_log(WLR_ERROR, "Unable to create XKB context"); @@ -482,16 +482,17 @@ seat_add_device(struct cg_seat *seat, struct cg_input_device *device) { update_capabilities(seat); } -void remove_keyboard(struct cg_seat *seat, struct cg_input_device *keyboard) { - if (!keyboard) { +void +remove_keyboard(struct cg_seat *seat, struct cg_input_device *keyboard) { + if(!keyboard) { return; } struct wlr_seat *wlr_seat = seat->seat; struct wlr_keyboard *wlr_keyboard = keyboard->wlr_device->keyboard; - if (keyboard->wlr_device->keyboard->group) { - wlr_keyboard_group_remove_keyboard(wlr_keyboard->group,wlr_keyboard); + if(keyboard->wlr_device->keyboard->group) { + wlr_keyboard_group_remove_keyboard(wlr_keyboard->group, wlr_keyboard); } - if (wlr_seat_get_keyboard(wlr_seat) == wlr_keyboard) { + if(wlr_seat_get_keyboard(wlr_seat) == wlr_keyboard) { wlr_seat_set_keyboard(wlr_seat, NULL); } --seat->num_keyboards; @@ -505,11 +506,11 @@ seat_remove_device(struct cg_seat *seat, struct cg_input_device *device) { break; case WLR_INPUT_DEVICE_POINTER: remove_pointer(seat, device->pointer); - device->pointer=NULL; + device->pointer = NULL; break; case WLR_INPUT_DEVICE_TOUCH: remove_touch(seat, device->touch); - device->touch=NULL; + device->touch = NULL; break; case WLR_INPUT_DEVICE_SWITCH: wlr_log(WLR_DEBUG, "Switch input is not implemented"); @@ -836,7 +837,7 @@ handle_destroy(struct wl_listener *listener, void *_data) { struct cg_input_device *it, *it_tmp; wl_list_for_each_safe(it, it_tmp, &seat->server->input->devices, link) { - input_manager_handle_device_destroy(&it->device_destroy,NULL); + input_manager_handle_device_destroy(&it->device_destroy, NULL); } wlr_xcursor_manager_destroy(seat->xcursor_manager); @@ -926,9 +927,9 @@ seat_create(struct cg_server *server, struct wlr_backend *backend) { &seat->request_set_primary_selection); wl_list_init(&seat->keyboard_groups); - seat->num_keyboards=0; - seat->num_pointers=0; - seat->num_touch=0; + seat->num_keyboards = 0; + seat->num_pointers = 0; + seat->num_touch = 0; wl_list_init(&seat->drag_icons); seat->request_start_drag.notify = handle_request_start_drag; From 4ed9966d7b4caed231f8c0d5b1ec7261e9714520 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 19 Sep 2021 07:34:14 +0200 Subject: [PATCH 295/689] Add documentation for input configuration --- man/cagebreak-config.5.md | 69 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index 45afd8f..8c4b4b2 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -93,6 +93,75 @@ by prepending a line with the # symbol. *hsplit* Split current tile horizontally +*input * + Set the setting "" to "" for device "". The identifier can either be "\*" (wildcard), of the form "type:" or the identifier of the device as printed for example by *cagebreak --show-info*. The supported input types are + - touchpad + - pointer + - keyboard + - touch + - tablet_tool + - tablet_pad + - switch + + Configurations are applied sequentially. Currently only libinput devices may be configured. The available settings and their corresponding values are as follows: + + *accel_profile adaptive|flat* + Sets the pointer acceleration profile for the specified input device. + + *calibration_matrix <6 space-separated floating point values>* + Sets the calibration matrix. + + *click_method none|button_areas|clickfinger* + Changes the click method for the specified device. + + *drag enabled|disabled* + Enables or disables tap-and-drag for specified input device. + + *drag_lock enabled|disabled* + Enables or disables drag lock for specified input device. + + *dwt enabled|disabled* + Enables or disables disable-while-typing for the specified input device. + + *enabled|disabled|disabled_on_external_mouse* + Enables or disables send_events for specified input device. Disabling + send_events disables the input device. + + *left_handed enabled|disabled* + Enables or disables left handed mode for specified input device. + + *middle_emulation enabled|disabled* + Enables or disables middle click emulation. + + *natural_scroll enabled|disabled* + Enables or disables natural (inverted) scrolling for the specified input + device. + + *pointer_accel [<-1|1>]* + Changes the pointer acceleration for the specified input device. + + *scroll_button disable|* + Sets the button used for scroll_method on_button_down. The button can + be given as an event name or code, which can be obtained from *libinput + debug-events*. If set to + _disable_, it disables the scroll_method on_button_down. + + *scroll_factor * + Changes the scroll factor for the specified input device. Scroll speed will + be scaled by the given value, which must be non-negative. + + *scroll_method none|two_finger|edge|on_button_down* + Changes the scroll method for the specified input device. + + *tap enabled|disabled* + Enables or disables tap for specified input device. + + *tap_button_map lrm|lmr* + Specifies which button mapping to use for tapping. _lrm_ treats 1 finger as + left click, 2 fingers as right click, and 3 fingers as middle click. _lmr_ + treats 1 finger as left click, 2 fingers as middle click, and 3 fingers as + right click. + *mode * Enter mode "". After a keybinding is processed, return to default mode From 4c6bc1b59db6a88d16cbcf31d6f7f1959eb2156a Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 19 Sep 2021 10:23:36 +0200 Subject: [PATCH 296/689] Add support for printing input/output identifiers --- cagebreak.c | 23 ++++++++++++++++++++--- keybinding.c | 15 +++++++++++++++ keybinding.h | 1 + man/cagebreak-config.5.md | 6 +++++- message.c | 25 ++++++++++++------------- pango.c | 2 +- parse.c | 16 ++++------------ parse.h | 6 ++++++ server.c | 36 ++++++++++++++++++++++++++++++++++++ server.h | 2 ++ util.c | 22 ++++++++++++++++++++++ util.h | 7 +++++++ 12 files changed, 131 insertions(+), 30 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index df8cde1..8b9184a 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -61,6 +61,8 @@ #define WAIT_ANY -1 #endif +bool show_info=false; + void set_sig_handler(int sig, void (*action)(int)) { struct sigaction act; @@ -134,7 +136,8 @@ usage(FILE *file, const char *const cage) { " -D\t Turn on damage tracking debugging\n" #endif " -h\t Display this help message\n" - " -v\t Show the version number and exit\n", + " -v\t Show the version number and exit\n" + " -s\t Show information about the current setup and exit\n", cage); } @@ -142,9 +145,9 @@ static bool parse_args(struct cg_server *server, int argc, char *argv[]) { int c; #ifdef DEBUG - while((c = getopt(argc, argv, "rDhv")) != -1) { + while((c = getopt(argc, argv, "rDhvs")) != -1) { #else - while((c = getopt(argc, argv, "rhv")) != -1) { + while((c = getopt(argc, argv, "rhvs")) != -1) { #endif switch(c) { case 'r': @@ -164,6 +167,9 @@ parse_args(struct cg_server *server, int argc, char *argv[]) { case 'v': fprintf(stdout, "Cagebreak version " CG_VERSION "\n"); exit(0); + case 's': + show_info=true; + break; default: usage(stderr, argv[0]); return false; @@ -528,6 +534,17 @@ main(int argc, char *argv[]) { wlr_xwayland_set_seat(xwayland, server.seat->seat); #endif + if(show_info) { + char *msg=server_show_info(&server); + if(msg != NULL) { + fprintf(stderr,"%s",msg); + free(msg); + } else { + wlr_log(WLR_ERROR,"Failed to get info on cagebreak setup\n"); + } + exit(0); + } + if(ipc_init(&server) != 0) { wlr_log(WLR_ERROR, "Failed to initialize IPC"); ret = 1; diff --git a/keybinding.c b/keybinding.c index 536e13c..26b2ae2 100644 --- a/keybinding.c +++ b/keybinding.c @@ -701,6 +701,18 @@ keybinding_show_time(struct cg_server *server) { free(msg); } +void +keybinding_show_info(struct cg_server *server) { + char *msg=server_show_info(server); + + if(!msg) { + return; + } + + message_printf(server->curr_output, "%s", msg); + free(msg); +} + void keybinding_move_view_to_next_output(struct cg_server *server) { if(wl_list_length(&server->outputs) <= 1) { @@ -940,6 +952,9 @@ run_action(enum keybinding_action action, struct cg_server *server, case KEYBINDING_SHOW_TIME: keybinding_show_time(server); break; + case KEYBINDING_SHOW_INFO: + keybinding_show_info(server); + break; case KEYBINDING_RESIZE_TILE_HORIZONTAL: resize_tile(server, data.i, 0); break; diff --git a/keybinding.h b/keybinding.h index dcc696f..4cd0e87 100644 --- a/keybinding.h +++ b/keybinding.h @@ -39,6 +39,7 @@ enum keybinding_action { KEYBINDING_MOVE_VIEW_TO_WORKSPACE, // data.u is the desired workspace KEYBINDING_MOVE_VIEW_TO_NEXT_OUTPUT, KEYBINDING_SHOW_TIME, + KEYBINDING_SHOW_INFO, KEYBINDING_SWAP_LEFT, KEYBINDING_SWAP_RIGHT, diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index 8c4b4b2..4472431 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -94,7 +94,7 @@ by prepending a line with the # symbol. Split current tile horizontally *input * - Set the setting "" to "" for device "". The identifier can either be "\*" (wildcard), of the form "type:" or the identifier of the device as printed for example by *cagebreak --show-info*. The supported input types are + Set the setting "" to "" for device "". The identifier can either be "\*" (wildcard), of the form "type:" or the identifier of the device as printed for example by *cagebreak -s*. The supported input types are - touchpad - pointer - keyboard @@ -209,6 +209,10 @@ by prepending a line with the # symbol. *resizeup* Resize the current tile towards the top +*show_info* + Display info about the current setup. In particular, print the identifiers + of the available inputs and outputs. + *setmode * Set the default mode to diff --git a/message.c b/message.c index 2ff2075..e544813 100644 --- a/message.c +++ b/message.c @@ -8,6 +8,7 @@ #include #include +#include "util.h" #include "message.h" #include "output.h" #include "pango.h" @@ -32,14 +33,14 @@ to_cairo_subpixel_order(const enum wl_output_subpixel subpixel) { struct wlr_texture * create_message_texture(const char *string, const struct cg_output *output) { - const int PADDING = 2; - const int MESSAGE_HEIGHT = 17 + 2 * PADDING; + const int WIDTH_PADDING = 8; + const int HEIGHT_PADDING = 2; const char *font = "pango:Monospace 10"; struct wlr_texture *texture; double scale = output->wlr_output->scale; int width = 0; - int height = MESSAGE_HEIGHT * scale; + int height = 0; // We must use a non-nil cairo_t for cairo_set_font_options to work. // Therefore, we cannot use cairo_create(NULL). @@ -59,8 +60,9 @@ create_message_texture(const char *string, const struct cg_output *output) { cairo_font_options_set_subpixel_order( fo, to_cairo_subpixel_order(output->wlr_output->subpixel)); cairo_set_font_options(c, fo); - get_text_size(c, font, &width, NULL, NULL, scale, "%s", string); - width += 2 * PADDING; + get_text_size(c, font, &width, &height, NULL, scale, "%s", string); + width += 2 * WIDTH_PADDING; + height += 2 * HEIGHT_PADDING; cairo_surface_destroy(dummy_surface); cairo_destroy(c); @@ -77,7 +79,7 @@ create_message_texture(const char *string, const struct cg_output *output) { cairo_set_line_width(cairo, 2); cairo_rectangle(cairo, 0, 0, width, height); cairo_stroke(cairo); - cairo_move_to(cairo, PADDING, PADDING); + cairo_move_to(cairo, WIDTH_PADDING, HEIGHT_PADDING); pango_printf(cairo, font, scale, "%s", string); @@ -149,17 +151,14 @@ message_set_output(struct cg_output *output, const char *string, void message_printf(struct cg_output *output, const char *fmt, ...) { - uint16_t buf_len = 256; - char *buffer = (char *)malloc(buf_len * sizeof(char)); + va_list ap; + va_start(ap, fmt); + char *buffer = malloc_vsprintf_va_list(fmt,ap); + va_end(ap); if(buffer == NULL) { wlr_log(WLR_ERROR, "Failed to allocate buffer in message_printf"); return; } - va_list ap; - - va_start(ap, fmt); - vsnprintf(buffer, buf_len, fmt, ap); - va_end(ap); struct wlr_box *box = malloc(sizeof(struct wlr_box)); if(box == NULL) { diff --git a/pango.c b/pango.c index c1ca414..e9d04d3 100644 --- a/pango.c +++ b/pango.c @@ -25,7 +25,7 @@ get_pango_layout(cairo_t *cairo, const char *font, const char *text, pango_attr_list_insert(attrs, pango_attr_scale_new(scale)); PangoFontDescription *desc = pango_font_description_from_string(font); pango_layout_set_font_description(layout, desc); - pango_layout_set_single_paragraph_mode(layout, 1); + pango_layout_set_single_paragraph_mode(layout, false); pango_layout_set_attributes(layout, attrs); pango_attr_list_unref(attrs); pango_font_description_free(desc); diff --git a/parse.c b/parse.c index f38f761..4bbf72d 100644 --- a/parse.c +++ b/parse.c @@ -11,23 +11,13 @@ #include "output.h" #include "parse.h" #include "server.h" - -char * -malloc_vsprintf(const char *fmt, va_list ap) { - va_list ap2; - va_copy(ap2, ap); - int len = vsnprintf(NULL, 0, fmt, ap); - char *ret = malloc(sizeof(char) * (len + 1)); - vsnprintf(ret, len + 1, fmt, ap2); - va_end(ap2); - return ret; -} +#include "util.h" char * log_error(const char *fmt, ...) { va_list args; va_start(args, fmt); - char *ret = malloc_vsprintf(fmt, args); + char *ret = malloc_vsprintf_va_list(fmt, args); if(ret != NULL) { wlr_log(WLR_ERROR, "%s", ret); } @@ -631,6 +621,8 @@ parse_command(struct cg_server *server, struct keybinding *keybinding, keybinding->action = KEYBINDING_SPLIT_HORIZONTAL; } else if(strcmp(action, "quit") == 0) { keybinding->action = KEYBINDING_QUIT; + } else if(strcmp(action, "show_info") == 0) { + keybinding->action = KEYBINDING_SHOW_INFO; } else if(strcmp(action, "close") == 0) { keybinding->action = KEYBINDING_CLOSE_VIEW; } else if(strcmp(action, "focus") == 0) { diff --git a/parse.h b/parse.h index ba1b2e8..798d732 100644 --- a/parse.h +++ b/parse.h @@ -4,9 +4,15 @@ #define MAX_LINE_SIZE 256 +#include + struct cg_server; int parse_rc_line(struct cg_server *server, char *line, char **errstr); +char * +parse_malloc_vsprintf(const char *fmt, ...); +char * +parse_malloc_vsprintf_va_list(const char *fmt, va_list list); #endif /* end of include guard PARSE_H */ diff --git a/server.c b/server.c index c82296f..b69f6dd 100644 --- a/server.c +++ b/server.c @@ -9,11 +9,17 @@ #define _POSIX_C_SOURCE 200809L + #include +#include #include #include +#include #include "server.h" +#include "input_manager.h" +#include "output.h" +#include "util.h" void display_terminate(struct cg_server *server) { @@ -35,3 +41,33 @@ get_mode_index_from_name(char *const *modes, const char *mode_name) { } return -1; } + +char * +server_show_info(struct cg_server *server) { + char *output_str=strdup(""), *output_str_tmp; + struct cg_output *output; + wl_list_for_each(output, &server->outputs, link) { + if(!output_str) { + return NULL; + } + output_str_tmp=output_str; + output_str=malloc_vsprintf("%s\t * %s\n",output_str, output->wlr_output->name); + free(output_str_tmp); + } + char *input_str=strdup(""), *input_str_tmp; + struct cg_input_device *input; + wl_list_for_each(input, &server->input->devices, link) { + if(!input_str) { + return NULL; + } + input_str_tmp=input_str; + if(strcmp(input->identifier,"") != 0) { + input_str=malloc_vsprintf("%s\t * H:%s\n",input_str, input->identifier); + } + free(input_str_tmp); + } + char *ret=malloc_vsprintf("Outputs:\n%sInputs:\n%s",output_str,input_str); + free(output_str); + free(input_str); + return ret; +} diff --git a/server.h b/server.h index 79bb408..9ee21e1 100644 --- a/server.h +++ b/server.h @@ -61,5 +61,7 @@ void display_terminate(struct cg_server *server); int get_mode_index_from_name(char *const *modes, const char *mode_name); +char * +server_show_info(struct cg_server *server); #endif diff --git a/util.c b/util.c index a877092..b74a589 100644 --- a/util.c +++ b/util.c @@ -10,6 +10,7 @@ #include #include "util.h" +#include int scale_length(int length, int offset, double scale) { @@ -33,3 +34,24 @@ scale_box(struct wlr_box *box, double scale) { box->x = (int)round(box->x * scale); box->y = (int)round(box->y * scale); } + +char * +malloc_vsprintf_va_list(const char *fmt, va_list ap) { + va_list ap2; + va_copy(ap2, ap); + int len = vsnprintf(NULL, 0, fmt, ap); + char *ret = malloc(sizeof(char) * (len + 1)); + vsnprintf(ret, len + 1, fmt, ap2); + va_end(ap2); + return ret; +} + +char * +malloc_vsprintf(const char *fmt, ...) { + va_list args; + va_start(args,fmt); + char *ret=malloc_vsprintf_va_list(fmt,args); + return ret; +} + + diff --git a/util.h b/util.h index 8ddc7be..01e403e 100644 --- a/util.h +++ b/util.h @@ -1,6 +1,8 @@ #ifndef CG_UTIL_H #define CG_UTIL_H +#include + struct wlr_box; /** Apply scale to a width or height. */ @@ -10,4 +12,9 @@ scale_length(int length, int offset, double scale); void scale_box(struct wlr_box *box, double scale); +char * +malloc_vsprintf(const char *fmt, ...); +char * +malloc_vsprintf_va_list(const char *fmt, va_list list); + #endif From cc4780eb71fcc3f13b3380806734b55cbc8bd588 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 19 Sep 2021 10:25:34 +0200 Subject: [PATCH 297/689] Apply clang-format --- cagebreak.c | 12 ++++++------ keybinding.c | 2 +- message.c | 4 ++-- server.c | 24 +++++++++++++----------- util.c | 6 ++---- 5 files changed, 24 insertions(+), 24 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index 8b9184a..f1ae6a7 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -61,7 +61,7 @@ #define WAIT_ANY -1 #endif -bool show_info=false; +bool show_info = false; void set_sig_handler(int sig, void (*action)(int)) { @@ -137,7 +137,7 @@ usage(FILE *file, const char *const cage) { #endif " -h\t Display this help message\n" " -v\t Show the version number and exit\n" - " -s\t Show information about the current setup and exit\n", + " -s\t Show information about the current setup and exit\n", cage); } @@ -168,7 +168,7 @@ parse_args(struct cg_server *server, int argc, char *argv[]) { fprintf(stdout, "Cagebreak version " CG_VERSION "\n"); exit(0); case 's': - show_info=true; + show_info = true; break; default: usage(stderr, argv[0]); @@ -535,12 +535,12 @@ main(int argc, char *argv[]) { #endif if(show_info) { - char *msg=server_show_info(&server); + char *msg = server_show_info(&server); if(msg != NULL) { - fprintf(stderr,"%s",msg); + fprintf(stderr, "%s", msg); free(msg); } else { - wlr_log(WLR_ERROR,"Failed to get info on cagebreak setup\n"); + wlr_log(WLR_ERROR, "Failed to get info on cagebreak setup\n"); } exit(0); } diff --git a/keybinding.c b/keybinding.c index 26b2ae2..0686d90 100644 --- a/keybinding.c +++ b/keybinding.c @@ -703,7 +703,7 @@ keybinding_show_time(struct cg_server *server) { void keybinding_show_info(struct cg_server *server) { - char *msg=server_show_info(server); + char *msg = server_show_info(server); if(!msg) { return; diff --git a/message.c b/message.c index e544813..f05b175 100644 --- a/message.c +++ b/message.c @@ -8,11 +8,11 @@ #include #include -#include "util.h" #include "message.h" #include "output.h" #include "pango.h" #include "server.h" +#include "util.h" cairo_subpixel_order_t to_cairo_subpixel_order(const enum wl_output_subpixel subpixel) { @@ -153,7 +153,7 @@ void message_printf(struct cg_output *output, const char *fmt, ...) { va_list ap; va_start(ap, fmt); - char *buffer = malloc_vsprintf_va_list(fmt,ap); + char *buffer = malloc_vsprintf_va_list(fmt, ap); va_end(ap); if(buffer == NULL) { wlr_log(WLR_ERROR, "Failed to allocate buffer in message_printf"); diff --git a/server.c b/server.c index b69f6dd..e0ccb82 100644 --- a/server.c +++ b/server.c @@ -9,16 +9,15 @@ #define _POSIX_C_SOURCE 200809L - -#include #include +#include #include #include #include -#include "server.h" #include "input_manager.h" #include "output.h" +#include "server.h" #include "util.h" void @@ -44,29 +43,32 @@ get_mode_index_from_name(char *const *modes, const char *mode_name) { char * server_show_info(struct cg_server *server) { - char *output_str=strdup(""), *output_str_tmp; + char *output_str = strdup(""), *output_str_tmp; struct cg_output *output; wl_list_for_each(output, &server->outputs, link) { if(!output_str) { return NULL; } - output_str_tmp=output_str; - output_str=malloc_vsprintf("%s\t * %s\n",output_str, output->wlr_output->name); + output_str_tmp = output_str; + output_str = malloc_vsprintf("%s\t * %s\n", output_str, + output->wlr_output->name); free(output_str_tmp); } - char *input_str=strdup(""), *input_str_tmp; + char *input_str = strdup(""), *input_str_tmp; struct cg_input_device *input; wl_list_for_each(input, &server->input->devices, link) { if(!input_str) { return NULL; } - input_str_tmp=input_str; - if(strcmp(input->identifier,"") != 0) { - input_str=malloc_vsprintf("%s\t * H:%s\n",input_str, input->identifier); + input_str_tmp = input_str; + if(strcmp(input->identifier, "") != 0) { + input_str = + malloc_vsprintf("%s\t * H:%s\n", input_str, input->identifier); } free(input_str_tmp); } - char *ret=malloc_vsprintf("Outputs:\n%sInputs:\n%s",output_str,input_str); + char *ret = + malloc_vsprintf("Outputs:\n%sInputs:\n%s", output_str, input_str); free(output_str); free(input_str); return ret; diff --git a/util.c b/util.c index b74a589..83b7e66 100644 --- a/util.c +++ b/util.c @@ -49,9 +49,7 @@ malloc_vsprintf_va_list(const char *fmt, va_list ap) { char * malloc_vsprintf(const char *fmt, ...) { va_list args; - va_start(args,fmt); - char *ret=malloc_vsprintf_va_list(fmt,args); + va_start(args, fmt); + char *ret = malloc_vsprintf_va_list(fmt, args); return ret; } - - From 69fe10f4be56387d9538275b1800a39477595982 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 19 Sep 2021 10:43:16 +0200 Subject: [PATCH 298/689] Remove debug code --- server.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server.c b/server.c index e0ccb82..1ad23e6 100644 --- a/server.c +++ b/server.c @@ -63,7 +63,7 @@ server_show_info(struct cg_server *server) { input_str_tmp = input_str; if(strcmp(input->identifier, "") != 0) { input_str = - malloc_vsprintf("%s\t * H:%s\n", input_str, input->identifier); + malloc_vsprintf("%s\t * %s\n", input_str, input->identifier); } free(input_str_tmp); } From 95af01b119e095fcb296b33be38d7e87ca773870 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 20 Sep 2021 08:54:00 +0200 Subject: [PATCH 299/689] Fix potential null pointer dereferences --- cagebreak.c | 3 +-- keybinding.c | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index f1ae6a7..0738b67 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -272,6 +272,7 @@ main(int argc, char *argv[]) { #endif wl_list_init(&server.input_config); + wl_list_init(&server.output_config); server.modes = malloc(4 * sizeof(char *)); if(!server.modes) { @@ -337,8 +338,6 @@ main(int argc, char *argv[]) { goto end; } - wl_list_init(&server.output_config); - renderer = wlr_backend_get_renderer(backend); wlr_renderer_init_wl_display(renderer, server.wl_display); diff --git a/keybinding.c b/keybinding.c index 0686d90..5d802fe 100644 --- a/keybinding.c +++ b/keybinding.c @@ -115,6 +115,9 @@ keybinding_list_init() { void keybinding_list_free(struct keybinding_list *list) { + if(!list) { + return; + } for(unsigned int i = 0; i < list->length; ++i) { keybinding_free(list->keybindings[i], true); } From 85b8cefd8d2d3a3cedf5ca312469b530a989184b Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Sat, 25 Sep 2021 21:35:27 +0200 Subject: [PATCH 300/689] Add input configuration to examples --- examples/config | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/examples/config b/examples/config index b6a3ca2..0ecf20b 100644 --- a/examples/config +++ b/examples/config @@ -78,3 +78,11 @@ definekey top XF86MonBrightnessUp exec xbacklight -inc 1 output eDP-1 pos 0 0 res 1366x768 rate 60 output eDP-1 disable output eDP-1 enable + +##################### +#Input configuration +##################### + +input 1234:0:Device_Ident click_method clickfinger +input type:pointer scroll_method two_finger +input * calibration_matrix 1 2 3 4 5 6 From 43c6c82326749d5613c897f3d16e465e16af7bf9 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Sat, 25 Sep 2021 21:35:50 +0200 Subject: [PATCH 301/689] Prepare 1.8.0 release --- man/cagebreak-config.5.md | 4 ++-- man/cagebreak.1.md | 5 ++++- meson.build | 14 +++++++------- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index 4472431..321d6bf 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -1,4 +1,4 @@ -cagebreak-config(1) "Version 1.7.5" "Cagebreak Manual" +cagebreak-config(1) "Version 1.8.0" "Cagebreak Manual" # NAME @@ -103,7 +103,7 @@ by prepending a line with the # symbol. - tablet_pad - switch - Configurations are applied sequentially. Currently only libinput devices may be configured. The available settings and their corresponding values are as follows: + Configurations are applied sequentially. Currently, only libinput devices may be configured. The available settings and their corresponding values are as follows: *accel_profile adaptive|flat* Sets the pointer acceleration profile for the specified input device. diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index 97f2ac4..309be7c 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -1,4 +1,4 @@ -cagebreak(1) "Version 1.7.5" "Cagebreak Manual" +cagebreak(1) "Version 1.8.0" "Cagebreak Manual" # NAME @@ -38,6 +38,9 @@ are displayed in a message box at the top right of the screen. *-r* Rotate the output 90 degrees clockwise, can be specified up to three times +*-s* + Show all available inputs and outputs + *-v* Show version number and exit diff --git a/meson.build b/meson.build index 7ab216b..d990bd4 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('cagebreak', 'c', - version: '1.7.5', + version: '1.8.0', license: 'MIT', default_options: [ 'c_std=c11', @@ -207,15 +207,15 @@ reproducible_build_versions = { 'wayland_client': '1.19.0', 'wayland_cursor': '1.19.0', 'wlroots': '0.14.1', - 'xkbcommon': '1.3.0', + 'xkbcommon': '1.3.1', 'fontconfig': '2.13.94', - 'libinput': '2.13.94', - 'libevdev': '2.13.94', - 'libudev': '2.13.94', + 'libinput': '1.19.0', + 'libevdev': '1.11.0', + 'libudev': '249', 'pixman': '0.40.0', - 'pango': '1.48.7', + 'pango': '1.48.10', 'cairo': '1.17.4', - 'pangocairo': '1.48.7', + 'pangocairo': '1.48.10', 'math': '-1' } From 6ae77a341b0fde001437e008808477c8231075bd Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Sun, 26 Sep 2021 10:40:37 +0200 Subject: [PATCH 302/689] Add changelog --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index ed2c2e6..86830f3 100644 --- a/README.md +++ b/README.md @@ -512,6 +512,10 @@ Adds support for non-build dependencies and an option for builds without pandoc. Improve window ordering. +### Release 1.8.0 + +Adds libinput configuration and virtual keyboard and pointer support. + ## Contributors * Aisha Tammy From 47082c9afc038bd2aae06ceb16e93ce1ad5ecad3 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Sun, 26 Sep 2021 10:40:51 +0200 Subject: [PATCH 303/689] Update man page build time --- meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index d990bd4..e8a2cfd 100644 --- a/meson.build +++ b/meson.build @@ -268,7 +268,7 @@ if get_option('man-pages') output : 'cagebreak.1', input : 'man/cagebreak.1.md', capture : true, - command : [sh, '-c', 'export SOURCE_DATE_EPOCH=1625921119 ; @0@ < @INPUT@'.format(scdoc.path())], + command : [sh, '-c', 'export SOURCE_DATE_EPOCH=1632645085 ; @0@ < @INPUT@'.format(scdoc.path())], install: true, install_dir: mandir1 ) @@ -277,7 +277,7 @@ if get_option('man-pages') output : 'cagebreak-config.5', input : 'man/cagebreak-config.5.md', capture : true, - command : [sh, '-c', 'export SOURCE_DATE_EPOCH=1625921119 ; @0@ < @INPUT@'.format(scdoc.path())], + command : [sh, '-c', 'export SOURCE_DATE_EPOCH=1632645085 ; @0@ < @INPUT@'.format(scdoc.path())], install: true, install_dir: mandir5 ) From 7a4c9cff363081e7c3d812c5052dbc7faa7237c0 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Sun, 26 Sep 2021 21:23:30 +0200 Subject: [PATCH 304/689] Add release artefacts --- README.md | 15 +++++++++++++++ signatures/1.7.4-cagebreak-config.5.sig | Bin 0 -> 566 bytes signatures/1.7.4-cagebreak.1.sig | Bin 0 -> 566 bytes signatures/1.7.4.sig | Bin 0 -> 566 bytes signatures/cagebreak-config.5.sig | Bin 566 -> 566 bytes signatures/cagebreak.1.sig | Bin 566 -> 566 bytes signatures/cagebreak.sig | Bin 566 -> 566 bytes 7 files changed, 15 insertions(+) create mode 100644 signatures/1.7.4-cagebreak-config.5.sig create mode 100644 signatures/1.7.4-cagebreak.1.sig create mode 100644 signatures/1.7.4.sig diff --git a/README.md b/README.md index 86830f3..3008d93 100644 --- a/README.md +++ b/README.md @@ -204,6 +204,21 @@ For every release after 1.0.5, hashes will be provided. For every release after 1.7.0, hashes will be provided for man pages too. +1.8.0 cagebreak + + * sha 256: ac84aa4a08c311da79ca29d92eef4254cb625674b255dbb75621ee6b171a1d79 + * sha 512: c047bb1986fd1d444547e4d64aa7ef9138b3d30327ac3ad9b4c6976e8df6638bae07c39293b5bc9c20e959c0a22b0e40eb2b23b4766d9a5531377ff954b16229 + +1.8.0 cagebreak.1 + + * sha 256: 4de43de7bde67d6d806d206dffc34389f0b5c3ba648bfef673b7bc0adeb29202 + * sha 512: 72aac9a2e9a47f2f85949222d5944dc293332a616e3b961c625fe876172f66638038057c30aa18904d6d969451f468b4fe45e918c0b204cf6952d58ea4c69c33 + +1.8.0 cagebreak-config.5 + + * sha 256: 678aadde06b5ff6bfbd9bc9460423210f9599bcaa0e50c2eae076dc6d6852781 + * sha 512: 72056018fc1c559f26bd7e007b3f1db7d478cec7ec9337620e03a1e3d06910e244a52e8f655ea4f5d73669ffe064bbd23506005d9a6c06764b0f820d7a1df43f + 1.7.4 cagebreak * sha 256: c7442db906239b13f8d09e91cbe01f9e47b2a2c75bbb4b52adefd15dfbfa820f diff --git a/signatures/1.7.4-cagebreak-config.5.sig b/signatures/1.7.4-cagebreak-config.5.sig new file mode 100644 index 0000000000000000000000000000000000000000..0fa98a3b5e3730da2324fb1b7cdc2142ad58171e GIT binary patch literal 566 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 delta 543 zcmV+)0^t3&1hxc_B7b1qlfM882@vvEYtv>GYq?0M5CE9)E)*64OdS($)&npk{I5;b zc+pEKzy}wDMm=T-$2|1`bs{&Y>cZDJGW7e;q}N*MXANSae^O7~?xSPiEtuYujH0@S zb$t^13_l}bD|Y!PfTD6Ru(ZAAgHhn(r5%v3-$2YxD0g}Xb$?Tr0nCo>_OV`oZdpn3 zd1bs+OynFI`6WsP9rre1nNY0f%rga!k83rbemp7vWa!vS9X9-lnVIjks;77kVu5Ff=L_x#>DW=*{MebO%6b>B@UON}NM>E7w{W;>Y zTi9yunD+)jUwirB$?iGo#*4OqhHw#XZS8!=IlFzLgwm diff --git a/signatures/cagebreak.sig b/signatures/cagebreak.sig index 22e1818ab09d095c08f005169e584fd605ad2096..a7634a92693b30deb71ef71ca850c6d5cee432f8 100644 GIT binary patch delta 543 zcmV+)0^t3&1hxc_B7b2}$W8zX2@vvEYtv>GYq@KD5C42M41b8lDa1hwp}r$*6mfYIB?xP9hm$L{d+4`+61fy$ha_yf(-u; zOaD|8D6IreUw@pEQcm$JdR}-FdOa!?sBGUlHeF@5>JEKB=OV2~-Iuz0Af)-!8b+;) ziv25Ro?Rw<@n)Rf^)`SS_>l{RD?CrEKTsW1@KGl-8(gt_c1jHGSF@93g>#}VFCxHe zVj~d)1Rdu|p&j}{SE2~TE6f-C9cP`0IG^ z%aDQz5{Sd++aJk?eibqa^NK+47`5T@1;;FbQ;Y`F=+^-+GYq_Kp5B@w2|2`G;@$*x1{c?@Es7QnE zGX?SLQxZ_*NgIF7G2TK-`Zc}Sdb8)5pS|hhN3AC>ag3)vJj99sG9ZNz}N_o zxOtBa)>gqm#Xa=70XoRSgrM6ynScw9i@cwIRW@Ae_f>RiB7b#CjW1@>8=mFN=fpc{ zgXof*S_^3=>;5IeN`#o9FRcSUj`KvPZ68Fjx5=^6;jR);i6yZ9(|R+>2bFQr1c`Bl zyAp`AbsxwSAV-f8Foy2L-mlaT6;F$aTLuksFaUI6j0Mb*hM5QLWLQDf@O-8LmdqO3 zfEOGmy2`sIKYvFUdFEBQg1@#{pJXTuSybKI`ko4+z@QV1_3dUL#I~STc}!&> zR+)Xt?`~CSF3Tg4BJno#Db-kXATr&d=rSYwMwt1;Ab;XlP9P^3(2sBB3u3$fRE{nI zP{j=)THh7UgY;@giKJ|4kaSPon`d9o+kP(IC=$(Kx Date: Sun, 17 Oct 2021 07:50:03 +0200 Subject: [PATCH 305/689] Add support for default configuration file --- cagebreak.c | 14 ++++++++++++-- examples/config | 12 ++++++------ meson.build | 2 ++ 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index 0738b67..838078f 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -192,7 +192,7 @@ set_configuration(struct cg_server *server, if(config_file == NULL) { wlr_log(WLR_ERROR, "Could not open config file \"%s\"", config_file_path); - return -1; + return 1; } char line[MAX_LINE_SIZE * sizeof(char)]; for(unsigned int line_num = 1; @@ -557,7 +557,17 @@ main(int argc, char *argv[]) { ret = 1; goto end; } - if(set_configuration(&server, config_file) != 0) { + int conf_ret = set_configuration(&server, config_file); + + // Configurtion file not found + if(conf_ret == 1) { + char *default_conf = "/etc/xdg/cagebreak/config"; + wlr_log(WLR_ERROR, "Loading default configuration file: \"%s\"", + default_conf); + conf_ret = set_configuration(&server, default_conf); + } + + if(conf_ret != 0) { free(config_file); ret = 1; goto end; diff --git a/examples/config b/examples/config index 0ecf20b..f701684 100644 --- a/examples/config +++ b/examples/config @@ -75,14 +75,14 @@ definekey top XF86MonBrightnessUp exec xbacklight -inc 1 ###################### #Output configuration ###################### -output eDP-1 pos 0 0 res 1366x768 rate 60 -output eDP-1 disable -output eDP-1 enable +#output eDP-1 pos 0 0 res 1366x768 rate 60 +#output eDP-1 disable +#output eDP-1 enable ##################### #Input configuration ##################### -input 1234:0:Device_Ident click_method clickfinger -input type:pointer scroll_method two_finger -input * calibration_matrix 1 2 3 4 5 6 +#input 1234:0:Device_Ident click_method clickfinger +#input type:pointer scroll_method two_finger +#input * calibration_matrix 1 2 3 4 5 6 diff --git a/meson.build b/meson.build index e8a2cfd..5b7a377 100644 --- a/meson.build +++ b/meson.build @@ -258,6 +258,8 @@ executable( c_args: fuzz_compile_args, ) +install_data('examples/config',install_dir: '/etc/xdg/cagebreak') + if get_option('man-pages') scdoc = find_program('scdoc') sh = find_program('sh') From 24705616c4f2e399b23ed0094fc5caae3772480f Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 17 Oct 2021 15:26:52 +0200 Subject: [PATCH 306/689] Fix rendering bug on tile swap --- keybinding.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/keybinding.c b/keybinding.c index 5d802fe..f7761cd 100644 --- a/keybinding.c +++ b/keybinding.c @@ -201,7 +201,8 @@ swap_tile(struct cg_tile *tile, view_maximize(swap_tile->view, swap_tile); view_damage_whole(swap_tile->view); } else { - wlr_output_damage_add_box(tile->workspace->output->damage, &tile->tile); + wlr_output_damage_add_box(tile->workspace->output->damage, + &swap_tile->tile); } seat_set_focus(server->seat, swap_tile->view); From cf460a53426943e49892c50d2b9fc53d216c5cdb Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Mon, 8 Nov 2021 20:39:03 +0100 Subject: [PATCH 307/689] Prepare 1.8.1 --- man/cagebreak-config.5.md | 2 +- man/cagebreak.1.md | 2 +- meson.build | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index 321d6bf..4bffac7 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -1,4 +1,4 @@ -cagebreak-config(1) "Version 1.8.0" "Cagebreak Manual" +cagebreak-config(1) "Version 1.8.1" "Cagebreak Manual" # NAME diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index 309be7c..ccbe02f 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -1,4 +1,4 @@ -cagebreak(1) "Version 1.8.0" "Cagebreak Manual" +cagebreak(1) "Version 1.8.1" "Cagebreak Manual" # NAME diff --git a/meson.build b/meson.build index 5b7a377..810e934 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('cagebreak', 'c', - version: '1.8.0', + version: '1.8.1', license: 'MIT', default_options: [ 'c_std=c11', @@ -209,7 +209,7 @@ reproducible_build_versions = { 'wlroots': '0.14.1', 'xkbcommon': '1.3.1', 'fontconfig': '2.13.94', - 'libinput': '1.19.0', + 'libinput': '1.19.2', 'libevdev': '1.11.0', 'libudev': '249', 'pixman': '0.40.0', From 713f863062c393841886fb8667b20fcc4b6f1572 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Fri, 12 Nov 2021 16:52:58 +0100 Subject: [PATCH 308/689] Fix dependency --- meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 810e934..287222c 100644 --- a/meson.build +++ b/meson.build @@ -210,7 +210,7 @@ reproducible_build_versions = { 'xkbcommon': '1.3.1', 'fontconfig': '2.13.94', 'libinput': '1.19.2', - 'libevdev': '1.11.0', + 'libevdev': '1.12.0', 'libudev': '249', 'pixman': '0.40.0', 'pango': '1.48.10', @@ -258,7 +258,7 @@ executable( c_args: fuzz_compile_args, ) -install_data('examples/config',install_dir: '/etc/xdg/cagebreak') +install_data('examples/config', install_dir : '/etc/xdg/cagebreak') if get_option('man-pages') scdoc = find_program('scdoc') From 1a0290c0d45254fb21059760d16fb1c48a4ffd14 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Fri, 12 Nov 2021 17:57:00 +0100 Subject: [PATCH 309/689] Add man epoch --- meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 287222c..15806f5 100644 --- a/meson.build +++ b/meson.build @@ -270,7 +270,7 @@ if get_option('man-pages') output : 'cagebreak.1', input : 'man/cagebreak.1.md', capture : true, - command : [sh, '-c', 'export SOURCE_DATE_EPOCH=1632645085 ; @0@ < @INPUT@'.format(scdoc.path())], + command : [sh, '-c', 'export SOURCE_DATE_EPOCH=1636733005 ; @0@ < @INPUT@'.format(scdoc.path())], install: true, install_dir: mandir1 ) @@ -279,7 +279,7 @@ if get_option('man-pages') output : 'cagebreak-config.5', input : 'man/cagebreak-config.5.md', capture : true, - command : [sh, '-c', 'export SOURCE_DATE_EPOCH=1632645085 ; @0@ < @INPUT@'.format(scdoc.path())], + command : [sh, '-c', 'export SOURCE_DATE_EPOCH=1636733005 ; @0@ < @INPUT@'.format(scdoc.path())], install: true, install_dir: mandir5 ) From 9df55bb7cd2b45c1f3664e9b648e38c7a55ca10b Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Fri, 12 Nov 2021 18:05:57 +0100 Subject: [PATCH 310/689] Add Issue description --- Bugs.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Bugs.md b/Bugs.md index c9d9197..244056d 100644 --- a/Bugs.md +++ b/Bugs.md @@ -341,3 +341,14 @@ The advantages are: Cagebreak has always used pandoc to compile man pages. Cagebreak now uses scdoc instead. +### Issue 27 + + * github issue number: #8 + * Fixed: 1.8.1 + +``` +Apologies for opening two tickets instead of one, but I thought that these two suggestions are different enought they merit their own "issue". + +Would replicating the behaviour in ratpoison (if no config file is found, load predefined defaults) something you would be interested in? I personally found confusing when I first tried cagebreak that it wouldn't start without a config file, coming from ratpoison. Of course, other people's experience might be different. +``` + From 4f46f020fa047332a69b0ee5de7fd3e2497ab342 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Fri, 12 Nov 2021 18:06:24 +0100 Subject: [PATCH 311/689] Add 1.8.1 release hashes --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 3008d93..a99d6fe 100644 --- a/README.md +++ b/README.md @@ -204,6 +204,21 @@ For every release after 1.0.5, hashes will be provided. For every release after 1.7.0, hashes will be provided for man pages too. +1.8.1 cagebreak + + * sha 256: e3247281d21525413790e3feceae129d9b0559497615d3fdd64ec2fc4ab9ab3d + * sha 512: 8c7c2820be9d7c74e3f9e239c7da740ff41d7f11cd40953dbfbc59c04942077f08625f6d7ec37e6037fd9c4b6950fc4f9af23478080665fdda867c65e0a187bf + +1.8.1 cagebreak.1 + + * sha 256: 96997afdfde9c2719533799aa48c8f036610bb04bc719130d2ab3a3617b072ee + * sha 512: 0831f5d2e3b4f23fd5775df2b7f6486099d64962567222a8fb49e6a40e7d29ed36a7c2c16201bbdcc985ac74f1d0e034b530afbe0ce58d6a0c53d467cff0a6a0 + +1.8.1 cagebreak-config.5 + + * sha 256: bd0e2eb02ba28ec1c8f2bd0fd5cd4c84af24b615fcc477414e49e68e1963cf1b + * sha 512: 7135a2b371294bfdc759a393c13fa0225f1789dba94bb09e96ae689796215b8030280d6cc09c9d1fe139f000f5a4748efd16bb3e5d3b9fcc74a19259802f20ef + 1.8.0 cagebreak * sha 256: ac84aa4a08c311da79ca29d92eef4254cb625674b255dbb75621ee6b171a1d79 From 1f6a0062fdc4de01599622e2cbd1806e3a662e25 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Fri, 12 Nov 2021 18:06:50 +0100 Subject: [PATCH 312/689] Rename 1.8.0 signatures --- ...ak-config.5.sig => 1.8.0-cagebreak-config.5.sig} | Bin .../{cagebreak.1.sig => 1.8.0-cagebreak.1.sig} | Bin signatures/{cagebreak.sig => 1.8.0.sig} | Bin 3 files changed, 0 insertions(+), 0 deletions(-) rename signatures/{cagebreak-config.5.sig => 1.8.0-cagebreak-config.5.sig} (100%) rename signatures/{cagebreak.1.sig => 1.8.0-cagebreak.1.sig} (100%) rename signatures/{cagebreak.sig => 1.8.0.sig} (100%) diff --git a/signatures/cagebreak-config.5.sig b/signatures/1.8.0-cagebreak-config.5.sig similarity index 100% rename from signatures/cagebreak-config.5.sig rename to signatures/1.8.0-cagebreak-config.5.sig diff --git a/signatures/cagebreak.1.sig b/signatures/1.8.0-cagebreak.1.sig similarity index 100% rename from signatures/cagebreak.1.sig rename to signatures/1.8.0-cagebreak.1.sig diff --git a/signatures/cagebreak.sig b/signatures/1.8.0.sig similarity index 100% rename from signatures/cagebreak.sig rename to signatures/1.8.0.sig From 3528c109153fa3a3a4648ef0e4ff90e3782cc47d Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Fri, 12 Nov 2021 18:08:56 +0100 Subject: [PATCH 313/689] Add new signatures --- signatures/cagebreak-config.5.sig | Bin 0 -> 566 bytes signatures/cagebreak.1.sig | Bin 0 -> 566 bytes signatures/cagebreak.sig | Bin 0 -> 566 bytes 3 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 signatures/cagebreak-config.5.sig create mode 100644 signatures/cagebreak.1.sig create mode 100644 signatures/cagebreak.sig diff --git a/signatures/cagebreak-config.5.sig b/signatures/cagebreak-config.5.sig new file mode 100644 index 0000000000000000000000000000000000000000..a8dcddbb8fac719c3a8dff1262b4491f841c1ee0 GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j+QYm%>XjF(OTWxqo5S8LN|6>GT#0%4AyegFyy5b{@R z(`FTGxuLEP|4`&cLypF@_=!^Y6WMzO^hgwA?*+8@Dy$)Vm7@m96jT!h<2A#{CdXKt zCE&242O$oniCtN3j3GAMKT;B$q&Qezo5Yn52spXjB*>uXpqJP-M(16>8#AO?SAj$3 zQII~;WVL(+CiHR&0{;EGbzZc|owS4;pjt()9dzl1O`npifHzq0kZy7i{Kwj;wYrYf z@hQc9HTyHfE|mUZ3kfzkjiwK(e`in3&!p4z1Tk1yVa5g)Up&TsEwI_}toPOhuVJE+ zIL!->f?Q0C&$S0ZkwQRFBBw;oYF8+<1SAomvxEY2c#?t3uzyZ;cu?{pz2C3%0Qsjk zHi0^!qt&27||&Js$;fOj*K{;QD@{!*~33EnKO%z=+q3h z=<;@2iHE?l?eu)Iq-mFx2X8NBr5CHy{-@oa+{IByh1^*m-;Cg@InL8E@^t#X`?F2F zfJA^EjI)FUIxvvAhS>|h+F3Y4As=!-6G^9u*u6-ob5>KHNuOlCIxQN6L=3t4 z6{K0vi=eJiF;m^|YtPE(@H@$07CJ+x1sREecMNn=q;Z8c-xe1I1oiz4H;hUqS+E?2 zk|}1oj+)lIyoG$imTX~jz|5|TI&bG7mS;VGKHgY`=1R+}^5 EAl|$ZhyVZp literal 0 HcmV?d00001 diff --git a/signatures/cagebreak.1.sig b/signatures/cagebreak.1.sig new file mode 100644 index 0000000000000000000000000000000000000000..1ded6a279c2371a23ec98a1686c1f19371049416 GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j+QYm%>XjF(OTWxqo5S8LN|6>GT#0%4Ayc>oFt5b{@R z(`FTGx!orZ|7$1CSrns?s|bmbwH!qeK~h#HaMK7TOE7h-v3JIpA7XFy4;OdZ14yKN z(!xZNltcN>5hx<08>j_3lK3O|qemqvQR|c5^4T6pg8i4vVl$}}KpqyzJ&*^xnT5>c zS!`sN6;Fvq_@|AW1c$$yNkKdxyL`PGtdE>OV-E(<2slS_DSo7^Ge%s(6ed^5$aFsiw}q zPDcJkDxN6RHR$etsF1I|1Z;Qt;!#qi4i}O$oQ)WMae=#nlYbLm?sp^~-=-6tCLvGS zpMPpZ#U5IgJd*DCr;aJUtb}sE3h>$uM@Gv^Eo>zof0Nc>V|x252492nB1J2U0I%=s zGH8>Z+zs%+B#?`GR3?egEw|(hX^t#2EUIGi9=xS5VrSzB) zxxR|n1$py7&eB1Kh-{Z*{^NowXjF(OTWxqo5S8LN|6>GT#0%4AyYyb)g5b{@R z(`FTGx!T(h0H){{?qPG=ZpU$mlpWat9^EbI{c8Lyy;kt1*rm4`Zn-JdM*sf#Fi(%s zPDmIpoyiay;`|OpiqTRlr;+8wBa}3SO8i75FYA;Yv7K+zvGnd{dMA$AeU1kS*z!7I zzR4+K>}FuDI`$qP<(@8+d}cU=>Sfo6PU6J9)4CN$b)+);f3gf0KQJKEAT3wWwjBfifp5G6cfrxDu zeigvv$zH8E2x=;*YN|pzK=FKpfazQ)j;mV+@d{(Er(>aBgj7qzHoI%A41;tdX)lGG z@T{lLmWF;b$!WV=DG+{(Ds+@a((i>)PgEd=C#;l3%oC(|1}1p&cgQ7gTYrJbvb3pr zwd*U^2n-gn=2x#p?!43FS=oznOQIq=1K*lP5_+2&R9TiniNfopPck`EQ1X|To;KM^ z;4%v;gdas5G5wI>{Gv&q{nVhf#|Bu1Q=tD9?K(7y&S!3BrUwZ(RN1u_(xrAuUs4>m z7&gKOJ|^7+8)ACXIIcGymF{E5h>ReJ}Q!NQlav`zPR` zt{A@OUb0ec*j}*6kA3S-L;m+WSTDONpoFQ8-6`35$eYA*GQJEM60Wwi`us@?n#+x} EkZ=JPJOBUy literal 0 HcmV?d00001 From 569373170581bcbc4e3879ef698ea4be7937d9ca Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 4 Dec 2021 22:27:07 +0100 Subject: [PATCH 314/689] Fix damage tracking for view children --- view.c | 42 ++++++++---------------------------------- view.h | 1 - xdg_shell.c | 17 ----------------- 3 files changed, 8 insertions(+), 52 deletions(-) diff --git a/view.c b/view.c index 19ae2ad..e2856a4 100644 --- a/view.c +++ b/view.c @@ -51,10 +51,9 @@ view_get_prev_view(struct cg_view *view) { void view_damage_child(struct cg_view_child *child, bool whole) { - int x, y; - child->get_coords(child, &x, &y); - output_damage_surface(child->view->workspace->output, child->wlr_surface, - x + child->view->ox, y + child->view->oy, whole); + if(child->view != NULL) { + view_damage_part(child->view); + } } static void @@ -138,30 +137,6 @@ subsurface_handle_destroy(struct wl_listener *listener, void *_data) { subsurface_destroy(view_child); } -static void -subsurface_get_coords(struct cg_view_child *child, int *x, int *y) { - struct wlr_surface *surface = child->wlr_surface; - *x = *y = 0; - - if(child->parent && child->parent->get_coords) { - int sx, sy; - child->parent->get_coords(child->parent, &sx, &sy); - *x += sx; - *y += sy; - } else { - while(surface && wlr_surface_is_subsurface(surface)) { - struct wlr_subsurface *subsurface = - wlr_subsurface_from_wlr_surface(surface); - if(subsurface == NULL) { - break; - } - *x += subsurface->current.x; - *y += subsurface->current.y; - surface = subsurface->parent; - } - } -} - static void subsurface_create(struct cg_view_child *parent, struct cg_view *view, struct wlr_subsurface *wlr_subsurface) { @@ -173,7 +148,6 @@ subsurface_create(struct cg_view_child *parent, struct cg_view *view, view_child_init(&subsurface->view_child, parent, view, wlr_subsurface->surface); subsurface->view_child.destroy = subsurface_destroy; - subsurface->view_child.get_coords = subsurface_get_coords; subsurface->wlr_subsurface = wlr_subsurface; subsurface->destroy.notify = subsurface_handle_destroy; @@ -279,6 +253,11 @@ view_unmap(struct cg_view *view) { if(view->wlr_surface == NULL) { return; } + + struct cg_view_child *child, *tmp; + wl_list_for_each_safe(child, tmp, &view->children, link) { + child->destroy(child); + } #if CG_HAS_XWAYLAND if((view->type != CG_XWAYLAND_VIEW || xwayland_view_should_manage(view))) #endif @@ -323,11 +302,6 @@ view_unmap(struct cg_view *view) { wl_list_remove(&view->new_subsurface.link); view->wlr_surface = NULL; - - struct cg_view_child *child, *tmp; - wl_list_for_each_safe(child, tmp, &view->children, link) { - child->destroy(child); - } } void diff --git a/view.h b/view.h index add26b0..62a1f32 100644 --- a/view.h +++ b/view.h @@ -62,7 +62,6 @@ struct cg_view_child { struct wl_listener new_subsurface; void (*destroy)(struct cg_view_child *child); - void (*get_coords)(struct cg_view_child *child, int *x, int *y); }; struct cg_subsurface { diff --git a/xdg_shell.c b/xdg_shell.c index 0e76dc4..d703db5 100644 --- a/xdg_shell.c +++ b/xdg_shell.c @@ -119,22 +119,6 @@ popup_unconstrain(struct cg_xdg_popup *popup) { wlr_xdg_popup_unconstrain_from_box(popup->wlr_popup, &output_toplevel_box); } -static void -xdg_popup_get_coords(struct cg_view_child *child, int *x, int *y) { - if(!child) { - return; - } - struct cg_xdg_popup *popup = (struct cg_xdg_popup *)child; - struct wlr_xdg_surface *surface = popup->wlr_popup->base; - - int x_offset = -surface->geometry.x; - int y_offset = -surface->geometry.y; - - wlr_xdg_popup_get_toplevel_coords( - surface->popup, x_offset + surface->popup->geometry.x, - y_offset + surface->popup->geometry.y, x, y); -} - static void xdg_popup_create(struct cg_view *view, struct wlr_xdg_popup *wlr_popup) { struct cg_xdg_popup *popup = calloc(1, sizeof(struct cg_xdg_popup)); @@ -143,7 +127,6 @@ xdg_popup_create(struct cg_view *view, struct wlr_xdg_popup *wlr_popup) { } popup->wlr_popup = wlr_popup; - popup->view_child.get_coords = xdg_popup_get_coords; view_child_init(&popup->view_child, NULL, view, wlr_popup->base->surface); popup->view_child.destroy = xdg_popup_destroy; popup->destroy.notify = handle_xdg_popup_destroy; From 816fdeb9532346236f18ab43c850bad1aefbeb39 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Mon, 6 Dec 2021 11:08:21 +0100 Subject: [PATCH 315/689] Update year in copyright notices --- LICENSE | 2 +- idle_inhibit_v1.c | 2 +- input_manager.c | 2 +- ipc_server.c | 2 +- man/cagebreak-config.5.md | 2 +- man/cagebreak.1.md | 2 +- output.c | 2 +- render.c | 2 +- seat.c | 2 +- server.c | 2 +- util.c | 2 +- view.c | 2 +- workspace.c | 2 +- xdg_shell.c | 2 +- xwayland.c | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/LICENSE b/LICENSE index bd31b7d..538d78c 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2020-2021 The Cagebreak authors +Copyright (c) 2020-2022 The Cagebreak authors Copyright (c) 2018-2020 Jente Hidskes Copyright (c) 2019 The Sway authors diff --git a/idle_inhibit_v1.c b/idle_inhibit_v1.c index 7da2dd7..8ebc768 100644 --- a/idle_inhibit_v1.c +++ b/idle_inhibit_v1.c @@ -1,7 +1,7 @@ /* * Cagebreak: A Wayland tiling compositor. * - * Copyright (C) 2020 The Cagebreak Authors + * Copyright (C) 2020-2022 The Cagebreak Authors * Copyright (C) 2018-2019 Jente Hidskes * * See the LICENSE file accompanying this file. diff --git a/input_manager.c b/input_manager.c index 10f94fa..2157b43 100644 --- a/input_manager.c +++ b/input_manager.c @@ -1,7 +1,7 @@ /* * Cagebreak: A Wayland tiling compositor. * - * Copyright (C) 2020 The Cagebreak Authors + * Copyright (C) 2020-2022 The Cagebreak Authors * Copyright (C) 2018-2020 Jente Hidskes * * See the LICENSE file accompanying this file. diff --git a/ipc_server.c b/ipc_server.c index a7c6f21..7301867 100644 --- a/ipc_server.c +++ b/ipc_server.c @@ -1,7 +1,7 @@ /* * Cagebreak: A Wayland tiling compositor. * - * Copyright (C) 2020 The Cagebreak Authors + * Copyright (C) 2020-2022 The Cagebreak Authors * Copyright (C) 2018-2020 Jente Hidskes * * See the LICENSE file accompanying this file. diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index 4bffac7..63bdf31 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -286,7 +286,7 @@ See GitHub Issues: # LICENSE -Copyright (c) 2020-2021 The Cagebreak authors +Copyright (c) 2020-2022 The Cagebreak authors Copyright (c) 2018-2020 Jente Hidskes Copyright (c) 2019 The Sway authors diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index ccbe02f..59bce56 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -75,7 +75,7 @@ See GitHub Issues: # LICENSE -Copyright (c) 2020-2021 The Cagebreak authors +Copyright (c) 2020-2022 The Cagebreak authors Copyright (c) 2018-2020 Jente Hidskes Copyright (c) 2019 The Sway authors diff --git a/output.c b/output.c index 028f8b8..8feaec9 100644 --- a/output.c +++ b/output.c @@ -1,7 +1,7 @@ /* * Cagebreak: A Wayland tiling compositor. * - * Copyright (C) 2020 The Cagebreak Authors + * Copyright (C) 2020-2022 The Cagebreak Authors * Copyright (C) 2018-2020 Jente Hidskes * Copyright (C) 2019 The Sway authors * diff --git a/render.c b/render.c index 80c769b..ca4a2d2 100644 --- a/render.c +++ b/render.c @@ -1,7 +1,7 @@ /* * Cagebreak: A Wayland tiling compositor. * - * Copyright (C) 2020 The Cagebreak Authors + * Copyright (C) 2020-2022 The Cagebreak Authors * Copyright (C) 2018-2020 Jente Hidskes * Copyright (C) 2019 The Sway authors * diff --git a/seat.c b/seat.c index 91ab374..280b3ea 100644 --- a/seat.c +++ b/seat.c @@ -1,7 +1,7 @@ /* * Cagebreak: A Wayland tiling compositor. * - * Copyright (C) 2020 The Cagebreak Authors + * Copyright (C) 2020-2022 The Cagebreak Authors * Copyright (C) 2018-2020 Jente Hidskes * * See the LICENSE file accompanying this file. diff --git a/server.c b/server.c index 1ad23e6..e5b6137 100644 --- a/server.c +++ b/server.c @@ -1,7 +1,7 @@ /* * Cagebreak: A Wayland tiling compositor. * - * Copyright (C) 2020 The Cagebreak Authors + * Copyright (C) 2020-2022 The Cagebreak Authors * Copyright (C) 2018-2019 Jente Hidskes * * See the LICENSE file accompanying this file. diff --git a/util.c b/util.c index 83b7e66..1e7fa7c 100644 --- a/util.c +++ b/util.c @@ -1,7 +1,7 @@ /* * Cagebreak: A Wayland tiling compositor. * - * Copyright (C) 2020 The Cagebreak Authors + * Copyright (C) 2020-2022 The Cagebreak Authors * Copyright (C) 2019 The Sway authors * * See the LICENSE file accompanying this file. diff --git a/view.c b/view.c index e2856a4..09fc463 100644 --- a/view.c +++ b/view.c @@ -1,7 +1,7 @@ /* * Cagebreak: A Wayland tiling compositor. * - * Copyright (C) 2020 The Cagebreak Authors + * Copyright (C) 2020-2022 The Cagebreak Authors * Copyright (C) 2018-2020 Jente Hidskes * * See the LICENSE file accompanying this file. diff --git a/workspace.c b/workspace.c index 36bea40..1b701e8 100644 --- a/workspace.c +++ b/workspace.c @@ -1,7 +1,7 @@ /* * Cagebreak: A Wayland tiling compositor. * - * Copyright (C) 2020 The Cagebreak Authors + * Copyright (C) 2020-2022 The Cagebreak Authors * Copyright (C) 2018-2019 Jente Hidskes * * See the LICENSE file accompanying this file. diff --git a/xdg_shell.c b/xdg_shell.c index d703db5..7972b5f 100644 --- a/xdg_shell.c +++ b/xdg_shell.c @@ -1,7 +1,7 @@ /* * Cagebreak: A Wayland tiling compositor. * - * Copyright (C) 2020 The Cagebreak Authors + * Copyright (C) 2020-2022 The Cagebreak Authors * Copyright (C) 2018-2019 Jente Hidskes * * See the LICENSE file accompanying this file. diff --git a/xwayland.c b/xwayland.c index b790527..daf3658 100644 --- a/xwayland.c +++ b/xwayland.c @@ -1,7 +1,7 @@ /* * Cagebreak: A Wayland tiling compositor. * - * Copyright (C) 2020 The Cagebreak Authors + * Copyright (C) 2020-2022 The Cagebreak Authors * Copyright (C) 2018-2020 Jente Hidskes * * See the LICENSE file accompanying this file. From 5aad3ca6154efb897debdf1b83e9b4bdeb683ac0 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Mon, 6 Dec 2021 11:11:28 +0100 Subject: [PATCH 316/689] Adjust version numbers --- man/cagebreak-config.5.md | 2 +- man/cagebreak.1.md | 2 +- meson.build | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index 63bdf31..670c58e 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -1,4 +1,4 @@ -cagebreak-config(1) "Version 1.8.1" "Cagebreak Manual" +cagebreak-config(1) "Version 1.8.2" "Cagebreak Manual" # NAME diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index 59bce56..cfb0a22 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -1,4 +1,4 @@ -cagebreak(1) "Version 1.8.1" "Cagebreak Manual" +cagebreak(1) "Version 1.8.2" "Cagebreak Manual" # NAME diff --git a/meson.build b/meson.build index 15806f5..69bbfb9 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('cagebreak', 'c', - version: '1.8.1', + version: '1.8.2', license: 'MIT', default_options: [ 'c_std=c11', From 0b2f9afad93a91b4270e4e6888cd92e715a946f1 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Mon, 6 Dec 2021 11:12:20 +0100 Subject: [PATCH 317/689] Add Issue 28 --- Bugs.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Bugs.md b/Bugs.md index 244056d..328450d 100644 --- a/Bugs.md +++ b/Bugs.md @@ -352,3 +352,15 @@ Apologies for opening two tickets instead of one, but I thought that these two s Would replicating the behaviour in ratpoison (if no config file is found, load predefined defaults) something you would be interested in? I personally found confusing when I first tried cagebreak that it wouldn't start without a config file, coming from ratpoison. Of course, other people's experience might be different. ``` +### Issue 28 + + * github issue number: #10 + * Fixed: 1.8.2 + +``` +I'm using v. 1.8.1 and am experiencing a screen refresh lag, particularly on Firefox: + +When I type in anything, the text is refreshed and becomes visible only following mouse movement. I don't experience this with the same setup when I use Sway as the compositor. +``` + +Cagebreak had an error with damage tracking. From aad150f4b0a1a10e9a18f0ee1cb287b9d85a37da Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Mon, 6 Dec 2021 11:20:09 +0100 Subject: [PATCH 318/689] Set EPOCH for man pages --- meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 69bbfb9..56e8792 100644 --- a/meson.build +++ b/meson.build @@ -270,7 +270,7 @@ if get_option('man-pages') output : 'cagebreak.1', input : 'man/cagebreak.1.md', capture : true, - command : [sh, '-c', 'export SOURCE_DATE_EPOCH=1636733005 ; @0@ < @INPUT@'.format(scdoc.path())], + command : [sh, '-c', 'export SOURCE_DATE_EPOCH=1638785664 ; @0@ < @INPUT@'.format(scdoc.path())], install: true, install_dir: mandir1 ) @@ -279,7 +279,7 @@ if get_option('man-pages') output : 'cagebreak-config.5', input : 'man/cagebreak-config.5.md', capture : true, - command : [sh, '-c', 'export SOURCE_DATE_EPOCH=1636733005 ; @0@ < @INPUT@'.format(scdoc.path())], + command : [sh, '-c', 'export SOURCE_DATE_EPOCH=1638785664 ; @0@ < @INPUT@'.format(scdoc.path())], install: true, install_dir: mandir5 ) From 1e76f9253d985193dcfa3b327c52d68c93eb0767 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Mon, 6 Dec 2021 11:24:43 +0100 Subject: [PATCH 319/689] Increment dependency versions --- meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 56e8792..b81b261 100644 --- a/meson.build +++ b/meson.build @@ -213,9 +213,9 @@ reproducible_build_versions = { 'libevdev': '1.12.0', 'libudev': '249', 'pixman': '0.40.0', - 'pango': '1.48.10', + 'pango': '1.50.0', 'cairo': '1.17.4', - 'pangocairo': '1.48.10', + 'pangocairo': '1.50.0', 'math': '-1' } From 0c683158a7580fc74f1f14bc8ca2bd03ed81ed02 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Mon, 6 Dec 2021 21:05:02 +0100 Subject: [PATCH 320/689] Add hashes for 1.8.2 --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index a99d6fe..ef88746 100644 --- a/README.md +++ b/README.md @@ -204,6 +204,21 @@ For every release after 1.0.5, hashes will be provided. For every release after 1.7.0, hashes will be provided for man pages too. +1.8.2 cagebreak + + * sha 256: f4d275d48ba3d999969f8cb3c8142d27aa8e8d362106ee7575e4b13c02173b2a + * sha 512: 72b11cb966b0978133b9848c2a7f57574c599c7fe895ca9f1cba16930216e1ac8aeae86d976593fc01b15e94ecc1430666f474654cf2fe41eda8c1181bf03f3d + +1.8.2 cagebreak.1 + + * sha 256: 51ee97a7c0b86268cf7622f84f7b1813df8e4a7838c00aae412a611d3693e87a + * sha 512: 5ce826afbee9cbc1129f37463f5b6d4dfc060583f6f7816dd5039b18d66a2b7e22f7293a4aa03acc4e6c690886d0297fef5b9f85d720a4467becfd833b59a160 + +1.8.2 cagebreak-config.5 + + * sha 256: 7c780ba85211ba40c7535b3f10f12312f9edeaa10030228ba21a96724469a325 + * sha 512: 9a56ba16c2aed6f17d4098e54900a5d25602f986e3606dd6ed26563c1920c66404b210dbca9f41bfcc3284bf5a42b750263bcaa2317320f8725e8f9c66e8b893 + 1.8.1 cagebreak * sha 256: e3247281d21525413790e3feceae129d9b0559497615d3fdd64ec2fc4ab9ab3d From 1e747747ca5393fccee82af6049e344cae271bf4 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Mon, 6 Dec 2021 21:10:03 +0100 Subject: [PATCH 321/689] Add signatures for 1.8.2 --- signatures/1.8.1-cagebreak-config.5.sig | Bin 0 -> 566 bytes signatures/1.8.1-cagebreak.1.sig | Bin 0 -> 566 bytes signatures/1.8.2.sig | Bin 0 -> 566 bytes signatures/cagebreak-config.5.sig | Bin 566 -> 566 bytes signatures/cagebreak.1.sig | Bin 566 -> 566 bytes signatures/cagebreak.sig | Bin 566 -> 566 bytes 6 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 signatures/1.8.1-cagebreak-config.5.sig create mode 100644 signatures/1.8.1-cagebreak.1.sig create mode 100644 signatures/1.8.2.sig diff --git a/signatures/1.8.1-cagebreak-config.5.sig b/signatures/1.8.1-cagebreak-config.5.sig new file mode 100644 index 0000000000000000000000000000000000000000..a8dcddbb8fac719c3a8dff1262b4491f841c1ee0 GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j+QYm%>XjF(OTWxqo5S8LN|6>GT#0%4AyegFyy5b{@R z(`FTGxuLEP|4`&cLypF@_=!^Y6WMzO^hgwA?*+8@Dy$)Vm7@m96jT!h<2A#{CdXKt zCE&242O$oniCtN3j3GAMKT;B$q&Qezo5Yn52spXjB*>uXpqJP-M(16>8#AO?SAj$3 zQII~;WVL(+CiHR&0{;EGbzZc|owS4;pjt()9dzl1O`npifHzq0kZy7i{Kwj;wYrYf z@hQc9HTyHfE|mUZ3kfzkjiwK(e`in3&!p4z1Tk1yVa5g)Up&TsEwI_}toPOhuVJE+ zIL!->f?Q0C&$S0ZkwQRFBBw;oYF8+<1SAomvxEY2c#?t3uzyZ;cu?{pz2C3%0Qsjk zHi0^!qt&27||&Js$;fOj*K{;QD@{!*~33EnKO%z=+q3h z=<;@2iHE?l?eu)Iq-mFx2X8NBr5CHy{-@oa+{IByh1^*m-;Cg@InL8E@^t#X`?F2F zfJA^EjI)FUIxvvAhS>|h+F3Y4As=!-6G^9u*u6-ob5>KHNuOlCIxQN6L=3t4 z6{K0vi=eJiF;m^|YtPE(@H@$07CJ+x1sREecMNn=q;Z8c-xe1I1oiz4H;hUqS+E?2 zk|}1oj+)lIyoG$imTX~jz|5|TI&bG7mS;VGKHgY`=1R+}^5 EAl|$ZhyVZp literal 0 HcmV?d00001 diff --git a/signatures/1.8.1-cagebreak.1.sig b/signatures/1.8.1-cagebreak.1.sig new file mode 100644 index 0000000000000000000000000000000000000000..1ded6a279c2371a23ec98a1686c1f19371049416 GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j+QYm%>XjF(OTWxqo5S8LN|6>GT#0%4Ayc>oFt5b{@R z(`FTGx!orZ|7$1CSrns?s|bmbwH!qeK~h#HaMK7TOE7h-v3JIpA7XFy4;OdZ14yKN z(!xZNltcN>5hx<08>j_3lK3O|qemqvQR|c5^4T6pg8i4vVl$}}KpqyzJ&*^xnT5>c zS!`sN6;Fvq_@|AW1c$$yNkKdxyL`PGtdE>OV-E(<2slS_DSo7^Ge%s(6ed^5$aFsiw}q zPDcJkDxN6RHR$etsF1I|1Z;Qt;!#qi4i}O$oQ)WMae=#nlYbLm?sp^~-=-6tCLvGS zpMPpZ#U5IgJd*DCr;aJUtb}sE3h>$uM@Gv^Eo>zof0Nc>V|x252492nB1J2U0I%=s zGH8>Z+zs%+B#?`GR3?egEw|(hX^t#2EUIGi9=xS5VrSzB) zxxR|n1$py7&eB1Kh-{Z*{^NowXjF(OTWxqo5S8LN|6>GT#0%4AyYyb)g5b{@R z(`FTGx!T(h0H){{?qPG=ZpU$mlpWat9^EbI{c8Lyy;kt1*rm4`Zn-JdM*sf#Fi(%s zPDmIpoyiay;`|OpiqTRlr;+8wBa}3SO8i75FYA;Yv7K+zvGnd{dMA$AeU1kS*z!7I zzR4+K>}FuDI`$qP<(@8+d}cU=>Sfo6PU6J9)4CN$b)+);f3gf0KQJKEAT3wWwjBfifp5G6cfrxDu zeigvv$zH8E2x=;*YN|pzK=FKpfazQ)j;mV+@d{(Er(>aBgj7qzHoI%A41;tdX)lGG z@T{lLmWF;b$!WV=DG+{(Ds+@a((i>)PgEd=C#;l3%oC(|1}1p&cgQ7gTYrJbvb3pr zwd*U^2n-gn=2x#p?!43FS=oznOQIq=1K*lP5_+2&R9TiniNfopPck`EQ1X|To;KM^ z;4%v;gdas5G5wI>{Gv&q{nVhf#|Bu1Q=tD9?K(7y&S!3BrUwZ(RN1u_(xrAuUs4>m z7&gKOJ|^7+8)ACXIIcGymF{E5h>ReJ}Q!NQlav`zPR` zt{A@OUb0ec*j}*6kA3S-L;m+WSTDONpoFQ8-6`35$eYA*GQJEM60Wwi`us@?n#+x} EkZ=JPJOBUy literal 0 HcmV?d00001 diff --git a/signatures/cagebreak-config.5.sig b/signatures/cagebreak-config.5.sig index a8dcddbb8fac719c3a8dff1262b4491f841c1ee0..ee831f34180a3a1a6e550daa8af0771ea5b7043d 100644 GIT binary patch delta 542 zcmV+(0^$9(1hxc_BY&=KtpExM5b{@R(`FTGxgfO=0ItNOUOYhumTMlu%Hu1cO*sO@ zH7RNJ9K5<%$u6D_`7J(o%ztq0pi0^6pn8wU3aWTLvC9h_mRaeoa#FegPZg%6{ppB8 zGjHXnL>6)*YM@7Xh2~8OplT6&-^m%;g-|wDJs+S;I>9p}segsh6pMqEUygy9;(0d- zYm6_MCj#+uHwJor0E=6&%_1dsIPC*5?*zD4`Z@rx-%NZ2WHv-;j1TPG6%&bA)j0PV z2a>)&bY7%^t}6zg9dX?F%||@kIA6;iidBk0hF~V_r8D2l4lffhr7}3w>zi&*7(bBl z`%mnhMG~8v4}Yj|^n#dGR7){#zuo&`GupJ6au&A)kS8IP>-sb#4~!y2Yea-&>u2Z{ zMa=2nt~b8&r~ct`om=iO@bn%BQ6|%(~Q4P6Pim+tK!LXBA)RlR?5mI9{M>K$H09%Xir7BV_}sX9K&RC4F)l5<*#Ksts_z?P_P gW{BxssuvGhg*M#2j#Vb`3CA}nCd%RcX-?0WmTW8sqW}N^ delta 542 zcmV+(0^$9(1hxc_BY%#cegFyy5b{@R(`FTGxuLEP|4`&cLypF@_=!^Y6WMzO^hgwA z?*+8@Dy$)Vm7@m96jT!h<2A#{CdXKtCE&242O$oniCtN3j3GAMKT;B$q&Qezo5Yn5 z2spXjB*>uXpqJP-M(16>8#AO?SAj$3QII~;WVL(+CiHR&0)PJfyLDc)$(^)>9H3f7 zt{rsgg-xH5tbjLI?~rbC5d6p5sI|I|)bT0BeKq?t#4eQnVG9X1IgO?ds()us%+I9L z^aL?jSz*Qo7GFHZel4)s@T~XN1+QVEk~qx^kAhrGi_f(OL6Jg0P$H*9&T3aEv;-s( zp|gYna(I$~%YU$cPIP!s@*=(8uk!%;r#Ci%I;>{%OGVBm3d!dGrRQ#)GPlCjku4a} zDFCWtwo{IbIG<5x65psrCdQ{C@t&&ucUJIP-bIzy)g z8Hs>*40KYYafLPC78eBs_5BPtj7lb1upEYxDQ3Ekn%2C$g?z%6Y+-Z2%&v<%Z|5N6 gmC4hyQ5Sq0Et2JhKu>mS;VGKHgY`=1R+}^5Af~trk^lez diff --git a/signatures/cagebreak.1.sig b/signatures/cagebreak.1.sig index 1ded6a279c2371a23ec98a1686c1f19371049416..e4133eb28d3b10e4f566ea58267ec02a7b7976dd 100644 GIT binary patch delta 542 zcmV+(0^$9(1hxc_BY&=KssIWJ5b{@R(`FTGxq+Dv{yDkmKMvV5FYPhA3d4w~)7M2! zE0{DSNr!&NBv`?VAVXx0`;nkfXnCD{TJQGKtaLN1dkGQ=I@yUw|_-Z9o$sW*OjjhQ~&?~ delta 542 zcmV+(0^$9(1hxc_BY%#cc>oFt5b{@R(`FTGx!orZ|7$1CSrns?s|bmbwH!qeK~h#H zaMK7TOE7h-v3JIpA7XFy4;OdZ14yKN(!xZNltcN>5hx<08>j_3lK3O|qemqvQR|c5 z^4T6pg8i4vVl$}}KpqyzJ&*^xnT5>cS!`sN6;Fvq_@|AW1b>IWn@K@DAG>_L8my0; zKVuID&;`q+-Qed$;9y2Y4Y0t=n!YE#Xn^q3L3zKYlddGkNc(m{rZY?ovHt4sIdQZ1dh*xOcYCpyBO$2&yGw39yS9g5I&=TCPPJ{@=#* zdKHwc>aSS1sQENv0{MIO|2Ana3kNmtjT{qHGicfMUf0E47k^K?iF2bFJM#vnv7Xxn z#e3xuGU`^-V|r|C!uBT60+8qrz9$6G4UsA=M?Kk;#r_stB_K(^)emvrm-8K^wr_Rg zf@@bC4k~WoQ-A5C6VmRT?A>vcY>S%puddg)AM@rZ%(R%wyPU3w%4!B84Aw)drM2v# zlV=s6S-#0l?0<0>0~QlML+{HHSP5kMt;+sLO92P%cOrO%=GPUPeyXnMYS}%_Q`;z6 zlCY|iSl1&UO0v9QVH&%a5qJ5=#14u0(eHVvSplw^;R4n~`+Lw0Quh2BkbDsmxZPwKh=Kufz delta 542 zcmV+(0^$9(1hxc_BY%#cYyb)g5b{@R(`FTGx!T(h0H){{?qPG=ZpU$mlpWat9^EbI z{c8Lyy;kt1*rm4`Zn-JdM*sf#Fi(%sPDmIpoyiay;`|OpiqTRlr;+8wBa}3SO8i75 zFYA;Yv7K+zvGnd{dMA$AeU1kS*z!7IzR4+K>}FuDI`$qP<$sD2}UJ z2Js4GuBT(6UVnsCOT#w1Ype`|bR%gmg`DuLr_Yv#el*ExyIUy`ev2w}lt$9;g;7sb zAciNblts)Fq<97>)8tv%i*ie%B02-# znnn_On;KMEmO_cb>!nXJIa5&bmzSP4*-GFt3o3*kMSmPI{gB}NqDi3r)S$J;23Unt zp#K%^Iy8#TXKrSu2MIS+*|iqZrFKbQQXID!Hq)H!tUa-iIed|s`{`WgrFS{wA ggsG0*DHqv!$eYA*GQJEM60Wwi`us@?n#+x}kVpj(MgRZ+ From 851a2f893557f5460362b906d3d808e47623c64d Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 24 Dec 2021 15:52:25 +0100 Subject: [PATCH 322/689] Add more advanced multi-output support * Add commands screen, movetoscreen, movetoprevscreen * Add option prio to output command to allow for output priority specification --- cagebreak.c | 10 ++++- keybinding.c | 116 +++++++++++++++++++++++++++++++++++++++++---------- keybinding.h | 4 +- output.c | 92 ++++++++++++++++++++++++++++------------ output.h | 8 ++++ parse.c | 61 +++++++++++++++++++++++++-- server.h | 1 + 7 files changed, 238 insertions(+), 54 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index 838078f..38261ec 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -53,6 +53,7 @@ #include "seat.h" #include "server.h" #include "xdg_shell.h" +#include "workspace.h" #if CG_HAS_XWAYLAND #include "xwayland.h" #endif @@ -273,6 +274,7 @@ main(int argc, char *argv[]) { wl_list_init(&server.input_config); wl_list_init(&server.output_config); + wl_list_init(&server.output_priorities); server.modes = malloc(4 * sizeof(char *)); if(!server.modes) { @@ -576,11 +578,15 @@ main(int argc, char *argv[]) { } { - + struct wl_list tmp_list; + wl_list_init(&tmp_list); + wl_list_insert_list(&tmp_list,&server.outputs); + wl_list_init(&server.outputs); struct cg_output *output, *output_tmp; - wl_list_for_each_safe(output, output_tmp, &server.outputs, link) { + wl_list_for_each_safe(output, output_tmp, &tmp_list, link) { output_configure(&server, output); } + server.curr_output=wl_container_of(server.outputs.next,server.curr_output,link); } /* Place the cursor to the top left of the output layout. */ diff --git a/keybinding.c b/keybinding.c index f7761cd..721188f 100644 --- a/keybinding.c +++ b/keybinding.c @@ -593,23 +593,8 @@ into_process(const char *command) { } void -keybinding_cycle_outputs(struct cg_server *server, bool reverse) { - if(reverse) { - server->curr_output = wl_container_of(server->curr_output->link.prev, - server->curr_output, link); - } else { - server->curr_output = wl_container_of(server->curr_output->link.next, - server->curr_output, link); - } - if(&server->curr_output->link == &server->outputs) { - if(reverse) { - server->curr_output = wl_container_of( - server->curr_output->link.prev, server->curr_output, link); - } else { - server->curr_output = wl_container_of( - server->curr_output->link.next, server->curr_output, link); - } - } +set_output(struct cg_server *server, struct cg_output *output) { + server->curr_output = output; seat_set_focus( server->seat, server->curr_output->workspaces[server->curr_output->curr_workspace] @@ -617,6 +602,28 @@ keybinding_cycle_outputs(struct cg_server *server, bool reverse) { message_printf(server->curr_output, "Current Output"); } +void +keybinding_cycle_outputs(struct cg_server *server, bool reverse) { + struct cg_output *output=NULL; + if(reverse) { + output = wl_container_of(server->curr_output->link.prev, + server->curr_output, link); + } else { + output = wl_container_of(server->curr_output->link.next, + server->curr_output, link); + } + if(&output->link == &server->outputs) { + if(reverse) { + output = wl_container_of( + output->link.prev, output, link); + } else { + output = wl_container_of( + output->link.next, output, link); + } + } + set_output(server,output); +} + /* Cycle through views, whereby the workspace does not change */ void keybinding_cycle_views(struct cg_server *server, bool reverse) { @@ -718,7 +725,7 @@ keybinding_show_info(struct cg_server *server) { } void -keybinding_move_view_to_next_output(struct cg_server *server) { +keybinding_move_view_to_cycle_output(struct cg_server *server, bool reverse) { if(wl_list_length(&server->outputs) <= 1) { return; } @@ -736,7 +743,7 @@ keybinding_move_view_to_next_output(struct cg_server *server) { seat_set_focus(server->seat, NULL); } } - keybinding_cycle_outputs(server, false); + keybinding_cycle_outputs(server, reverse); if(view != NULL) { wl_list_insert(&server->curr_output ->workspaces[server->curr_output->curr_workspace] @@ -831,6 +838,49 @@ keybinding_set_background(struct cg_server *server, float *bg) { server->bg_color[2] = bg[2]; } +void +keybinding_switch_output(struct cg_server *server, int output) { + struct cg_output *it; + int count=1; + wl_list_for_each(it,&server->outputs,link) { + if(count==output) { + set_output(server,it); + return; + } + ++count; + } + message_printf(server->curr_output,"Output %d does not exist",output); + return; +} + +void +keybinding_move_view_to_output(struct cg_server *server, int output_num) { + struct cg_view *view = + server->curr_output->workspaces[server->curr_output->curr_workspace] + ->focused_tile->view; + if(view != NULL) { + wl_list_remove(&view->link); + server->curr_output->workspaces[server->curr_output->curr_workspace] + ->focused_tile->view = NULL; + keybinding_cycle_views(server, false); + if(server->curr_output->workspaces[server->curr_output->curr_workspace] + ->focused_tile->view == NULL) { + seat_set_focus(server->seat, NULL); + } + } + keybinding_switch_output(server, output_num); + if(view != NULL) { + struct cg_workspace *ws = + server->curr_output + ->workspaces[server->curr_output->curr_workspace]; + view->workspace = ws; + wl_list_insert(&ws->views, &view->link); + ws->focused_tile->view = view; + view_maximize(view, ws->focused_tile); + seat_set_focus(server->seat, view); + } +} + void keybinding_move_view_to_workspace(struct cg_server *server, uint32_t ws) { struct cg_view *view = @@ -859,6 +909,22 @@ keybinding_move_view_to_workspace(struct cg_server *server, uint32_t ws) { } } +void +merge_config(struct cg_output_config *config_new, struct cg_output_config *config_old) { + if(config_new->status==OUTPUT_DEFAULT) { + config_new->status=config_old->status; + } + if(config_new->pos.x == -1) { + config_new->pos=config_old->pos; + } + if(config_new->refresh_rate==0) { + config_new->refresh_rate=config_old->refresh_rate; + } + if(config_new->priority==-1) { + config_new->priority=config_old->priority; + } +} + void keybinding_configure_output(struct cg_server *server, struct cg_output_config *cfg) { @@ -877,6 +943,7 @@ keybinding_configure_output(struct cg_server *server, wl_list_for_each_safe(it, tmp, &server->output_config, link) { if(strcmp(config->output_name, it->output_name) == 0) { wl_list_remove(&it->link); + merge_config(config, it); free(it->output_name); free(it); } @@ -944,6 +1011,9 @@ run_action(enum keybinding_action action, struct cg_server *server, case KEYBINDING_SWITCH_WORKSPACE: keybinding_switch_ws(server, data.u); break; + case KEYBINDING_SWITCH_OUTPUT: + keybinding_switch_output(server, data.u); + break; case KEYBINDING_SWITCH_MODE: server->seat->mode = data.u; break; @@ -969,6 +1039,10 @@ run_action(enum keybinding_action action, struct cg_server *server, keybinding_move_view_to_workspace(server, data.u); break; } + case KEYBINDING_MOVE_VIEW_TO_OUTPUT: { + keybinding_move_view_to_output(server, data.u); + break; + } case KEYBINDING_SWAP_LEFT: { swap_tile_left( server->curr_output->workspaces[server->curr_output->curr_workspace] @@ -1017,8 +1091,8 @@ run_action(enum keybinding_action action, struct cg_server *server, ->focused_tile); break; } - case KEYBINDING_MOVE_VIEW_TO_NEXT_OUTPUT: { - keybinding_move_view_to_next_output(server); + case KEYBINDING_MOVE_VIEW_TO_CYCLE_OUTPUT: { + keybinding_move_view_to_cycle_output(server,data.b); break; } case KEYBINDING_DEFINEKEY: diff --git a/keybinding.h b/keybinding.h index 4cd0e87..aaae649 100644 --- a/keybinding.h +++ b/keybinding.h @@ -29,6 +29,7 @@ enum keybinding_action { // configuration KEYBINDING_QUIT, KEYBINDING_NOOP, + KEYBINDING_SWITCH_OUTPUT, // data.u is the desired output KEYBINDING_SWITCH_WORKSPACE, // data.u is the desired workspace KEYBINDING_SWITCH_MODE, // data.u is the desired mode KEYBINDING_SWITCH_DEFAULT_MODE, // data.u is the desired mode @@ -37,7 +38,8 @@ enum keybinding_action { KEYBINDING_RESIZE_TILE_VERTICAL, // data.i is the number of pixels to add to // the current height KEYBINDING_MOVE_VIEW_TO_WORKSPACE, // data.u is the desired workspace - KEYBINDING_MOVE_VIEW_TO_NEXT_OUTPUT, + KEYBINDING_MOVE_VIEW_TO_OUTPUT, // data.u is the desired output + KEYBINDING_MOVE_VIEW_TO_CYCLE_OUTPUT, //data.b is 0 if forward, 1 if reverse KEYBINDING_SHOW_TIME, KEYBINDING_SHOW_INFO, diff --git a/output.c b/output.c index 8feaec9..9a9a475 100644 --- a/output.c +++ b/output.c @@ -564,6 +564,29 @@ output_set_mode(struct wlr_output *output, int width, int height, wlr_output_set_mode(output, best); } +void +output_insert(struct cg_server *server, struct cg_output *output) { + struct cg_output *it, *prev_it=NULL; + bool first=true; + wl_list_for_each(it,&server->outputs,link) { + if(it->prioritypriority) { + if(first == true) { + wl_list_insert(&server->outputs,&output->link); + } else { + wl_list_insert(it->link.prev,&output->link); + } + return; + } + first=false; + prev_it=it; + } + if(prev_it==NULL) { + wl_list_insert(&server->outputs,&output->link); + } else { + wl_list_insert(&prev_it->link,&output->link); + } +} + void output_configure(struct cg_server *server, struct cg_output *output) { struct wlr_output *wlr_output = output->wlr_output; @@ -577,7 +600,7 @@ output_configure(struct cg_server *server, struct cg_output *output) { wlr_output_layout_remove(server->output_layout, wlr_output); } - if(config == NULL || config->status == OUTPUT_ENABLE) { + if(config == NULL) { wlr_output_layout_add_auto(server->output_layout, wlr_output); struct wlr_output_mode *preferred_mode = @@ -586,23 +609,30 @@ output_configure(struct cg_server *server, struct cg_output *output) { wlr_output_set_mode(wlr_output, preferred_mode); } wl_list_remove(&output->link); - wl_list_insert(&server->outputs, &output->link); + output_insert(server,output); wlr_output_enable(wlr_output, true); wlr_output_commit(wlr_output); - } else if(config->status == OUTPUT_DISABLE) { - output_clear(output); - wl_list_insert(&server->disabled_outputs, &output->link); - wlr_output_enable(wlr_output, false); - wlr_output_commit(wlr_output); } else { - wl_list_remove(&output->link); - wl_list_insert(&server->outputs, &output->link); - output_set_mode(wlr_output, config->pos.width, config->pos.height, - config->refresh_rate); - wlr_output_layout_add(server->output_layout, wlr_output, config->pos.x, - config->pos.y); - wlr_output_enable(wlr_output, true); - wlr_output_commit(wlr_output); + if(config->status == OUTPUT_DISABLE) { + output_clear(output); + wl_list_insert(&server->disabled_outputs, &output->link); + wlr_output_enable(wlr_output, false); + wlr_output_commit(wlr_output); + } else { + wl_list_remove(&output->link); + if(config->priority != -1) { + output->priority=config->priority; + } + if(config->pos.x != -1) { + output_set_mode(wlr_output, config->pos.width, config->pos.height, + config->refresh_rate); + wlr_output_layout_add(server->output_layout, wlr_output, config->pos.x, + config->pos.y); + } + output_insert(server,output); + wlr_output_enable(wlr_output, true); + wlr_output_commit(wlr_output); + } } } @@ -626,17 +656,14 @@ handle_new_output(struct wl_listener *listener, void *data) { output->damage = wlr_output_damage_create(wlr_output); output->last_scanned_out_view = NULL; - output->mode.notify = handle_output_mode; - wl_signal_add(&wlr_output->events.mode, &output->mode); - output->commit.notify = handle_output_commit; - wl_signal_add(&wlr_output->events.commit, &output->commit); - output->destroy.notify = handle_output_destroy; - wl_signal_add(&wlr_output->events.destroy, &output->destroy); - output->damage_frame.notify = handle_output_damage_frame; - wl_signal_add(&output->damage->events.frame, &output->damage_frame); - output->damage_destroy.notify = handle_output_damage_destroy; - wl_signal_add(&output->damage->events.destroy, &output->damage_destroy); - + struct cg_output_priorities *it; + int prio=-1; + wl_list_for_each(it, &server->output_priorities, link) { + if(strcmp(output->wlr_output->name,it->ident)==0) { + prio=it->priority; + } + } + output->priority=prio; wlr_output_set_transform(wlr_output, server->output_transform); output->workspaces = NULL; @@ -650,7 +677,7 @@ handle_new_output(struct wl_listener *listener, void *data) { wlr_output->name, wlr_output->scale); } - wl_list_insert(&server->outputs, &output->link); + output_insert(server,output); output_configure(server, output); wlr_output_damage_add_whole(output->damage); @@ -672,6 +699,17 @@ handle_new_output(struct wl_listener *listener, void *data) { wlr_xcursor_manager_set_cursor_image(server->seat->xcursor_manager, DEFAULT_XCURSOR, server->seat->cursor); wlr_cursor_warp(server->seat->cursor, NULL, 0, 0); + + output->mode.notify = handle_output_mode; + wl_signal_add(&wlr_output->events.mode, &output->mode); + output->commit.notify = handle_output_commit; + wl_signal_add(&wlr_output->events.commit, &output->commit); + output->destroy.notify = handle_output_destroy; + wl_signal_add(&wlr_output->events.destroy, &output->destroy); + output->damage_frame.notify = handle_output_damage_frame; + wl_signal_add(&output->damage->events.frame, &output->damage_frame); + output->damage_destroy.notify = handle_output_damage_destroy; + wl_signal_add(&output->damage->events.destroy, &output->damage_destroy); } #if CG_HAS_FANALYZE #pragma GCC diagnostic pop diff --git a/output.h b/output.h index 42cb629..796d0f4 100644 --- a/output.h +++ b/output.h @@ -23,11 +23,18 @@ struct cg_output { struct cg_workspace **workspaces; struct wl_list messages; int curr_workspace; + int priority; struct cg_view *last_scanned_out_view; struct wl_list link; // cg_server::outputs }; +struct cg_output_priorities { + char *ident; + int priority; + struct wl_list link; +}; + enum output_status { OUTPUT_ENABLE, OUTPUT_DISABLE, OUTPUT_DEFAULT }; struct cg_output_config { @@ -35,6 +42,7 @@ struct cg_output_config { struct wlr_box pos; char *output_name; float refresh_rate; + int priority; struct wl_list link; // cg_server::output_config }; diff --git a/parse.c b/parse.c index 4bbf72d..7042a78 100644 --- a/parse.c +++ b/parse.c @@ -503,6 +503,8 @@ parse_output_config_keyword(char *key_str, enum output_status *status) { } if(strcmp(key_str, "pos") == 0) { *status = OUTPUT_DEFAULT; + } else if(strcmp(key_str, "prio") == 0) { + *status = OUTPUT_DEFAULT; } else if(strcmp(key_str, "enable") == 0) { *status = OUTPUT_ENABLE; } else if(strcmp(key_str, "disable") == 0) { @@ -521,6 +523,11 @@ parse_output_config(char **saveptr, char **errstr) { log_error("Failed to allocate memory for output configuration"); goto error; } + cfg->status=OUTPUT_DEFAULT; + cfg->pos.x=-1; + cfg->output_name=NULL; + cfg->refresh_rate=0; + cfg->priority=-1; char *name = strtok_r(NULL, " ", saveptr); if(name == NULL) { *errstr = @@ -529,7 +536,7 @@ parse_output_config(char **saveptr, char **errstr) { } char *key_str = strtok_r(NULL, " ", saveptr); if(parse_output_config_keyword(key_str, &(cfg->status)) != 0) { - *errstr = log_error("Expected keyword \"pos\", \"enable\" or " + *errstr = log_error("Expected keyword \"pos\", \"prio\", \"enable\" or " "\"disable\" in output configuration for output %s", name); goto error; @@ -539,6 +546,16 @@ parse_output_config(char **saveptr, char **errstr) { return cfg; } + if(strcmp(key_str, "prio") == 0) { + cfg->priority=parse_uint(saveptr, " "); + if(cfg->priority<0) { + *errstr = log_error( "Error parsing priority of output configuration for output %s", name); + goto error; + } + cfg->output_name = strdup(name); + return cfg; + } + cfg->pos.x = parse_uint(saveptr, " "); if(cfg->pos.x < 0) { *errstr = log_error( @@ -669,6 +686,23 @@ parse_command(struct cg_server *server, struct keybinding *keybinding, } else if(strcmp(action, "resizeup") == 0) { keybinding->action = KEYBINDING_RESIZE_TILE_VERTICAL; keybinding->data.i = -10; + } else if(strcmp(action, "screen") == 0) { + keybinding->action = KEYBINDING_SWITCH_OUTPUT; + char *noutp_str = strtok_r(NULL, " ", &saveptr); + if(noutp_str == NULL) { + *errstr = log_error( + "Expected argument for \"output\" action, got none."); + return -1; + } + + long outp = strtol(noutp_str, NULL, 10); + if(outp < 1) { + *errstr = log_error("Workspace number must be an integer number " + "larger or equal to 1. Got %ld", + outp); + return -1; + } + keybinding->data.u = outp; } else if(strcmp(action, "workspace") == 0) { keybinding->action = KEYBINDING_SWITCH_WORKSPACE; char *nws_str = strtok_r(NULL, " ", &saveptr); @@ -686,12 +720,29 @@ parse_command(struct cg_server *server, struct keybinding *keybinding, return -1; } keybinding->data.u = ws - 1; + } else if(strcmp(action, "movetoscreen") == 0) { + keybinding->action = KEYBINDING_MOVE_VIEW_TO_OUTPUT; + char *noutp_str = strtok_r(NULL, " ", &saveptr); + if(noutp_str == NULL) { + *errstr = log_error( + "Expected argument for \"movetoscreen\" action, got none."); + return -1; + } + + long outp = strtol(noutp_str, NULL, 10); + if(outp < 1) { + *errstr = log_error("Output number must be an integer larger or " + "equal to 1. Got %ld", + outp); + return -1; + } + keybinding->data.u = outp; } else if(strcmp(action, "movetoworkspace") == 0) { keybinding->action = KEYBINDING_MOVE_VIEW_TO_WORKSPACE; char *nws_str = strtok_r(NULL, " ", &saveptr); if(nws_str == NULL) { *errstr = log_error( - "Expected argument for \"workspace\" action, got none."); + "Expected argument for \"movetoworkspace\" action, got none."); return -1; } @@ -720,7 +771,11 @@ parse_command(struct cg_server *server, struct keybinding *keybinding, } else if(strcmp(action, "focusdown") == 0) { keybinding->action = KEYBINDING_FOCUS_BOTTOM; } else if(strcmp(action, "movetonextscreen") == 0) { - keybinding->action = KEYBINDING_MOVE_VIEW_TO_NEXT_OUTPUT; + keybinding->action = KEYBINDING_MOVE_VIEW_TO_CYCLE_OUTPUT; + keybinding->data.b=false; + } else if(strcmp(action, "movetoprevscreen") == 0) { + keybinding->action = KEYBINDING_MOVE_VIEW_TO_CYCLE_OUTPUT; + keybinding->data.b=true; } else if(strcmp(action, "switchvt") == 0) { keybinding->action = KEYBINDING_CHANGE_TTY; char *ntty = strtok_r(NULL, " ", &saveptr); diff --git a/server.h b/server.h index 9ee21e1..54fbc17 100644 --- a/server.h +++ b/server.h @@ -32,6 +32,7 @@ struct cg_server { struct wl_list outputs; struct cg_output *curr_output; struct wl_listener new_output; + struct wl_list output_priorities; struct wl_listener xdg_toplevel_decoration; struct wl_listener new_xdg_shell_surface; From da1a5898f4f32422c20c177c1345cf24c28a2979 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 24 Dec 2021 15:56:04 +0100 Subject: [PATCH 323/689] Apply clang-format --- cagebreak.c | 7 ++++--- keybinding.c | 43 ++++++++++++++++++++--------------------- keybinding.h | 7 ++++--- output.c | 54 ++++++++++++++++++++++++++-------------------------- parse.c | 26 +++++++++++++------------ 5 files changed, 70 insertions(+), 67 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index 38261ec..a9852e5 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -52,8 +52,8 @@ #include "parse.h" #include "seat.h" #include "server.h" -#include "xdg_shell.h" #include "workspace.h" +#include "xdg_shell.h" #if CG_HAS_XWAYLAND #include "xwayland.h" #endif @@ -580,13 +580,14 @@ main(int argc, char *argv[]) { { struct wl_list tmp_list; wl_list_init(&tmp_list); - wl_list_insert_list(&tmp_list,&server.outputs); + wl_list_insert_list(&tmp_list, &server.outputs); wl_list_init(&server.outputs); struct cg_output *output, *output_tmp; wl_list_for_each_safe(output, output_tmp, &tmp_list, link) { output_configure(&server, output); } - server.curr_output=wl_container_of(server.outputs.next,server.curr_output,link); + server.curr_output = + wl_container_of(server.outputs.next, server.curr_output, link); } /* Place the cursor to the top left of the output layout. */ diff --git a/keybinding.c b/keybinding.c index 721188f..624a09f 100644 --- a/keybinding.c +++ b/keybinding.c @@ -604,24 +604,22 @@ set_output(struct cg_server *server, struct cg_output *output) { void keybinding_cycle_outputs(struct cg_server *server, bool reverse) { - struct cg_output *output=NULL; + struct cg_output *output = NULL; if(reverse) { output = wl_container_of(server->curr_output->link.prev, - server->curr_output, link); + server->curr_output, link); } else { output = wl_container_of(server->curr_output->link.next, - server->curr_output, link); + server->curr_output, link); } if(&output->link == &server->outputs) { if(reverse) { - output = wl_container_of( - output->link.prev, output, link); + output = wl_container_of(output->link.prev, output, link); } else { - output = wl_container_of( - output->link.next, output, link); + output = wl_container_of(output->link.next, output, link); } } - set_output(server,output); + set_output(server, output); } /* Cycle through views, whereby the workspace does not change */ @@ -841,15 +839,15 @@ keybinding_set_background(struct cg_server *server, float *bg) { void keybinding_switch_output(struct cg_server *server, int output) { struct cg_output *it; - int count=1; - wl_list_for_each(it,&server->outputs,link) { - if(count==output) { - set_output(server,it); + int count = 1; + wl_list_for_each(it, &server->outputs, link) { + if(count == output) { + set_output(server, it); return; } ++count; } - message_printf(server->curr_output,"Output %d does not exist",output); + message_printf(server->curr_output, "Output %d does not exist", output); return; } @@ -910,18 +908,19 @@ keybinding_move_view_to_workspace(struct cg_server *server, uint32_t ws) { } void -merge_config(struct cg_output_config *config_new, struct cg_output_config *config_old) { - if(config_new->status==OUTPUT_DEFAULT) { - config_new->status=config_old->status; +merge_config(struct cg_output_config *config_new, + struct cg_output_config *config_old) { + if(config_new->status == OUTPUT_DEFAULT) { + config_new->status = config_old->status; } if(config_new->pos.x == -1) { - config_new->pos=config_old->pos; + config_new->pos = config_old->pos; } - if(config_new->refresh_rate==0) { - config_new->refresh_rate=config_old->refresh_rate; + if(config_new->refresh_rate == 0) { + config_new->refresh_rate = config_old->refresh_rate; } - if(config_new->priority==-1) { - config_new->priority=config_old->priority; + if(config_new->priority == -1) { + config_new->priority = config_old->priority; } } @@ -1092,7 +1091,7 @@ run_action(enum keybinding_action action, struct cg_server *server, break; } case KEYBINDING_MOVE_VIEW_TO_CYCLE_OUTPUT: { - keybinding_move_view_to_cycle_output(server,data.b); + keybinding_move_view_to_cycle_output(server, data.b); break; } case KEYBINDING_DEFINEKEY: diff --git a/keybinding.h b/keybinding.h index aaae649..88378a1 100644 --- a/keybinding.h +++ b/keybinding.h @@ -37,9 +37,10 @@ enum keybinding_action { // to the current width KEYBINDING_RESIZE_TILE_VERTICAL, // data.i is the number of pixels to add to // the current height - KEYBINDING_MOVE_VIEW_TO_WORKSPACE, // data.u is the desired workspace - KEYBINDING_MOVE_VIEW_TO_OUTPUT, // data.u is the desired output - KEYBINDING_MOVE_VIEW_TO_CYCLE_OUTPUT, //data.b is 0 if forward, 1 if reverse + KEYBINDING_MOVE_VIEW_TO_WORKSPACE, // data.u is the desired workspace + KEYBINDING_MOVE_VIEW_TO_OUTPUT, // data.u is the desired output + KEYBINDING_MOVE_VIEW_TO_CYCLE_OUTPUT, // data.b is 0 if forward, 1 if + // reverse KEYBINDING_SHOW_TIME, KEYBINDING_SHOW_INFO, diff --git a/output.c b/output.c index 9a9a475..6370b39 100644 --- a/output.c +++ b/output.c @@ -566,24 +566,24 @@ output_set_mode(struct wlr_output *output, int width, int height, void output_insert(struct cg_server *server, struct cg_output *output) { - struct cg_output *it, *prev_it=NULL; - bool first=true; - wl_list_for_each(it,&server->outputs,link) { - if(it->prioritypriority) { + struct cg_output *it, *prev_it = NULL; + bool first = true; + wl_list_for_each(it, &server->outputs, link) { + if(it->priority < output->priority) { if(first == true) { - wl_list_insert(&server->outputs,&output->link); + wl_list_insert(&server->outputs, &output->link); } else { - wl_list_insert(it->link.prev,&output->link); + wl_list_insert(it->link.prev, &output->link); } return; } - first=false; - prev_it=it; + first = false; + prev_it = it; } - if(prev_it==NULL) { - wl_list_insert(&server->outputs,&output->link); + if(prev_it == NULL) { + wl_list_insert(&server->outputs, &output->link); } else { - wl_list_insert(&prev_it->link,&output->link); + wl_list_insert(&prev_it->link, &output->link); } } @@ -609,27 +609,27 @@ output_configure(struct cg_server *server, struct cg_output *output) { wlr_output_set_mode(wlr_output, preferred_mode); } wl_list_remove(&output->link); - output_insert(server,output); + output_insert(server, output); wlr_output_enable(wlr_output, true); wlr_output_commit(wlr_output); } else { if(config->status == OUTPUT_DISABLE) { - output_clear(output); - wl_list_insert(&server->disabled_outputs, &output->link); - wlr_output_enable(wlr_output, false); - wlr_output_commit(wlr_output); + output_clear(output); + wl_list_insert(&server->disabled_outputs, &output->link); + wlr_output_enable(wlr_output, false); + wlr_output_commit(wlr_output); } else { wl_list_remove(&output->link); if(config->priority != -1) { - output->priority=config->priority; + output->priority = config->priority; } if(config->pos.x != -1) { - output_set_mode(wlr_output, config->pos.width, config->pos.height, - config->refresh_rate); - wlr_output_layout_add(server->output_layout, wlr_output, config->pos.x, - config->pos.y); + output_set_mode(wlr_output, config->pos.width, + config->pos.height, config->refresh_rate); + wlr_output_layout_add(server->output_layout, wlr_output, + config->pos.x, config->pos.y); } - output_insert(server,output); + output_insert(server, output); wlr_output_enable(wlr_output, true); wlr_output_commit(wlr_output); } @@ -657,13 +657,13 @@ handle_new_output(struct wl_listener *listener, void *data) { output->last_scanned_out_view = NULL; struct cg_output_priorities *it; - int prio=-1; + int prio = -1; wl_list_for_each(it, &server->output_priorities, link) { - if(strcmp(output->wlr_output->name,it->ident)==0) { - prio=it->priority; + if(strcmp(output->wlr_output->name, it->ident) == 0) { + prio = it->priority; } } - output->priority=prio; + output->priority = prio; wlr_output_set_transform(wlr_output, server->output_transform); output->workspaces = NULL; @@ -677,7 +677,7 @@ handle_new_output(struct wl_listener *listener, void *data) { wlr_output->name, wlr_output->scale); } - output_insert(server,output); + output_insert(server, output); output_configure(server, output); wlr_output_damage_add_whole(output->damage); diff --git a/parse.c b/parse.c index 7042a78..6164408 100644 --- a/parse.c +++ b/parse.c @@ -523,11 +523,11 @@ parse_output_config(char **saveptr, char **errstr) { log_error("Failed to allocate memory for output configuration"); goto error; } - cfg->status=OUTPUT_DEFAULT; - cfg->pos.x=-1; - cfg->output_name=NULL; - cfg->refresh_rate=0; - cfg->priority=-1; + cfg->status = OUTPUT_DEFAULT; + cfg->pos.x = -1; + cfg->output_name = NULL; + cfg->refresh_rate = 0; + cfg->priority = -1; char *name = strtok_r(NULL, " ", saveptr); if(name == NULL) { *errstr = @@ -547,9 +547,11 @@ parse_output_config(char **saveptr, char **errstr) { } if(strcmp(key_str, "prio") == 0) { - cfg->priority=parse_uint(saveptr, " "); - if(cfg->priority<0) { - *errstr = log_error( "Error parsing priority of output configuration for output %s", name); + cfg->priority = parse_uint(saveptr, " "); + if(cfg->priority < 0) { + *errstr = log_error( + "Error parsing priority of output configuration for output %s", + name); goto error; } cfg->output_name = strdup(name); @@ -690,8 +692,8 @@ parse_command(struct cg_server *server, struct keybinding *keybinding, keybinding->action = KEYBINDING_SWITCH_OUTPUT; char *noutp_str = strtok_r(NULL, " ", &saveptr); if(noutp_str == NULL) { - *errstr = log_error( - "Expected argument for \"output\" action, got none."); + *errstr = + log_error("Expected argument for \"output\" action, got none."); return -1; } @@ -772,10 +774,10 @@ parse_command(struct cg_server *server, struct keybinding *keybinding, keybinding->action = KEYBINDING_FOCUS_BOTTOM; } else if(strcmp(action, "movetonextscreen") == 0) { keybinding->action = KEYBINDING_MOVE_VIEW_TO_CYCLE_OUTPUT; - keybinding->data.b=false; + keybinding->data.b = false; } else if(strcmp(action, "movetoprevscreen") == 0) { keybinding->action = KEYBINDING_MOVE_VIEW_TO_CYCLE_OUTPUT; - keybinding->data.b=true; + keybinding->data.b = true; } else if(strcmp(action, "switchvt") == 0) { keybinding->action = KEYBINDING_CHANGE_TTY; char *ntty = strtok_r(NULL, " ", &saveptr); From 348925e30a350ee5a9ab60e6364f258654a02f68 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 24 Dec 2021 17:52:31 +0100 Subject: [PATCH 324/689] Add configure_message command --- cagebreak.c | 13 +++++++++- keybinding.c | 32 +++++++++++++++++++++++ keybinding.h | 2 ++ message.c | 15 ++++++----- message.h | 7 +++++ parse.c | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++- server.h | 3 ++- 7 files changed, 135 insertions(+), 10 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index a9852e5..164b4ea 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -307,7 +307,18 @@ main(int argc, char *argv[]) { } server.nws = 1; - server.message_timeout = 2; + server.message_config.fg_color[0]=0.0; + server.message_config.fg_color[1]=0.0; + server.message_config.fg_color[2]=0.0; + server.message_config.fg_color[3]=1.0; + + server.message_config.bg_color[0]=0.9; + server.message_config.bg_color[1]=0.85; + server.message_config.bg_color[2]=0.85; + server.message_config.bg_color[3]=1.0; + + server.message_config.display_time = 2; + server.message_config.font=strdup("pango:Monospace 10"); event_loop = wl_display_get_event_loop(server.wl_display); sigint_source = diff --git a/keybinding.c b/keybinding.c index 624a09f..c192e41 100644 --- a/keybinding.c +++ b/keybinding.c @@ -75,6 +75,12 @@ keybinding_free(struct keybinding *keybinding, bool recursive) { free(keybinding->data.i_cfg->mapped_to_output); } free(keybinding->data.o_cfg); + break; + case KEYBINDING_CONFIGURE_MESSAGE: + if(keybinding->data.m_cfg->font!=NULL) { + free(keybinding->data.m_cfg->font); + } + break; default: break; } @@ -970,6 +976,29 @@ keybinding_configure_input(struct cg_server *server, cg_input_apply_config(cfg, server); } +void +keybinding_configure_message(struct cg_server *server, struct cg_message_config *config) { + if(config->font!=NULL) { + free(server->message_config.font); + server->message_config.font=strdup(config->font); + } + if(config->display_time!=-1) { + server->message_config.display_time=config->display_time; + } + if(config->bg_color[0]!=-1) { + server->message_config.bg_color[0]=config->bg_color[0]; + server->message_config.bg_color[1]=config->bg_color[1]; + server->message_config.bg_color[2]=config->bg_color[2]; + server->message_config.bg_color[3]=config->bg_color[3]; + } + if(config->fg_color[0]!=-1) { + server->message_config.fg_color[0]=config->fg_color[0]; + server->message_config.fg_color[1]=config->fg_color[1]; + server->message_config.fg_color[2]=config->fg_color[2]; + server->message_config.fg_color[3]=config->fg_color[3]; + } +} + void keybinding_configure_input_dev(struct cg_server *server, struct cg_input_config *cfg) {} @@ -1109,6 +1138,9 @@ run_action(enum keybinding_action action, struct cg_server *server, case KEYBINDING_CONFIGURE_OUTPUT: keybinding_configure_output(server, data.o_cfg); break; + case KEYBINDING_CONFIGURE_MESSAGE: + keybinding_configure_message(server, data.m_cfg); + break; case KEYBINDING_CONFIGURE_INPUT: keybinding_configure_input(server, data.i_cfg); break; diff --git a/keybinding.h b/keybinding.h index 88378a1..fd9eefc 100644 --- a/keybinding.h +++ b/keybinding.h @@ -25,6 +25,7 @@ enum keybinding_action { KEYBINDING_CYCLE_OUTPUT, // data.b is 0 if forward, 1 if reverse KEYBINDING_CONFIGURE_OUTPUT, // data.o_cfg is the desired output // configuration + KEYBINDING_CONFIGURE_MESSAGE, // data.m_cfg is the desired config KEYBINDING_CONFIGURE_INPUT, // data.i_cfg is the desired input // configuration KEYBINDING_QUIT, @@ -69,6 +70,7 @@ union keybinding_params { struct keybinding *kb; struct cg_output_config *o_cfg; struct cg_input_config *i_cfg; + struct cg_message_config *m_cfg; }; struct keybinding { diff --git a/message.c b/message.c index f05b175..291f6ef 100644 --- a/message.c +++ b/message.c @@ -35,7 +35,6 @@ struct wlr_texture * create_message_texture(const char *string, const struct cg_output *output) { const int WIDTH_PADDING = 8; const int HEIGHT_PADDING = 2; - const char *font = "pango:Monospace 10"; struct wlr_texture *texture; double scale = output->wlr_output->scale; @@ -60,7 +59,7 @@ create_message_texture(const char *string, const struct cg_output *output) { cairo_font_options_set_subpixel_order( fo, to_cairo_subpixel_order(output->wlr_output->subpixel)); cairo_set_font_options(c, fo); - get_text_size(c, font, &width, &height, NULL, scale, "%s", string); + get_text_size(c, output->server->message_config.font, &width, &height, NULL, scale, "%s", string); width += 2 * WIDTH_PADDING; height += 2 * HEIGHT_PADDING; cairo_surface_destroy(dummy_surface); @@ -72,16 +71,18 @@ create_message_texture(const char *string, const struct cg_output *output) { cairo_set_antialias(cairo, CAIRO_ANTIALIAS_BEST); cairo_set_font_options(cairo, fo); cairo_font_options_destroy(fo); - cairo_set_source_rgba(cairo, 0.9, 0.85, 0.85, 1.0); + float *bg_col=output->server->message_config.bg_color; + cairo_set_source_rgba(cairo, bg_col[0], bg_col[1], bg_col[2], bg_col[3]); cairo_paint(cairo); PangoContext *pango = pango_cairo_create_context(cairo); - cairo_set_source_rgba(cairo, 0, 0, 0, 1); + float *fg_col=output->server->message_config.fg_color; + cairo_set_source_rgba(cairo, fg_col[0], fg_col[1], fg_col[2], fg_col[3]); cairo_set_line_width(cairo, 2); cairo_rectangle(cairo, 0, 0, width, height); cairo_stroke(cairo); cairo_move_to(cairo, WIDTH_PADDING, HEIGHT_PADDING); - pango_printf(cairo, font, scale, "%s", string); + pango_printf(cairo, output->server->message_config.font, scale, "%s", string); cairo_surface_flush(surface); unsigned char *data = cairo_image_surface_get_data(surface); @@ -176,7 +177,7 @@ message_printf(struct cg_output *output, const char *fmt, ...) { message_set_output(output, buffer, box, CG_MESSAGE_TOP_RIGHT); free(buffer); - alarm(output->server->message_timeout); + alarm(output->server->message_config.display_time); } #if CG_HAS_FANALYZE #pragma GCC diagnostic pop @@ -195,7 +196,7 @@ message_printf_pos(struct cg_output *output, struct wlr_box *position, message_set_output(output, buffer, position, align); free(buffer); - alarm(output->server->message_timeout); + alarm(output->server->message_config.display_time); } void diff --git a/message.h b/message.h index 9a4e53e..b1081ab 100644 --- a/message.h +++ b/message.h @@ -16,6 +16,13 @@ enum cg_message_align { CG_MESSAGE_CENTER, }; +struct cg_message_config { + char *font; + int display_time; + float bg_color[4]; + float fg_color[4]; +}; + struct cg_message { struct wlr_box *position; struct wlr_texture *message; diff --git a/parse.c b/parse.c index 6164408..2a22e66 100644 --- a/parse.c +++ b/parse.c @@ -122,7 +122,7 @@ parse_input_config(char **saveptr, char **errstr) { char *ident = NULL; if(cfg == NULL) { *errstr = - log_error("Failed to allocate memory for output configuration"); + log_error("Failed to allocate memory for input configuration"); goto error; } @@ -340,6 +340,9 @@ parse_input_config(char **saveptr, char **errstr) { "Invalid option \"%s\" to setting \"tap_button_map\"", value); goto error; } + } else { + *errstr = log_error("Invalid option to command \"input\""); + goto error; } free(value); @@ -625,6 +628,68 @@ error: return NULL; } +struct cg_message_config *parse_message_config(char **saveptr, char **errstr) { + struct cg_message_config *cfg = calloc(1, sizeof(struct cg_message_config)); + if(cfg == NULL) { + *errstr = + log_error("Failed to allocate memory for message configuration"); + goto error; + } + + cfg->bg_color[0]=-1; + cfg->fg_color[0]=-1; + cfg->display_time=-1; + cfg->font=NULL; + + char *setting = strtok_r(NULL, " ", saveptr); + if(setting == NULL) { + *errstr = + log_error("Expected setting to be set for message configuration, got none"); + goto error; + } + + if(strcmp(setting, "font") == 0) { + cfg->font=strdup(*saveptr); + if(cfg->font == NULL) { + *errstr = log_error( "Unable to allocate memory for font descrition in command \"message\""); + goto error; + } + } else if(strcmp(setting, "display_time") == 0) { + cfg->display_time=parse_uint(saveptr, " "); + if(cfg->display_time<0) { + *errstr = log_error("Error parsing command \"configure_message display_time\", expected a non-negative integer"); + goto error; + } + } else if(strcmp(setting, "bg_color") == 0) { + for(int i = 0; i < 4; ++i) { + cfg->bg_color[i]=parse_float(saveptr, " "); + if(cfg->bg_color[i] == FLT_MIN) { + *errstr = + log_error("Error parsing command \"configure_message bg_color\", expected 4 float values separated by spaces"); + goto error; + } + } + } else if(strcmp(setting, "fg_color") == 0) { + for(int i = 0; i < 4; ++i) { + cfg->fg_color[i]=parse_float(saveptr, " "); + if(cfg->fg_color[i] == FLT_MIN) { + *errstr = + log_error("Error parsing command \"configure_message bg_color\", expected 4 float values separated by spaces"); + goto error; + } + } + } else { + *errstr = log_error("Invalid option to command \"configure_message\""); + goto error; + } + return cfg; + +error: + wlr_log(WLR_ERROR, "Message configuration must be of the form 'configure_message '"); + return NULL; + +} + int parse_command(struct cg_server *server, struct keybinding *keybinding, char *saveptr, char **errstr) { @@ -865,6 +930,12 @@ parse_command(struct cg_server *server, struct keybinding *keybinding, if(keybinding->data.i_cfg == NULL) { return -1; } + } else if(strcmp(action, "configure_message") == 0) { + keybinding->action = KEYBINDING_CONFIGURE_MESSAGE; + keybinding->data.m_cfg = parse_message_config(&saveptr, errstr); + if(keybinding->data.m_cfg == NULL) { + return -1; + } } else { *errstr = log_error("Error, unsupported action \"%s\".", action); return -1; diff --git a/server.h b/server.h index 54fbc17..22dfe32 100644 --- a/server.h +++ b/server.h @@ -3,6 +3,7 @@ #include "config.h" #include "ipc_server.h" +#include "message.h" #include #include @@ -43,6 +44,7 @@ struct cg_server { struct keybinding_list *keybindings; struct wl_list output_config; struct wl_list input_config; + struct cg_message_config message_config; enum wl_output_transform output_transform; @@ -51,7 +53,6 @@ struct cg_server { bool running; char **modes; uint16_t nws; - uint16_t message_timeout; float *bg_color; #ifdef DEBUG bool debug_damage_tracking; From bc22892a068cb5c5fa47a42e5ec12083e0bce533 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 24 Dec 2021 17:54:07 +0100 Subject: [PATCH 325/689] Apply clang-format --- cagebreak.c | 18 +++++++++--------- keybinding.c | 33 +++++++++++++++++---------------- keybinding.h | 14 +++++++------- message.c | 10 ++++++---- parse.c | 46 ++++++++++++++++++++++++++-------------------- 5 files changed, 65 insertions(+), 56 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index 164b4ea..300ac22 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -307,18 +307,18 @@ main(int argc, char *argv[]) { } server.nws = 1; - server.message_config.fg_color[0]=0.0; - server.message_config.fg_color[1]=0.0; - server.message_config.fg_color[2]=0.0; - server.message_config.fg_color[3]=1.0; + server.message_config.fg_color[0] = 0.0; + server.message_config.fg_color[1] = 0.0; + server.message_config.fg_color[2] = 0.0; + server.message_config.fg_color[3] = 1.0; - server.message_config.bg_color[0]=0.9; - server.message_config.bg_color[1]=0.85; - server.message_config.bg_color[2]=0.85; - server.message_config.bg_color[3]=1.0; + server.message_config.bg_color[0] = 0.9; + server.message_config.bg_color[1] = 0.85; + server.message_config.bg_color[2] = 0.85; + server.message_config.bg_color[3] = 1.0; server.message_config.display_time = 2; - server.message_config.font=strdup("pango:Monospace 10"); + server.message_config.font = strdup("pango:Monospace 10"); event_loop = wl_display_get_event_loop(server.wl_display); sigint_source = diff --git a/keybinding.c b/keybinding.c index c192e41..8635b35 100644 --- a/keybinding.c +++ b/keybinding.c @@ -77,7 +77,7 @@ keybinding_free(struct keybinding *keybinding, bool recursive) { free(keybinding->data.o_cfg); break; case KEYBINDING_CONFIGURE_MESSAGE: - if(keybinding->data.m_cfg->font!=NULL) { + if(keybinding->data.m_cfg->font != NULL) { free(keybinding->data.m_cfg->font); } break; @@ -977,25 +977,26 @@ keybinding_configure_input(struct cg_server *server, } void -keybinding_configure_message(struct cg_server *server, struct cg_message_config *config) { - if(config->font!=NULL) { +keybinding_configure_message(struct cg_server *server, + struct cg_message_config *config) { + if(config->font != NULL) { free(server->message_config.font); - server->message_config.font=strdup(config->font); + server->message_config.font = strdup(config->font); } - if(config->display_time!=-1) { - server->message_config.display_time=config->display_time; + if(config->display_time != -1) { + server->message_config.display_time = config->display_time; } - if(config->bg_color[0]!=-1) { - server->message_config.bg_color[0]=config->bg_color[0]; - server->message_config.bg_color[1]=config->bg_color[1]; - server->message_config.bg_color[2]=config->bg_color[2]; - server->message_config.bg_color[3]=config->bg_color[3]; + if(config->bg_color[0] != -1) { + server->message_config.bg_color[0] = config->bg_color[0]; + server->message_config.bg_color[1] = config->bg_color[1]; + server->message_config.bg_color[2] = config->bg_color[2]; + server->message_config.bg_color[3] = config->bg_color[3]; } - if(config->fg_color[0]!=-1) { - server->message_config.fg_color[0]=config->fg_color[0]; - server->message_config.fg_color[1]=config->fg_color[1]; - server->message_config.fg_color[2]=config->fg_color[2]; - server->message_config.fg_color[3]=config->fg_color[3]; + if(config->fg_color[0] != -1) { + server->message_config.fg_color[0] = config->fg_color[0]; + server->message_config.fg_color[1] = config->fg_color[1]; + server->message_config.fg_color[2] = config->fg_color[2]; + server->message_config.fg_color[3] = config->fg_color[3]; } } diff --git a/keybinding.h b/keybinding.h index fd9eefc..548ce66 100644 --- a/keybinding.h +++ b/keybinding.h @@ -20,14 +20,14 @@ enum keybinding_action { KEYBINDING_SPLIT_HORIZONTAL, KEYBINDING_CHANGE_TTY, // data.u is the desired tty KEYBINDING_LAYOUT_FULLSCREEN, - KEYBINDING_CYCLE_VIEWS, // data.b is 0 if forward, 1 if reverse - KEYBINDING_CYCLE_TILES, // data.b is 0 if forward, 1 if reverse - KEYBINDING_CYCLE_OUTPUT, // data.b is 0 if forward, 1 if reverse - KEYBINDING_CONFIGURE_OUTPUT, // data.o_cfg is the desired output - // configuration + KEYBINDING_CYCLE_VIEWS, // data.b is 0 if forward, 1 if reverse + KEYBINDING_CYCLE_TILES, // data.b is 0 if forward, 1 if reverse + KEYBINDING_CYCLE_OUTPUT, // data.b is 0 if forward, 1 if reverse + KEYBINDING_CONFIGURE_OUTPUT, // data.o_cfg is the desired output + // configuration KEYBINDING_CONFIGURE_MESSAGE, // data.m_cfg is the desired config - KEYBINDING_CONFIGURE_INPUT, // data.i_cfg is the desired input - // configuration + KEYBINDING_CONFIGURE_INPUT, // data.i_cfg is the desired input + // configuration KEYBINDING_QUIT, KEYBINDING_NOOP, KEYBINDING_SWITCH_OUTPUT, // data.u is the desired output diff --git a/message.c b/message.c index 291f6ef..7786a07 100644 --- a/message.c +++ b/message.c @@ -59,7 +59,8 @@ create_message_texture(const char *string, const struct cg_output *output) { cairo_font_options_set_subpixel_order( fo, to_cairo_subpixel_order(output->wlr_output->subpixel)); cairo_set_font_options(c, fo); - get_text_size(c, output->server->message_config.font, &width, &height, NULL, scale, "%s", string); + get_text_size(c, output->server->message_config.font, &width, &height, NULL, + scale, "%s", string); width += 2 * WIDTH_PADDING; height += 2 * HEIGHT_PADDING; cairo_surface_destroy(dummy_surface); @@ -71,18 +72,19 @@ create_message_texture(const char *string, const struct cg_output *output) { cairo_set_antialias(cairo, CAIRO_ANTIALIAS_BEST); cairo_set_font_options(cairo, fo); cairo_font_options_destroy(fo); - float *bg_col=output->server->message_config.bg_color; + float *bg_col = output->server->message_config.bg_color; cairo_set_source_rgba(cairo, bg_col[0], bg_col[1], bg_col[2], bg_col[3]); cairo_paint(cairo); PangoContext *pango = pango_cairo_create_context(cairo); - float *fg_col=output->server->message_config.fg_color; + float *fg_col = output->server->message_config.fg_color; cairo_set_source_rgba(cairo, fg_col[0], fg_col[1], fg_col[2], fg_col[3]); cairo_set_line_width(cairo, 2); cairo_rectangle(cairo, 0, 0, width, height); cairo_stroke(cairo); cairo_move_to(cairo, WIDTH_PADDING, HEIGHT_PADDING); - pango_printf(cairo, output->server->message_config.font, scale, "%s", string); + pango_printf(cairo, output->server->message_config.font, scale, "%s", + string); cairo_surface_flush(surface); unsigned char *data = cairo_image_surface_get_data(surface); diff --git a/parse.c b/parse.c index 2a22e66..112b5b6 100644 --- a/parse.c +++ b/parse.c @@ -628,7 +628,8 @@ error: return NULL; } -struct cg_message_config *parse_message_config(char **saveptr, char **errstr) { +struct cg_message_config * +parse_message_config(char **saveptr, char **errstr) { struct cg_message_config *cfg = calloc(1, sizeof(struct cg_message_config)); if(cfg == NULL) { *errstr = @@ -636,45 +637,50 @@ struct cg_message_config *parse_message_config(char **saveptr, char **errstr) { goto error; } - cfg->bg_color[0]=-1; - cfg->fg_color[0]=-1; - cfg->display_time=-1; - cfg->font=NULL; + cfg->bg_color[0] = -1; + cfg->fg_color[0] = -1; + cfg->display_time = -1; + cfg->font = NULL; char *setting = strtok_r(NULL, " ", saveptr); if(setting == NULL) { - *errstr = - log_error("Expected setting to be set for message configuration, got none"); + *errstr = log_error( + "Expected setting to be set for message configuration, got none"); goto error; } if(strcmp(setting, "font") == 0) { - cfg->font=strdup(*saveptr); + cfg->font = strdup(*saveptr); if(cfg->font == NULL) { - *errstr = log_error( "Unable to allocate memory for font descrition in command \"message\""); + *errstr = log_error("Unable to allocate memory for font descrition " + "in command \"message\""); goto error; } } else if(strcmp(setting, "display_time") == 0) { - cfg->display_time=parse_uint(saveptr, " "); - if(cfg->display_time<0) { - *errstr = log_error("Error parsing command \"configure_message display_time\", expected a non-negative integer"); + cfg->display_time = parse_uint(saveptr, " "); + if(cfg->display_time < 0) { + *errstr = + log_error("Error parsing command \"configure_message " + "display_time\", expected a non-negative integer"); goto error; } } else if(strcmp(setting, "bg_color") == 0) { for(int i = 0; i < 4; ++i) { - cfg->bg_color[i]=parse_float(saveptr, " "); + cfg->bg_color[i] = parse_float(saveptr, " "); if(cfg->bg_color[i] == FLT_MIN) { - *errstr = - log_error("Error parsing command \"configure_message bg_color\", expected 4 float values separated by spaces"); + *errstr = log_error( + "Error parsing command \"configure_message bg_color\", " + "expected 4 float values separated by spaces"); goto error; } } } else if(strcmp(setting, "fg_color") == 0) { for(int i = 0; i < 4; ++i) { - cfg->fg_color[i]=parse_float(saveptr, " "); + cfg->fg_color[i] = parse_float(saveptr, " "); if(cfg->fg_color[i] == FLT_MIN) { - *errstr = - log_error("Error parsing command \"configure_message bg_color\", expected 4 float values separated by spaces"); + *errstr = log_error( + "Error parsing command \"configure_message bg_color\", " + "expected 4 float values separated by spaces"); goto error; } } @@ -685,9 +691,9 @@ struct cg_message_config *parse_message_config(char **saveptr, char **errstr) { return cfg; error: - wlr_log(WLR_ERROR, "Message configuration must be of the form 'configure_message '"); + wlr_log(WLR_ERROR, "Message configuration must be of the form " + "'configure_message '"); return NULL; - } int From aff1de892b6da1986d56e951edb360347d974b8c Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 25 Dec 2021 15:35:31 +0100 Subject: [PATCH 326/689] Add support for event notifications over ipc --- cagebreak.c | 15 +++++--- ipc_server.c | 101 ++++++++++++++++++++++++++++++++++++++++++++++++++- ipc_server.h | 2 + keybinding.c | 47 +++++++++++++++++++++++- output.c | 11 +++++- server.h | 2 + view.c | 11 ++++++ view.h | 1 + workspace.c | 7 +++- workspace.h | 4 +- 10 files changed, 188 insertions(+), 13 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index 300ac22..9caaa34 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -307,6 +307,8 @@ main(int argc, char *argv[]) { } server.nws = 1; + server.views_curr_id=0; + server.tiles_curr_id=0; server.message_config.fg_color[0] = 0.0; server.message_config.fg_color[1] = 0.0; server.message_config.fg_color[2] = 0.0; @@ -365,6 +367,12 @@ main(int argc, char *argv[]) { goto end; } + if(ipc_init(&server) != 0) { + wlr_log(WLR_ERROR, "Failed to initialize IPC"); + ret = 1; + goto end; + } + compositor = wlr_compositor_create(server.wl_display, renderer); if(!compositor) { wlr_log(WLR_ERROR, "Unable to create the wlroots compositor"); @@ -557,12 +565,6 @@ main(int argc, char *argv[]) { exit(0); } - if(ipc_init(&server) != 0) { - wlr_log(WLR_ERROR, "Failed to initialize IPC"); - ret = 1; - goto end; - } - { // config_file should only be visible as long as it is valid char *config_file = get_config_file(); if(config_file == NULL) { @@ -642,6 +644,7 @@ end: wlr_output_layout_destroy(server.output_layout); free(server.input); + free(server.message_config.font); pango_cairo_font_map_set_default(NULL); cairo_debug_reset_static_data(); FcFini(); diff --git a/ipc_server.c b/ipc_server.c index 7301867..168df16 100644 --- a/ipc_server.c +++ b/ipc_server.c @@ -13,6 +13,7 @@ #include "message.h" #include "parse.h" #include "server.h" +#include "util.h" #include #include @@ -22,6 +23,10 @@ #include #include +static const char ipc_magic[] = {'c', 'g', '-', 'i', 'p', 'c'}; + +#define IPC_HEADER_SIZE (sizeof(ipc_magic) + 4) + static void handle_display_destroy(struct wl_listener *listener, void *data) { struct cg_ipc_handle *ipc = wl_container_of(listener, ipc, display_destroy); @@ -109,6 +114,44 @@ ipc_init(struct cg_server *server) { return 0; } +int ipc_client_handle_writable(int client_fd, uint32_t mask, void *data) { + struct cg_ipc_client *client = data; + + if (mask & WL_EVENT_ERROR) { + ipc_client_disconnect(client); + return 0; + } + + if (mask & WL_EVENT_HANGUP) { + ipc_client_disconnect(client); + return 0; + } + + if (client->write_buffer_len <= 0) { + return 0; + } + + ssize_t written = write(client->fd, client->write_buffer, client->write_buffer_len); + + if (written == -1 && errno == EAGAIN) { + return 0; + } else if (written == -1) { + wlr_log(WLR_ERROR, "Unable to send data from queue to IPC client"); + ipc_client_disconnect(client); + return 0; + } + + memmove(client->write_buffer, client->write_buffer + written, client->write_buffer_len - written); + client->write_buffer_len -= written; + + if (client->write_buffer_len == 0 && client->writable_event_source) { + wl_event_source_remove(client->writable_event_source); + client->writable_event_source = NULL; + } + + return 0; +} + int ipc_handle_connection(int fd, uint32_t mask, void *data) { (void)fd; @@ -154,7 +197,7 @@ ipc_handle_connection(int fd, uint32_t mask, void *data) { client->event_source = wl_event_loop_add_fd(server->event_loop, client_fd, WL_EVENT_READABLE, ipc_client_handle_readable, client); - client->writable_event_source = NULL; + client->writable_event_source = wl_event_loop_add_fd(server->event_loop, client_fd, WL_EVENT_WRITABLE, ipc_client_handle_writable, client); client->write_buffer_size = 128; client->write_buffer_len = 0; @@ -275,3 +318,59 @@ ipc_client_handle_command(struct cg_ipc_client *client) { } client->read_buf_len -= offset; } + +void ipc_send_event_client(struct cg_ipc_client *client, const char *payload, uint32_t payload_length) { + char data[IPC_HEADER_SIZE]; + + memcpy(data, ipc_magic, sizeof(ipc_magic)); + memcpy(data + sizeof(ipc_magic), &payload_length, sizeof(payload_length)); + + while (client->write_buffer_len + IPC_HEADER_SIZE + payload_length >= + client->write_buffer_size) { + client->write_buffer_size *= 2; + } + + if (client->write_buffer_size > 4e6) { // 4 MB + wlr_log(WLR_ERROR, "Client write buffer too big (%zu), disconnecting client", + client->write_buffer_size); + ipc_client_disconnect(client); + return; + } + + char *new_buffer = realloc(client->write_buffer, client->write_buffer_size); + if (!new_buffer) { + wlr_log(WLR_ERROR, "Unable to reallocate ipc client write buffer"); + ipc_client_disconnect(client); + return; + } + client->write_buffer = new_buffer; + + memcpy(client->write_buffer + client->write_buffer_len, data, IPC_HEADER_SIZE); + client->write_buffer_len += IPC_HEADER_SIZE; + memcpy(client->write_buffer + client->write_buffer_len, payload, payload_length); + client->write_buffer_len += payload_length; +} + +void ipc_send_event(struct cg_server *server, const char *fmt, ...) { + if(wl_list_empty(&server->ipc.client_list)) { + return; + } + va_list args; + va_start(args, fmt); + char *msg = malloc_vsprintf_va_list(fmt, args); + if(msg == NULL) { + wlr_log(WLR_ERROR, "Unable to allocate memory for ipc event"); + va_end(args); + return; + } + va_end(args); + struct cg_ipc_client *it,*tmp; + uint32_t len=strlen(msg); + wl_list_for_each_safe(it,tmp,&server->ipc.client_list,link) { + if(it->writable_event_source==NULL) { + it->writable_event_source = wl_event_loop_add_fd(server->event_loop, it->fd, WL_EVENT_WRITABLE, ipc_client_handle_writable, it); + } + ipc_send_event_client(it, msg, len); + } + free(msg); +} diff --git a/ipc_server.h b/ipc_server.h index 60339df..61ba631 100644 --- a/ipc_server.h +++ b/ipc_server.h @@ -33,6 +33,8 @@ struct cg_ipc_handle { struct sockaddr_un *sockaddr; }; +void +ipc_send_event(struct cg_server *server, const char *fmt, ...); int ipc_init(struct cg_server *server); int diff --git a/keybinding.c b/keybinding.c index 8635b35..870c33a 100644 --- a/keybinding.c +++ b/keybinding.c @@ -212,6 +212,7 @@ swap_tile(struct cg_tile *tile, } seat_set_focus(server->seat, swap_tile->view); + ipc_send_event(tile->workspace->output->server,"swap_tile(tile_id:%d,swap_tile_id:%d,workspace:%d,output:%s)",tile->id,swap_tile->id,tile->workspace->num+1,tile->workspace->output->wlr_output->name); } void @@ -354,7 +355,7 @@ resize(struct cg_tile *tile, const struct cg_tile *parent, int coord_offset, } } - int old_x = tile->tile.x, old_y = tile->tile.y; + int old_x = tile->tile.x, old_y = tile->tile.y, old_height=tile->tile.height, old_width=tile->tile.width; *get_coord(tile) += coord_offset; *get_dim(tile) += dim_offset; struct wlr_box damage_box = { @@ -366,6 +367,7 @@ resize(struct cg_tile *tile, const struct cg_tile *parent, int coord_offset, if(tile->view != NULL) { view_maximize(tile->view, tile); } + ipc_send_event(tile->workspace->output->server,"resize_tile(tile_id:%d,old_dims:[%d;%d;%d;%d],new_dims:[%d;%d;%d;%d],workspace:%d,output:%s)",tile->id,old_x,old_y,old_height,old_width,tile->tile.x,tile->tile.y,tile->tile.height,tile->tile.width,tile->workspace->num+1,tile->workspace->output->wlr_output->name); } int * @@ -473,7 +475,7 @@ keybinding_workspace_fullscreen(struct cg_server *server) { workspace_free_tiles(output->workspaces[output->curr_workspace]); if(full_screen_workspace_tiles( server->output_layout, output->wlr_output, - output->workspaces[output->curr_workspace]) != 0) { + output->workspaces[output->curr_workspace],&server->tiles_curr_id) != 0) { wlr_log(WLR_ERROR, "Failed to allocate space for fullscreen workspace"); return; } @@ -486,6 +488,7 @@ keybinding_workspace_fullscreen(struct cg_server *server) { } seat_set_focus(server->seat, current_view); + ipc_send_event(output->server,"fullscreen(tile_id:%d,workspace:%d,output:%s)",output->workspaces[output->curr_workspace]->focused_tile->id,output->workspaces[output->curr_workspace]->num+1,output->wlr_output->name); } // Switch to a differerent virtual terminal @@ -550,6 +553,8 @@ keybinding_split_output(struct cg_output *output, bool vertical) { wlr_log(WLR_ERROR, "Failed to allocate new tile for splitting"); return; } + new_tile->id=output->server->tiles_curr_id; + ++output->server->tiles_curr_id; new_tile->tile.x = new_x; new_tile->tile.y = new_y; new_tile->tile.width = x + width - new_x; @@ -572,6 +577,7 @@ keybinding_split_output(struct cg_output *output, bool vertical) { if(original_view != NULL) { view_maximize(original_view, curr_workspace->focused_tile); } + ipc_send_event(output->server,"split(tile_id:%d,new_tile_id:%d,workspace:%d,output:%s,vertical:%d)",curr_workspace->focused_tile->id,new_tile->id,curr_workspace->num+1,curr_workspace->output->wlr_output->name,vertical); } static void @@ -579,7 +585,12 @@ keybinding_close_view(struct cg_view *view) { if(view == NULL) { return; } + struct cg_output *outp=view->workspace->output; + uint32_t view_id=view->id; + uint32_t tile_id=view->id; + uint32_t ws=view->workspace->num; view->impl->close(view); + ipc_send_event(outp->server,"close(view_id:%d,tile_id:%d,workspace:%d,output:%s)",view_id,tile_id,ws+1,outp->wlr_output->name); } static void @@ -611,6 +622,7 @@ set_output(struct cg_server *server, struct cg_output *output) { void keybinding_cycle_outputs(struct cg_server *server, bool reverse) { struct cg_output *output = NULL; + struct cg_output *old_output=server->curr_output; if(reverse) { output = wl_container_of(server->curr_output->link.prev, server->curr_output, link); @@ -626,6 +638,7 @@ keybinding_cycle_outputs(struct cg_server *server, bool reverse) { } } set_output(server, output); + ipc_send_event(output->server,"cycle_outputs(old_output:%s,new_output:%s,reverse:%d)",old_output->wlr_output->name,output->wlr_output->name,reverse); } /* Cycle through views, whereby the workspace does not change */ @@ -669,12 +682,14 @@ keybinding_cycle_views(struct cg_server *server, bool reverse) { curr_workspace->focused_tile->view = wl_container_of( next_view->link.prev, curr_workspace->focused_tile->view, link); seat_set_focus(server->seat, next_view); + ipc_send_event(curr_workspace->output->server,"cycle_views(old_view_id:%d,new_view_id:%d,tile_id:%d,workspace:%d,output:%s)",current_view->id,next_view->id,next_view->tile->id,curr_workspace->num+1,curr_workspace->output->wlr_output->name); } void keybinding_cycle_tiles(struct cg_server *server, bool reverse) { struct cg_output *output = server->curr_output; struct cg_workspace *workspace = output->workspaces[output->curr_workspace]; + struct cg_tile *old_tile=workspace->focused_tile; if(reverse) { workspace_focus_tile(workspace, workspace->focused_tile->prev); } else { @@ -683,6 +698,7 @@ keybinding_cycle_tiles(struct cg_server *server, bool reverse) { struct cg_view *next_view = workspace->focused_tile->view; seat_set_focus(server->seat, next_view); + ipc_send_event(output->server,"cycle_tiles(old_tile_id:%d,new_tile_id:%d,workspace:%d,output:%s)",old_tile->id,workspace->focused_tile->id,workspace->num+1,output->wlr_output->name); } int @@ -694,11 +710,13 @@ keybinding_switch_ws(struct cg_server *server, uint32_t ws) { return -1; } struct cg_output *output = server->curr_output; + uint32_t old_ws=server->curr_output->curr_workspace; output->curr_workspace = ws; seat_set_focus(server->seat, server->curr_output->workspaces[ws]->focused_tile->view); wlr_output_damage_add_whole(output->damage); message_printf(server->curr_output, "Workspace %d", ws + 1); + ipc_send_event(output->server,"switch_ws(old_workspace:%d,new_workspace:%d,output:%s)",old_ws+1,ws+1,output->wlr_output->name); return 0; } @@ -733,6 +751,7 @@ keybinding_move_view_to_cycle_output(struct cg_server *server, bool reverse) { if(wl_list_length(&server->outputs) <= 1) { return; } + struct cg_output *old_outp=server->curr_output; struct cg_view *view = server->curr_output->workspaces[server->curr_output->curr_workspace] ->focused_tile->view; @@ -761,11 +780,13 @@ keybinding_move_view_to_cycle_output(struct cg_server *server, bool reverse) { view_maximize(view, view->tile); seat_set_focus(server->seat, view); } + ipc_send_event(server,"move_view_cycle_output(view_id:%d,old_output:%s,new_output:%s)",view->id,old_outp->wlr_output->name,server->curr_output->wlr_output->name); } void keybinding_set_nws(struct cg_server *server, int nws) { struct cg_output *output; + int old_nws=server->nws; wl_list_for_each(output, &server->outputs, link) { for(unsigned int i = nws; i < server->nws; ++i) { struct cg_view *view, *tmp; @@ -794,6 +815,7 @@ keybinding_set_nws(struct cg_server *server, int nws) { output->workspaces = new_workspaces; for(int i = server->nws; i < nws; ++i) { output->workspaces[i] = full_screen_workspace(output); + output->workspaces[i]->num=i; if(!output->workspaces[i]) { wlr_log(WLR_ERROR, "Failed to allocate additional workspaces"); return; @@ -812,6 +834,7 @@ keybinding_set_nws(struct cg_server *server, int nws) { server->seat, server->curr_output->workspaces[server->curr_output->curr_workspace] ->focused_tile->view); + ipc_send_event(server,"set_nws(old_nws:%d,new_nws:%d)",old_nws,server->nws); } void @@ -828,15 +851,18 @@ keybinding_definemode(struct cg_server *server, char *mode) { server->modes[length] = NULL; server->modes[length - 1] = strdup(mode); + ipc_send_event(server,"definemode(mode:%s)",mode); } void keybinding_definekey(struct cg_server *server, struct keybinding *kb) { keybinding_list_push(server->keybindings, kb); + ipc_send_event(server,"definekey(modifiers:%d,key:%d,command:%d)",kb->modifiers,kb->key,kb->action); } void keybinding_set_background(struct cg_server *server, float *bg) { + ipc_send_event(server,"background(old_bg:[%f,%f,%f],new_bg:[%f,%f,%f])",server->bg_color[0],server->bg_color[1],server->bg_color[2],bg[0],bg[1],bg[2]); server->bg_color[0] = bg[0]; server->bg_color[1] = bg[1]; server->bg_color[2] = bg[2]; @@ -844,11 +870,13 @@ keybinding_set_background(struct cg_server *server, float *bg) { void keybinding_switch_output(struct cg_server *server, int output) { + struct cg_output *old_outp=server->curr_output; struct cg_output *it; int count = 1; wl_list_for_each(it, &server->outputs, link) { if(count == output) { set_output(server, it); + ipc_send_event(server,"switch_output(old_output:%s,new_output:%s)",old_outp->wlr_output->name,it->wlr_output->name); return; } ++count; @@ -859,6 +887,7 @@ keybinding_switch_output(struct cg_server *server, int output) { void keybinding_move_view_to_output(struct cg_server *server, int output_num) { + struct cg_output *old_outp=server->curr_output; struct cg_view *view = server->curr_output->workspaces[server->curr_output->curr_workspace] ->focused_tile->view; @@ -883,10 +912,18 @@ keybinding_move_view_to_output(struct cg_server *server, int output_num) { view_maximize(view, ws->focused_tile); seat_set_focus(server->seat, view); } + char *view_title=""; + int view_id=-1; + if(view != NULL) { + view_title=view->impl->get_title(view); + view_id=view->id; + } + ipc_send_event(server,"move_view_to_output(view_id:%d,old_output:%s,new_output:%s,view_title:%s)",view_id,old_outp->wlr_output->name,server->curr_output->wlr_output->name,view_title); } void keybinding_move_view_to_workspace(struct cg_server *server, uint32_t ws) { + uint32_t old_ws=server->curr_output->curr_workspace; struct cg_view *view = server->curr_output->workspaces[server->curr_output->curr_workspace] ->focused_tile->view; @@ -911,6 +948,7 @@ keybinding_move_view_to_workspace(struct cg_server *server, uint32_t ws) { view_maximize(view, ws->focused_tile); seat_set_focus(server->seat, view); } + ipc_send_event(server,"move_view_to_ws(view_id:%d,old_workspace:%d,new_workspace:%d,output:%s,view_title:%s)",view->id,old_ws,ws,view->workspace->output->wlr_output->name,view->impl->get_title(view)); } void @@ -959,12 +997,14 @@ keybinding_configure_output(struct cg_server *server, wl_list_for_each_safe(output, tmp_output, &server->outputs, link) { if(strcmp(config->output_name, output->wlr_output->name) == 0) { output_configure(server, output); + ipc_send_event(output->server,"configure_output(output:%s)",cfg->output_name); return; } } wl_list_for_each_safe(output, tmp_output, &server->disabled_outputs, link) { if(strcmp(config->output_name, output->wlr_output->name) == 0) { output_configure(server, output); + ipc_send_event(output->server,"configure_output(output:%s)",cfg->output_name); return; } } @@ -974,6 +1014,7 @@ void keybinding_configure_input(struct cg_server *server, struct cg_input_config *cfg) { cg_input_apply_config(cfg, server); + ipc_send_event(server,"configure_input(input:%s)",cfg->identifier); } void @@ -998,6 +1039,7 @@ keybinding_configure_message(struct cg_server *server, server->message_config.fg_color[2] = config->fg_color[2]; server->message_config.fg_color[3] = config->fg_color[3]; } + ipc_send_event(server,"configure_message()"); } void @@ -1047,6 +1089,7 @@ run_action(enum keybinding_action action, struct cg_server *server, server->seat->mode = data.u; break; case KEYBINDING_SWITCH_DEFAULT_MODE: + ipc_send_event(server,"switch_default_mode(old_mode:%d,mode:%d)",server->seat->default_mode,data.u); server->seat->mode = data.u; server->seat->default_mode = data.u; break; diff --git a/output.c b/output.c index 6370b39..d5ddba0 100644 --- a/output.c +++ b/output.c @@ -8,7 +8,7 @@ * See the LICENSE file accompanying this file. */ -#define _POSIX_C_SOURCE 200112L +#define _POSIX_C_SOURCE 200809L #include "config.h" #include @@ -480,6 +480,7 @@ output_clear(struct cg_output *output) { static void output_destroy(struct cg_output *output) { struct cg_server *server = output->server; + char *outp_name=strdup(output->wlr_output->name); wl_list_remove(&output->destroy.link); wl_list_remove(&output->mode.link); @@ -499,6 +500,12 @@ output_destroy(struct cg_output *output) { free(output); + if(outp_name!=NULL) { + ipc_send_event(server,"new_output(output:%s)",outp_name); + free(outp_name); + } else { + wlr_log(WLR_ERROR, "Failed to allocate memory for output name in output_destroy"); + } if(wl_list_empty(&server->outputs)) { wl_display_terminate(server->wl_display); } @@ -684,6 +691,7 @@ handle_new_output(struct wl_listener *listener, void *data) { output->workspaces = malloc(server->nws * sizeof(struct cg_workspace *)); for(unsigned int i = 0; i < server->nws; ++i) { output->workspaces[i] = full_screen_workspace(output); + output->workspaces[i]->num=i; if(!output->workspaces[i]) { wlr_log(WLR_ERROR, "Failed to allocate workspaces for output"); return; @@ -710,6 +718,7 @@ handle_new_output(struct wl_listener *listener, void *data) { wl_signal_add(&output->damage->events.frame, &output->damage_frame); output->damage_destroy.notify = handle_output_damage_destroy; wl_signal_add(&output->damage->events.destroy, &output->damage_destroy); + ipc_send_event(server,"new_output(output:%s,priority:%d)",output->wlr_output->name,output->priority); } #if CG_HAS_FANALYZE #pragma GCC diagnostic pop diff --git a/server.h b/server.h index 22dfe32..610210d 100644 --- a/server.h +++ b/server.h @@ -54,6 +54,8 @@ struct cg_server { char **modes; uint16_t nws; float *bg_color; + uint32_t views_curr_id; + uint32_t tiles_curr_id; #ifdef DEBUG bool debug_damage_tracking; #endif diff --git a/view.c b/view.c index 09fc463..afa418b 100644 --- a/view.c +++ b/view.c @@ -23,6 +23,7 @@ #include "server.h" #include "view.h" #include "workspace.h" +#include "ipc_server.h" #if CG_HAS_XWAYLAND #include "xwayland.h" #endif @@ -249,6 +250,12 @@ view_for_each_popup(struct cg_view *view, wlr_surface_iterator_func_t iterator, void view_unmap(struct cg_view *view) { + + uint32_t id=view->id; + uint32_t tile_id=view->tile->id; + uint32_t ws=view->workspace->num; + char *output_name=view->workspace->output->wlr_output->name; + char *title=view->impl->get_title(view); /* If the view is not mapped, do nothing */ if(view->wlr_surface == NULL) { return; @@ -302,6 +309,7 @@ view_unmap(struct cg_view *view) { wl_list_remove(&view->new_subsurface.link); view->wlr_surface = NULL; + ipc_send_event(view->workspace->server,"view_unmap(view_id:%d,tile_id:%d,workspace:%d,output:%s,view_title:%s)",id,tile_id,ws+1,output_name,title); } void @@ -340,6 +348,7 @@ view_map(struct cg_view *view, struct wlr_surface *surface, wl_list_insert(&ws->views, &view->link); } seat_set_focus(output->server->seat, view); + ipc_send_event(output->server,"view_map(view_id:%d,tile_id:%d,workspace:%d,output:%s,view_title:%s)",view->id,view->tile->id,view->workspace->num+1,view->workspace->output->wlr_output->name,view->impl->get_title(view)); } void @@ -363,6 +372,8 @@ view_init(struct cg_view *view, enum cg_view_type type, view->server = server; view->type = type; view->impl = impl; + view->id=server->views_curr_id; + ++server->views_curr_id; wl_list_init(&view->children); } diff --git a/view.h b/view.h index 62a1f32..772728d 100644 --- a/view.h +++ b/view.h @@ -32,6 +32,7 @@ struct cg_view { const struct cg_view_impl *impl; struct wl_listener new_subsurface; + uint32_t id; }; struct cg_view_impl { diff --git a/workspace.c b/workspace.c index 1b701e8..5b68b63 100644 --- a/workspace.c +++ b/workspace.c @@ -26,7 +26,7 @@ int full_screen_workspace_tiles(struct wlr_output_layout *layout, struct wlr_output *output, - struct cg_workspace *workspace) { + struct cg_workspace *workspace, uint32_t *tiles_curr_id) { workspace->focused_tile = calloc(1, sizeof(struct cg_tile)); if(!workspace->focused_tile) { return -1; @@ -40,6 +40,8 @@ full_screen_workspace_tiles(struct wlr_output_layout *layout, workspace->focused_tile->tile.width = output_box->width; workspace->focused_tile->tile.height = output_box->height; workspace->focused_tile->view = NULL; + workspace->focused_tile->id = *tiles_curr_id; + ++(*tiles_curr_id); return 0; } #if CG_HAS_FANALYZE @@ -53,8 +55,9 @@ full_screen_workspace(struct cg_output *output) { return NULL; } workspace->server = output->server; + workspace->num=-1; if(full_screen_workspace_tiles(output->server->output_layout, - output->wlr_output, workspace) != 0) { + output->wlr_output, workspace, &output->server->tiles_curr_id) != 0) { free(workspace); return NULL; } diff --git a/workspace.h b/workspace.h index a5da674..51b190e 100644 --- a/workspace.h +++ b/workspace.h @@ -12,6 +12,7 @@ struct cg_tile { struct cg_view *view; struct cg_tile *next; struct cg_tile *prev; + uint32_t id; }; struct cg_workspace { @@ -21,6 +22,7 @@ struct cg_workspace { struct cg_output *output; struct cg_tile *focused_tile; + uint32_t num; }; struct cg_workspace * @@ -28,7 +30,7 @@ full_screen_workspace(struct cg_output *output); int full_screen_workspace_tiles(struct wlr_output_layout *layout, struct wlr_output *output, - struct cg_workspace *workspace); + struct cg_workspace *workspace, uint32_t *tiles_curr_id); void workspace_free_tiles(struct cg_workspace *workspace); void From fd671ac2dd4e69868f3e4f080d750b757c798641 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 25 Dec 2021 15:38:31 +0100 Subject: [PATCH 327/689] Apply clang-format --- cagebreak.c | 4 +- ipc_server.c | 63 ++++++++++++++--------- keybinding.c | 143 +++++++++++++++++++++++++++++++++++---------------- output.c | 14 ++--- view.c | 25 +++++---- workspace.c | 8 +-- workspace.h | 3 +- 7 files changed, 170 insertions(+), 90 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index 9caaa34..3aea339 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -307,8 +307,8 @@ main(int argc, char *argv[]) { } server.nws = 1; - server.views_curr_id=0; - server.tiles_curr_id=0; + server.views_curr_id = 0; + server.tiles_curr_id = 0; server.message_config.fg_color[0] = 0.0; server.message_config.fg_color[1] = 0.0; server.message_config.fg_color[2] = 0.0; diff --git a/ipc_server.c b/ipc_server.c index 168df16..86560b9 100644 --- a/ipc_server.c +++ b/ipc_server.c @@ -114,37 +114,40 @@ ipc_init(struct cg_server *server) { return 0; } -int ipc_client_handle_writable(int client_fd, uint32_t mask, void *data) { +int +ipc_client_handle_writable(int client_fd, uint32_t mask, void *data) { struct cg_ipc_client *client = data; - if (mask & WL_EVENT_ERROR) { + if(mask & WL_EVENT_ERROR) { ipc_client_disconnect(client); return 0; } - if (mask & WL_EVENT_HANGUP) { + if(mask & WL_EVENT_HANGUP) { ipc_client_disconnect(client); return 0; } - if (client->write_buffer_len <= 0) { + if(client->write_buffer_len <= 0) { return 0; } - ssize_t written = write(client->fd, client->write_buffer, client->write_buffer_len); + ssize_t written = + write(client->fd, client->write_buffer, client->write_buffer_len); - if (written == -1 && errno == EAGAIN) { + if(written == -1 && errno == EAGAIN) { return 0; - } else if (written == -1) { + } else if(written == -1) { wlr_log(WLR_ERROR, "Unable to send data from queue to IPC client"); ipc_client_disconnect(client); return 0; } - memmove(client->write_buffer, client->write_buffer + written, client->write_buffer_len - written); + memmove(client->write_buffer, client->write_buffer + written, + client->write_buffer_len - written); client->write_buffer_len -= written; - if (client->write_buffer_len == 0 && client->writable_event_source) { + if(client->write_buffer_len == 0 && client->writable_event_source) { wl_event_source_remove(client->writable_event_source); client->writable_event_source = NULL; } @@ -197,7 +200,9 @@ ipc_handle_connection(int fd, uint32_t mask, void *data) { client->event_source = wl_event_loop_add_fd(server->event_loop, client_fd, WL_EVENT_READABLE, ipc_client_handle_readable, client); - client->writable_event_source = wl_event_loop_add_fd(server->event_loop, client_fd, WL_EVENT_WRITABLE, ipc_client_handle_writable, client); + client->writable_event_source = + wl_event_loop_add_fd(server->event_loop, client_fd, WL_EVENT_WRITABLE, + ipc_client_handle_writable, client); client->write_buffer_size = 128; client->write_buffer_len = 0; @@ -319,39 +324,45 @@ ipc_client_handle_command(struct cg_ipc_client *client) { client->read_buf_len -= offset; } -void ipc_send_event_client(struct cg_ipc_client *client, const char *payload, uint32_t payload_length) { +void +ipc_send_event_client(struct cg_ipc_client *client, const char *payload, + uint32_t payload_length) { char data[IPC_HEADER_SIZE]; memcpy(data, ipc_magic, sizeof(ipc_magic)); memcpy(data + sizeof(ipc_magic), &payload_length, sizeof(payload_length)); - while (client->write_buffer_len + IPC_HEADER_SIZE + payload_length >= - client->write_buffer_size) { + while(client->write_buffer_len + IPC_HEADER_SIZE + payload_length >= + client->write_buffer_size) { client->write_buffer_size *= 2; } - if (client->write_buffer_size > 4e6) { // 4 MB - wlr_log(WLR_ERROR, "Client write buffer too big (%zu), disconnecting client", - client->write_buffer_size); + if(client->write_buffer_size > 4e6) { // 4 MB + wlr_log(WLR_ERROR, + "Client write buffer too big (%zu), disconnecting client", + client->write_buffer_size); ipc_client_disconnect(client); return; } char *new_buffer = realloc(client->write_buffer, client->write_buffer_size); - if (!new_buffer) { + if(!new_buffer) { wlr_log(WLR_ERROR, "Unable to reallocate ipc client write buffer"); ipc_client_disconnect(client); return; } client->write_buffer = new_buffer; - memcpy(client->write_buffer + client->write_buffer_len, data, IPC_HEADER_SIZE); + memcpy(client->write_buffer + client->write_buffer_len, data, + IPC_HEADER_SIZE); client->write_buffer_len += IPC_HEADER_SIZE; - memcpy(client->write_buffer + client->write_buffer_len, payload, payload_length); + memcpy(client->write_buffer + client->write_buffer_len, payload, + payload_length); client->write_buffer_len += payload_length; } -void ipc_send_event(struct cg_server *server, const char *fmt, ...) { +void +ipc_send_event(struct cg_server *server, const char *fmt, ...) { if(wl_list_empty(&server->ipc.client_list)) { return; } @@ -364,11 +375,13 @@ void ipc_send_event(struct cg_server *server, const char *fmt, ...) { return; } va_end(args); - struct cg_ipc_client *it,*tmp; - uint32_t len=strlen(msg); - wl_list_for_each_safe(it,tmp,&server->ipc.client_list,link) { - if(it->writable_event_source==NULL) { - it->writable_event_source = wl_event_loop_add_fd(server->event_loop, it->fd, WL_EVENT_WRITABLE, ipc_client_handle_writable, it); + struct cg_ipc_client *it, *tmp; + uint32_t len = strlen(msg); + wl_list_for_each_safe(it, tmp, &server->ipc.client_list, link) { + if(it->writable_event_source == NULL) { + it->writable_event_source = wl_event_loop_add_fd( + server->event_loop, it->fd, WL_EVENT_WRITABLE, + ipc_client_handle_writable, it); } ipc_send_event_client(it, msg, len); } diff --git a/keybinding.c b/keybinding.c index 870c33a..b5b6380 100644 --- a/keybinding.c +++ b/keybinding.c @@ -212,7 +212,11 @@ swap_tile(struct cg_tile *tile, } seat_set_focus(server->seat, swap_tile->view); - ipc_send_event(tile->workspace->output->server,"swap_tile(tile_id:%d,swap_tile_id:%d,workspace:%d,output:%s)",tile->id,swap_tile->id,tile->workspace->num+1,tile->workspace->output->wlr_output->name); + ipc_send_event( + tile->workspace->output->server, + "swap_tile(tile_id:%d,swap_tile_id:%d,workspace:%d,output:%s)", + tile->id, swap_tile->id, tile->workspace->num + 1, + tile->workspace->output->wlr_output->name); } void @@ -355,7 +359,8 @@ resize(struct cg_tile *tile, const struct cg_tile *parent, int coord_offset, } } - int old_x = tile->tile.x, old_y = tile->tile.y, old_height=tile->tile.height, old_width=tile->tile.width; + int old_x = tile->tile.x, old_y = tile->tile.y, + old_height = tile->tile.height, old_width = tile->tile.width; *get_coord(tile) += coord_offset; *get_dim(tile) += dim_offset; struct wlr_box damage_box = { @@ -367,7 +372,13 @@ resize(struct cg_tile *tile, const struct cg_tile *parent, int coord_offset, if(tile->view != NULL) { view_maximize(tile->view, tile); } - ipc_send_event(tile->workspace->output->server,"resize_tile(tile_id:%d,old_dims:[%d;%d;%d;%d],new_dims:[%d;%d;%d;%d],workspace:%d,output:%s)",tile->id,old_x,old_y,old_height,old_width,tile->tile.x,tile->tile.y,tile->tile.height,tile->tile.width,tile->workspace->num+1,tile->workspace->output->wlr_output->name); + ipc_send_event(tile->workspace->output->server, + "resize_tile(tile_id:%d,old_dims:[%d;%d;%d;%d],new_dims:[%d;" + "%d;%d;%d],workspace:%d,output:%s)", + tile->id, old_x, old_y, old_height, old_width, tile->tile.x, + tile->tile.y, tile->tile.height, tile->tile.width, + tile->workspace->num + 1, + tile->workspace->output->wlr_output->name); } int * @@ -473,9 +484,9 @@ keybinding_workspace_fullscreen(struct cg_server *server) { } workspace_free_tiles(output->workspaces[output->curr_workspace]); - if(full_screen_workspace_tiles( - server->output_layout, output->wlr_output, - output->workspaces[output->curr_workspace],&server->tiles_curr_id) != 0) { + if(full_screen_workspace_tiles(server->output_layout, output->wlr_output, + output->workspaces[output->curr_workspace], + &server->tiles_curr_id) != 0) { wlr_log(WLR_ERROR, "Failed to allocate space for fullscreen workspace"); return; } @@ -488,7 +499,11 @@ keybinding_workspace_fullscreen(struct cg_server *server) { } seat_set_focus(server->seat, current_view); - ipc_send_event(output->server,"fullscreen(tile_id:%d,workspace:%d,output:%s)",output->workspaces[output->curr_workspace]->focused_tile->id,output->workspaces[output->curr_workspace]->num+1,output->wlr_output->name); + ipc_send_event(output->server, + "fullscreen(tile_id:%d,workspace:%d,output:%s)", + output->workspaces[output->curr_workspace]->focused_tile->id, + output->workspaces[output->curr_workspace]->num + 1, + output->wlr_output->name); } // Switch to a differerent virtual terminal @@ -553,7 +568,7 @@ keybinding_split_output(struct cg_output *output, bool vertical) { wlr_log(WLR_ERROR, "Failed to allocate new tile for splitting"); return; } - new_tile->id=output->server->tiles_curr_id; + new_tile->id = output->server->tiles_curr_id; ++output->server->tiles_curr_id; new_tile->tile.x = new_x; new_tile->tile.y = new_y; @@ -577,7 +592,11 @@ keybinding_split_output(struct cg_output *output, bool vertical) { if(original_view != NULL) { view_maximize(original_view, curr_workspace->focused_tile); } - ipc_send_event(output->server,"split(tile_id:%d,new_tile_id:%d,workspace:%d,output:%s,vertical:%d)",curr_workspace->focused_tile->id,new_tile->id,curr_workspace->num+1,curr_workspace->output->wlr_output->name,vertical); + ipc_send_event( + output->server, + "split(tile_id:%d,new_tile_id:%d,workspace:%d,output:%s,vertical:%d)", + curr_workspace->focused_tile->id, new_tile->id, curr_workspace->num + 1, + curr_workspace->output->wlr_output->name, vertical); } static void @@ -585,12 +604,14 @@ keybinding_close_view(struct cg_view *view) { if(view == NULL) { return; } - struct cg_output *outp=view->workspace->output; - uint32_t view_id=view->id; - uint32_t tile_id=view->id; - uint32_t ws=view->workspace->num; + struct cg_output *outp = view->workspace->output; + uint32_t view_id = view->id; + uint32_t tile_id = view->id; + uint32_t ws = view->workspace->num; view->impl->close(view); - ipc_send_event(outp->server,"close(view_id:%d,tile_id:%d,workspace:%d,output:%s)",view_id,tile_id,ws+1,outp->wlr_output->name); + ipc_send_event(outp->server, + "close(view_id:%d,tile_id:%d,workspace:%d,output:%s)", + view_id, tile_id, ws + 1, outp->wlr_output->name); } static void @@ -622,7 +643,7 @@ set_output(struct cg_server *server, struct cg_output *output) { void keybinding_cycle_outputs(struct cg_server *server, bool reverse) { struct cg_output *output = NULL; - struct cg_output *old_output=server->curr_output; + struct cg_output *old_output = server->curr_output; if(reverse) { output = wl_container_of(server->curr_output->link.prev, server->curr_output, link); @@ -638,7 +659,9 @@ keybinding_cycle_outputs(struct cg_server *server, bool reverse) { } } set_output(server, output); - ipc_send_event(output->server,"cycle_outputs(old_output:%s,new_output:%s,reverse:%d)",old_output->wlr_output->name,output->wlr_output->name,reverse); + ipc_send_event( + output->server, "cycle_outputs(old_output:%s,new_output:%s,reverse:%d)", + old_output->wlr_output->name, output->wlr_output->name, reverse); } /* Cycle through views, whereby the workspace does not change */ @@ -682,14 +705,19 @@ keybinding_cycle_views(struct cg_server *server, bool reverse) { curr_workspace->focused_tile->view = wl_container_of( next_view->link.prev, curr_workspace->focused_tile->view, link); seat_set_focus(server->seat, next_view); - ipc_send_event(curr_workspace->output->server,"cycle_views(old_view_id:%d,new_view_id:%d,tile_id:%d,workspace:%d,output:%s)",current_view->id,next_view->id,next_view->tile->id,curr_workspace->num+1,curr_workspace->output->wlr_output->name); + ipc_send_event(curr_workspace->output->server, + "cycle_views(old_view_id:%d,new_view_id:%d,tile_id:%d," + "workspace:%d,output:%s)", + current_view->id, next_view->id, next_view->tile->id, + curr_workspace->num + 1, + curr_workspace->output->wlr_output->name); } void keybinding_cycle_tiles(struct cg_server *server, bool reverse) { struct cg_output *output = server->curr_output; struct cg_workspace *workspace = output->workspaces[output->curr_workspace]; - struct cg_tile *old_tile=workspace->focused_tile; + struct cg_tile *old_tile = workspace->focused_tile; if(reverse) { workspace_focus_tile(workspace, workspace->focused_tile->prev); } else { @@ -698,7 +726,11 @@ keybinding_cycle_tiles(struct cg_server *server, bool reverse) { struct cg_view *next_view = workspace->focused_tile->view; seat_set_focus(server->seat, next_view); - ipc_send_event(output->server,"cycle_tiles(old_tile_id:%d,new_tile_id:%d,workspace:%d,output:%s)",old_tile->id,workspace->focused_tile->id,workspace->num+1,output->wlr_output->name); + ipc_send_event( + output->server, + "cycle_tiles(old_tile_id:%d,new_tile_id:%d,workspace:%d,output:%s)", + old_tile->id, workspace->focused_tile->id, workspace->num + 1, + output->wlr_output->name); } int @@ -710,13 +742,15 @@ keybinding_switch_ws(struct cg_server *server, uint32_t ws) { return -1; } struct cg_output *output = server->curr_output; - uint32_t old_ws=server->curr_output->curr_workspace; + uint32_t old_ws = server->curr_output->curr_workspace; output->curr_workspace = ws; seat_set_focus(server->seat, server->curr_output->workspaces[ws]->focused_tile->view); wlr_output_damage_add_whole(output->damage); message_printf(server->curr_output, "Workspace %d", ws + 1); - ipc_send_event(output->server,"switch_ws(old_workspace:%d,new_workspace:%d,output:%s)",old_ws+1,ws+1,output->wlr_output->name); + ipc_send_event(output->server, + "switch_ws(old_workspace:%d,new_workspace:%d,output:%s)", + old_ws + 1, ws + 1, output->wlr_output->name); return 0; } @@ -751,7 +785,7 @@ keybinding_move_view_to_cycle_output(struct cg_server *server, bool reverse) { if(wl_list_length(&server->outputs) <= 1) { return; } - struct cg_output *old_outp=server->curr_output; + struct cg_output *old_outp = server->curr_output; struct cg_view *view = server->curr_output->workspaces[server->curr_output->curr_workspace] ->focused_tile->view; @@ -780,13 +814,17 @@ keybinding_move_view_to_cycle_output(struct cg_server *server, bool reverse) { view_maximize(view, view->tile); seat_set_focus(server->seat, view); } - ipc_send_event(server,"move_view_cycle_output(view_id:%d,old_output:%s,new_output:%s)",view->id,old_outp->wlr_output->name,server->curr_output->wlr_output->name); + ipc_send_event( + server, + "move_view_cycle_output(view_id:%d,old_output:%s,new_output:%s)", + view->id, old_outp->wlr_output->name, + server->curr_output->wlr_output->name); } void keybinding_set_nws(struct cg_server *server, int nws) { struct cg_output *output; - int old_nws=server->nws; + int old_nws = server->nws; wl_list_for_each(output, &server->outputs, link) { for(unsigned int i = nws; i < server->nws; ++i) { struct cg_view *view, *tmp; @@ -815,7 +853,7 @@ keybinding_set_nws(struct cg_server *server, int nws) { output->workspaces = new_workspaces; for(int i = server->nws; i < nws; ++i) { output->workspaces[i] = full_screen_workspace(output); - output->workspaces[i]->num=i; + output->workspaces[i]->num = i; if(!output->workspaces[i]) { wlr_log(WLR_ERROR, "Failed to allocate additional workspaces"); return; @@ -834,7 +872,8 @@ keybinding_set_nws(struct cg_server *server, int nws) { server->seat, server->curr_output->workspaces[server->curr_output->curr_workspace] ->focused_tile->view); - ipc_send_event(server,"set_nws(old_nws:%d,new_nws:%d)",old_nws,server->nws); + ipc_send_event(server, "set_nws(old_nws:%d,new_nws:%d)", old_nws, + server->nws); } void @@ -851,18 +890,21 @@ keybinding_definemode(struct cg_server *server, char *mode) { server->modes[length] = NULL; server->modes[length - 1] = strdup(mode); - ipc_send_event(server,"definemode(mode:%s)",mode); + ipc_send_event(server, "definemode(mode:%s)", mode); } void keybinding_definekey(struct cg_server *server, struct keybinding *kb) { keybinding_list_push(server->keybindings, kb); - ipc_send_event(server,"definekey(modifiers:%d,key:%d,command:%d)",kb->modifiers,kb->key,kb->action); + ipc_send_event(server, "definekey(modifiers:%d,key:%d,command:%d)", + kb->modifiers, kb->key, kb->action); } void keybinding_set_background(struct cg_server *server, float *bg) { - ipc_send_event(server,"background(old_bg:[%f,%f,%f],new_bg:[%f,%f,%f])",server->bg_color[0],server->bg_color[1],server->bg_color[2],bg[0],bg[1],bg[2]); + ipc_send_event(server, "background(old_bg:[%f,%f,%f],new_bg:[%f,%f,%f])", + server->bg_color[0], server->bg_color[1], + server->bg_color[2], bg[0], bg[1], bg[2]); server->bg_color[0] = bg[0]; server->bg_color[1] = bg[1]; server->bg_color[2] = bg[2]; @@ -870,13 +912,14 @@ keybinding_set_background(struct cg_server *server, float *bg) { void keybinding_switch_output(struct cg_server *server, int output) { - struct cg_output *old_outp=server->curr_output; + struct cg_output *old_outp = server->curr_output; struct cg_output *it; int count = 1; wl_list_for_each(it, &server->outputs, link) { if(count == output) { set_output(server, it); - ipc_send_event(server,"switch_output(old_output:%s,new_output:%s)",old_outp->wlr_output->name,it->wlr_output->name); + ipc_send_event(server, "switch_output(old_output:%s,new_output:%s)", + old_outp->wlr_output->name, it->wlr_output->name); return; } ++count; @@ -887,7 +930,7 @@ keybinding_switch_output(struct cg_server *server, int output) { void keybinding_move_view_to_output(struct cg_server *server, int output_num) { - struct cg_output *old_outp=server->curr_output; + struct cg_output *old_outp = server->curr_output; struct cg_view *view = server->curr_output->workspaces[server->curr_output->curr_workspace] ->focused_tile->view; @@ -912,18 +955,22 @@ keybinding_move_view_to_output(struct cg_server *server, int output_num) { view_maximize(view, ws->focused_tile); seat_set_focus(server->seat, view); } - char *view_title=""; - int view_id=-1; + char *view_title = ""; + int view_id = -1; if(view != NULL) { - view_title=view->impl->get_title(view); - view_id=view->id; + view_title = view->impl->get_title(view); + view_id = view->id; } - ipc_send_event(server,"move_view_to_output(view_id:%d,old_output:%s,new_output:%s,view_title:%s)",view_id,old_outp->wlr_output->name,server->curr_output->wlr_output->name,view_title); + ipc_send_event(server, + "move_view_to_output(view_id:%d,old_output:%s,new_output:%s," + "view_title:%s)", + view_id, old_outp->wlr_output->name, + server->curr_output->wlr_output->name, view_title); } void keybinding_move_view_to_workspace(struct cg_server *server, uint32_t ws) { - uint32_t old_ws=server->curr_output->curr_workspace; + uint32_t old_ws = server->curr_output->curr_workspace; struct cg_view *view = server->curr_output->workspaces[server->curr_output->curr_workspace] ->focused_tile->view; @@ -948,7 +995,12 @@ keybinding_move_view_to_workspace(struct cg_server *server, uint32_t ws) { view_maximize(view, ws->focused_tile); seat_set_focus(server->seat, view); } - ipc_send_event(server,"move_view_to_ws(view_id:%d,old_workspace:%d,new_workspace:%d,output:%s,view_title:%s)",view->id,old_ws,ws,view->workspace->output->wlr_output->name,view->impl->get_title(view)); + ipc_send_event(server, + "move_view_to_ws(view_id:%d,old_workspace:%d,new_workspace:%" + "d,output:%s,view_title:%s)", + view->id, old_ws, ws, + view->workspace->output->wlr_output->name, + view->impl->get_title(view)); } void @@ -997,14 +1049,16 @@ keybinding_configure_output(struct cg_server *server, wl_list_for_each_safe(output, tmp_output, &server->outputs, link) { if(strcmp(config->output_name, output->wlr_output->name) == 0) { output_configure(server, output); - ipc_send_event(output->server,"configure_output(output:%s)",cfg->output_name); + ipc_send_event(output->server, "configure_output(output:%s)", + cfg->output_name); return; } } wl_list_for_each_safe(output, tmp_output, &server->disabled_outputs, link) { if(strcmp(config->output_name, output->wlr_output->name) == 0) { output_configure(server, output); - ipc_send_event(output->server,"configure_output(output:%s)",cfg->output_name); + ipc_send_event(output->server, "configure_output(output:%s)", + cfg->output_name); return; } } @@ -1014,7 +1068,7 @@ void keybinding_configure_input(struct cg_server *server, struct cg_input_config *cfg) { cg_input_apply_config(cfg, server); - ipc_send_event(server,"configure_input(input:%s)",cfg->identifier); + ipc_send_event(server, "configure_input(input:%s)", cfg->identifier); } void @@ -1039,7 +1093,7 @@ keybinding_configure_message(struct cg_server *server, server->message_config.fg_color[2] = config->fg_color[2]; server->message_config.fg_color[3] = config->fg_color[3]; } - ipc_send_event(server,"configure_message()"); + ipc_send_event(server, "configure_message()"); } void @@ -1089,7 +1143,8 @@ run_action(enum keybinding_action action, struct cg_server *server, server->seat->mode = data.u; break; case KEYBINDING_SWITCH_DEFAULT_MODE: - ipc_send_event(server,"switch_default_mode(old_mode:%d,mode:%d)",server->seat->default_mode,data.u); + ipc_send_event(server, "switch_default_mode(old_mode:%d,mode:%d)", + server->seat->default_mode, data.u); server->seat->mode = data.u; server->seat->default_mode = data.u; break; diff --git a/output.c b/output.c index d5ddba0..cf034c3 100644 --- a/output.c +++ b/output.c @@ -480,7 +480,7 @@ output_clear(struct cg_output *output) { static void output_destroy(struct cg_output *output) { struct cg_server *server = output->server; - char *outp_name=strdup(output->wlr_output->name); + char *outp_name = strdup(output->wlr_output->name); wl_list_remove(&output->destroy.link); wl_list_remove(&output->mode.link); @@ -500,11 +500,12 @@ output_destroy(struct cg_output *output) { free(output); - if(outp_name!=NULL) { - ipc_send_event(server,"new_output(output:%s)",outp_name); + if(outp_name != NULL) { + ipc_send_event(server, "new_output(output:%s)", outp_name); free(outp_name); } else { - wlr_log(WLR_ERROR, "Failed to allocate memory for output name in output_destroy"); + wlr_log(WLR_ERROR, + "Failed to allocate memory for output name in output_destroy"); } if(wl_list_empty(&server->outputs)) { wl_display_terminate(server->wl_display); @@ -691,7 +692,7 @@ handle_new_output(struct wl_listener *listener, void *data) { output->workspaces = malloc(server->nws * sizeof(struct cg_workspace *)); for(unsigned int i = 0; i < server->nws; ++i) { output->workspaces[i] = full_screen_workspace(output); - output->workspaces[i]->num=i; + output->workspaces[i]->num = i; if(!output->workspaces[i]) { wlr_log(WLR_ERROR, "Failed to allocate workspaces for output"); return; @@ -718,7 +719,8 @@ handle_new_output(struct wl_listener *listener, void *data) { wl_signal_add(&output->damage->events.frame, &output->damage_frame); output->damage_destroy.notify = handle_output_damage_destroy; wl_signal_add(&output->damage->events.destroy, &output->damage_destroy); - ipc_send_event(server,"new_output(output:%s,priority:%d)",output->wlr_output->name,output->priority); + ipc_send_event(server, "new_output(output:%s,priority:%d)", + output->wlr_output->name, output->priority); } #if CG_HAS_FANALYZE #pragma GCC diagnostic pop diff --git a/view.c b/view.c index afa418b..cdb90df 100644 --- a/view.c +++ b/view.c @@ -18,12 +18,12 @@ #include #include +#include "ipc_server.h" #include "output.h" #include "seat.h" #include "server.h" #include "view.h" #include "workspace.h" -#include "ipc_server.h" #if CG_HAS_XWAYLAND #include "xwayland.h" #endif @@ -251,11 +251,11 @@ view_for_each_popup(struct cg_view *view, wlr_surface_iterator_func_t iterator, void view_unmap(struct cg_view *view) { - uint32_t id=view->id; - uint32_t tile_id=view->tile->id; - uint32_t ws=view->workspace->num; - char *output_name=view->workspace->output->wlr_output->name; - char *title=view->impl->get_title(view); + uint32_t id = view->id; + uint32_t tile_id = view->tile->id; + uint32_t ws = view->workspace->num; + char *output_name = view->workspace->output->wlr_output->name; + char *title = view->impl->get_title(view); /* If the view is not mapped, do nothing */ if(view->wlr_surface == NULL) { return; @@ -309,7 +309,10 @@ view_unmap(struct cg_view *view) { wl_list_remove(&view->new_subsurface.link); view->wlr_surface = NULL; - ipc_send_event(view->workspace->server,"view_unmap(view_id:%d,tile_id:%d,workspace:%d,output:%s,view_title:%s)",id,tile_id,ws+1,output_name,title); + ipc_send_event(view->workspace->server, + "view_unmap(view_id:%d,tile_id:%d,workspace:%d,output:%s," + "view_title:%s)", + id, tile_id, ws + 1, output_name, title); } void @@ -348,7 +351,11 @@ view_map(struct cg_view *view, struct wlr_surface *surface, wl_list_insert(&ws->views, &view->link); } seat_set_focus(output->server->seat, view); - ipc_send_event(output->server,"view_map(view_id:%d,tile_id:%d,workspace:%d,output:%s,view_title:%s)",view->id,view->tile->id,view->workspace->num+1,view->workspace->output->wlr_output->name,view->impl->get_title(view)); + ipc_send_event( + output->server, + "view_map(view_id:%d,tile_id:%d,workspace:%d,output:%s,view_title:%s)", + view->id, view->tile->id, view->workspace->num + 1, + view->workspace->output->wlr_output->name, view->impl->get_title(view)); } void @@ -372,7 +379,7 @@ view_init(struct cg_view *view, enum cg_view_type type, view->server = server; view->type = type; view->impl = impl; - view->id=server->views_curr_id; + view->id = server->views_curr_id; ++server->views_curr_id; wl_list_init(&view->children); diff --git a/workspace.c b/workspace.c index 5b68b63..e7da406 100644 --- a/workspace.c +++ b/workspace.c @@ -26,7 +26,8 @@ int full_screen_workspace_tiles(struct wlr_output_layout *layout, struct wlr_output *output, - struct cg_workspace *workspace, uint32_t *tiles_curr_id) { + struct cg_workspace *workspace, + uint32_t *tiles_curr_id) { workspace->focused_tile = calloc(1, sizeof(struct cg_tile)); if(!workspace->focused_tile) { return -1; @@ -55,9 +56,10 @@ full_screen_workspace(struct cg_output *output) { return NULL; } workspace->server = output->server; - workspace->num=-1; + workspace->num = -1; if(full_screen_workspace_tiles(output->server->output_layout, - output->wlr_output, workspace, &output->server->tiles_curr_id) != 0) { + output->wlr_output, workspace, + &output->server->tiles_curr_id) != 0) { free(workspace); return NULL; } diff --git a/workspace.h b/workspace.h index 51b190e..43eb250 100644 --- a/workspace.h +++ b/workspace.h @@ -30,7 +30,8 @@ full_screen_workspace(struct cg_output *output); int full_screen_workspace_tiles(struct wlr_output_layout *layout, struct wlr_output *output, - struct cg_workspace *workspace, uint32_t *tiles_curr_id); + struct cg_workspace *workspace, + uint32_t *tiles_curr_id); void workspace_free_tiles(struct cg_workspace *workspace); void From 7449faf021d62042b04ee8c38439792ad055ac86 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Wed, 29 Dec 2021 18:35:10 +0100 Subject: [PATCH 328/689] Add documentation for multi-output support * man/cagebreak-config.5 * movetoprevscreen * movetoscreen * screen * addition of prio to output --- man/cagebreak-config.5.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index 670c58e..043b37f 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -168,6 +168,12 @@ by prepending a line with the # symbol. *movetonextscreen* Move the current window to the next screen +*movetoprevscreen* + Move the current window to the previous screen + +*movetoscreen * + Move the currently focused window to the n-th screen + *movetoworkspace * Move the currently focused window to the n-th workspace @@ -180,13 +186,16 @@ by prepending a line with the # symbol. *only* Remove all splits and make the current window fill the entire screen -*output [[pos res x rate ] | enable | disable]* +*output [[pos res x rate ] | enable | disable | prio ]* Configure the output "". and are the position of the monitor in pixels. The top-left monitor should have the coordinates 0 0. and specify the resolution in pixels and sets the refresh rate of the monitor (often this is 50 or 60). The options enable and disable enable or disable the output . Note that if is the only enabled - output, *output disable* has no effect. + output, *output disable* has no effect. prio is used to set the + priority of an output. If nothing else is set, outputs are added as they + request to be added and have a numerical priority of -1. Using prio + it is possible to set priorities for outputs, where >= 1. *prev* Focus previous window in current tile @@ -209,6 +218,9 @@ by prepending a line with the # symbol. *resizeup* Resize the current tile towards the top +*screen * + Change to the n-th screen + *show_info* Display info about the current setup. In particular, print the identifiers of the available inputs and outputs. From 38fee7ea71c392cb5c39c02e8a6aff99be0073bd Mon Sep 17 00:00:00 2001 From: project-repo Date: Wed, 29 Dec 2021 20:10:47 +0100 Subject: [PATCH 329/689] Add explanation of prio --- man/cagebreak-config.5.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index 043b37f..3924574 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -195,7 +195,9 @@ by prepending a line with the # symbol. output, *output disable* has no effect. prio is used to set the priority of an output. If nothing else is set, outputs are added as they request to be added and have a numerical priority of -1. Using prio - it is possible to set priorities for outputs, where >= 1. + it is possible to set priorities for outputs, where >= 1. The larger is, + the higher the priority is, that is to say, the earlier the output will + appear in the list of outputs. *prev* Focus previous window in current tile From 932ce1df5514e64ce33ac025f1c1146c7fc85c06 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Thu, 30 Dec 2021 17:26:12 +0100 Subject: [PATCH 330/689] Remove duplicate documentation --- man/cagebreak-config.5.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index 3924574..2d7bc42 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -21,23 +21,23 @@ by prepending a line with the # symbol. *abort* Return to the default mode without running any command -*background - Set background color* +*background* Set the background color. This command expects three floating point numbers between 0 and 1, specifying the r, g and b values respectively. (e.g. "background 1.0 0.0 0.0" sets to background color to red) There is no support for specifying a background image. -*bind - Bind key to command in root mode* +*bind* This command requires a key (see *KEY DEFINITIONS*) and a command (see *COMMANDS*) as an argument. Subsequently, pressing this key while in command mode executes the supplied action. bind is equivalent to definekey root -*close - Close current window* +*close* This command closes the current window. It may be useful for windows of applications which do not offer any method of closing them. -*definekey - Bind key to action in arbitrary mode* +*definekey* This command behaves similarly to the *bind* command with the difference that the mode in which the keybinding is activated is specified by the user. A call to this function is to be structured as follows: From 5b470aa3d7c928cc899f3ea869d2db2bdfdadc63 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Thu, 30 Dec 2021 22:35:52 +0100 Subject: [PATCH 331/689] Modularize README.md --- Changelog.md | 38 ++++ Hashes.md | 196 +++++++++++++++++ README.md | 585 +++++++++++++++++++++++++++++++-------------------- meson.build | 8 +- 4 files changed, 590 insertions(+), 237 deletions(-) create mode 100644 Changelog.md create mode 100644 Hashes.md diff --git a/Changelog.md b/Changelog.md new file mode 100644 index 0000000..5c16076 --- /dev/null +++ b/Changelog.md @@ -0,0 +1,38 @@ +# Changelog + +## Release 1.0.0 + +Adds basic tiling window manager functionality to cage. + +## Release 1.1.0 + +Unifies commands and actions. See Issue 4 in Bugs.md. + +## Release 1.2.0 + +Adds output configuration as described in the man pages. + +## Release 1.3.0 + +Adds IPC as described in the man pages. + +## Release 1.4.0 + +Adds close command for windows as described in the man pages. + +## Release 1.5.0 + +Adds options to disable or enable outputs. See Issue 22 in Bugs.md and Issue #2 on github. + +## Release 1.6.0 + +Adds support for non-build dependencies and an option for builds without pandoc. + +## Release 1.7.0 + +Improve window ordering. + +## Release 1.8.0 + +Adds libinput configuration and virtual keyboard and pointer support. + diff --git a/Hashes.md b/Hashes.md new file mode 100644 index 0000000..414a315 --- /dev/null +++ b/Hashes.md @@ -0,0 +1,196 @@ +# Hashes + +1.8.2 cagebreak + + * sha 256: f4d275d48ba3d999969f8cb3c8142d27aa8e8d362106ee7575e4b13c02173b2a + * sha 512: 72b11cb966b0978133b9848c2a7f57574c599c7fe895ca9f1cba16930216e1ac8aeae86d976593fc01b15e94ecc1430666f474654cf2fe41eda8c1181bf03f3d + +1.8.2 cagebreak.1 + + * sha 256: 51ee97a7c0b86268cf7622f84f7b1813df8e4a7838c00aae412a611d3693e87a + * sha 512: 5ce826afbee9cbc1129f37463f5b6d4dfc060583f6f7816dd5039b18d66a2b7e22f7293a4aa03acc4e6c690886d0297fef5b9f85d720a4467becfd833b59a160 + +1.8.2 cagebreak-config.5 + + * sha 256: 7c780ba85211ba40c7535b3f10f12312f9edeaa10030228ba21a96724469a325 + * sha 512: 9a56ba16c2aed6f17d4098e54900a5d25602f986e3606dd6ed26563c1920c66404b210dbca9f41bfcc3284bf5a42b750263bcaa2317320f8725e8f9c66e8b893 + +1.8.1 cagebreak + + * sha 256: e3247281d21525413790e3feceae129d9b0559497615d3fdd64ec2fc4ab9ab3d + * sha 512: 8c7c2820be9d7c74e3f9e239c7da740ff41d7f11cd40953dbfbc59c04942077f08625f6d7ec37e6037fd9c4b6950fc4f9af23478080665fdda867c65e0a187bf + +1.8.1 cagebreak.1 + + * sha 256: 96997afdfde9c2719533799aa48c8f036610bb04bc719130d2ab3a3617b072ee + * sha 512: 0831f5d2e3b4f23fd5775df2b7f6486099d64962567222a8fb49e6a40e7d29ed36a7c2c16201bbdcc985ac74f1d0e034b530afbe0ce58d6a0c53d467cff0a6a0 + +1.8.1 cagebreak-config.5 + + * sha 256: bd0e2eb02ba28ec1c8f2bd0fd5cd4c84af24b615fcc477414e49e68e1963cf1b + * sha 512: 7135a2b371294bfdc759a393c13fa0225f1789dba94bb09e96ae689796215b8030280d6cc09c9d1fe139f000f5a4748efd16bb3e5d3b9fcc74a19259802f20ef + +1.8.0 cagebreak + + * sha 256: ac84aa4a08c311da79ca29d92eef4254cb625674b255dbb75621ee6b171a1d79 + * sha 512: c047bb1986fd1d444547e4d64aa7ef9138b3d30327ac3ad9b4c6976e8df6638bae07c39293b5bc9c20e959c0a22b0e40eb2b23b4766d9a5531377ff954b16229 + +1.8.0 cagebreak.1 + + * sha 256: 4de43de7bde67d6d806d206dffc34389f0b5c3ba648bfef673b7bc0adeb29202 + * sha 512: 72aac9a2e9a47f2f85949222d5944dc293332a616e3b961c625fe876172f66638038057c30aa18904d6d969451f468b4fe45e918c0b204cf6952d58ea4c69c33 + +1.8.0 cagebreak-config.5 + + * sha 256: 678aadde06b5ff6bfbd9bc9460423210f9599bcaa0e50c2eae076dc6d6852781 + * sha 512: 72056018fc1c559f26bd7e007b3f1db7d478cec7ec9337620e03a1e3d06910e244a52e8f655ea4f5d73669ffe064bbd23506005d9a6c06764b0f820d7a1df43f + +1.7.4 cagebreak + + * sha 256: c7442db906239b13f8d09e91cbe01f9e47b2a2c75bbb4b52adefd15dfbfa820f + * sha 512: 9c36ce706f31e1b8afacd8f9cd216c460d66030e0b2736a3dd929902b0d5fc52c5e69dbf6787205b8c495d960e00b6e7f633da86ab6e31613f1b4a9fd47c9f0e + +1.7.4 cagebreak.1 + + * sha 256: 3dacc521e5e9b963cceeefeed6a10104c7c415d86826a72788aba5b33ce320f1 + * sha 512: 0a4c4fbff09dd403fed61056ae3211ad2b4370b4e9ed07806fc22624e5312b4a25e469dc0eef1ca4556cbb8efabb0127e7519df79852e110faa98fb17ca377de + +1.7.4 cagebreak-config.5 + + * sha 256: ed22fed1818172f31d3fb3efbe5e66b49f135cb2367b1c85209fd880ff7532ab + * sha 512: cc634c63962ae50b4de20a3aad8ca0970175b53156690d69e6a69fd8f370ad20d84db783cc7e94c61d4d4d89f1205d43622690e58afba549ed57ddad009e3bac + +1.7.3 cagebreak + + * sha 256: 8adb4911d9603fec5b8eb4f67a09be95b8f0b37e50d4ab579191da78df18f70b + * sha 512: eddaecd7b577b9fe77b1ed4d341074f7f860967568392d0479543ea8860b4289df3eb5645885e18e35260b14843663ae50f98103f8016e857237a397632322a6 + +1.7.3 cagebreak.1 + + * sha 256: bcc623e42c86ab65bc2f8cb7e4377ca0d816ddc281527b7caeded62753e943b8 + * sha 512: b4290e1040bd6a299d478ad6b695de75cf030d0d274340b43d3ed4382cf6877f824cd4ed9d7020bfb55afe276c62de7fc07c3fbee6f6485c6440a024115afe12 + +1.7.3 cagebreak-config.5 + + * sha 256: b9789b6abd473e9afb33d4e2c7822f7d8f3c10e9eb3fb70c47b713f6331c626a + * sha 512: c49e01cfc4a4ed272f054bea8f2845f0e3f1609cf85d1a0ce14c1b67dc207df153b11bc20ceef09c855d467f0e013e54623ce9f70c217c4278607fc54d0e3206 + +1.7.2 cagebreak + + * sha 256: 40f4642e8e8caee338055079b046f6e0b790c87226ee307b27a64fcb2a6c6472 + * sha 512: 22c5f1986ca4262a7c08a6c03cffe36eaedd8c3c5e27e12baf12a90f94aea088ac93ee107770f162fc70148be687f6394b8fd64ad3fe14414bdf63b55b33798e + +1.7.2 cagebreak.1 + + * sha 256: 3253e592c40c78fd3733c761163acc2efaaf5865627cf51fd33cc0bc5d9cc6e7 + * sha 512: 901305e166c10aa7e4a26b721a69e0ba4779f4f8ee690551438ceadae65929f13949457872b9397dd46c5b7bad6a6f2638d6fd6df9bc5567c914c798cbf3e9a4 + +1.7.2 cagebreak-config.5 + + * sha 256: 148ec4d80dc9a86485fe77f8daf1f7fa4cb3d1b6aaa709bb012005583779e1f7 + * sha 512: d5732572e47dd07078ac2f6d589522e6007188fc05ac79520c93442212d5c0341459f135191b88c608a75b2f56c2de4065566bd869fbc24e475936d32a54a7f8 + +1.7.1 cagebreak + + * sha 256: 5a40797e016a2fa32b5bb70a056b35c482bef09f1795bbaf0188dbadaf8197c3 + * sha 512: 2ef327b63ac4651f23517be8d5cb8fbec99bd889f52f8abfd62a09ca6e6c0060347ab8d60e4917d39edd36db34597a673239967533f14457733acb97f6c29a7f + +1.7.1 cagebreak.1 + + * sha 256: 0301f04254ae6e7ada7e22bbe7aee022ec0793fbce434a396868258e6f1ea4cf + * sha 512: f0c0c5de30be907e9ba5c9cfa0bca8cef3e94c0b5f52de9e2c3681c85aa957f75e92b5e26bb894c3a5e251295cfe7a1470653cc7dc05564d7d91c6eb43b7409a + +1.7.1 cagebreak-config.5 + + * sha 256: 6882330a77f3ff98ea642f47b4090b38d542abf0b7be3f226486c5614899efc6 + * sha 512: a572f97836e4ccc6d67aa21c7f4aaebe06adb066c70038b670ec1ef267e3750764cb53e96b8d7bc24c7f993f24c0cfabee183307b45006d049f7416559bcaca4 + +1.7.0 + + * sha 256: 5af11b84e61a82a1a276e8f91f6ebc6baafd2c98d22be3da1d01734cc9d55faa + * sha 512: 45474115fb4c28fe1ee91ad54706bfe521b6e70bd8ea619b94a3f50bae426891bf6a0387aa9b2f7f6d18349280c4e84973e4e433d50c090e5a764c64fa67795d + +1.6.0 + + * sha 256: aef473eae73454429afb158d66a7bd9aec75ef915845b7508de5448820357aa8 + * sha 512: 17889bc1af9f343598a5ee599b25e702987dd0bd905a9566874e8a0094c57168e413938624949fa214e6e382cbcf89d7342292b44012cd8e692947f6c01a960a + +1.5.1 + + * sha 256: 9c6df4b94c180f5657cb424383aa2bf3aca063c8e7b40af0497be1ef7bdb858a + * sha 512: 219f753347ae64a4dd593568797438742e9ddae380c729598d8eda863080a6ed4e5086d735fc348c48328bb795a5a5b57b0421be5dd45755744d895b24312627 + +1.5.0 + + * sha 256: 22010e2916493b0d7cfb08c2196f12589509ce11010a7107aed13ddbfd9709cc + * sha 512: 707d6cc01326ba32402f9fb402ff8aceaeaba63ca6ba2eb157e5a4c83123515a3a74da960813479db303eddc2e7f79f39b241dff05b89d47d72d5f1d20ca6d37 + +1.4.4 + + * sha 256: c6e08e19feb17f768e136cf02f5692ef121ff289763dc60ef8678103803d3307 + * sha 512: aebf27fa9c24f93dfd0b7c96536c253e2ea603d6746c40e8de2163e06367bc57ac4e22d6c07dd1e0963cce5b18b460d373e15b5c12a5a42ae6b70787971960c9 + +1.4.3 + + * sha 256: 5e29cbaf7c0c5ca74f71a5605bb3d6e302e051798401fee9a79419720b8d8e95 + * sha 512: 8004865f8603648d9ac9bb700f3ee040e6516c222ad3d783b34219c8fa3a7bdbba6abb74fe92c4d0bd4dbbce0ec4d08be12297a8bad5032baeb589eec557e24e + +1.4.2 + + * sha 256: 27efb9328cf9cab1f81e66627696baf8c7cc2c372339a2890f955b40f3a7c396 + * sha 512: afcdbbce0753aff4770a88ddbd7df5687a7de0c77de3a2d296f85a8b8e01813212be6a0b69548aadef58e0e7da19ffea71c4f3448572656d4b19ff7f2f2fb70a + +1.4.1 + + * sha 256: c3e0ccceaf1078b91071c40b0ccb7c4f8e53ae38b05ee6637f9f39f7f6ece2cb + * sha 512: fd77f39fc7a7e5376d8505a61d643ed4d8f4cfbbf38d70cf9ef6989645e8cc6cb9d4b1024d241dc689b6fd927a405c97b9c918b6994b8f9ab7406646f37b952d + +1.4.0 + + * sha 256: 14aa93d890c62cc763b3b546a51ad8560479d5e91fa9f949858ae6bc785e80be + * sha 512: 88f93b49792684c38553b65d2296a0e502a059814a0cfff30d05c89958870d6f66d67aac2074cfd307bad82b0d72d5c4944822a61a68f665dc161407db365fbc + +1.3.4 + + * sha 256: ea9f634b8f6e2b9f191745a25abff4969eb7ea19cb3186b79a6138904aedeb1c + * sha 512: 9094f9c92acbff8fd95d38e7458c5184804f8913fa8c405bc2b6a0a220fe478b06cfeadbae41bd5ef84bde8d5642c249df9dada953e39c25926aa650c30a5309 + +1.3.3 + + * sha 256: 801851ceb52afac333a1decdd236ddef55555f8b36f865e8b3a831975a496f0d + * sha 512: ce64dd56ab99bba0a83414fecc82d85322e1ca5ca3a2ca77bdc7055b2dd10fd5e20e3ff62809a696d1b04ff0046fed88e2d7538aa447099d7c2d7df8e627b2e0 + +1.3.2 + + * sha 256: 2cefab73b8d5902b30adb0dda1bd292af2ee808d232abcc4b2a2802d522d5232 + * sha 512: 3789efde2cb6f629c77738dd6c8638646b345d5272868aa9b244b2b19c53e6a0f5911d34744e3a9ff6253c73b2b11f6714f37ae86cc21d6979e0c8539315d659 + +1.3.1 + + * sha 256: 71be224cd99d20da4f039675ec5c48213dd14ef027b804501fa3241886b2b08b + * sha 512: d094b786e5a74b01699997a85747943e6de3544cc903dd1c5dba449c66bd925b6378de800d3734969dabf8a20c7004dc3402e3c59577db09ce107b68a1f7bd21 + +1.3.0 + + * sha 256: aecc5292f56f7250d777110cee1f11a92018a9eb2117d7d37cd51d7d3a5cbae0 + * sha 512: 1d2d220f44787a97359a32f305e33185f0369551e61a9d7066023bfa43de50849eba5bcbb0083d2dc563ac993b8d51dd733afa0adb2a823ef50ecfee5624bbc0 + +1.2.1 + + * sha 256: 803f7667dc4997062f9ec95afcdca0cac68c82a7cf057cef83fe1ccfee33b8bc + * sha 512: 4d6b7efea10d190a153f893123b1715f290f4b131b490f3d23f489e2dd8edbb886001282849aad9575ad2f40375bbbded59c1cb6157115fcc14dd6a2a061b103 + +1.2.0 + + * sha 256: b3c6135833001a0ef600ea9628cca11f4130a524ebe748929d8f7bad034f2bf0 + * sha 512: c044a086a9f65b0d27d05e2f12a20fe5d77386fc5682991c13a1894a84804bcd337c9167235869661d6e6581133521bd710ef2330066a5d2e2703d1630042f3f + +1.1.0 + + * sha 256: fc393e225c549f893b9e21e8b904e546d5857bac1d905b3d26334c8f8a1cda11 + * sha 512: 8b94b1069e767202bcab087cb592eadc42f0453d17ee119d48760be00bc66278cf0fa60bb09308d30cb551df6a7a3e26e2ab8b29c04f0e953cc6906542cd2d6f + +1.0.6 + + * sha 256: 712ae9a8f17a9e589e108f0d503da203cc5eaf1c4a6ca6efb5b4c83b432ce0b8 + * sha 512: d574003023a00cfd6623aac986a5a7f397cfd0bc9114017629a8c72731b0df3977c4a31768502dfa8a6607be06930089b2ccf6ffca9b5bcd1096b7ca0aede226 diff --git a/README.md b/README.md index ef88746..99f75d9 100644 --- a/README.md +++ b/README.md @@ -121,7 +121,7 @@ occur. Once any failure occurs the entire checklist must be completed from scrat * [ ] man/cagebreak-config * [ ] Set EPOCH to release day in man generation in meson.build * [ ] wiki - * [ ] README.md Changelog for major and minor releases but not patches + * [ ] Changelog.md for major and minor releases but not patches * [ ] Fixed bugs documented in Bugs.md * [ ] Include issue description from github * [ ] Testing @@ -134,7 +134,7 @@ occur. Once any failure occurs the entire checklist must be completed from scrat * [ ] meson.build reproducible build versions are current archlinux libraries and gcc * [ ] Cagebreak is reproducible on multiple machines * [ ] Documented reproducible build artefacts - * [ ] Hashes of the artefacts in README.md + * [ ] Hashes of the artefacts in Hashes.md * [ ] Renamed previous signatures * [ ] Created gpg signature of the artefacts * [ ] `gpg --detach-sign -u keyid cagebreak` @@ -169,7 +169,7 @@ occur. Once any failure occurs the entire checklist must be completed from scrat * [ ] Checked archive * [ ] tar -xvf release_version.tar.gz * [ ] cd cagebreak - * [ ] meson build --buildtype=release + * [ ] meson build -Dxwayland=true -Dman-pages=true --buildtype=release * [ ] ninja -C build * [ ] gpg --verify ../signatures/cagebreak.sig build/cagebreak * [ ] cd .. @@ -204,200 +204,8 @@ For every release after 1.0.5, hashes will be provided. For every release after 1.7.0, hashes will be provided for man pages too. -1.8.2 cagebreak +See [Hashes.md](Hashes.md) - * sha 256: f4d275d48ba3d999969f8cb3c8142d27aa8e8d362106ee7575e4b13c02173b2a - * sha 512: 72b11cb966b0978133b9848c2a7f57574c599c7fe895ca9f1cba16930216e1ac8aeae86d976593fc01b15e94ecc1430666f474654cf2fe41eda8c1181bf03f3d - -1.8.2 cagebreak.1 - - * sha 256: 51ee97a7c0b86268cf7622f84f7b1813df8e4a7838c00aae412a611d3693e87a - * sha 512: 5ce826afbee9cbc1129f37463f5b6d4dfc060583f6f7816dd5039b18d66a2b7e22f7293a4aa03acc4e6c690886d0297fef5b9f85d720a4467becfd833b59a160 - -1.8.2 cagebreak-config.5 - - * sha 256: 7c780ba85211ba40c7535b3f10f12312f9edeaa10030228ba21a96724469a325 - * sha 512: 9a56ba16c2aed6f17d4098e54900a5d25602f986e3606dd6ed26563c1920c66404b210dbca9f41bfcc3284bf5a42b750263bcaa2317320f8725e8f9c66e8b893 - -1.8.1 cagebreak - - * sha 256: e3247281d21525413790e3feceae129d9b0559497615d3fdd64ec2fc4ab9ab3d - * sha 512: 8c7c2820be9d7c74e3f9e239c7da740ff41d7f11cd40953dbfbc59c04942077f08625f6d7ec37e6037fd9c4b6950fc4f9af23478080665fdda867c65e0a187bf - -1.8.1 cagebreak.1 - - * sha 256: 96997afdfde9c2719533799aa48c8f036610bb04bc719130d2ab3a3617b072ee - * sha 512: 0831f5d2e3b4f23fd5775df2b7f6486099d64962567222a8fb49e6a40e7d29ed36a7c2c16201bbdcc985ac74f1d0e034b530afbe0ce58d6a0c53d467cff0a6a0 - -1.8.1 cagebreak-config.5 - - * sha 256: bd0e2eb02ba28ec1c8f2bd0fd5cd4c84af24b615fcc477414e49e68e1963cf1b - * sha 512: 7135a2b371294bfdc759a393c13fa0225f1789dba94bb09e96ae689796215b8030280d6cc09c9d1fe139f000f5a4748efd16bb3e5d3b9fcc74a19259802f20ef - -1.8.0 cagebreak - - * sha 256: ac84aa4a08c311da79ca29d92eef4254cb625674b255dbb75621ee6b171a1d79 - * sha 512: c047bb1986fd1d444547e4d64aa7ef9138b3d30327ac3ad9b4c6976e8df6638bae07c39293b5bc9c20e959c0a22b0e40eb2b23b4766d9a5531377ff954b16229 - -1.8.0 cagebreak.1 - - * sha 256: 4de43de7bde67d6d806d206dffc34389f0b5c3ba648bfef673b7bc0adeb29202 - * sha 512: 72aac9a2e9a47f2f85949222d5944dc293332a616e3b961c625fe876172f66638038057c30aa18904d6d969451f468b4fe45e918c0b204cf6952d58ea4c69c33 - -1.8.0 cagebreak-config.5 - - * sha 256: 678aadde06b5ff6bfbd9bc9460423210f9599bcaa0e50c2eae076dc6d6852781 - * sha 512: 72056018fc1c559f26bd7e007b3f1db7d478cec7ec9337620e03a1e3d06910e244a52e8f655ea4f5d73669ffe064bbd23506005d9a6c06764b0f820d7a1df43f - -1.7.4 cagebreak - - * sha 256: c7442db906239b13f8d09e91cbe01f9e47b2a2c75bbb4b52adefd15dfbfa820f - * sha 512: 9c36ce706f31e1b8afacd8f9cd216c460d66030e0b2736a3dd929902b0d5fc52c5e69dbf6787205b8c495d960e00b6e7f633da86ab6e31613f1b4a9fd47c9f0e - -1.7.4 cagebreak.1 - - * sha 256: 3dacc521e5e9b963cceeefeed6a10104c7c415d86826a72788aba5b33ce320f1 - * sha 512: 0a4c4fbff09dd403fed61056ae3211ad2b4370b4e9ed07806fc22624e5312b4a25e469dc0eef1ca4556cbb8efabb0127e7519df79852e110faa98fb17ca377de - -1.7.4 cagebreak-config.5 - - * sha 256: ed22fed1818172f31d3fb3efbe5e66b49f135cb2367b1c85209fd880ff7532ab - * sha 512: cc634c63962ae50b4de20a3aad8ca0970175b53156690d69e6a69fd8f370ad20d84db783cc7e94c61d4d4d89f1205d43622690e58afba549ed57ddad009e3bac - -1.7.3 cagebreak - - * sha 256: 8adb4911d9603fec5b8eb4f67a09be95b8f0b37e50d4ab579191da78df18f70b - * sha 512: eddaecd7b577b9fe77b1ed4d341074f7f860967568392d0479543ea8860b4289df3eb5645885e18e35260b14843663ae50f98103f8016e857237a397632322a6 - -1.7.3 cagebreak.1 - - * sha 256: bcc623e42c86ab65bc2f8cb7e4377ca0d816ddc281527b7caeded62753e943b8 - * sha 512: b4290e1040bd6a299d478ad6b695de75cf030d0d274340b43d3ed4382cf6877f824cd4ed9d7020bfb55afe276c62de7fc07c3fbee6f6485c6440a024115afe12 - -1.7.3 cagebreak-config.5 - - * sha 256: b9789b6abd473e9afb33d4e2c7822f7d8f3c10e9eb3fb70c47b713f6331c626a - * sha 512: c49e01cfc4a4ed272f054bea8f2845f0e3f1609cf85d1a0ce14c1b67dc207df153b11bc20ceef09c855d467f0e013e54623ce9f70c217c4278607fc54d0e3206 - -1.7.2 cagebreak - - * sha 256: 40f4642e8e8caee338055079b046f6e0b790c87226ee307b27a64fcb2a6c6472 - * sha 512: 22c5f1986ca4262a7c08a6c03cffe36eaedd8c3c5e27e12baf12a90f94aea088ac93ee107770f162fc70148be687f6394b8fd64ad3fe14414bdf63b55b33798e - -1.7.2 cagebreak.1 - - * sha 256: 3253e592c40c78fd3733c761163acc2efaaf5865627cf51fd33cc0bc5d9cc6e7 - * sha 512: 901305e166c10aa7e4a26b721a69e0ba4779f4f8ee690551438ceadae65929f13949457872b9397dd46c5b7bad6a6f2638d6fd6df9bc5567c914c798cbf3e9a4 - -1.7.2 cagebreak-config.5 - - * sha 256: 148ec4d80dc9a86485fe77f8daf1f7fa4cb3d1b6aaa709bb012005583779e1f7 - * sha 512: d5732572e47dd07078ac2f6d589522e6007188fc05ac79520c93442212d5c0341459f135191b88c608a75b2f56c2de4065566bd869fbc24e475936d32a54a7f8 - -1.7.1 cagebreak - - * sha 256: 5a40797e016a2fa32b5bb70a056b35c482bef09f1795bbaf0188dbadaf8197c3 - * sha 512: 2ef327b63ac4651f23517be8d5cb8fbec99bd889f52f8abfd62a09ca6e6c0060347ab8d60e4917d39edd36db34597a673239967533f14457733acb97f6c29a7f - -1.7.1 cagebreak.1 - - * sha 256: 0301f04254ae6e7ada7e22bbe7aee022ec0793fbce434a396868258e6f1ea4cf - * sha 512: f0c0c5de30be907e9ba5c9cfa0bca8cef3e94c0b5f52de9e2c3681c85aa957f75e92b5e26bb894c3a5e251295cfe7a1470653cc7dc05564d7d91c6eb43b7409a - -1.7.1 cagebreak-config.5 - - * sha 256: 6882330a77f3ff98ea642f47b4090b38d542abf0b7be3f226486c5614899efc6 - * sha 512: a572f97836e4ccc6d67aa21c7f4aaebe06adb066c70038b670ec1ef267e3750764cb53e96b8d7bc24c7f993f24c0cfabee183307b45006d049f7416559bcaca4 - -1.7.0 - - * sha 256: 5af11b84e61a82a1a276e8f91f6ebc6baafd2c98d22be3da1d01734cc9d55faa - * sha 512: 45474115fb4c28fe1ee91ad54706bfe521b6e70bd8ea619b94a3f50bae426891bf6a0387aa9b2f7f6d18349280c4e84973e4e433d50c090e5a764c64fa67795d - -1.6.0 - - * sha 256: aef473eae73454429afb158d66a7bd9aec75ef915845b7508de5448820357aa8 - * sha 512: 17889bc1af9f343598a5ee599b25e702987dd0bd905a9566874e8a0094c57168e413938624949fa214e6e382cbcf89d7342292b44012cd8e692947f6c01a960a - -1.5.1 - - * sha 256: 9c6df4b94c180f5657cb424383aa2bf3aca063c8e7b40af0497be1ef7bdb858a - * sha 512: 219f753347ae64a4dd593568797438742e9ddae380c729598d8eda863080a6ed4e5086d735fc348c48328bb795a5a5b57b0421be5dd45755744d895b24312627 - -1.5.0 - - * sha 256: 22010e2916493b0d7cfb08c2196f12589509ce11010a7107aed13ddbfd9709cc - * sha 512: 707d6cc01326ba32402f9fb402ff8aceaeaba63ca6ba2eb157e5a4c83123515a3a74da960813479db303eddc2e7f79f39b241dff05b89d47d72d5f1d20ca6d37 - -1.4.4 - - * sha 256: c6e08e19feb17f768e136cf02f5692ef121ff289763dc60ef8678103803d3307 - * sha 512: aebf27fa9c24f93dfd0b7c96536c253e2ea603d6746c40e8de2163e06367bc57ac4e22d6c07dd1e0963cce5b18b460d373e15b5c12a5a42ae6b70787971960c9 - -1.4.3 - - * sha 256: 5e29cbaf7c0c5ca74f71a5605bb3d6e302e051798401fee9a79419720b8d8e95 - * sha 512: 8004865f8603648d9ac9bb700f3ee040e6516c222ad3d783b34219c8fa3a7bdbba6abb74fe92c4d0bd4dbbce0ec4d08be12297a8bad5032baeb589eec557e24e - -1.4.2 - - * sha 256: 27efb9328cf9cab1f81e66627696baf8c7cc2c372339a2890f955b40f3a7c396 - * sha 512: afcdbbce0753aff4770a88ddbd7df5687a7de0c77de3a2d296f85a8b8e01813212be6a0b69548aadef58e0e7da19ffea71c4f3448572656d4b19ff7f2f2fb70a - -1.4.1 - - * sha 256: c3e0ccceaf1078b91071c40b0ccb7c4f8e53ae38b05ee6637f9f39f7f6ece2cb - * sha 512: fd77f39fc7a7e5376d8505a61d643ed4d8f4cfbbf38d70cf9ef6989645e8cc6cb9d4b1024d241dc689b6fd927a405c97b9c918b6994b8f9ab7406646f37b952d - -1.4.0 - - * sha 256: 14aa93d890c62cc763b3b546a51ad8560479d5e91fa9f949858ae6bc785e80be - * sha 512: 88f93b49792684c38553b65d2296a0e502a059814a0cfff30d05c89958870d6f66d67aac2074cfd307bad82b0d72d5c4944822a61a68f665dc161407db365fbc - -1.3.4 - - * sha 256: ea9f634b8f6e2b9f191745a25abff4969eb7ea19cb3186b79a6138904aedeb1c - * sha 512: 9094f9c92acbff8fd95d38e7458c5184804f8913fa8c405bc2b6a0a220fe478b06cfeadbae41bd5ef84bde8d5642c249df9dada953e39c25926aa650c30a5309 - -1.3.3 - - * sha 256: 801851ceb52afac333a1decdd236ddef55555f8b36f865e8b3a831975a496f0d - * sha 512: ce64dd56ab99bba0a83414fecc82d85322e1ca5ca3a2ca77bdc7055b2dd10fd5e20e3ff62809a696d1b04ff0046fed88e2d7538aa447099d7c2d7df8e627b2e0 - -1.3.2 - - * sha 256: 2cefab73b8d5902b30adb0dda1bd292af2ee808d232abcc4b2a2802d522d5232 - * sha 512: 3789efde2cb6f629c77738dd6c8638646b345d5272868aa9b244b2b19c53e6a0f5911d34744e3a9ff6253c73b2b11f6714f37ae86cc21d6979e0c8539315d659 - -1.3.1 - - * sha 256: 71be224cd99d20da4f039675ec5c48213dd14ef027b804501fa3241886b2b08b - * sha 512: d094b786e5a74b01699997a85747943e6de3544cc903dd1c5dba449c66bd925b6378de800d3734969dabf8a20c7004dc3402e3c59577db09ce107b68a1f7bd21 - -1.3.0 - - * sha 256: aecc5292f56f7250d777110cee1f11a92018a9eb2117d7d37cd51d7d3a5cbae0 - * sha 512: 1d2d220f44787a97359a32f305e33185f0369551e61a9d7066023bfa43de50849eba5bcbb0083d2dc563ac993b8d51dd733afa0adb2a823ef50ecfee5624bbc0 - -1.2.1 - - * sha 256: 803f7667dc4997062f9ec95afcdca0cac68c82a7cf057cef83fe1ccfee33b8bc - * sha 512: 4d6b7efea10d190a153f893123b1715f290f4b131b490f3d23f489e2dd8edbb886001282849aad9575ad2f40375bbbded59c1cb6157115fcc14dd6a2a061b103 - -1.2.0 - - * sha 256: b3c6135833001a0ef600ea9628cca11f4130a524ebe748929d8f7bad034f2bf0 - * sha 512: c044a086a9f65b0d27d05e2f12a20fe5d77386fc5682991c13a1894a84804bcd337c9167235869661d6e6581133521bd710ef2330066a5d2e2703d1630042f3f - -1.1.0 - - * sha 256: fc393e225c549f893b9e21e8b904e546d5857bac1d905b3d26334c8f8a1cda11 - * sha 512: 8b94b1069e767202bcab087cb592eadc42f0453d17ee119d48760be00bc66278cf0fa60bb09308d30cb551df6a7a3e26e2ab8b29c04f0e953cc6906542cd2d6f - -1.0.6 - - * sha 256: 712ae9a8f17a9e589e108f0d503da203cc5eaf1c4a6ca6efb5b4c83b432ce0b8 - * sha 512: d574003023a00cfd6623aac986a5a7f397cfd0bc9114017629a8c72731b0df3977c4a31768502dfa8a6607be06930089b2ccf6ffca9b5bcd1096b7ca0aede226 #### GPG Signatures @@ -410,7 +218,7 @@ Due to errors in the release process, the releases 1.7.1 and 1.7.2 did not inclu signatures in the appropriate folder of the git repository. However, signatures were provided as release-artefacts at the time of release. The signatures were introduced into the repository with 1.7.3. The integrity of cagebreak is still the same because the signatures were -provided as release-artefacts (which were themselves signed) and the hashes in README.md +provided as release-artefacts (which were themselves signed) and the hashes in Hashes.md are part of a signed release tag. #### Signing Keys @@ -525,41 +333,7 @@ public key or provide the fingerprint and directions to obtain the key. ## Changelog -### Release 1.0.0 - -Adds basic tiling window manager functionality to cage. - -### Release 1.1.0 - -Unifies commands and actions. See Issue 4 in Bugs.md. - -### Release 1.2.0 - -Adds output configuration as described in the man pages. - -### Release 1.3.0 - -Adds IPC as described in the man pages. - -### Release 1.4.0 - -Adds close command for windows as described in the man pages. - -### Release 1.5.0 - -Adds options to disable or enable outputs. See Issue 22 in Bugs.md and Issue #2 on github. - -### Release 1.6.0 - -Adds support for non-build dependencies and an option for builds without pandoc. - -### Release 1.7.0 - -Improve window ordering. - -### Release 1.8.0 - -Adds libinput configuration and virtual keyboard and pointer support. +See [Changelog.md](Changelog.md) ## Contributors @@ -569,4 +343,349 @@ Adds libinput configuration and virtual keyboard and pointer support. ## License -Please see [LICENSE](https://github.com/project-repo/cagebreak/blob/master/LICENSE) +Please see [LICENSE](https://github.com/project-repo/cagebreak/blob/master/LICENSE# Cagebreak: A Wayland Tiling Compositor Inspired by Ratpoison + +This is Cagebreak, a Wayland tiling compositor. The goal of this project is to +provide a successor to ratpoison for Wayland users. However, this is +no reimplementation of ratpoison. Should you like to know if a feature +will be implemented, open an issue or get in touch with the development team. + +For documentation of Cagebreak, please see +the man pages for [cagebreak](man/cagebreak.1.md) and cagebreak +[configuration](man/cagebreak-config.5.md) and the +[Wiki](https://github.com/project-repo/cagebreak/wiki/). + +Cagebreak is based on [Cage](https://github.com/Hjdskes/cage), a Wayland kiosk +compositor. + +Cagebreak is currently being developed under Arch Linux and uses the libraries +as they are obtained through pacman. However, cagebreak should also work on +other distributions given the proper library versions. + +## Installation + +If you are using archlinux, just use the PKGBUILDs from the aur: + + * Using the `cagebreak` package, Cagebreak is compiled on the target system (since release 1.3.0) + * Using `cagebreak-bin` package, the pre-built binaries are extracted to the appropriate paths on the target system (since release 1.3.2) + +See [cagebreak-pkgbuild](https://github.com/project-repo/cagebreak-pkgbuild) for details. + +### Obtaining Source Code + +There are different ways to obtain cagebreak source: + + * git clone (for all releases) + * download release asset tarballs (starting at release 1.2.1) + +### Verifying Source Code + +There are corresponding methods of verifying that you obtained the correct code: + + * our git history includes signed tags for releases + * release assets starting at release 1.2.1 contain a signature for the tarball + +### Building Cagebreak + +You can build Cagebreak with the [meson](https://mesonbuild.com/) build system. It +requires wayland, wlroots and xkbcommon to be installed. Note that Cagebreak is +developed against the latest tag of wlroots, in order not to constantly chase +breaking changes as soon as they occur. + +Simply execute the following steps to build Cagebreak: + +``` +$ meson build +$ ninja -C build +``` + +#### Release Build + +By default, this builds a debug build. To build a release build, use `meson +build --buildtype=release`. + +#### Xwayland Support + +Cagebreak comes with compile-time support for XWayland. To enable this, +first make sure that your version of wlroots is compiled with this +option. Then, add `-Dxwayland=true` to the `meson` command above. Note +that you'll need to have the XWayland binary installed on your system +for this to work. + +#### Man Pages + +Cagebreak has man pages. To use them, make sure that you have `pandoc` +installed. Then, add `-Dman-pages=true` to the `meson` command. + +### Running Cagebreak + +You can start Cagebreak by running `./build/cagebreak`. If you run it from +within an existing X11 or Wayland session, it will open in a virtual output as +a window in your existing session. If you run it in a TTY, it'll run with the +KMS+DRM backend. For more configuration options, see the man pages. + +## Contributing to Cagebreak + +Cagebreak is currently developed to fit the needs of its creators. Should you desire +to implement a feature, please let us know in advance by opening an issue. However, +the feature set is intentionally limited (i.e. we removed support for a desktop +background) and will continue to be so in the future. + +Nonetheless, don't be intimidated by the (slightly lengthy) release checklist or any other +part of this file. Do what you can, open an issue and we will collaborate +toward a solution. + +### Branching Strategy and Versioning + +All features are to be developed on feature branches, named after the feature. + +There exists a branch `development` to which all reasonable feature branches +are merged for final testing. + +Once `development` is ready for a release, meaning that the release checklist is fulfilled, +it is merged into `master`, creating a new release, which is tagged and signed. + +All releases are tagged according to [semantic versioning](https://semver.org) guidelines. + +In the past, our git history did not perfectly reflect this scheme. + +### Releases + +The release checklist must be completely fulfilled in one run for a release to +occur. Once any failure occurs the entire checklist must be completed from scratch. + + * [ ] `git checkout development` + * [ ] `git pull origin development` + * [ ] `git push origin development` + * [ ] `ninja -C build clang-format` makes no changes + * [ ] New version number determined according to [semantic versioning](https://semver.org) guidelines + * [ ] Relevant Documentation completed + * [ ] New features + * [ ] man pages + * [ ] man/cagebreak + * [ ] man/cagebreak-config + * [ ] Set EPOCH to release day in man generation in meson.build + * [ ] wiki + * [ ] Changelog.md for major and minor releases but not patches + * [ ] Fixed bugs documented in Bugs.md + * [ ] Include issue description from github + * [ ] Testing + * [ ] Manual testing + * [ ] Libfuzzer testing + * [ ] Version Number + * [ ] meson.build + * [ ] git tag + * [ ] man pages + * [ ] meson.build reproducible build versions are current archlinux libraries and gcc + * [ ] Cagebreak is reproducible on multiple machines + * [ ] Documented reproducible build artefacts + * [ ] Hashes of the artefacts in Hashes.md + * [ ] Renamed previous signatures + * [ ] Created gpg signature of the artefacts + * [ ] `gpg --detach-sign -u keyid cagebreak` + * [ ] `gpg --detach-sign -u keyid cagebreak.1` + * [ ] `gpg --detach-sign -u keyid cagebreak-config.5` + * [ ] `git add` relevant files + * [ ] `git commit` + * [ ] `git push origin development` + * [ ] Determined commit and tag message (Start with "Release version_number\n\n") + * [ ] Mentioned fixed Bugs.md issues ("Fixed Issue n") + * [ ] Mentioned other important changes + * [ ] `git checkout master` + * [ ] `git merge --squash development` + * [ ] `git commit` and insert message + * [ ] `git tag -u keyid version HEAD` and insert message + * [ ] `git tag -v version` and check output + * [ ] `git push --tags origin master` + * [ ] `git checkout development` + * [ ] `git merge master` + * [ ] `git push --tags origin development` + * [ ] `git archive --prefix=cagebreak/ -o release_version.tar.gz tags/version .` + * [ ] Create release-artefacts_version.tar.gz + * [ ] `mkdir release-artefacts_version` + * [ ] `cp build/cagebreak release-artefacts_version/` + * [ ] `cp build/cagebreak.sig release-artefacts_version/` + * [ ] `cp build/cagebreak.1 release-artefacts_version/` + * [ ] `cp build/cagebreak.1.sig release-artefacts_version/` + * [ ] `cp build/cagebreak-config.5 release-artefacts_version/` + * [ ] `cp build/cagebreak-config.5.sig release-artefacts_version/` + * [ ] `cp LICENSE release-artefacts_version/` + * [ ] `export SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) ; tar --sort=name --mtime= --owner=0 --group=0 --numeric-owner -czf release-artefacts_version.tar.gz release-artefacts_version` + * [ ] Checked archive + * [ ] tar -xvf release_version.tar.gz + * [ ] cd cagebreak + * [ ] meson build -Dxwayland=true -Dman-pages=true --buildtype=release + * [ ] ninja -C build + * [ ] gpg --verify ../signatures/cagebreak.sig build/cagebreak + * [ ] cd .. + * [ ] rm -rf cagebreak + * [ ] `gpg --detach-sign -u keyid release_version.tar.gz` + * [ ] `gpg --detach-sign -u keyid release-artefacts_version.tar.gz` + * [ ] Upload archives and signatures as release assets + +### Reproducible Builds + +Cagebreak offers reproducible builds given the exact library versions specified +in `meson.build`. Should a version mismatch occur, a warning will be emitted. We have +decided on this compromise to allow flexibility and security. In general we will +adapt the versions to the packages available under Arch Linux at the time of +release. + +There are reproducibility issues up to and including release `1.2.0`. See +`Issue 5` in [Bugs.md](Bugs.md). + +#### Reproducible Build Instructions + +All hashes and signatures are provided for the following build instructions. + +``` +meson build -Dxwayland=true -Dman-pages=true --buildtype=release +ninja -C build +``` + +#### Hashes for Builds + +For every release after 1.0.5, hashes will be provided. + +For every release after 1.7.0, hashes will be provided for man pages too. + +See [Hashes.md](Hashes.md) + + +#### GPG Signatures + +For every release after 1.0.5, a GPG signature will be provided in `signatures`. + +The current signature is called `cagebreak.sig`, whereas all older signatures +will be named after their release version. + +Due to errors in the release process, the releases 1.7.1 and 1.7.2 did not include the release +signatures in the appropriate folder of the git repository. However, signatures were provided +as release-artefacts at the time of release. The signatures were introduced into the +repository with 1.7.3. The integrity of cagebreak is still the same because the signatures were +provided as release-artefacts (which were themselves signed) and the hashes in Hashes.md +are part of a signed release tag. + +#### Signing Keys + +All releases are signed by at least one of the following collection of +keys. + + * E79F6D9E113529F4B1FFE4D5C4F974D70CEC2C5B + * 4739D329C9187A1C2795C20A02ABFDEC3A40545F + * 7535AB89220A5C15A728B75F74104CC7DCA5D7A8 + * 827BC2320D535AEAD0540E6E2E66F65D99761A6F + * A88D7431E5BAAD0B6EAE550AC8D61D8BD4FA3C46 + * 8F872885968EB8C589A32E9539ACC012896D450F + * 896B92AF738C974E0065BF42F2576BD366156BB9 + * AA927AFD50AF7C6810E69FE8274F2C605359E31B + +Should we at any point retire a key, we will only replace it with keys signed +by at least one of the above collection. + +We registered project-repo.co and added mail addresses after release `1.3.0`. + +We now have a mail address and its key is signed by signing keys. See Security +Bugs for details. + +The full public keys can be found in `keys/` along with any revocation certificates. + +### GCC and -fanalyzer + +Cagebreak should compile with any reasonably new gcc or clang. Consider +a gcc version of at least [10.1](https://gcc.gnu.org/gcc-10/changes.html) if +you want to get the benefit of the brand-new +[-fanalyzer](https://gcc.gnu.org/onlinedocs/gcc/Static-Analyzer-Options.html) +flag. However, this new flag sometimes produces false-postives and we +selectively disable warnings for affected code segments as described below. + +Meson is configured to set `CG_HAS_FANALYZE` if `-fanalyzer` is available. +Therefore, to maintain portability, false-positive fanalyzer warnings are to be +disabled using the following syntax: + +``` +#if CG_HAS_FANALYZE +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "WARNING OPTION" +#endif +``` +and after + +``` +#if CG_HAS_FANALYZE +#pragma GCC diagnostic pop +#endif +``` + +### Fuzzing + +Along with the project source code, a fuzzing framework based on `libfuzzer` is +supplied. This allows for the testing of the parsing code responsible for reading +the `cagebreak` configuration file. When `libfuzzer` is available (please +use the `clang` compiler to enable it), building the fuzz-testing software can +be enabled by passing `-Dfuzz=true` to meson. This generates a `build/fuzz/fuzz-parse` +binary according to the `libfuzzer` specifications. Further documentation on +how to run this binary can be found [here](https://llvm.org/docs/LibFuzzer.html). + +Here is an example workflow: + +``` +rm -rf build +CC=clang meson build -Dfuzz=true -Db_sanitize=address,undefined -Db_lundef=false +ninja -C build/ +mkdir build/fuzz_corpus +cp examples/config build/fuzz_corpus/ +WLR_BACKENDS=headless ./build/fuzz/fuzz-parse -jobs=12 -max_len=50000 -close_fd_mask=3 build/fuzz_corpus/ +``` + +You may want to tweak `-jobs` or add other options depending on your own setup. +We have found code path discovery to increase rapidly when the fuzzer is supplied +with an initial config file. We are working on improving our fuzzing coverage to +find bugs in other areas of the code. + +#### Caveat + +Currently, there are memory leaks which do not seem to stem from our code but rather +the code of wl-roots or some other library we depend on. We are working on the problem. +In the meantime, add `-Db_detect-leaks=0` to the meson command to exclude memory leaks. + +## Bugs + +For any bug, please [create an +issue](https://github.com/project-repo/cagebreak/issues/new) on +[GitHub](https://github.com/project-rep/cagebreak). + +Fixed bugs are to be assigned a number and summarized inside Bugs.md for future reference +independent of github, in case this service is unavailable. + +### Security Bugs + +Should you want to get in touch with the developers of cagebreak to report a +security vulnerability or a different issue confidentially, contact +`cagebreak @ project-repo . co`. + +We will try to respond to everything that is not obvious spam. + +Please encrypt your email with the appropriate GPG key found in `keys/`. + + * B15B92642760E11FE002DE168708D42451A94AB5 + * F8DD9F8DD12B85A28F5827C4678E34D2E753AA3C + +Note that the keys are signed by cagebreak signing keys. + +If you want us to respond via GPG-encrypted mail, please include your own +public key or provide the fingerprint and directions to obtain the key. + +## Changelog + +See [Changelog.md](Changelog.md) + +## Contributors + + * Aisha Tammy + * [make man pages optional](https://github.com/project-repo/cagebreak/pull/4), released + in 1.6.0 with slight modifications + +## License + +Please see [LICENSE](https://github.com/project-repo/cagebreak/blob/master/LICENSE)) diff --git a/meson.build b/meson.build index b81b261..903ac1a 100644 --- a/meson.build +++ b/meson.build @@ -229,11 +229,11 @@ foreach name, dep : cagebreak_dependencies_dict if reproducible_build_versions[name] != '-1' if dep[1] == false if dep[0].version() < reproducible_build_versions[name] - warning('The installed version of "' + name + '" on your machine (' + dep[0].version() + ') is older than the one used to generate the binary specified in the README section "Reproducible Builds" (' + reproducible_build_versions[name] + '). It is recommended to use an up-to-date version for compiling cagebreak.' + warning('The installed version of "' + name + '" on your machine (' + dep[0].version() + ') is older than the one used to generate the binary specified in Hashes.md (' + reproducible_build_versions[name] + '). It is recommended to use an up-to-date version for compiling cagebreak.' ) endif elif reproducible_build_versions[name] != dep[0].version() - warning('The installed version of "' + name + '" on your machine (' + dep[0].version() + ') differs from the one used to generate the binary specified in the README section "Reproducible Builds" (' + reproducible_build_versions[name] + '). Cagebreak does not guarantee a reproducible build for this configuration.' + warning('The installed version of "' + name + '" on your machine (' + dep[0].version() + ') differs from the one used to generate the binary specified in Hashes.md (' + reproducible_build_versions[name] + '). Cagebreak does not guarantee a reproducible build for this configuration.' ) break endif @@ -244,9 +244,9 @@ reproducible_build_compiler = 'gcc' reproducible_build_compiler_version = '11.1.0' if cc.get_id() != reproducible_build_compiler - warning('The compiler "' + cc.get_id() + '" differs from the one used to generate to binary specified in the README section "Reproducible Builds" (' + reproducible_build_compiler + ').') + warning('The compiler "' + cc.get_id() + '" differs from the one used to generate to binary specified in Hashes.md (' + reproducible_build_compiler + ').') elif cc.version() != reproducible_build_compiler_version - warning('The version of ' + cc.get_id() + ' (' + cc.version() + ') differs from the one used to generate the binary specified in the README section "Reproducible Builds" ' + reproducible_build_compiler_version + '.') + warning('The version of ' + cc.get_id() + ' (' + cc.version() + ') differs from the one used to generate the binary specified in Hashes.md ' + reproducible_build_compiler_version + '.') endif executable( From d71139b500db154de5dab1be814b2d04b04c8020 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Thu, 30 Dec 2021 23:19:28 +0100 Subject: [PATCH 332/689] Fix typo --- Changelog.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Changelog.md b/Changelog.md index 5c16076..c5a2f73 100644 --- a/Changelog.md +++ b/Changelog.md @@ -30,9 +30,12 @@ Adds support for non-build dependencies and an option for builds without pandoc. ## Release 1.7.0 -Improve window ordering. +Improves window ordering. ## Release 1.8.0 Adds libinput configuration and virtual keyboard and pointer support. +## Release 1.9.0 + +Adds TODO see release.delete From 296b106d441e0d5ae495a14b720131367b06f615 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Fri, 31 Dec 2021 12:55:13 +0100 Subject: [PATCH 333/689] Fix README copy error --- README.md | 365 +----------------------------------------------------- 1 file changed, 3 insertions(+), 362 deletions(-) diff --git a/README.md b/README.md index 99f75d9..17e84b1 100644 --- a/README.md +++ b/README.md @@ -308,28 +308,13 @@ In the meantime, add `-Db_detect-leaks=0` to the meson command to exclude memory For any bug, please [create an issue](https://github.com/project-repo/cagebreak/issues/new) on -[GitHub](https://github.com/project-rep/cagebreak). +[GitHub](https://github.com/project-repo/cagebreak). Fixed bugs are to be assigned a number and summarized inside Bugs.md for future reference independent of github, in case this service is unavailable. -### Security Bugs - -Should you want to get in touch with the developers of cagebreak to report a -security vulnerability or a different issue confidentially, contact -`cagebreak @ project-repo . co`. - -We will try to respond to everything that is not obvious spam. - -Please encrypt your email with the appropriate GPG key found in `keys/`. - - * B15B92642760E11FE002DE168708D42451A94AB5 - * F8DD9F8DD12B85A28F5827C4678E34D2E753AA3C - -Note that the keys are signed by cagebreak signing keys. - -If you want us to respond via GPG-encrypted mail, please include your own -public key or provide the fingerprint and directions to obtain the key. +For other means of contacting the Cagebreak authors and for security issues +see [SECURITY.md](SECURITY.md). ## Changelog @@ -345,347 +330,3 @@ See [Changelog.md](Changelog.md) Please see [LICENSE](https://github.com/project-repo/cagebreak/blob/master/LICENSE# Cagebreak: A Wayland Tiling Compositor Inspired by Ratpoison -This is Cagebreak, a Wayland tiling compositor. The goal of this project is to -provide a successor to ratpoison for Wayland users. However, this is -no reimplementation of ratpoison. Should you like to know if a feature -will be implemented, open an issue or get in touch with the development team. - -For documentation of Cagebreak, please see -the man pages for [cagebreak](man/cagebreak.1.md) and cagebreak -[configuration](man/cagebreak-config.5.md) and the -[Wiki](https://github.com/project-repo/cagebreak/wiki/). - -Cagebreak is based on [Cage](https://github.com/Hjdskes/cage), a Wayland kiosk -compositor. - -Cagebreak is currently being developed under Arch Linux and uses the libraries -as they are obtained through pacman. However, cagebreak should also work on -other distributions given the proper library versions. - -## Installation - -If you are using archlinux, just use the PKGBUILDs from the aur: - - * Using the `cagebreak` package, Cagebreak is compiled on the target system (since release 1.3.0) - * Using `cagebreak-bin` package, the pre-built binaries are extracted to the appropriate paths on the target system (since release 1.3.2) - -See [cagebreak-pkgbuild](https://github.com/project-repo/cagebreak-pkgbuild) for details. - -### Obtaining Source Code - -There are different ways to obtain cagebreak source: - - * git clone (for all releases) - * download release asset tarballs (starting at release 1.2.1) - -### Verifying Source Code - -There are corresponding methods of verifying that you obtained the correct code: - - * our git history includes signed tags for releases - * release assets starting at release 1.2.1 contain a signature for the tarball - -### Building Cagebreak - -You can build Cagebreak with the [meson](https://mesonbuild.com/) build system. It -requires wayland, wlroots and xkbcommon to be installed. Note that Cagebreak is -developed against the latest tag of wlroots, in order not to constantly chase -breaking changes as soon as they occur. - -Simply execute the following steps to build Cagebreak: - -``` -$ meson build -$ ninja -C build -``` - -#### Release Build - -By default, this builds a debug build. To build a release build, use `meson -build --buildtype=release`. - -#### Xwayland Support - -Cagebreak comes with compile-time support for XWayland. To enable this, -first make sure that your version of wlroots is compiled with this -option. Then, add `-Dxwayland=true` to the `meson` command above. Note -that you'll need to have the XWayland binary installed on your system -for this to work. - -#### Man Pages - -Cagebreak has man pages. To use them, make sure that you have `pandoc` -installed. Then, add `-Dman-pages=true` to the `meson` command. - -### Running Cagebreak - -You can start Cagebreak by running `./build/cagebreak`. If you run it from -within an existing X11 or Wayland session, it will open in a virtual output as -a window in your existing session. If you run it in a TTY, it'll run with the -KMS+DRM backend. For more configuration options, see the man pages. - -## Contributing to Cagebreak - -Cagebreak is currently developed to fit the needs of its creators. Should you desire -to implement a feature, please let us know in advance by opening an issue. However, -the feature set is intentionally limited (i.e. we removed support for a desktop -background) and will continue to be so in the future. - -Nonetheless, don't be intimidated by the (slightly lengthy) release checklist or any other -part of this file. Do what you can, open an issue and we will collaborate -toward a solution. - -### Branching Strategy and Versioning - -All features are to be developed on feature branches, named after the feature. - -There exists a branch `development` to which all reasonable feature branches -are merged for final testing. - -Once `development` is ready for a release, meaning that the release checklist is fulfilled, -it is merged into `master`, creating a new release, which is tagged and signed. - -All releases are tagged according to [semantic versioning](https://semver.org) guidelines. - -In the past, our git history did not perfectly reflect this scheme. - -### Releases - -The release checklist must be completely fulfilled in one run for a release to -occur. Once any failure occurs the entire checklist must be completed from scratch. - - * [ ] `git checkout development` - * [ ] `git pull origin development` - * [ ] `git push origin development` - * [ ] `ninja -C build clang-format` makes no changes - * [ ] New version number determined according to [semantic versioning](https://semver.org) guidelines - * [ ] Relevant Documentation completed - * [ ] New features - * [ ] man pages - * [ ] man/cagebreak - * [ ] man/cagebreak-config - * [ ] Set EPOCH to release day in man generation in meson.build - * [ ] wiki - * [ ] Changelog.md for major and minor releases but not patches - * [ ] Fixed bugs documented in Bugs.md - * [ ] Include issue description from github - * [ ] Testing - * [ ] Manual testing - * [ ] Libfuzzer testing - * [ ] Version Number - * [ ] meson.build - * [ ] git tag - * [ ] man pages - * [ ] meson.build reproducible build versions are current archlinux libraries and gcc - * [ ] Cagebreak is reproducible on multiple machines - * [ ] Documented reproducible build artefacts - * [ ] Hashes of the artefacts in Hashes.md - * [ ] Renamed previous signatures - * [ ] Created gpg signature of the artefacts - * [ ] `gpg --detach-sign -u keyid cagebreak` - * [ ] `gpg --detach-sign -u keyid cagebreak.1` - * [ ] `gpg --detach-sign -u keyid cagebreak-config.5` - * [ ] `git add` relevant files - * [ ] `git commit` - * [ ] `git push origin development` - * [ ] Determined commit and tag message (Start with "Release version_number\n\n") - * [ ] Mentioned fixed Bugs.md issues ("Fixed Issue n") - * [ ] Mentioned other important changes - * [ ] `git checkout master` - * [ ] `git merge --squash development` - * [ ] `git commit` and insert message - * [ ] `git tag -u keyid version HEAD` and insert message - * [ ] `git tag -v version` and check output - * [ ] `git push --tags origin master` - * [ ] `git checkout development` - * [ ] `git merge master` - * [ ] `git push --tags origin development` - * [ ] `git archive --prefix=cagebreak/ -o release_version.tar.gz tags/version .` - * [ ] Create release-artefacts_version.tar.gz - * [ ] `mkdir release-artefacts_version` - * [ ] `cp build/cagebreak release-artefacts_version/` - * [ ] `cp build/cagebreak.sig release-artefacts_version/` - * [ ] `cp build/cagebreak.1 release-artefacts_version/` - * [ ] `cp build/cagebreak.1.sig release-artefacts_version/` - * [ ] `cp build/cagebreak-config.5 release-artefacts_version/` - * [ ] `cp build/cagebreak-config.5.sig release-artefacts_version/` - * [ ] `cp LICENSE release-artefacts_version/` - * [ ] `export SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) ; tar --sort=name --mtime= --owner=0 --group=0 --numeric-owner -czf release-artefacts_version.tar.gz release-artefacts_version` - * [ ] Checked archive - * [ ] tar -xvf release_version.tar.gz - * [ ] cd cagebreak - * [ ] meson build -Dxwayland=true -Dman-pages=true --buildtype=release - * [ ] ninja -C build - * [ ] gpg --verify ../signatures/cagebreak.sig build/cagebreak - * [ ] cd .. - * [ ] rm -rf cagebreak - * [ ] `gpg --detach-sign -u keyid release_version.tar.gz` - * [ ] `gpg --detach-sign -u keyid release-artefacts_version.tar.gz` - * [ ] Upload archives and signatures as release assets - -### Reproducible Builds - -Cagebreak offers reproducible builds given the exact library versions specified -in `meson.build`. Should a version mismatch occur, a warning will be emitted. We have -decided on this compromise to allow flexibility and security. In general we will -adapt the versions to the packages available under Arch Linux at the time of -release. - -There are reproducibility issues up to and including release `1.2.0`. See -`Issue 5` in [Bugs.md](Bugs.md). - -#### Reproducible Build Instructions - -All hashes and signatures are provided for the following build instructions. - -``` -meson build -Dxwayland=true -Dman-pages=true --buildtype=release -ninja -C build -``` - -#### Hashes for Builds - -For every release after 1.0.5, hashes will be provided. - -For every release after 1.7.0, hashes will be provided for man pages too. - -See [Hashes.md](Hashes.md) - - -#### GPG Signatures - -For every release after 1.0.5, a GPG signature will be provided in `signatures`. - -The current signature is called `cagebreak.sig`, whereas all older signatures -will be named after their release version. - -Due to errors in the release process, the releases 1.7.1 and 1.7.2 did not include the release -signatures in the appropriate folder of the git repository. However, signatures were provided -as release-artefacts at the time of release. The signatures were introduced into the -repository with 1.7.3. The integrity of cagebreak is still the same because the signatures were -provided as release-artefacts (which were themselves signed) and the hashes in Hashes.md -are part of a signed release tag. - -#### Signing Keys - -All releases are signed by at least one of the following collection of -keys. - - * E79F6D9E113529F4B1FFE4D5C4F974D70CEC2C5B - * 4739D329C9187A1C2795C20A02ABFDEC3A40545F - * 7535AB89220A5C15A728B75F74104CC7DCA5D7A8 - * 827BC2320D535AEAD0540E6E2E66F65D99761A6F - * A88D7431E5BAAD0B6EAE550AC8D61D8BD4FA3C46 - * 8F872885968EB8C589A32E9539ACC012896D450F - * 896B92AF738C974E0065BF42F2576BD366156BB9 - * AA927AFD50AF7C6810E69FE8274F2C605359E31B - -Should we at any point retire a key, we will only replace it with keys signed -by at least one of the above collection. - -We registered project-repo.co and added mail addresses after release `1.3.0`. - -We now have a mail address and its key is signed by signing keys. See Security -Bugs for details. - -The full public keys can be found in `keys/` along with any revocation certificates. - -### GCC and -fanalyzer - -Cagebreak should compile with any reasonably new gcc or clang. Consider -a gcc version of at least [10.1](https://gcc.gnu.org/gcc-10/changes.html) if -you want to get the benefit of the brand-new -[-fanalyzer](https://gcc.gnu.org/onlinedocs/gcc/Static-Analyzer-Options.html) -flag. However, this new flag sometimes produces false-postives and we -selectively disable warnings for affected code segments as described below. - -Meson is configured to set `CG_HAS_FANALYZE` if `-fanalyzer` is available. -Therefore, to maintain portability, false-positive fanalyzer warnings are to be -disabled using the following syntax: - -``` -#if CG_HAS_FANALYZE -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "WARNING OPTION" -#endif -``` -and after - -``` -#if CG_HAS_FANALYZE -#pragma GCC diagnostic pop -#endif -``` - -### Fuzzing - -Along with the project source code, a fuzzing framework based on `libfuzzer` is -supplied. This allows for the testing of the parsing code responsible for reading -the `cagebreak` configuration file. When `libfuzzer` is available (please -use the `clang` compiler to enable it), building the fuzz-testing software can -be enabled by passing `-Dfuzz=true` to meson. This generates a `build/fuzz/fuzz-parse` -binary according to the `libfuzzer` specifications. Further documentation on -how to run this binary can be found [here](https://llvm.org/docs/LibFuzzer.html). - -Here is an example workflow: - -``` -rm -rf build -CC=clang meson build -Dfuzz=true -Db_sanitize=address,undefined -Db_lundef=false -ninja -C build/ -mkdir build/fuzz_corpus -cp examples/config build/fuzz_corpus/ -WLR_BACKENDS=headless ./build/fuzz/fuzz-parse -jobs=12 -max_len=50000 -close_fd_mask=3 build/fuzz_corpus/ -``` - -You may want to tweak `-jobs` or add other options depending on your own setup. -We have found code path discovery to increase rapidly when the fuzzer is supplied -with an initial config file. We are working on improving our fuzzing coverage to -find bugs in other areas of the code. - -#### Caveat - -Currently, there are memory leaks which do not seem to stem from our code but rather -the code of wl-roots or some other library we depend on. We are working on the problem. -In the meantime, add `-Db_detect-leaks=0` to the meson command to exclude memory leaks. - -## Bugs - -For any bug, please [create an -issue](https://github.com/project-repo/cagebreak/issues/new) on -[GitHub](https://github.com/project-rep/cagebreak). - -Fixed bugs are to be assigned a number and summarized inside Bugs.md for future reference -independent of github, in case this service is unavailable. - -### Security Bugs - -Should you want to get in touch with the developers of cagebreak to report a -security vulnerability or a different issue confidentially, contact -`cagebreak @ project-repo . co`. - -We will try to respond to everything that is not obvious spam. - -Please encrypt your email with the appropriate GPG key found in `keys/`. - - * B15B92642760E11FE002DE168708D42451A94AB5 - * F8DD9F8DD12B85A28F5827C4678E34D2E753AA3C - -Note that the keys are signed by cagebreak signing keys. - -If you want us to respond via GPG-encrypted mail, please include your own -public key or provide the fingerprint and directions to obtain the key. - -## Changelog - -See [Changelog.md](Changelog.md) - -## Contributors - - * Aisha Tammy - * [make man pages optional](https://github.com/project-repo/cagebreak/pull/4), released - in 1.6.0 with slight modifications - -## License - -Please see [LICENSE](https://github.com/project-repo/cagebreak/blob/master/LICENSE)) From c5800b2223400a7f078d1c967af44e4a38bffa47 Mon Sep 17 00:00:00 2001 From: project-repo Date: Wed, 26 Jan 2022 19:36:10 +0100 Subject: [PATCH 334/689] Switch to wlr_scene api --- cagebreak.c | 73 ++++++-- input_manager.h | 2 +- keybinding.c | 31 ++-- meson.build | 7 +- message.c | 102 +++++++++-- message.h | 5 +- output.c | 476 ++++++++++-------------------------------------- output.h | 26 +-- render.c | 277 ---------------------------- render.h | 9 - seat.c | 88 ++------- seat.h | 1 + server.c | 2 +- server.h | 7 +- util.c | 3 +- view.c | 197 ++------------------ view.h | 53 +----- workspace.c | 9 + workspace.h | 5 +- xdg_shell.c | 249 +++++++++---------------- xdg_shell.h | 12 -- xwayland.c | 59 +----- xwayland.h | 1 - 23 files changed, 404 insertions(+), 1290 deletions(-) delete mode 100644 render.c delete mode 100644 render.h diff --git a/cagebreak.c b/cagebreak.c index 3aea339..3c144da 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -17,9 +17,13 @@ #include #include #include +#include #include #include +#include #include +#include +#include #include #include #include @@ -28,6 +32,8 @@ #include #include #include +#include +#include #include #include #include @@ -133,9 +139,6 @@ usage(FILE *file, const char *const cage) { "\n" " -r\t Rotate the output 90 degrees clockwise, specify up to three " "times\n" -#ifdef DEBUG - " -D\t Turn on damage tracking debugging\n" -#endif " -h\t Display this help message\n" " -v\t Show the version number and exit\n" " -s\t Show information about the current setup and exit\n", @@ -145,11 +148,7 @@ usage(FILE *file, const char *const cage) { static bool parse_args(struct cg_server *server, int argc, char *argv[]) { int c; -#ifdef DEBUG - while((c = getopt(argc, argv, "rDhvs")) != -1) { -#else while((c = getopt(argc, argv, "rhvs")) != -1) { -#endif switch(c) { case 'r': server->output_transform++; @@ -157,11 +156,6 @@ parse_args(struct cg_server *server, int argc, char *argv[]) { server->output_transform = WL_OUTPUT_TRANSFORM_NORMAL; } break; -#ifdef DEBUG - case 'D': - server->debug_damage_tracking = true; - break; -#endif case 'h': usage(stdout, argv[0]); return false; @@ -245,7 +239,6 @@ main(int argc, char *argv[]) { struct wl_event_source *sigterm_source = NULL; struct wl_event_source *sigalrm_source = NULL; struct wlr_backend *backend = NULL; - struct wlr_renderer *renderer = NULL; struct wlr_compositor *compositor = NULL; struct wlr_data_device_manager *data_device_manager = NULL; struct wlr_server_decoration_manager *server_decoration_manager = NULL; @@ -253,6 +246,8 @@ main(int argc, char *argv[]) { struct wlr_export_dmabuf_manager_v1 *export_dmabuf_manager = NULL; struct wlr_screencopy_manager_v1 *screencopy_manager = NULL; struct wlr_data_control_manager_v1 *data_control_manager = NULL; + struct wlr_viewporter *viewporter = NULL; + struct wlr_presentation *presentation = NULL; struct wlr_xdg_output_manager_v1 *output_manager = NULL; struct wlr_gamma_control_manager_v1 *gamma_control_manager = NULL; struct wlr_xdg_shell *xdg_shell = NULL; @@ -353,10 +348,23 @@ main(int argc, char *argv[]) { goto end; } - renderer = wlr_backend_get_renderer(backend); - wlr_renderer_init_wl_display(renderer, server.wl_display); + server.renderer = wlr_renderer_autocreate(backend); + if (!server.renderer) { + wlr_log(WLR_ERROR, "Unable to create the wlroots renderer"); + ret = 1; + goto end; + } - server.bg_color = (float[4]){0, 0, 0, 1}; + server.allocator = wlr_allocator_autocreate(server.backend, server.renderer); + if (!server.allocator) { + wlr_log(WLR_ERROR, "Unable to create the wlroots allocator"); + ret = 1; + goto end; + } + + wlr_renderer_init_wl_display(server.renderer, server.wl_display); + + server.bg_color = (float[4]){0, 0, 1, 1}; wl_list_init(&server.outputs); wl_list_init(&server.disabled_outputs); @@ -373,7 +381,15 @@ main(int argc, char *argv[]) { goto end; } - compositor = wlr_compositor_create(server.wl_display, renderer); + server.scene = wlr_scene_create(); + if (!server.scene) { + wlr_log(WLR_ERROR, "Unable to create scene"); + ret = 1; + goto end; + } + wlr_scene_attach_output_layout(server.scene, server.output_layout); + + compositor = wlr_compositor_create(server.wl_display, server.renderer); if(!compositor) { wlr_log(WLR_ERROR, "Unable to create the wlroots compositor"); ret = 1; @@ -467,6 +483,29 @@ main(int argc, char *argv[]) { goto end; } + viewporter = wlr_viewporter_create(server.wl_display); + if (!viewporter) { + wlr_log(WLR_ERROR, "Unable to create the viewporter interface"); + ret = 1; + goto end; + } + + presentation = wlr_presentation_create(server.wl_display, server.backend); + if (!presentation) { + wlr_log(WLR_ERROR, "Unable to create the presentation interface"); + ret = 1; + goto end; + } + wlr_scene_set_presentation(server.scene, presentation); + + export_dmabuf_manager = wlr_export_dmabuf_manager_v1_create(server.wl_display); + if (!export_dmabuf_manager) { + wlr_log(WLR_ERROR, "Unable to create the export DMABUF manager"); + ret = 1; + goto end; + } + + screencopy_manager = wlr_screencopy_manager_v1_create(server.wl_display); if(!screencopy_manager) { wlr_log(WLR_ERROR, "Unable to create the screencopy manager"); diff --git a/input_manager.h b/input_manager.h index 6a2cdc3..35318f6 100644 --- a/input_manager.h +++ b/input_manager.h @@ -4,7 +4,7 @@ #include "seat.h" #include "server.h" #include -#include +#include struct cg_input_manager * input_manager_create(struct cg_server *server); diff --git a/keybinding.c b/keybinding.c index b5b6380..7314b09 100644 --- a/keybinding.c +++ b/keybinding.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include "input.h" @@ -196,21 +197,13 @@ swap_tile(struct cg_tile *tile, swap_tile->view = tmp_view; if(tile->view != NULL) { view_maximize(tile->view, tile); - view_damage_whole(tile->view); - } else { - wlr_output_damage_add_box(tile->workspace->output->damage, &tile->tile); } workspace_focus_tile( server->curr_output->workspaces[server->curr_output->curr_workspace], swap_tile); if(swap_tile->view != NULL) { view_maximize(swap_tile->view, swap_tile); - view_damage_whole(swap_tile->view); - } else { - wlr_output_damage_add_box(tile->workspace->output->damage, - &swap_tile->tile); } - seat_set_focus(server->seat, swap_tile->view); ipc_send_event( tile->workspace->output->server, @@ -363,12 +356,7 @@ resize(struct cg_tile *tile, const struct cg_tile *parent, int coord_offset, old_height = tile->tile.height, old_width = tile->tile.width; *get_coord(tile) += coord_offset; *get_dim(tile) += dim_offset; - struct wlr_box damage_box = { - .x = old_x, - .y = old_y, - .width = tile->tile.x - old_x == 0 ? tile->tile.width : coord_offset, - .height = tile->tile.y == 0 ? tile->tile.height : coord_offset}; - wlr_output_damage_add_box(tile->workspace->output->damage, &damage_box); + if(tile->view != NULL) { view_maximize(tile->view, tile); } @@ -699,8 +687,6 @@ keybinding_cycle_views(struct cg_server *server, bool reverse) { return; } - wlr_output_damage_add_box(curr_workspace->output->damage, - &curr_workspace->focused_tile->tile); /* Prevent seat_set_focus from reordering the views */ curr_workspace->focused_tile->view = wl_container_of( next_view->link.prev, curr_workspace->focused_tile->view, link); @@ -743,10 +729,9 @@ keybinding_switch_ws(struct cg_server *server, uint32_t ws) { } struct cg_output *output = server->curr_output; uint32_t old_ws = server->curr_output->curr_workspace; - output->curr_workspace = ws; + workspace_focus(output,ws); seat_set_focus(server->seat, server->curr_output->workspaces[ws]->focused_tile->view); - wlr_output_damage_add_whole(output->damage); message_printf(server->curr_output, "Workspace %d", ws + 1); ipc_send_event(output->server, "switch_ws(old_workspace:%d,new_workspace:%d,output:%s)", @@ -794,7 +779,6 @@ keybinding_move_view_to_cycle_output(struct cg_server *server, bool reverse) { server->curr_output->workspaces[server->curr_output->curr_workspace] ->focused_tile->view = NULL; keybinding_cycle_views(server, false); - view_damage_whole(view); if(server->curr_output->workspaces[server->curr_output->curr_workspace] ->focused_tile->view == NULL) { seat_set_focus(server->seat, NULL); @@ -864,7 +848,7 @@ keybinding_set_nws(struct cg_server *server, int nws) { } if(output->curr_workspace >= nws) { - output->curr_workspace = nws - 1; + workspace_focus(output,nws-1); } } server->nws = nws; @@ -908,6 +892,13 @@ keybinding_set_background(struct cg_server *server, float *bg) { server->bg_color[0] = bg[0]; server->bg_color[1] = bg[1]; server->bg_color[2] = bg[2]; + struct cg_output *it=NULL; + wl_list_for_each(it,&server->outputs,link) { + wlr_scene_rect_set_color(it->bg, server->bg_color); + } + wl_list_for_each(it,&server->disabled_outputs,link) { + wlr_scene_rect_set_color(it->bg, server->bg_color); + } } void diff --git a/meson.build b/meson.build index b81b261..6574753 100644 --- a/meson.build +++ b/meson.build @@ -53,12 +53,11 @@ if is_freebsd ) endif -wlroots = dependency('wlroots', version: ['>=0.14.1', '< 0.15.0']) +wlroots = dependency('wlroots', version: ['>=0.14.1', '< 0.16.0']) wayland_protos = dependency('wayland-protocols', version: '>=1.14') wayland_server = dependency('wayland-server') wayland_cursor = dependency('wayland-cursor') wayland_client = dependency('wayland-client') -pixman = dependency('pixman-1') xkbcommon = dependency('xkbcommon') cairo = dependency('cairo') pango = dependency('pango') @@ -132,7 +131,6 @@ cagebreak_source_strings = [ 'workspace.c', 'output.c', 'parse.c', - 'render.c', 'seat.c', 'util.c', 'view.c', @@ -150,7 +148,6 @@ cagebreak_header_strings = [ 'workspace.h', 'output.h', 'parse.h', - 'render.h', 'seat.h', 'server.h', 'util.h', @@ -194,7 +191,6 @@ cagebreak_dependencies_dict = { 'libinput': [libinput,true], 'libevdev': [libevdev,true], 'libudev': [libudev,true], - 'pixman': [pixman,true], 'pango': [pango,true], 'cairo': [cairo,true], 'pangocairo': [pangocairo,true], @@ -212,7 +208,6 @@ reproducible_build_versions = { 'libinput': '1.19.2', 'libevdev': '1.12.0', 'libudev': '249', - 'pixman': '0.40.0', 'pango': '1.50.0', 'cairo': '1.17.4', 'pangocairo': '1.50.0', diff --git a/message.c b/message.c index 7786a07..8e8e0d1 100644 --- a/message.c +++ b/message.c @@ -2,11 +2,16 @@ #include #include #include +#include #include #include #include #include #include +#include +#include +#include +#include #include "message.h" #include "output.h" @@ -14,6 +19,62 @@ #include "server.h" #include "util.h" +struct msg_buffer { + struct wlr_buffer base; + void *data; + uint32_t format; + size_t stride; +}; + +static void msg_buffer_destroy(struct wlr_buffer *wlr_buffer) { + struct msg_buffer *buffer = wl_container_of(wlr_buffer, buffer, base); + free(buffer->data); + free(buffer); +} + +static bool msg_buffer_begin_data_ptr_access(struct wlr_buffer *wlr_buffer, + uint32_t flags, void **data, uint32_t *format, size_t *stride) { + struct msg_buffer *buffer = wl_container_of(wlr_buffer, buffer, base); + if(data != NULL) { + *data = (void *)buffer->data; + } + if(format != NULL) { + *format = buffer->format; + } + if(stride != NULL) { + *stride = buffer->stride; + } + return true; +} + +static void msg_buffer_end_data_ptr_access(struct wlr_buffer *wlr_buffer) { + // This space is intentionally left blank +} + +static const struct wlr_buffer_impl msg_buffer_impl = { + .destroy = msg_buffer_destroy, + .begin_data_ptr_access = msg_buffer_begin_data_ptr_access, + .end_data_ptr_access = msg_buffer_end_data_ptr_access, +}; + +static struct msg_buffer *msg_buffer_create(uint32_t width, uint32_t height, uint32_t stride) { + struct msg_buffer *buffer = calloc(1, sizeof(*buffer)); + if (buffer == NULL) { + return NULL; + } + + wlr_buffer_init(&buffer->base, &msg_buffer_impl, width, height); + buffer->format = DRM_FORMAT_ARGB8888; + buffer->stride = stride; + + buffer->data = malloc(buffer->stride * height); + if (buffer->data == NULL) { + free(buffer); + return NULL; + } + + return buffer; +} cairo_subpixel_order_t to_cairo_subpixel_order(const enum wl_output_subpixel subpixel) { switch(subpixel) { @@ -31,12 +92,11 @@ to_cairo_subpixel_order(const enum wl_output_subpixel subpixel) { return CAIRO_SUBPIXEL_ORDER_DEFAULT; } -struct wlr_texture * +struct msg_buffer * create_message_texture(const char *string, const struct cg_output *output) { const int WIDTH_PADDING = 8; const int HEIGHT_PADDING = 2; - struct wlr_texture *texture; double scale = output->wlr_output->scale; int width = 0; int height = 0; @@ -89,14 +149,21 @@ create_message_texture(const char *string, const struct cg_output *output) { cairo_surface_flush(surface); unsigned char *data = cairo_image_surface_get_data(surface); int stride = cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, width); - struct wlr_renderer *renderer = - wlr_backend_get_renderer(output->wlr_output->backend); - texture = wlr_texture_from_pixels(renderer, DRM_FORMAT_ARGB8888, stride, - width, height, data); + + struct msg_buffer *buf=msg_buffer_create(width, height,stride); + void *data_ptr; + + if(!wlr_buffer_begin_data_ptr_access(&buf->base, WLR_BUFFER_DATA_PTR_ACCESS_WRITE,&data_ptr,NULL,NULL)) { + wlr_log(WLR_ERROR, "Failed to get pointer access to message buffer"); + return NULL; + } + memcpy(data_ptr,data,stride*height); + wlr_buffer_end_data_ptr_access(&buf->base); + cairo_surface_destroy(surface); g_object_unref(pango); cairo_destroy(cairo); - return texture; + return buf; } #if CG_HAS_FANALYZE @@ -112,8 +179,8 @@ message_set_output(struct cg_output *output, const char *string, free(box); return; } - message->message = create_message_texture(string, output); - if(!message->message) { + struct msg_buffer *buf = create_message_texture(string, output); + if(!buf) { wlr_log(WLR_ERROR, "Could not create message texture"); free(box); free(message); @@ -122,8 +189,8 @@ message_set_output(struct cg_output *output, const char *string, message->position = box; wl_list_insert(&output->messages, &message->link); - int width = message->message->width; - int height = message->message->height; + int width = buf->base.width; + int height = buf->base.height; message->position->width = width; message->position->height = height; switch(align) { @@ -149,7 +216,13 @@ message_set_output(struct cg_output *output, const char *string, default: break; } - wlr_output_damage_add_box(output->damage, message->position); + + message->message=wlr_scene_buffer_create(&output->scene_output->scene->node,&buf->base); + wlr_scene_node_raise_to_top(&message->message->node); + wlr_scene_node_set_enabled(&message->message->node,true); + struct wlr_box *outp_box = wlr_output_layout_get_box( + output->server->output_layout, output->wlr_output); + wlr_scene_node_set_position(&message->message->node, message->position->x+outp_box->x, message->position->y+outp_box->y); } void @@ -206,9 +279,10 @@ message_clear(struct cg_output *output) { struct cg_message *message, *tmp; wl_list_for_each_safe(message, tmp, &output->messages, link) { wl_list_remove(&message->link); - wlr_output_damage_add_box(output->damage, message->position); - wlr_texture_destroy(message->message); + struct wlr_buffer *buf=message->message->buffer; + wlr_scene_node_destroy(&message->message->node); free(message->position); + buf->impl->destroy(buf); free(message); } } diff --git a/message.h b/message.h index b1081ab..e672f5d 100644 --- a/message.h +++ b/message.h @@ -6,7 +6,7 @@ struct cg_output; struct wlr_box; -struct wlr_texture; +struct wlr_buffer; enum cg_message_align { CG_MESSAGE_TOP_LEFT, @@ -25,7 +25,8 @@ struct cg_message_config { struct cg_message { struct wlr_box *position; - struct wlr_texture *message; + struct wlr_scene_buffer *message; + struct wl_surface *surface; struct wl_list link; }; diff --git a/output.c b/output.c index cf034c3..a31e575 100644 --- a/output.c +++ b/output.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -34,7 +35,6 @@ #include "keybinding.h" #include "message.h" #include "output.h" -#include "render.h" #include "seat.h" #include "server.h" #include "util.h" @@ -44,367 +44,6 @@ #include "xwayland.h" #endif -static void -output_for_each_surface(struct cg_output *output, - cg_surface_iterator_func_t iterator, void *user_data); - -struct surface_iterator_data { - cg_surface_iterator_func_t user_iterator; - void *user_data; - - struct cg_output *output; - - /* Output-local coordinates. */ - double ox, oy; -}; - -static bool -intersects_with_output(struct cg_output *output, - const struct wlr_output_layout *output_layout, - const struct wlr_box *surface_box) { - /* Since the surface_box's x- and y-coordinates are already output local, - * the x- and y-coordinates of this box need to be 0 for this function to - * work correctly. */ - struct wlr_box output_box = {0}; - wlr_output_effective_resolution(output->wlr_output, &output_box.width, - &output_box.height); - - struct wlr_box intersection; - return wlr_box_intersection(&intersection, &output_box, surface_box); -} - -static void -output_for_each_surface_iterator(struct wlr_surface *surface, int sx, int sy, - void *user_data) { - struct surface_iterator_data *data = user_data; - struct cg_output *output = data->output; - - if(!wlr_surface_has_buffer(surface)) { - return; - } - - struct wlr_box surface_box = { - .x = data->ox + sx + surface->sx, - .y = data->oy + sy + surface->sy, - .width = surface->current.width, - .height = surface->current.height, - }; - - if(!intersects_with_output(output, output->server->output_layout, - &surface_box)) { - return; - } - - data->user_iterator(data->output, surface, &surface_box, data->user_data); -} - -void -output_surface_for_each_surface(struct cg_output *output, - struct wlr_surface *surface, double ox, - double oy, cg_surface_iterator_func_t iterator, - void *user_data) { - struct surface_iterator_data data = { - .user_iterator = iterator, - .user_data = user_data, - .output = output, - .ox = ox, - .oy = oy, - }; - - wlr_surface_for_each_surface(surface, output_for_each_surface_iterator, - &data); -} - -static void -output_view_for_each_surface(struct cg_output *output, struct cg_view *view, - cg_surface_iterator_func_t iterator, - void *user_data) { - struct surface_iterator_data data = { - .user_iterator = iterator, - .user_data = user_data, - .output = output, - .ox = view->ox, - .oy = view->oy, - }; - - view_for_each_surface(view, output_for_each_surface_iterator, &data); -} - -void -output_view_for_each_popup(struct cg_output *output, struct cg_view *view, - cg_surface_iterator_func_t iterator, - void *user_data) { - struct surface_iterator_data data = { - .user_iterator = iterator, - .user_data = user_data, - .output = output, - .ox = view->ox, - .oy = view->oy, - }; - - view_for_each_popup(view, output_for_each_surface_iterator, &data); -} - -void -output_drag_icons_for_each_surface(struct cg_output *output, - struct wl_list *drag_icons, - cg_surface_iterator_func_t iterator, - void *user_data) { - struct cg_drag_icon *drag_icon; - wl_list_for_each(drag_icon, drag_icons, link) { - if(drag_icon->wlr_drag_icon->mapped) { - double ox = drag_icon->lx; - double oy = drag_icon->ly; - wlr_output_layout_output_coords(output->server->output_layout, - output->wlr_output, &ox, &oy); - output_surface_for_each_surface(output, - drag_icon->wlr_drag_icon->surface, - ox, oy, iterator, user_data); - } - } -} - -static void -output_for_each_surface(struct cg_output *output, - cg_surface_iterator_func_t iterator, void *user_data) { - struct cg_view *view; - wl_list_for_each_reverse( - view, &output->workspaces[output->curr_workspace]->views, link) { - output_view_for_each_surface(output, view, iterator, user_data); - } - - wl_list_for_each_reverse( - view, &output->workspaces[output->curr_workspace]->unmanaged_views, - link) { - output_view_for_each_surface(output, view, iterator, user_data); - } - - output_drag_icons_for_each_surface( - output, &output->server->seat->drag_icons, iterator, user_data); -} - -struct send_frame_done_data { - struct timespec when; -}; - -static void -send_frame_done_iterator(struct cg_output *output, struct wlr_surface *surface, - struct wlr_box *box, void *user_data) { - struct send_frame_done_data *data = user_data; - wlr_surface_send_frame_done(surface, &data->when); -} - -static void -send_frame_done(struct cg_output *output, struct send_frame_done_data *data) { - output_for_each_surface(output, send_frame_done_iterator, data); -} - -struct damage_data { - bool whole; -}; - -static void -count_surface_iterator(struct cg_output *output, struct wlr_surface *surface, - struct wlr_box *_box, void *data) { - size_t *n = data; - (*n)++; -} - -static bool -scan_out_primary_view(struct cg_output *output) { - struct cg_server *server = output->server; - struct wlr_output *wlr_output = output->wlr_output; - - if(!wl_list_empty(&output->messages)) { - return false; - } - - struct cg_drag_icon *drag_icon; - wl_list_for_each(drag_icon, &server->seat->drag_icons, link) { - if(drag_icon->wlr_drag_icon->mapped) { - return false; - } - } - - struct cg_workspace *ws = output->workspaces[output->curr_workspace]; - if(ws->focused_tile->next != ws->focused_tile) { - return false; - } - - struct cg_view *view = ws->focused_tile->view; - if(view == NULL || view->wlr_surface == NULL) { - return false; - } - - size_t n_surfaces = 0; - output_view_for_each_surface(output, view, count_surface_iterator, - &n_surfaces); - if(n_surfaces > 1) { - return false; - } - -#if CG_HAS_XWAYLAND - if(view->type == CG_XWAYLAND_VIEW) { - struct cg_xwayland_view *xwayland_view = xwayland_view_from_view(view); - if(!wl_list_empty(&xwayland_view->xwayland_surface->children) || - !wl_list_empty(&view->workspace->unmanaged_views)) { - return false; - } - } -#endif - - struct wlr_surface *surface = view->wlr_surface; - - if(!surface->buffer) { - return false; - } - - if((float)surface->current.scale != wlr_output->scale || - surface->current.transform != wlr_output->transform) { - return false; - } - - wlr_output_attach_buffer(wlr_output, &surface->buffer->base); - if(!wlr_output_test(wlr_output)) { - return false; - } - return wlr_output_commit(wlr_output); -} - -static void -damage_surface_iterator(struct cg_output *output, struct wlr_surface *surface, - struct wlr_box *box, void *user_data) { - struct wlr_output *wlr_output = output->wlr_output; - struct damage_data *data = (struct damage_data *)user_data; - bool whole = data->whole; - - scale_box(box, output->wlr_output->scale); - - if(whole) { - wlr_output_damage_add_box(output->damage, box); - } else if(pixman_region32_not_empty(&surface->buffer_damage)) { - pixman_region32_t damage; - pixman_region32_init(&damage); - wlr_surface_get_effective_damage(surface, &damage); - - if(ceil(wlr_output->scale) > surface->current.scale) { - /* When scaling up a surface it'll become - blurry, so we need to expand the damage - region. */ - wlr_region_expand(&damage, &damage, - ceil(wlr_output->scale) - surface->current.scale); - } - pixman_region32_translate(&damage, box->x, box->y); - wlr_output_damage_add(output->damage, &damage); - pixman_region32_fini(&damage); - } -} - -void -output_damage_surface(struct cg_output *output, struct wlr_surface *surface, - double ox, double oy, bool whole) { - struct damage_data data = { - .whole = whole, - }; - - output_surface_for_each_surface(output, surface, ox, oy, - damage_surface_iterator, &data); -} - -static void -handle_output_damage_frame(struct wl_listener *listener, void *data) { - struct cg_output *output = wl_container_of(listener, output, damage_frame); - struct send_frame_done_data frame_data = {0}; - - if(!output->wlr_output->enabled) { - return; - } - - bool scanned_out = scan_out_primary_view(output); - - if(scanned_out && !output->last_scanned_out_view) { - wlr_log(WLR_DEBUG, "Scanning out primary view"); - } - if(output->last_scanned_out_view && !scanned_out) { - wlr_log(WLR_DEBUG, "Stopping primary view scan out"); - wlr_output_damage_add_whole(output->damage); - output->last_scanned_out_view = NULL; - } - if(output->last_scanned_out_view && - output->last_scanned_out_view != seat_get_focus(output->server->seat)) { - wlr_output_damage_add_whole(output->damage); - } - if(scanned_out) { - output->last_scanned_out_view = - output->workspaces[output->curr_workspace]->focused_tile->view; - } - - if(scanned_out) { - goto frame_done; - } - - bool needs_frame; - pixman_region32_t damage; - pixman_region32_init(&damage); - if(!wlr_output_damage_attach_render(output->damage, &needs_frame, - &damage)) { - wlr_log(WLR_ERROR, "Cannot make damage output current"); - goto damage_finish; - } - - if(!needs_frame) { - wlr_output_rollback(output->wlr_output); - goto damage_finish; - } - - output_render(output, &damage); - -damage_finish: - pixman_region32_fini(&damage); - -frame_done: - clock_gettime(CLOCK_MONOTONIC, &frame_data.when); - send_frame_done(output, &frame_data); -} - -static void -handle_output_commit(struct wl_listener *listener, void *data) { - struct cg_output *output = wl_container_of(listener, output, commit); - struct wlr_output_event_commit *event = data; - - if(!output->wlr_output->enabled || output->workspaces == NULL) { - return; - } - - if(event->committed & - (WLR_OUTPUT_STATE_TRANSFORM | WLR_OUTPUT_STATE_SCALE)) { - struct cg_view *view; - wl_list_for_each( - view, &output->workspaces[output->curr_workspace]->views, link) { - if(view_is_visible(view)) { - view_maximize(view, view->tile); - } - } - } -} - -static void -handle_output_mode(struct wl_listener *listener, void *data) { - struct cg_output *output = wl_container_of(listener, output, mode); - - if(!output->wlr_output->enabled || output->workspaces == NULL) { - return; - } - - struct cg_view *view; - wl_list_for_each(view, &output->workspaces[output->curr_workspace]->views, - link) { - if(view_is_visible(view)) { - view_maximize(view, view->tile); - } - } -} - void output_clear(struct cg_output *output) { struct cg_server *server = output->server; @@ -485,8 +124,7 @@ output_destroy(struct cg_output *output) { wl_list_remove(&output->destroy.link); wl_list_remove(&output->mode.link); wl_list_remove(&output->commit.link); - wl_list_remove(&output->damage_frame.link); - wl_list_remove(&output->damage_destroy.link); + wl_list_remove(&output->frame.link); output_clear(output); @@ -513,17 +151,22 @@ output_destroy(struct cg_output *output) { } static void -handle_output_damage_destroy(struct wl_listener *listener, void *data) { - struct cg_output *output = - wl_container_of(listener, output, damage_destroy); +handle_output_destroy(struct wl_listener *listener, void *data) { + struct cg_output *output = wl_container_of(listener, output, destroy); output_destroy(output); } static void -handle_output_destroy(struct wl_listener *listener, void *data) { - struct cg_output *output = wl_container_of(listener, output, destroy); - wlr_output_damage_destroy(output->damage); - output_destroy(output); +handle_output_frame(struct wl_listener *listener, void *data) { + struct cg_output *output=wl_container_of(listener, output, frame); + if(!output->wlr_output->enabled) { + return; + } + wlr_scene_output_commit(output->scene_output); + + struct timespec now={0}; + clock_gettime(CLOCK_MONOTONIC, &now); + wlr_scene_output_send_frame_done(output->scene_output, &now); } struct cg_output_config * @@ -570,6 +213,19 @@ output_set_mode(struct wlr_output *output, int width, int height, wlr_log(WLR_DEBUG, "Assigning configured mode to %s", output->name); } wlr_output_set_mode(output, best); + if(!wlr_output_test(output)) { + wlr_log(WLR_ERROR, "Unable to assign configured mode to %s, picking arbitrary available mode",output->name); + struct wlr_output_mode *mode; + wl_list_for_each(mode, &output->modes, link) { + if(mode == best) { + continue; + } + wlr_output_set_mode(output, mode); + if(wlr_output_test(output)) { + break; + } + } + } } void @@ -642,6 +298,59 @@ output_configure(struct cg_server *server, struct cg_output *output) { wlr_output_commit(wlr_output); } } + struct wlr_scene_output *scene_output; + wl_list_for_each(scene_output,&output->server->scene->outputs,link) { + if(scene_output->output == wlr_output) { + output->scene_output=scene_output; + break; + } + } + if(output->bg!=NULL) { + wlr_scene_node_destroy(&output->bg->node); + } + output->bg=wlr_scene_rect_create(&output->scene_output->scene->node, output->wlr_output->width,output->wlr_output->height, server->bg_color); + struct wlr_box *box = wlr_output_layout_get_box( + server->output_layout, output->wlr_output); + wlr_scene_node_set_position(&output->bg->node, box->x, box->y); + wlr_scene_node_lower_to_bottom(&output->bg->node); +} + +static void +handle_output_commit(struct wl_listener *listener, void *data) { + struct cg_output *output = wl_container_of(listener, output, commit); + struct wlr_output_event_commit *event = data; + + if(!output->wlr_output->enabled || output->workspaces == NULL) { + return; + } + + if(event->committed & + (WLR_OUTPUT_STATE_TRANSFORM | WLR_OUTPUT_STATE_SCALE)) { + struct cg_view *view; + wl_list_for_each( + view, &output->workspaces[output->curr_workspace]->views, link) { + if(view_is_visible(view)) { + view_maximize(view, view->tile); + } + } + } +} + +static void +handle_output_mode(struct wl_listener *listener, void *data) { + struct cg_output *output = wl_container_of(listener, output, mode); + + if(!output->wlr_output->enabled || output->workspaces == NULL) { + return; + } + + struct cg_view *view; + wl_list_for_each(view, &output->workspaces[output->curr_workspace]->views, + link) { + if(view_is_visible(view)) { + view_maximize(view, view->tile); + } + } } #if CG_HAS_FANALYZE @@ -653,6 +362,11 @@ handle_new_output(struct wl_listener *listener, void *data) { struct cg_server *server = wl_container_of(listener, server, new_output); struct wlr_output *wlr_output = data; + if(!wlr_output_init_render(wlr_output,server->allocator,server->renderer)) { + wlr_log(WLR_ERROR, "Failed to initialize output rendering"); + return; + } + struct cg_output *output = calloc(1, sizeof(struct cg_output)); if(!output) { wlr_log(WLR_ERROR, "Failed to allocate output"); @@ -661,7 +375,6 @@ handle_new_output(struct wl_listener *listener, void *data) { output->wlr_output = wlr_output; output->server = server; - output->damage = wlr_output_damage_create(wlr_output); output->last_scanned_out_view = NULL; struct cg_output_priorities *it; @@ -675,7 +388,6 @@ handle_new_output(struct wl_listener *listener, void *data) { wlr_output_set_transform(wlr_output, server->output_transform); output->workspaces = NULL; - output->curr_workspace = 0; wl_list_init(&output->messages); if(!wlr_xcursor_manager_load(server->seat->xcursor_manager, @@ -687,7 +399,6 @@ handle_new_output(struct wl_listener *listener, void *data) { output_insert(server, output); output_configure(server, output); - wlr_output_damage_add_whole(output->damage); output->workspaces = malloc(server->nws * sizeof(struct cg_workspace *)); for(unsigned int i = 0; i < server->nws; ++i) { @@ -701,6 +412,9 @@ handle_new_output(struct wl_listener *listener, void *data) { wl_list_init(&output->workspaces[i]->unmanaged_views); } + wlr_scene_node_raise_to_top(&output->workspaces[0]->scene->node); + workspace_focus(output,0); + /* We are the first output. Set the current output to this one. */ if(server->curr_output == NULL) { server->curr_output = output; @@ -709,16 +423,14 @@ handle_new_output(struct wl_listener *listener, void *data) { DEFAULT_XCURSOR, server->seat->cursor); wlr_cursor_warp(server->seat->cursor, NULL, 0, 0); - output->mode.notify = handle_output_mode; - wl_signal_add(&wlr_output->events.mode, &output->mode); - output->commit.notify = handle_output_commit; - wl_signal_add(&wlr_output->events.commit, &output->commit); output->destroy.notify = handle_output_destroy; wl_signal_add(&wlr_output->events.destroy, &output->destroy); - output->damage_frame.notify = handle_output_damage_frame; - wl_signal_add(&output->damage->events.frame, &output->damage_frame); - output->damage_destroy.notify = handle_output_damage_destroy; - wl_signal_add(&output->damage->events.destroy, &output->damage_destroy); + output->frame.notify = handle_output_frame; + wl_signal_add(&wlr_output->events.frame, &output->frame); + output->commit.notify = handle_output_commit; + wl_signal_add(&wlr_output->events.commit, &output->commit); + output->mode.notify = handle_output_mode; + wl_signal_add(&wlr_output->events.mode, &output->mode); ipc_send_event(server, "new_output(output:%s,priority:%d)", output->wlr_output->name, output->priority); } diff --git a/output.h b/output.h index 796d0f4..787efdd 100644 --- a/output.h +++ b/output.h @@ -2,24 +2,23 @@ #define CG_OUTPUT_H #include -#include +#include struct cg_server; struct cg_view; struct wlr_output; -struct wlr_output_damage; struct wlr_surface; struct cg_output { struct cg_server *server; struct wlr_output *wlr_output; - struct wlr_output_damage *damage; + struct wlr_scene_output *scene_output; + struct wlr_scene_rect *bg; struct wl_listener mode; struct wl_listener commit; struct wl_listener destroy; - struct wl_listener damage_frame; - struct wl_listener damage_destroy; + struct wl_listener frame; struct cg_workspace **workspaces; struct wl_list messages; int curr_workspace; @@ -56,23 +55,6 @@ handle_new_output(struct wl_listener *listener, void *data); void output_configure(struct cg_server *server, struct cg_output *output); void -output_surface_for_each_surface(struct cg_output *output, - struct wlr_surface *surface, double ox, - double oy, cg_surface_iterator_func_t iterator, - void *user_data); -void -output_view_for_each_popup(struct cg_output *output, struct cg_view *view, - cg_surface_iterator_func_t iterator, - void *user_data); -void -output_drag_icons_for_each_surface(struct cg_output *output, - struct wl_list *drag_icons, - cg_surface_iterator_func_t iterator, - void *user_data); -void -output_damage_surface(struct cg_output *output, struct wlr_surface *surface, - double ox, double oy, bool whole); -void output_set_window_title(struct cg_output *output, const char *title); #endif diff --git a/render.c b/render.c deleted file mode 100644 index ca4a2d2..0000000 --- a/render.c +++ /dev/null @@ -1,277 +0,0 @@ -/* - * Cagebreak: A Wayland tiling compositor. - * - * Copyright (C) 2020-2022 The Cagebreak Authors - * Copyright (C) 2018-2020 Jente Hidskes - * Copyright (C) 2019 The Sway authors - * - * See the LICENSE file accompanying this file. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "message.h" -#include "output.h" -#include "seat.h" -#include "server.h" -#include "util.h" -#include "view.h" -#include "workspace.h" - -static void -scissor_output(struct wlr_output *output, pixman_box32_t *rect) { - struct wlr_renderer *renderer = wlr_backend_get_renderer(output->backend); - - struct wlr_box box = { - .x = rect->x1, - .y = rect->y1, - .width = rect->x2 - rect->x1, - .height = rect->y2 - rect->y1, - }; - - int output_width, output_height; - wlr_output_transformed_resolution(output, &output_width, &output_height); - enum wl_output_transform transform = - wlr_output_transform_invert(output->transform); - wlr_box_transform(&box, &box, transform, output_width, output_height); - - wlr_renderer_scissor(renderer, &box); -} - -struct render_data { - pixman_region32_t *damage; - int tile_width, tile_height; -}; - -static void -render_texture(struct wlr_output *wlr_output, pixman_region32_t *output_damage, - struct wlr_texture *texture, const struct wlr_box *box, - const float matrix[static 9]) { - struct wlr_renderer *renderer = - wlr_backend_get_renderer(wlr_output->backend); - - pixman_region32_t damage; - pixman_region32_init(&damage); - pixman_region32_union_rect(&damage, &damage, box->x, box->y, box->width, - box->height); - pixman_region32_intersect(&damage, &damage, output_damage); - if(!pixman_region32_not_empty(&damage)) { - goto damage_finish; - } - - int nrects; - pixman_box32_t *rects = pixman_region32_rectangles(&damage, &nrects); - for(int i = 0; i < nrects; i++) { - scissor_output(wlr_output, &rects[i]); - wlr_render_texture_with_matrix(renderer, texture, matrix, 1.0F); - } - -damage_finish: - pixman_region32_fini(&damage); -} - -static void -render_surface_iterator(struct cg_output *output, struct wlr_surface *surface, - struct wlr_box *box, void *user_data) { - struct render_data *data = user_data; - struct wlr_output *wlr_output = output->wlr_output; - pixman_region32_t *output_damage = data->damage; - - struct wlr_texture *texture = wlr_surface_get_texture(surface); - if(!texture) { - wlr_log(WLR_DEBUG, "Cannot obtain surface texture"); - return; - } - - scale_box(box, wlr_output->scale); - - float matrix[9]; - enum wl_output_transform transform = - wlr_output_transform_invert(surface->current.transform); - wlr_matrix_project_box(matrix, box, transform, 0.0F, - wlr_output->transform_matrix); - - if(data->tile_width != 0) { - box->width = - box->width > data->tile_width ? data->tile_width : box->width; - } - if(data->tile_height != 0) { - box->height = - box->height > data->tile_height ? data->tile_height : box->height; - } - render_texture(wlr_output, output_damage, texture, box, matrix); -} - -static void -render_drag_icons(struct cg_output *output, pixman_region32_t *damage, - struct wl_list *drag_icons) { - struct render_data data = { - .damage = damage, - .tile_width = 0, - .tile_height = 0, - }; - output_drag_icons_for_each_surface(output, drag_icons, - render_surface_iterator, &data); -} - -/** - * Render all toplevels without descending into popups. - */ -static void -render_view_toplevels(struct cg_view *view, struct cg_output *output, - pixman_region32_t *damage) { - struct render_data data = { - .damage = damage, - .tile_width = 0, - .tile_height = 0, - }; - struct cg_tile *view_tile = view_get_tile(view); - if(view_tile != NULL) { - if(view_tile->tile.width != view->wlr_surface->current.width || - view_tile->tile.height != view->wlr_surface->current.height) { - view_damage_whole(view); - } - data.tile_width = view_tile->tile.width; - data.tile_height = view_tile->tile.height; - } - - double ox, oy; - ox = view->ox; - oy = view->oy; - output_surface_for_each_surface(output, view->wlr_surface, ox, oy, - render_surface_iterator, &data); -} - -static void -render_popup_iterator(struct cg_output *output, struct wlr_surface *surface, - struct wlr_box *box, void *data) { - /* Render this popup's surface. */ - render_surface_iterator(output, surface, box, data); - - /* Render this popup's child toplevels. */ - output_surface_for_each_surface(output, surface, box->x, box->y, - render_surface_iterator, data); -} - -static void -render_view_popups(struct cg_view *view, struct cg_output *output, - pixman_region32_t *damage) { - struct render_data data = { - .damage = damage, - .tile_width = 0, - .tile_height = 0, - }; - output_view_for_each_popup(output, view, render_popup_iterator, &data); -} - -void -output_render(struct cg_output *output, pixman_region32_t *damage) { - struct cg_server *server = output->server; - struct wlr_output *wlr_output = output->wlr_output; - - struct wlr_renderer *renderer = - wlr_backend_get_renderer(wlr_output->backend); - if(!renderer) { - wlr_log(WLR_DEBUG, "Expected the output backend to have a renderer"); - return; - } - - wlr_renderer_begin(renderer, wlr_output->width, wlr_output->height); - - if(!pixman_region32_not_empty(damage)) { - wlr_log(WLR_DEBUG, "Output isn't damaged but needs a buffer swap"); - goto renderer_end; - } - -#ifdef DEBUG - if(server->debug_damage_tracking) { - wlr_renderer_clear(renderer, (float[]){1.0F, 0.0F, 0.0F, 1.0F}); - } -#endif - - int nrects; - pixman_box32_t *rects = pixman_region32_rectangles(damage, &nrects); - for(int i = 0; i < nrects; i++) { - scissor_output(wlr_output, &rects[i]); - wlr_renderer_clear(renderer, server->bg_color); - } - - bool first = true; - for(struct cg_tile *tile = - output->workspaces[output->curr_workspace]->focused_tile; - first || - tile != output->workspaces[output->curr_workspace]->focused_tile; - tile = tile->next) { - first = false; - /* Only render visible views */ - if(tile->view != NULL) { - render_view_toplevels(tile->view, output, damage); - } - } - - struct cg_view *view; - wl_list_for_each_reverse( - view, &output->workspaces[output->curr_workspace]->unmanaged_views, - link) { - render_view_toplevels(view, output, damage); - } - - struct cg_view *focused_view = seat_get_focus(server->seat); - if(focused_view != NULL) { - render_view_popups(focused_view, output, damage); - } - - struct cg_message *message; - wl_list_for_each_reverse(message, &output->messages, link) { - float matrix[9]; - wlr_matrix_project_box(matrix, message->position, - WL_OUTPUT_TRANSFORM_NORMAL, 0.0F, - wlr_output->transform_matrix); - render_texture(output->wlr_output, damage, message->message, - message->position, matrix); - } - render_drag_icons(output, damage, &server->seat->drag_icons); - -renderer_end: - /* Draw software cursor in case hardware cursors aren't - available. This is a no-op when they are. */ - wlr_output_render_software_cursors(wlr_output, damage); - wlr_renderer_scissor(renderer, NULL); - wlr_renderer_end(renderer); - - int output_width, output_height; - wlr_output_transformed_resolution(wlr_output, &output_width, - &output_height); - - pixman_region32_t frame_damage; - pixman_region32_init(&frame_damage); - - enum wl_output_transform transform = - wlr_output_transform_invert(wlr_output->transform); - wlr_region_transform(&frame_damage, &output->damage->current, transform, - output_width, output_height); - -#ifdef DEBUG - if(server->debug_damage_tracking) { - pixman_region32_union_rect(&frame_damage, &frame_damage, 0, 0, - output_width, output_height); - } -#endif - - wlr_output_set_damage(wlr_output, &frame_damage); - pixman_region32_fini(&frame_damage); - - if(!wlr_output_commit(wlr_output)) { - wlr_log(WLR_ERROR, "Could not commit output"); - } -} diff --git a/render.h b/render.h deleted file mode 100644 index 0a883bd..0000000 --- a/render.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef CG_RENDER_H -#define CG_RENDER_H - -struct cg_output; - -void -output_render(struct cg_output *output, pixman_region32_t *damage); - -#endif diff --git a/seat.c b/seat.c index 280b3ea..e1ed24f 100644 --- a/seat.c +++ b/seat.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -46,67 +47,22 @@ static void drag_icon_update_position(struct cg_drag_icon *drag_icon); -/* XDG toplevels may have nested surfaces, such as popup windows for context - * menus or tooltips. This function tests if any of those are underneath the - * coordinates lx and ly (in output Layout Coordinates). If so, it sets the - * surface pointer to that wlr_surface and the sx and sy coordinates to the - * coordinates relative to that surface's top-left corner. */ -static bool -view_at(const struct cg_view *view, double lx, double ly, - struct wlr_surface **surface, double *sx, double *sy) { - struct wlr_box *output_layout_box = wlr_output_layout_get_box( - view->server->output_layout, view->workspace->output->wlr_output); - if(output_layout_box == NULL) { - return false; - } - - double view_sx = lx - view->ox - output_layout_box->x; - double view_sy = ly - view->oy - output_layout_box->y; - - double _sx, _sy; - struct wlr_surface *_surface = - view_wlr_surface_at(view, view_sx, view_sy, &_sx, &_sy); - if(_surface != NULL) { - *sx = _sx; - *sy = _sy; - *surface = _surface; - return true; - } - - return false; -} - /* If desktop_view_at returns a view, there is also a * surface. There cannot be a surface without a view, either. It's * both or nothing. */ static struct cg_view * desktop_view_at(const struct cg_server *server, double lx, double ly, struct wlr_surface **surface, double *sx, double *sy) { - struct cg_view *view; - wl_list_for_each( - view, - &server->curr_output->workspaces[server->curr_output->curr_workspace] - ->unmanaged_views, - link) { - if(view_at(view, lx, ly, surface, sx, sy)) { - return view; - } + struct wlr_scene_node *node=wlr_scene_node_at(&server->scene->node, lx,ly,sx,sy); + if(node == NULL || node->type != WLR_SCENE_NODE_SURFACE) { + return NULL; } + *surface = wlr_scene_surface_from_node(node)->surface; - bool first = true; - for(struct cg_tile *tile = - server->curr_output->workspaces[server->curr_output->curr_workspace] - ->focused_tile; - first || - server->curr_output->workspaces[server->curr_output->curr_workspace] - ->focused_tile != tile; - tile = tile->next) { - first = false; - if(tile->view != NULL && view_at(tile->view, lx, ly, surface, sx, sy)) { - return tile->view; - } + while(node != NULL && node->data == NULL) { + node=node->parent; } - return NULL; + return node->data; } static void @@ -720,26 +676,12 @@ handle_cursor_motion(struct wl_listener *listener, void *data) { wlr_idle_notify_activity(seat->server->idle, seat->seat); } -static void -drag_icon_damage(struct cg_drag_icon *drag_icon) { - struct cg_output *output; - wl_list_for_each(output, &drag_icon->seat->server->outputs, link) { - struct wlr_box *output_layout_box = wlr_output_layout_get_box( - output->server->output_layout, output->wlr_output); - output_damage_surface(output, drag_icon->wlr_drag_icon->surface, - drag_icon->lx - output_layout_box->x, - drag_icon->ly - output_layout_box->y, true); - } -} - static void drag_icon_update_position(struct cg_drag_icon *drag_icon) { struct wlr_drag_icon *wlr_icon = drag_icon->wlr_drag_icon; struct cg_seat *seat = drag_icon->seat; struct wlr_touch_point *point; - drag_icon_damage(drag_icon); - switch(wlr_icon->drag->grab_type) { case WLR_DRAG_GRAB_KEYBOARD: return; @@ -756,8 +698,7 @@ drag_icon_update_position(struct cg_drag_icon *drag_icon) { drag_icon->ly = seat->touch_ly; break; } - - drag_icon_damage(drag_icon); + wlr_scene_node_set_position(drag_icon->scene_node, drag_icon->lx, drag_icon->ly); } static void @@ -765,9 +706,9 @@ handle_drag_icon_destroy(struct wl_listener *listener, void *_data) { struct cg_drag_icon *drag_icon = wl_container_of(listener, drag_icon, destroy); - drag_icon_damage(drag_icon); wl_list_remove(&drag_icon->link); wl_list_remove(&drag_icon->destroy.link); + wlr_scene_node_destroy(drag_icon->scene_node); free(drag_icon); } @@ -813,6 +754,11 @@ handle_start_drag(struct wl_listener *listener, void *data) { } drag_icon->seat = seat; drag_icon->wlr_drag_icon = wlr_drag_icon; + drag_icon->scene_node = wlr_scene_subsurface_tree_create(&seat->server->scene->node, wlr_drag_icon->surface); + if(!drag_icon->scene_node) { + free(drag_icon); + return; + } drag_icon->destroy.notify = handle_drag_icon_destroy; wl_signal_add(&wlr_drag_icon->events.destroy, &drag_icon->destroy); @@ -1038,5 +984,9 @@ seat_set_focus(struct cg_seat *seat, struct cg_view *view) { NULL); } + wlr_scene_node_raise_to_top(view->scene_node); process_cursor_motion(seat, -1); + struct wlr_box *box = wlr_output_layout_get_box( + server->output_layout, view->workspace->output->wlr_output); + wlr_scene_node_set_position(&view->workspace->output->bg->node, box->x, box->y); } diff --git a/seat.h b/seat.h index 9331042..c581de3 100644 --- a/seat.h +++ b/seat.h @@ -85,6 +85,7 @@ struct cg_drag_icon { struct wl_list link; // seat::drag_icons struct cg_seat *seat; struct wlr_drag_icon *wlr_drag_icon; + struct wlr_scene_node *scene_node; /* The drag icon has a position in layout coordinates. */ double lx, ly; diff --git a/server.c b/server.c index e5b6137..242fd30 100644 --- a/server.c +++ b/server.c @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include "input_manager.h" diff --git a/server.h b/server.h index 610210d..fbaab40 100644 --- a/server.h +++ b/server.h @@ -35,6 +35,10 @@ struct cg_server { struct wl_listener new_output; struct wl_list output_priorities; + struct wlr_renderer *renderer; + struct wlr_allocator *allocator; + struct wlr_scene *scene; + struct wl_listener xdg_toplevel_decoration; struct wl_listener new_xdg_shell_surface; #if CG_HAS_XWAYLAND @@ -56,9 +60,6 @@ struct cg_server { float *bg_color; uint32_t views_curr_id; uint32_t tiles_curr_id; -#ifdef DEBUG - bool debug_damage_tracking; -#endif }; void diff --git a/util.c b/util.c index 1e7fa7c..4ed180b 100644 --- a/util.c +++ b/util.c @@ -7,10 +7,11 @@ * See the LICENSE file accompanying this file. */ -#include +#include #include "util.h" #include +#include int scale_length(int length, int offset, double scale) { diff --git a/view.c b/view.c index cdb90df..da5aac5 100644 --- a/view.c +++ b/view.c @@ -12,11 +12,13 @@ #include #include #include -#include +#include #include #include #include #include +#include +#include #include "ipc_server.h" #include "output.h" @@ -50,118 +52,6 @@ view_get_prev_view(struct cg_view *view) { return prev; } -void -view_damage_child(struct cg_view_child *child, bool whole) { - if(child->view != NULL) { - view_damage_part(child->view); - } -} - -static void -view_child_handle_commit(struct wl_listener *listener, void *_data) { - struct cg_view_child *child = wl_container_of(listener, child, commit); - view_damage_child(child, false); -} - -static void -subsurface_create(struct cg_view_child *parent, struct cg_view *view, - struct wlr_subsurface *wlr_subsurface); - -static void -view_child_handle_new_subsurface(struct wl_listener *listener, void *data) { - struct cg_view_child *child = - wl_container_of(listener, child, new_subsurface); - struct wlr_subsurface *wlr_subsurface = data; - subsurface_create(child, child->view, wlr_subsurface); -} - -void -view_child_finish(struct cg_view_child *child) { - if(!child) { - return; - } - - if(child->view != NULL) { - view_damage_child(child, true); - } - - struct cg_view_child *subchild, *tmpchild; - wl_list_for_each_safe(subchild, tmpchild, &child->children, parent_link) { - subchild->parent = NULL; - wl_list_remove(&subchild->parent_link); - } - - wl_list_remove(&child->link); - if(child->parent != NULL) { - wl_list_remove(&child->parent_link); - } - wl_list_remove(&child->commit.link); - wl_list_remove(&child->new_subsurface.link); -} - -void -view_child_init(struct cg_view_child *child, struct cg_view_child *parent, - struct cg_view *view, struct wlr_surface *wlr_surface) { - child->view = view; - child->parent = parent; - if(parent != NULL) { - wl_list_insert(&parent->children, &child->parent_link); - } - child->wlr_surface = wlr_surface; - wl_list_init(&child->children); - - child->commit.notify = view_child_handle_commit; - wl_signal_add(&wlr_surface->events.commit, &child->commit); - child->new_subsurface.notify = view_child_handle_new_subsurface; - wl_signal_add(&wlr_surface->events.new_subsurface, &child->new_subsurface); - - wl_list_insert(&view->children, &child->link); -} - -static void -subsurface_destroy(struct cg_view_child *child) { - if(!child) { - return; - } - - struct cg_subsurface *subsurface = (struct cg_subsurface *)child; - wl_list_remove(&subsurface->destroy.link); - view_child_finish(&subsurface->view_child); - free(subsurface); -} - -static void -subsurface_handle_destroy(struct wl_listener *listener, void *_data) { - struct cg_subsurface *subsurface = - wl_container_of(listener, subsurface, destroy); - struct cg_view_child *view_child = (struct cg_view_child *)subsurface; - subsurface_destroy(view_child); -} - -static void -subsurface_create(struct cg_view_child *parent, struct cg_view *view, - struct wlr_subsurface *wlr_subsurface) { - struct cg_subsurface *subsurface = calloc(1, sizeof(struct cg_subsurface)); - if(!subsurface) { - return; - } - - view_child_init(&subsurface->view_child, parent, view, - wlr_subsurface->surface); - subsurface->view_child.destroy = subsurface_destroy; - subsurface->wlr_subsurface = wlr_subsurface; - - subsurface->destroy.notify = subsurface_handle_destroy; - wl_signal_add(&wlr_subsurface->events.destroy, &subsurface->destroy); -} - -static void -handle_new_subsurface(struct wl_listener *listener, void *data) { - struct cg_view *view = wl_container_of(listener, view, new_subsurface); - struct wlr_subsurface *wlr_subsurface = data; - subsurface_create(NULL, view, wlr_subsurface); -} - char * view_get_title(const struct cg_view *view) { const char *title = view->impl->get_title(view); @@ -196,28 +86,6 @@ view_is_visible(const struct cg_view *view) { return view_get_tile(view) != NULL; } -void -view_damage(struct cg_view *view, bool whole) { - struct cg_tile *view_tile = view_get_tile(view); - if(view_tile != NULL && - (view->wlr_surface->current.width != view_tile->tile.width || - view->wlr_surface->current.height != view_tile->tile.height)) { - view_maximize(view, view_tile); - } - output_damage_surface(view->workspace->output, view->wlr_surface, view->ox, - view->oy, whole); -} - -void -view_damage_part(struct cg_view *view) { - view_damage(view, false); -} - -void -view_damage_whole(struct cg_view *view) { - view_damage(view, true); -} - void view_activate(struct cg_view *view, bool activate) { if(view != NULL) { @@ -229,25 +97,13 @@ void view_maximize(struct cg_view *view, struct cg_tile *tile) { view->ox = tile->tile.x; view->oy = tile->tile.y; + struct wlr_box *box = wlr_output_layout_get_box( + view->server->output_layout, view->workspace->output->wlr_output); + wlr_scene_node_set_position(view->scene_node, view->ox+box->x, view->oy+box->y); view->impl->maximize(view, tile->tile.width, tile->tile.height); view->tile = tile; } -void -view_for_each_surface(struct cg_view *view, - wlr_surface_iterator_func_t iterator, void *data) { - view->impl->for_each_surface(view, iterator, data); -} - -void -view_for_each_popup(struct cg_view *view, wlr_surface_iterator_func_t iterator, - void *data) { - if(!view->impl->for_each_popup) { - return; - } - view->impl->for_each_popup(view, iterator, data); -} - void view_unmap(struct cg_view *view) { @@ -261,19 +117,13 @@ view_unmap(struct cg_view *view) { return; } - struct cg_view_child *child, *tmp; - wl_list_for_each_safe(child, tmp, &view->children, link) { - child->destroy(child); - } + wlr_scene_node_destroy(view->scene_node); + #if CG_HAS_XWAYLAND if((view->type != CG_XWAYLAND_VIEW || xwayland_view_should_manage(view))) #endif { struct cg_tile *view_tile = view_get_tile(view); - if(view_tile != NULL) { - wlr_output_damage_add_box(view_tile->workspace->output->damage, - &view_tile->tile); - } struct cg_view *prev = view_get_prev_view(view); if(view == view->server->seat->focused_view) { seat_set_focus(view->server->seat, prev); @@ -285,8 +135,6 @@ view_unmap(struct cg_view *view) { } view_tile = view_get_tile(view); if(view_tile != NULL) { - wlr_output_damage_add_box(view_tile->workspace->output->damage, - &view_tile->tile); view_tile->view = prev; if(prev != NULL) { view_maximize(prev, view_tile); @@ -295,7 +143,6 @@ view_unmap(struct cg_view *view) { } #if CG_HAS_XWAYLAND else { - view_damage_whole(view); if(view->server->seat->seat->keyboard_state.focused_surface == NULL || view->server->seat->seat->keyboard_state.focused_surface == view->wlr_surface) { @@ -307,7 +154,6 @@ view_unmap(struct cg_view *view) { wl_list_remove(&view->link); - wl_list_remove(&view->new_subsurface.link); view->wlr_surface = NULL; ipc_send_event(view->workspace->server, "view_unmap(view_id:%d,tile_id:%d,workspace:%d,output:%s," @@ -321,21 +167,12 @@ view_map(struct cg_view *view, struct wlr_surface *surface, struct cg_output *output = ws->output; view->wlr_surface = surface; - struct wlr_subsurface *subsurface; - wl_list_for_each(subsurface, &view->wlr_surface->subsurfaces_above, - parent_link) { - subsurface_create(NULL, view, subsurface); + view->scene_node=wlr_scene_subsurface_tree_create(&ws->scene->node, surface); + if(!view->scene_node) { + wl_resource_post_no_memory(surface->resource); + return; } - - wl_list_for_each(subsurface, &view->wlr_surface->subsurfaces_below, - parent_link) { - subsurface_create(NULL, view, subsurface); - } - - view->new_subsurface.notify = handle_new_subsurface; - wl_signal_add(&view->wlr_surface->events.new_subsurface, - &view->new_subsurface); - + view->scene_node->data=view; view->workspace = ws; #if CG_HAS_XWAYLAND @@ -381,12 +218,4 @@ view_init(struct cg_view *view, enum cg_view_type type, view->impl = impl; view->id = server->views_curr_id; ++server->views_curr_id; - - wl_list_init(&view->children); -} - -struct wlr_surface * -view_wlr_surface_at(const struct cg_view *view, double sx, double sy, - double *sub_x, double *sub_y) { - return view->impl->wlr_surface_at(view, sx, sy, sub_x, sub_y); } diff --git a/view.h b/view.h index 772728d..9484d58 100644 --- a/view.h +++ b/view.h @@ -21,9 +21,9 @@ struct cg_view { struct cg_workspace *workspace; struct cg_server *server; struct wl_list link; // server::views - struct wl_list children; // cg_view_child::link struct wlr_surface *wlr_surface; struct cg_tile *tile; + struct wlr_scene_node *scene_node; /* The view has a position in output coordinates. */ int ox, oy; @@ -31,7 +31,6 @@ struct cg_view { enum cg_view_type type; const struct cg_view_impl *impl; - struct wl_listener new_subsurface; uint32_t id; }; @@ -42,34 +41,6 @@ struct cg_view_impl { void (*close)(struct cg_view *view); void (*maximize)(struct cg_view *view, int width, int height); void (*destroy)(struct cg_view *view); - void (*for_each_surface)(struct cg_view *view, - wlr_surface_iterator_func_t iterator, void *data); - void (*for_each_popup)(struct cg_view *view, - wlr_surface_iterator_func_t iterator, void *data); - struct wlr_surface *(*wlr_surface_at)(const struct cg_view *view, double sx, - double sy, double *sub_x, - double *sub_y); -}; - -struct cg_view_child { - struct cg_view *view; - struct cg_view_child *parent; - struct wl_list children; - struct wlr_surface *wlr_surface; - struct wl_list link; - struct wl_list parent_link; - - struct wl_listener commit; - struct wl_listener new_subsurface; - - void (*destroy)(struct cg_view_child *child); -}; - -struct cg_subsurface { - struct cg_view_child view_child; - struct wlr_subsurface *wlr_subsurface; - - struct wl_listener destroy; }; char * @@ -81,20 +52,8 @@ view_is_primary(const struct cg_view *view); bool view_is_visible(const struct cg_view *view); void -view_damage_part(struct cg_view *view); -void -view_damage_whole(struct cg_view *view); -void -view_damage_child(struct cg_view_child *view, bool whole); -void view_activate(struct cg_view *view, bool activate); void -view_for_each_surface(struct cg_view *view, - wlr_surface_iterator_func_t iterator, void *data); -void -view_for_each_popup(struct cg_view *view, wlr_surface_iterator_func_t iterator, - void *data); -void view_unmap(struct cg_view *view); void view_maximize(struct cg_view *view, struct cg_tile *tile); @@ -106,16 +65,6 @@ view_destroy(struct cg_view *view); void view_init(struct cg_view *view, enum cg_view_type type, const struct cg_view_impl *impl, struct cg_server *server); - -struct wlr_surface * -view_wlr_surface_at(const struct cg_view *view, double sx, double sy, - double *sub_x, double *sub_y); - -void -view_child_finish(struct cg_view_child *child); -void -view_child_init(struct cg_view_child *child, struct cg_view_child *parent, - struct cg_view *view, struct wlr_surface *wlr_surface); struct cg_view * view_get_prev_view(struct cg_view *view); diff --git a/workspace.c b/workspace.c index e7da406..4000545 100644 --- a/workspace.c +++ b/workspace.c @@ -13,6 +13,7 @@ #include #include #include +#include #include "message.h" #include "output.h" @@ -57,6 +58,7 @@ full_screen_workspace(struct cg_output *output) { } workspace->server = output->server; workspace->num = -1; + workspace->scene = wlr_scene_tree_create(&output->scene_output->scene->node); if(full_screen_workspace_tiles(output->server->output_layout, output->wlr_output, workspace, &output->server->tiles_curr_id) != 0) { @@ -95,3 +97,10 @@ workspace_free(struct cg_workspace *workspace) { workspace_free_tiles(workspace); free(workspace); } + +void +workspace_focus(struct cg_output *outp, int ws) { + wlr_scene_node_place_above(&outp->bg->node,&outp->workspaces[outp->curr_workspace]->scene->node); + wlr_scene_node_place_above(&outp->workspaces[ws]->scene->node,&outp->bg->node); + outp->curr_workspace=ws; +} diff --git a/workspace.h b/workspace.h index 43eb250..77a9b00 100644 --- a/workspace.h +++ b/workspace.h @@ -1,7 +1,7 @@ #ifndef CG_WORKSPACE_H #define CG_WORKSPACE_H -#include +#include struct cg_output; struct cg_server; @@ -20,6 +20,7 @@ struct cg_workspace { struct wl_list views; struct wl_list unmanaged_views; struct cg_output *output; + struct wlr_scene_tree *scene; struct cg_tile *focused_tile; uint32_t num; @@ -38,5 +39,7 @@ void workspace_free(struct cg_workspace *workspace); void workspace_focus_tile(struct cg_workspace *ws, struct cg_tile *tile); +void +workspace_focus(struct cg_output *outp, int ws); #endif diff --git a/xdg_shell.c b/xdg_shell.c index 7972b5f..b5bc24b 100644 --- a/xdg_shell.c +++ b/xdg_shell.c @@ -10,13 +10,15 @@ #define _POSIX_C_SOURCE 200809L #include +#include #include -#include +#include #include #include #include #include #include +#include #include "output.h" #include "server.h" @@ -24,10 +26,29 @@ #include "workspace.h" #include "xdg_shell.h" +static struct cg_view * +popup_get_view(struct wlr_xdg_popup *popup) { + while(true) { + if(popup->parent == NULL || !wlr_surface_is_xdg_surface(popup->parent)) { + return NULL; + } + struct wlr_xdg_surface *xdg_surface = wlr_xdg_surface_from_wlr_surface(popup->parent); + switch(xdg_surface->role) { + case WLR_XDG_SURFACE_ROLE_TOPLEVEL: + return xdg_surface->data; + case WLR_XDG_SURFACE_ROLE_POPUP: + popup=xdg_surface->popup; + break; + case WLR_XDG_SURFACE_ROLE_NONE: + return NULL; + } + } +} + static void -xdg_decoration_handle_destroy(struct wl_listener *listener, void *_data) { - struct cg_xdg_decoration *xdg_decoration = - wl_container_of(listener, xdg_decoration, destroy); +xdg_decoration_handle_destroy(struct wl_listener *listener, void *data) +{ + struct cg_xdg_decoration *xdg_decoration = wl_container_of(listener, xdg_decoration, destroy); wl_list_remove(&xdg_decoration->destroy.link); wl_list_remove(&xdg_decoration->request_mode.link); @@ -53,54 +74,8 @@ xdg_decoration_handle_request_mode(struct wl_listener *listener, void *_data) { #endif static void -xdg_popup_destroy(struct cg_view_child *child) { - if(!child) { - return; - } - - view_damage_child(child, true); - struct cg_xdg_popup *popup = (struct cg_xdg_popup *)child; - wl_list_remove(&popup->destroy.link); - wl_list_remove(&popup->map.link); - wl_list_remove(&popup->unmap.link); - wl_list_remove(&popup->new_popup.link); - view_child_finish(&popup->view_child); - free(popup); -} - -static void -handle_xdg_popup_map(struct wl_listener *listener, void *_data) { - struct cg_xdg_popup *popup = wl_container_of(listener, popup, map); - view_damage_whole(popup->view_child.view); -} - -static void -handle_xdg_popup_unmap(struct wl_listener *listener, void *_data) { - struct cg_xdg_popup *popup = wl_container_of(listener, popup, unmap); - view_damage_whole(popup->view_child.view); -} - -static void -handle_xdg_popup_destroy(struct wl_listener *listener, void *_data) { - struct cg_xdg_popup *popup = wl_container_of(listener, popup, destroy); - struct cg_view_child *view_child = (struct cg_view_child *)popup; - xdg_popup_destroy(view_child); -} - -static void -xdg_popup_create(struct cg_view *view, struct wlr_xdg_popup *wlr_popup); - -static void -popup_handle_new_xdg_popup(struct wl_listener *listener, void *data) { - struct cg_xdg_popup *popup = wl_container_of(listener, popup, new_popup); - struct wlr_xdg_popup *wlr_popup = data; - xdg_popup_create(popup->view_child.view, wlr_popup); -} - -static void -popup_unconstrain(struct cg_xdg_popup *popup) { - struct cg_view *view = popup->view_child.view; - struct wlr_box *popup_box = &popup->wlr_popup->geometry; +popup_unconstrain(struct cg_view *view, struct wlr_xdg_popup *popup) { + struct wlr_box *popup_box = &popup->geometry; struct wlr_output_layout *output_layout = view->server->output_layout; struct wlr_box *view_output_box = wlr_output_layout_get_box( @@ -116,37 +91,7 @@ popup_unconstrain(struct cg_xdg_popup *popup) { .width = output_box->width, .height = output_box->height}; - wlr_xdg_popup_unconstrain_from_box(popup->wlr_popup, &output_toplevel_box); -} - -static void -xdg_popup_create(struct cg_view *view, struct wlr_xdg_popup *wlr_popup) { - struct cg_xdg_popup *popup = calloc(1, sizeof(struct cg_xdg_popup)); - if(!popup) { - return; - } - - popup->wlr_popup = wlr_popup; - view_child_init(&popup->view_child, NULL, view, wlr_popup->base->surface); - popup->view_child.destroy = xdg_popup_destroy; - popup->destroy.notify = handle_xdg_popup_destroy; - wl_signal_add(&wlr_popup->base->events.destroy, &popup->destroy); - popup->map.notify = handle_xdg_popup_map; - wl_signal_add(&wlr_popup->base->events.map, &popup->map); - popup->unmap.notify = handle_xdg_popup_unmap; - wl_signal_add(&wlr_popup->base->events.unmap, &popup->unmap); - popup->new_popup.notify = popup_handle_new_xdg_popup; - wl_signal_add(&wlr_popup->base->events.new_popup, &popup->new_popup); - - popup_unconstrain(popup); -} - -static void -handle_new_xdg_popup(struct wl_listener *listener, void *data) { - struct cg_xdg_shell_view *xdg_shell_view = - wl_container_of(listener, xdg_shell_view, new_popup); - struct wlr_xdg_popup *wlr_popup = data; - xdg_popup_create(&xdg_shell_view->view, wlr_popup); + wlr_xdg_popup_unconstrain_from_box(popup, &output_toplevel_box); } static struct cg_xdg_shell_view * @@ -206,31 +151,6 @@ destroy(struct cg_view *view) { free(xdg_shell_view); } -static void -for_each_surface(struct cg_view *view, wlr_surface_iterator_func_t iterator, - void *data) { - struct cg_xdg_shell_view *xdg_shell_view = xdg_shell_view_from_view(view); - wlr_xdg_surface_for_each_surface(xdg_shell_view->xdg_surface, iterator, - data); -} - -static void -for_each_popup(struct cg_view *view, wlr_surface_iterator_func_t iterator, - void *data) { - struct cg_xdg_shell_view *xdg_shell_view = xdg_shell_view_from_view(view); - wlr_xdg_surface_for_each_popup_surface(xdg_shell_view->xdg_surface, - iterator, data); -} - -static struct wlr_surface * -wlr_surface_at(const struct cg_view *view, double sx, double sy, double *sub_x, - double *sub_y) { - const struct cg_xdg_shell_view *xdg_shell_view = - xdg_shell_view_from_const_view(view); - return wlr_xdg_surface_surface_at(xdg_shell_view->xdg_surface, sx, sy, - sub_x, sub_y); -} - static void handle_xdg_shell_surface_request_fullscreen(struct wl_listener *listener, void *data) { @@ -241,23 +161,12 @@ handle_xdg_shell_surface_request_fullscreen(struct wl_listener *listener, event->fullscreen); } -static void -handle_xdg_shell_surface_commit(struct wl_listener *listener, void *_data) { - struct cg_xdg_shell_view *xdg_shell_view = - wl_container_of(listener, xdg_shell_view, commit); - struct cg_view *view = &xdg_shell_view->view; - view_damage_part(view); -} - static void handle_xdg_shell_surface_unmap(struct wl_listener *listener, void *_data) { struct cg_xdg_shell_view *xdg_shell_view = wl_container_of(listener, xdg_shell_view, unmap); struct cg_view *view = &xdg_shell_view->view; - wl_list_remove(&xdg_shell_view->new_popup.link); - wl_list_remove(&xdg_shell_view->commit.link); - view_unmap(view); } @@ -267,17 +176,9 @@ handle_xdg_shell_surface_map(struct wl_listener *listener, void *_data) { wl_container_of(listener, xdg_shell_view, map); struct cg_view *view = &xdg_shell_view->view; - xdg_shell_view->commit.notify = handle_xdg_shell_surface_commit; - wl_signal_add(&xdg_shell_view->xdg_surface->surface->events.commit, - &xdg_shell_view->commit); - xdg_shell_view->new_popup.notify = handle_new_xdg_popup; - wl_signal_add(&xdg_shell_view->xdg_surface->events.new_popup, - &xdg_shell_view->new_popup); - view_map(view, xdg_shell_view->xdg_surface->surface, view->server->curr_output ->workspaces[view->server->curr_output->curr_workspace]); - view_damage_whole(view); } static void @@ -301,43 +202,75 @@ static const struct cg_view_impl xdg_shell_view_impl = { .activate = activate, .close = close, .maximize = maximize, - .destroy = destroy, - .for_each_surface = for_each_surface, - .for_each_popup = for_each_popup, - .wlr_surface_at = wlr_surface_at, + .destroy = destroy }; + void -handle_xdg_shell_surface_new(struct wl_listener *listener, void *data) { - struct cg_server *server = - wl_container_of(listener, server, new_xdg_shell_surface); +handle_xdg_shell_surface_new(struct wl_listener *listener, void *data) +{ + struct cg_server *server = wl_container_of(listener, server, new_xdg_shell_surface); struct wlr_xdg_surface *xdg_surface = data; - if(xdg_surface->role != WLR_XDG_SURFACE_ROLE_TOPLEVEL) { - return; + switch (xdg_surface->role) { + case WLR_XDG_SURFACE_ROLE_TOPLEVEL:; + struct cg_xdg_shell_view *xdg_shell_view = calloc(1, sizeof(struct cg_xdg_shell_view)); + if (!xdg_shell_view) { + wlr_log(WLR_ERROR, "Failed to allocate XDG Shell view"); + return; + } + + view_init(&xdg_shell_view->view, CG_XDG_SHELL_VIEW, &xdg_shell_view_impl,server); + + xdg_shell_view->xdg_surface = xdg_surface; + + xdg_shell_view->map.notify = handle_xdg_shell_surface_map; + wl_signal_add(&xdg_surface->events.map, &xdg_shell_view->map); + xdg_shell_view->unmap.notify = handle_xdg_shell_surface_unmap; + wl_signal_add(&xdg_surface->events.unmap, &xdg_shell_view->unmap); + xdg_shell_view->destroy.notify = handle_xdg_shell_surface_destroy; + wl_signal_add(&xdg_surface->events.destroy, &xdg_shell_view->destroy); + xdg_shell_view->request_fullscreen.notify = handle_xdg_shell_surface_request_fullscreen; + wl_signal_add(&xdg_surface->toplevel->events.request_fullscreen, &xdg_shell_view->request_fullscreen); + + xdg_surface->data = xdg_shell_view; + break; + case WLR_XDG_SURFACE_ROLE_POPUP:; + struct wlr_xdg_popup *popup = xdg_surface->popup; + struct cg_view *view = popup_get_view(popup); + if (view == NULL) { + return; + } + + struct wlr_scene_node *parent_scene_node = NULL; + struct wlr_xdg_surface *parent = wlr_xdg_surface_from_wlr_surface(popup->parent); + switch (parent->role) { + case WLR_XDG_SURFACE_ROLE_TOPLEVEL:; + parent_scene_node = view->scene_node; + break; + case WLR_XDG_SURFACE_ROLE_POPUP: + parent_scene_node = parent->data; + break; + case WLR_XDG_SURFACE_ROLE_NONE: + break; + } + if (parent_scene_node == NULL) { + return; + } + + struct wlr_scene_node *popup_scene_node = wlr_scene_xdg_surface_create(parent_scene_node, xdg_surface); + if (popup_scene_node == NULL) { + wlr_log(WLR_ERROR, "Failed to allocate scene-graph node for XDG popup"); + return; + } + + popup_unconstrain(view, popup); + + xdg_surface->data = popup_scene_node; + break; + case WLR_XDG_SURFACE_ROLE_NONE: + assert(false); // unreachable } - - struct cg_xdg_shell_view *xdg_shell_view = - calloc(1, sizeof(struct cg_xdg_shell_view)); - if(!xdg_shell_view) { - wlr_log(WLR_ERROR, "Failed to allocate XDG Shell view"); - return; - } - view_init(&xdg_shell_view->view, CG_XDG_SHELL_VIEW, &xdg_shell_view_impl, - server); - - xdg_shell_view->xdg_surface = xdg_surface; - - xdg_shell_view->map.notify = handle_xdg_shell_surface_map; - wl_signal_add(&xdg_surface->events.map, &xdg_shell_view->map); - xdg_shell_view->unmap.notify = handle_xdg_shell_surface_unmap; - wl_signal_add(&xdg_surface->events.unmap, &xdg_shell_view->unmap); - xdg_shell_view->destroy.notify = handle_xdg_shell_surface_destroy; - wl_signal_add(&xdg_surface->events.destroy, &xdg_shell_view->destroy); - xdg_shell_view->request_fullscreen.notify = - handle_xdg_shell_surface_request_fullscreen; - wl_signal_add(&xdg_surface->toplevel->events.request_fullscreen, - &xdg_shell_view->request_fullscreen); } void diff --git a/xdg_shell.h b/xdg_shell.h index 601134b..cb92b5a 100644 --- a/xdg_shell.h +++ b/xdg_shell.h @@ -10,19 +10,7 @@ struct cg_xdg_shell_view { struct wl_listener destroy; struct wl_listener unmap; struct wl_listener map; - struct wl_listener commit; struct wl_listener request_fullscreen; - struct wl_listener new_popup; -}; - -struct cg_xdg_popup { - struct cg_view_child view_child; - struct wlr_xdg_popup *wlr_popup; - - struct wl_listener destroy; - struct wl_listener map; - struct wl_listener unmap; - struct wl_listener new_popup; }; struct cg_xdg_decoration { diff --git a/xwayland.c b/xwayland.c index daf3658..500a1ce 100644 --- a/xwayland.c +++ b/xwayland.c @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include @@ -72,29 +72,15 @@ close(struct cg_view *view) { static void maximize(struct cg_view *view, int width, int height) { struct cg_xwayland_view *xwayland_view = xwayland_view_from_view(view); - struct cg_output *output = view->workspace->output; - - struct wlr_box *box = wlr_output_layout_get_box( - view->server->output_layout, view->workspace->output->wlr_output); struct wlr_xwayland_surface_size_hints *hints = xwayland_view->xwayland_surface->size_hints; if(hints != NULL && hints->flags & PMaxSize) { if(width > hints->max_width) { - wlr_output_damage_add_box(output->damage, - &(struct wlr_box){.x = view->ox + box->x, - .y = view->oy + box->y, - .width = width, - .height = height}); width = hints->max_width; } if(height > hints->max_height) { - wlr_output_damage_add_box(output->damage, - &(struct wlr_box){.x = view->ox + box->x, - .y = view->oy + box->y, - .width = width, - .height = height}); height = hints->max_height; } } @@ -110,18 +96,6 @@ destroy(struct cg_view *view) { free(xwayland_view); } -static void -for_each_surface(struct cg_view *view, wlr_surface_iterator_func_t iterator, - void *data) { - wlr_surface_for_each_surface(view->wlr_surface, iterator, data); -} - -static struct wlr_surface * -wlr_surface_at(const struct cg_view *view, double sx, double sy, double *sub_x, - double *sub_y) { - return wlr_surface_surface_at(view->wlr_surface, sx, sy, sub_x, sub_y); -} - static void handle_xwayland_surface_request_fullscreen(struct wl_listener *listener, void *data) { @@ -133,33 +107,12 @@ handle_xwayland_surface_request_fullscreen(struct wl_listener *listener, xwayland_surface->fullscreen); } -static void -handle_xwayland_surface_commit(struct wl_listener *listener, void *_data) { - struct cg_xwayland_view *xwayland_view = - wl_container_of(listener, xwayland_view, commit); - struct cg_view *view = &xwayland_view->view; - /* xwayland surface has moved */ - if(xwayland_view->xwayland_surface->x != view->ox || - xwayland_view->xwayland_surface->y != view->oy) { - output_damage_surface(view->workspace->output, view->wlr_surface, - view->ox, view->oy, true); - view->ox = xwayland_view->xwayland_surface->x; - view->oy = xwayland_view->xwayland_surface->y; - output_damage_surface(view->workspace->output, view->wlr_surface, - view->ox, view->oy, true); - } else { - view_damage_part(view); - } -} - static void handle_xwayland_surface_unmap(struct wl_listener *listener, void *_data) { struct cg_xwayland_view *xwayland_view = wl_container_of(listener, xwayland_view, unmap); struct cg_view *view = &xwayland_view->view; - wl_list_remove(&xwayland_view->commit.link); - view_unmap(view); } @@ -174,15 +127,9 @@ handle_xwayland_surface_map(struct wl_listener *listener, void *_data) { view->oy = xwayland_view->xwayland_surface->y; } - xwayland_view->commit.notify = handle_xwayland_surface_commit; - wl_signal_add(&xwayland_view->xwayland_surface->surface->events.commit, - &xwayland_view->commit); - view_map(view, xwayland_view->xwayland_surface->surface, view->server->curr_output ->workspaces[view->server->curr_output->curr_workspace]); - - view_damage_whole(view); } static void @@ -207,10 +154,6 @@ static const struct cg_view_impl xwayland_view_impl = { .close = close, .maximize = maximize, .destroy = destroy, - .for_each_surface = for_each_surface, - /* XWayland doesn't have a separate popup iterator. */ - .for_each_popup = NULL, - .wlr_surface_at = wlr_surface_at, }; void diff --git a/xwayland.h b/xwayland.h index 4dfaac4..71db92f 100644 --- a/xwayland.h +++ b/xwayland.h @@ -10,7 +10,6 @@ struct cg_xwayland_view { struct wl_listener destroy; struct wl_listener unmap; struct wl_listener map; - struct wl_listener commit; struct wl_listener request_fullscreen; }; From bb924f63889beaaa84e410951c62e2d34fb0965b Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Wed, 2 Feb 2022 18:11:58 +0100 Subject: [PATCH 335/689] Edit man pages --- man/cagebreak-config.5.md | 256 +++++++++++++++++++++----------------- man/cagebreak.1.md | 2 + 2 files changed, 147 insertions(+), 111 deletions(-) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index 2d7bc42..2cbef4a 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -1,8 +1,8 @@ -cagebreak-config(1) "Version 1.8.2" "Cagebreak Manual" +cagebreak-config(5) "Version 1.8.2" "Cagebreak Manual" # NAME -*cagebreak-config* — Cagebreak config file +*cagebreak-config* — Cagebreak configuration file # SYNOPSIS @@ -10,91 +10,108 @@ cagebreak-config(1) "Version 1.8.2" "Cagebreak Manual" # DESCRIPTION -The cagebreak configuration file is a simple plain text file which configures -the way cagebreak behaves. -Each line constitutes a separate command which is parsed -independently from the rest of the file. Comments can be added -by prepending a line with the # symbol. +The cagebreak configuration is a plain text file. + +Each line consists of a comment or a command and its arguments which +are parsed sequentially but independently from the rest of the file. + +Each line starting with a "#" is a comment. + +See *KEY DEFINITIONS* for details on modifier keys and *MODES* for details +on modes. ## COMMANDS *abort* - Return to the default mode without running any command + Return to default mode -*background* - Set the background color. This command expects three floating point numbers - between 0 and 1, specifying the r, g and b values respectively. - (e.g. "background 1.0 0.0 0.0" sets to background color to red) - There is no support for specifying a background image. +*background * + Set RGB of background - <[r|g|b]> are floating point numbers + between 0 and 1. + There is no support for background images. -*bind* - This command requires a key (see *KEY DEFINITIONS*) and a command (see *COMMANDS*) as an argument. - Subsequently, pressing this key while in command mode executes the - supplied action. bind is equivalent to - definekey root +``` +# Set background to red +background 1.0 0.0 0.0 +``` + +*bind * + Bind to execute if pressed in root mode + +``` +bind +# is equivalent to +definekey root +``` *close* - This command closes the current window. It may be useful for windows of applications which - do not offer any method of closing them. + Close current window - This may be useful for windows of + applications which do not offer any method of closing them. -*definekey* - This command behaves similarly to the *bind* command with the - difference that the mode in which the keybinding is activated is - specified by the user. A call to this function is to be structured as follows: +*definekey * + Bind to execute if pressed in - + *definekey* is a more general version of *bind*. - definekey +*definemode * + Define new mode - After a call to *definemode*, + can be used with *definekey* to create a custom key mapping. -*definemode* - This command requires a single argument; the name of the mode to be defined. - Subsequent to a call to this function, the defined mode may be used along with - the definekey command to create a custom key mapping. Synopsis: +``` +# define new mode and create a mapping for it +definemode foo +definekey foo C-t abort +``` - definemode +*escape * + Set to switch to root mode to execute one command -*escape* - Defines the key with which the current mode can be changed to "root". - escape is equivalent to definekey top switch_mode root +``` +escape +# is equivalent to +definekey top mode root +``` *exchangedown* - Exchange the current window with the window in the tile to the bottom + Exchange current window with window in the tile to the bottom *exchangeleft* - Exchange the current window with the window in the tile to the left + Exchange current window with window in the tile to the left *exchangeright* - Exchange the current window with the window in the tile to the right + Exchange current window with window in the tile to the right *exchangeup* - Exchange the current window with the window in the tile to the top + Exchange current window with window in the tile to the top -*exec* - Executes the supplied shell command using *sh -c ""*. Synopsis: - - exec +*exec * + Execute using *sh -c* *focus* Focus next tile *focusdown* - Focus the tile to the bottom + Focus tile to the bottom *focusleft* - Focus the tile to the left + Focus tile to the left *focusprev* Focus previous tile *focusright* - Focus the tile to the right + Focus tile to the right *focusup* - Focus the tile to the top + Focus tile to the top *hsplit* Split current tile horizontally *input * - Set the setting "" to "" for device "". The identifier can either be "\*" (wildcard), of the form "type:" or the identifier of the device as printed for example by *cagebreak -s*. The supported input types are + Set to for device - + can be "\*" (wildcard), of the form + "type:" or the identifier of the device as printed + for example by *cagebreak -s*. The supported input types are - touchpad - pointer - keyboard @@ -103,135 +120,142 @@ by prepending a line with the # symbol. - tablet_pad - switch - Configurations are applied sequentially. Currently, only libinput devices may be configured. The available settings and their corresponding values are as follows: + Configurations are applied sequentially. Currently, only libinput + devices may be configured. The available settings and their + corresponding values are as follows: *accel_profile adaptive|flat* - Sets the pointer acceleration profile for the specified input device. + Set pointer acceleration profile for specified input device *calibration_matrix <6 space-separated floating point values>* - Sets the calibration matrix. + Set calibration matrix *click_method none|button_areas|clickfinger* - Changes the click method for the specified device. + Change click method for the specified device *drag enabled|disabled* - Enables or disables tap-and-drag for specified input device. + Enable or disable tap-and-drag for specified input device *drag_lock enabled|disabled* - Enables or disables drag lock for specified input device. + Enable or disable drag lock for specified input device *dwt enabled|disabled* - Enables or disables disable-while-typing for the specified input device. + Enable or disable disable-while-typing for specified input + device *enabled|disabled|disabled_on_external_mouse* - Enables or disables send_events for specified input device. Disabling - send_events disables the input device. + Enable or disable send_events for specified input device - + Disabling send_events disables the input device. *left_handed enabled|disabled* - Enables or disables left handed mode for specified input device. + Enable or disable left handed mode for specified input device *middle_emulation enabled|disabled* - Enables or disables middle click emulation. + Enable or disable middle click emulation *natural_scroll enabled|disabled* - Enables or disables natural (inverted) scrolling for the specified input - device. + Enable or disable natural (inverted) scrolling for specified + input device *pointer_accel [<-1|1>]* - Changes the pointer acceleration for the specified input device. + Change the pointer acceleration for specified input device *scroll_button disable|* - Sets the button used for scroll_method on_button_down. The button can - be given as an event name or code, which can be obtained from *libinput - debug-events*. If set to - _disable_, it disables the scroll_method on_button_down. + Set button used for scroll_method on_button_down - The button + can be given as an event name or code, which can be obtained from + *libinput debug-events*. If set to _disable_, it disables the + scroll_method on_button_down. *scroll_factor * - Changes the scroll factor for the specified input device. Scroll speed will - be scaled by the given value, which must be non-negative. + Change the scroll factor for the specified input device - Scroll + speed will be scaled by the given value, which must be non-negative. *scroll_method none|two_finger|edge|on_button_down* - Changes the scroll method for the specified input device. + Change scroll method for specified input device *tap enabled|disabled* - Enables or disables tap for specified input device. + Enable or disable tap for specified input device *tap_button_map lrm|lmr* - Specifies which button mapping to use for tapping. _lrm_ treats 1 finger as - left click, 2 fingers as right click, and 3 fingers as middle click. _lmr_ - treats 1 finger as left click, 2 fingers as middle click, and 3 fingers as - right click. + Specify which button mapping to use for tapping - _lrm_ treats 1 + finger as left click, 2 fingers as right click, and 3 fingers as + middle click. _lmr_ treats 1 finger as left click, 2 fingers as + middle click, and 3 fingers as right click. *mode * - Enter mode "". After a keybinding is processed, return to default mode + Enter mode "" - Returns to default mode, after a command is + executed. *movetonextscreen* - Move the current window to the next screen + Move current window to next screen *movetoprevscreen* - Move the current window to the previous screen + Move current window to previous screen *movetoscreen * - Move the currently focused window to the n-th screen + Move currently focused window to -th screen *movetoworkspace * - Move the currently focused window to the n-th workspace + Move currently focused window to -th workspace *next* Focus next window in current tile *nextscreen* - Focus the next screen + Focus next screen *only* - Remove all splits and make the current window fill the entire screen + Remove all splits and make current window fill the entire screen *output [[pos res x rate ] | enable | disable | prio ]* - Configure the output "". and are the position of the monitor - in pixels. The top-left monitor should have the coordinates 0 0. and - specify the resolution in pixels and sets the refresh rate of - the monitor (often this is 50 or 60). The options enable and disable - enable or disable the output . Note that if is the only enabled - output, *output disable* has no effect. prio is used to set the - priority of an output. If nothing else is set, outputs are added as they - request to be added and have a numerical priority of -1. Using prio - it is possible to set priorities for outputs, where >= 1. The larger is, - the higher the priority is, that is to say, the earlier the output will - appear in the list of outputs. + Configure output "" - + - and are the position of the + monitor in pixels. The top-left monitor should have the coordinates 0 0. + - and specify the resolution in pixels. + - sets the refresh rate of the monitor (often this is 50 or 60). + - enable and disable enable or disable . Note that if + is the only enabled output, *output disable* has + no effect. + - prio is used to set the priority of an output. If + nothing else is set, outputs are added as they request to be added + and have a numerical priority of -1. Using prio it is possible + to set priorities for outputs, where >= 1. The larger is, + the higher the priority is, that is to say, the earlier the output + will appear in the list of outputs. *prev* Focus previous window in current tile *prevscreen* - Focus the previous screen + Focus previous screen *quit* Exit cagebreak *resizedown* - Resize the current tile towards the bottom + Resize current tile towards the bottom *resizeleft* - Resize the current tile towards the left + Resize current tile towards the left *resizeright* - Resize the current tile towards the right + Resize current tile towards the right *resizeup* - Resize the current tile towards the top + Resize current tile towards the top *screen * - Change to the n-th screen + Change to -th screen *show_info* - Display info about the current setup. In particular, print the identifiers + Display information about the current setup - In particular, print the identifiers of the available inputs and outputs. *setmode * - Set the default mode to + Set default mode to *switchvt * - Switch to tty n + Switch to tty *time* Display time @@ -240,31 +264,37 @@ by prepending a line with the # symbol. Split current tile vertically *workspace * - Change to the n-th workspace + Change to -th workspace -*workspaces* - Requires a single integer larger than 1 and less than 30 as an argument. Sets the number of - workspaces to the supplied number +*workspaces * + Set number of workspaces to - is a single integer larger than 1 + and less than 30. # MODES By default, three modes are defined: *top* - The default mode. Keybindings defined in this mode can be accessed - directly, without the use of an escape key. + Default mode - Keybindings defined in this mode can be accessed + directly. + - *definekey* can be used to set keybindings for top mode. + - *setmode* can be used to set a different default mode. *root* - The command mode. Keybindings defined in this mode can be accessed - after pressing the key defined by the *escape* command. + Command mode - Keybindings defined in this mode can be accessed + after pressing the key defined by *escape*. + - *bind* can be used to set keybindings for root mode. *resize* - Resize mode. This mode is used for resizing tiles. + Resize mode - Used to resize tiles. + +*definemode* can be used to create additional modes. # KEY DEFINITIONS Keys are specified by their names as displayed for example by *xev*. -In addition, modifiers can be specified using the following syntax: + +Modifiers can be specified using the following syntax: - @@ -284,9 +314,11 @@ The supported modifiers are: *5 - Mod 5* -For example to specify the keybinding Control+t, the expression: +For example to specify the keybinding Control+t, the expression - C-t +``` +C-t +``` is used. @@ -301,7 +333,9 @@ See GitHub Issues: # LICENSE Copyright (c) 2020-2022 The Cagebreak authors + Copyright (c) 2018-2020 Jente Hidskes + Copyright (c) 2019 The Sway authors Permission is hereby granted, free of charge, to any person obtaining a copy of diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index cfb0a22..a7c8d5f 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -76,7 +76,9 @@ See GitHub Issues: # LICENSE Copyright (c) 2020-2022 The Cagebreak authors + Copyright (c) 2018-2020 Jente Hidskes + Copyright (c) 2019 The Sway authors Permission is hereby granted, free of charge, to any person obtaining a copy of From da1f973532aefb76e8d1c61cfcda95559a748a7e Mon Sep 17 00:00:00 2001 From: project-repo Date: Tue, 15 Feb 2022 22:33:53 +0100 Subject: [PATCH 336/689] Fix issues related to wlr_scene --- keybinding.c | 15 +++++++-------- parse.c | 4 ++-- view.c | 22 ++++++++++++++++++---- xwayland.c | 9 +++++---- 4 files changed, 32 insertions(+), 18 deletions(-) diff --git a/keybinding.c b/keybinding.c index 7314b09..d12f727 100644 --- a/keybinding.c +++ b/keybinding.c @@ -786,14 +786,11 @@ keybinding_move_view_to_cycle_output(struct cg_server *server, bool reverse) { } keybinding_cycle_outputs(server, reverse); if(view != NULL) { - wl_list_insert(&server->curr_output - ->workspaces[server->curr_output->curr_workspace] - ->views, - &view->link); - server->curr_output->workspaces[server->curr_output->curr_workspace] - ->focused_tile->view = view; - view->workspace = server->curr_output - ->workspaces[server->curr_output->curr_workspace]; + struct cg_workspace *ws=server->curr_output->workspaces[server->curr_output->curr_workspace]; + wl_list_insert(&ws->views, &view->link); + ws->focused_tile->view = view; + wlr_scene_node_reparent(view->scene_node, &ws->scene->node); + view->workspace = ws; view->tile = view->workspace->focused_tile; view_maximize(view, view->tile); seat_set_focus(server->seat, view); @@ -942,6 +939,7 @@ keybinding_move_view_to_output(struct cg_server *server, int output_num) { ->workspaces[server->curr_output->curr_workspace]; view->workspace = ws; wl_list_insert(&ws->views, &view->link); + wlr_scene_node_reparent(view->scene_node, &ws->scene->node); ws->focused_tile->view = view; view_maximize(view, ws->focused_tile); seat_set_focus(server->seat, view); @@ -982,6 +980,7 @@ keybinding_move_view_to_workspace(struct cg_server *server, uint32_t ws) { ->workspaces[server->curr_output->curr_workspace]; view->workspace = ws; wl_list_insert(&ws->views, &view->link); + wlr_scene_node_reparent(view->scene_node, &ws->scene->node); ws->focused_tile->view = view; view_maximize(view, ws->focused_tile); seat_set_focus(server->seat, view); diff --git a/parse.c b/parse.c index 112b5b6..7a4e3f8 100644 --- a/parse.c +++ b/parse.c @@ -864,12 +864,12 @@ parse_command(struct cg_server *server, struct keybinding *keybinding, char *mode = strtok_r(NULL, " ", &saveptr); if(mode == NULL) { *errstr = - log_error("Expected mode after \"switch_mode\". Got nothing."); + log_error("Expected mode after \"mode\". Got nothing."); return -1; } int mode_idx = get_mode_index_from_name(server->modes, mode); if(mode_idx == -1) { - *errstr = log_error("Unknown mode \"%s\" for switch_mode", mode); + *errstr = log_error("Unknown mode \"%s\" for \"mode\"", mode); return -1; } keybinding->data.u = (unsigned int)mode_idx; diff --git a/view.c b/view.c index da5aac5..e8f63e7 100644 --- a/view.c +++ b/view.c @@ -108,7 +108,7 @@ void view_unmap(struct cg_view *view) { uint32_t id = view->id; - uint32_t tile_id = view->tile->id; + uint32_t tile_id = 0; uint32_t ws = view->workspace->num; char *output_name = view->workspace->output->wlr_output->name; char *title = view->impl->get_title(view); @@ -117,13 +117,18 @@ view_unmap(struct cg_view *view) { return; } + if(view->tile == NULL) { + tile_id=-1; + } else { + tile_id=view->tile->id; + } + wlr_scene_node_destroy(view->scene_node); #if CG_HAS_XWAYLAND if((view->type != CG_XWAYLAND_VIEW || xwayland_view_should_manage(view))) #endif { - struct cg_tile *view_tile = view_get_tile(view); struct cg_view *prev = view_get_prev_view(view); if(view == view->server->seat->focused_view) { seat_set_focus(view->server->seat, prev); @@ -133,7 +138,7 @@ view_unmap(struct cg_view *view) { seat_set_focus(view->server->seat, view->server->seat->focused_view); } - view_tile = view_get_tile(view); + struct cg_tile *view_tile = view_get_tile(view); if(view_tile != NULL) { view_tile->view = prev; if(prev != NULL) { @@ -180,6 +185,9 @@ view_map(struct cg_view *view, struct wlr_surface *surface, their own (x,y) coordinates in handle_wayland_surface_map. */ if(view->type == CG_XWAYLAND_VIEW && !xwayland_view_should_manage(view)) { wl_list_insert(&ws->unmanaged_views, &view->link); + struct wlr_box *box = wlr_output_layout_get_box( + view->server->output_layout, view->workspace->output->wlr_output); + wlr_scene_node_set_position(view->scene_node, view->ox+box->x, view->oy+box->y); } else #endif { @@ -188,10 +196,16 @@ view_map(struct cg_view *view, struct wlr_surface *surface, wl_list_insert(&ws->views, &view->link); } seat_set_focus(output->server->seat, view); + int tile_id=0; + if(view->tile==NULL) { + tile_id=-1; + } else { + tile_id=view->tile->id; + } ipc_send_event( output->server, "view_map(view_id:%d,tile_id:%d,workspace:%d,output:%s,view_title:%s)", - view->id, view->tile->id, view->workspace->num + 1, + view->id, tile_id, view->workspace->num + 1, view->workspace->output->wlr_output->name, view->impl->get_title(view)); } diff --git a/xwayland.c b/xwayland.c index 500a1ce..086632f 100644 --- a/xwayland.c +++ b/xwayland.c @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include @@ -121,10 +120,12 @@ handle_xwayland_surface_map(struct wl_listener *listener, void *_data) { struct cg_xwayland_view *xwayland_view = wl_container_of(listener, xwayland_view, map); struct cg_view *view = &xwayland_view->view; - if(!xwayland_view_should_manage(view)) { - view->ox = xwayland_view->xwayland_surface->x; - view->oy = xwayland_view->xwayland_surface->y; + struct wlr_output_layout *output_layout = view->server->output_layout; + struct wlr_box *output_box = wlr_output_layout_get_box( + output_layout, view->server->curr_output->wlr_output); + view->ox = xwayland_view->xwayland_surface->x-output_box->x; + view->oy = xwayland_view->xwayland_surface->y-output_box->y; } view_map(view, xwayland_view->xwayland_surface->surface, From b1dd43799769afb42896b9d98719f635a4377824 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 18 Feb 2022 07:23:44 +0100 Subject: [PATCH 337/689] Remove duplicate code --- cagebreak.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index 3c144da..09af240 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -475,14 +475,6 @@ main(int argc, char *argv[]) { wlr_server_decoration_manager_set_default_mode( server_decoration_manager, WLR_SERVER_DECORATION_MANAGER_MODE_SERVER); - export_dmabuf_manager = - wlr_export_dmabuf_manager_v1_create(server.wl_display); - if(!export_dmabuf_manager) { - wlr_log(WLR_ERROR, "Unable to create the export DMABUF manager"); - ret = 1; - goto end; - } - viewporter = wlr_viewporter_create(server.wl_display); if (!viewporter) { wlr_log(WLR_ERROR, "Unable to create the viewporter interface"); From f12a16160c86325258dbed185317300358f7d3d1 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 18 Feb 2022 07:45:23 +0100 Subject: [PATCH 338/689] Add message command --- keybinding.c | 8 ++++++++ keybinding.h | 1 + parse.c | 8 ++++++++ 3 files changed, 17 insertions(+) diff --git a/keybinding.c b/keybinding.c index d12f727..16ef8e6 100644 --- a/keybinding.c +++ b/keybinding.c @@ -765,6 +765,11 @@ keybinding_show_info(struct cg_server *server) { free(msg); } +void +keybinding_display_message(struct cg_server *server, char *msg) { + message_printf(server->curr_output, "%s", msg); +} + void keybinding_move_view_to_cycle_output(struct cg_server *server, bool reverse) { if(wl_list_length(&server->outputs) <= 1) { @@ -1146,6 +1151,9 @@ run_action(enum keybinding_action action, struct cg_server *server, case KEYBINDING_SHOW_INFO: keybinding_show_info(server); break; + case KEYBINDING_DISPLAY_MESSAGE: + keybinding_display_message(server,data.c); + break; case KEYBINDING_RESIZE_TILE_HORIZONTAL: resize_tile(server, data.i, 0); break; diff --git a/keybinding.h b/keybinding.h index 548ce66..ebbfae9 100644 --- a/keybinding.h +++ b/keybinding.h @@ -44,6 +44,7 @@ enum keybinding_action { // reverse KEYBINDING_SHOW_TIME, KEYBINDING_SHOW_INFO, + KEYBINDING_DISPLAY_MESSAGE, KEYBINDING_SWAP_LEFT, KEYBINDING_SWAP_RIGHT, diff --git a/parse.c b/parse.c index 7a4e3f8..a28d712 100644 --- a/parse.c +++ b/parse.c @@ -731,6 +731,14 @@ parse_command(struct cg_server *server, struct keybinding *keybinding, keybinding->action = KEYBINDING_LAYOUT_FULLSCREEN; } else if(strcmp(action, "abort") == 0) { keybinding->action = KEYBINDING_NOOP; + } else if(strcmp(action, "message") == 0) { + keybinding->action = KEYBINDING_DISPLAY_MESSAGE; + if(saveptr == NULL) { + *errstr = log_error("Not enough paramaters to \"message\". Expected " + "string to display."); + return -1; + } + keybinding->data.c = strdup(saveptr); } else if(strcmp(action, "time") == 0) { keybinding->action = KEYBINDING_SHOW_TIME; } else if(strcmp(action, "nextscreen") == 0) { From ed5cca93901574524a9fa26f93a96e4d1adf8b5d Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 18 Feb 2022 08:05:28 +0100 Subject: [PATCH 339/689] Adjust logic for finding left,right,etc. tiles --- keybinding.c | 78 +++++++++++++++++++++++++++++----------------------- 1 file changed, 43 insertions(+), 35 deletions(-) diff --git a/keybinding.c b/keybinding.c index 16ef8e6..537f4bd 100644 --- a/keybinding.c +++ b/keybinding.c @@ -132,56 +132,71 @@ keybinding_list_free(struct keybinding_list *list) { free(list); } +// Returns whether x is between a and b (a exclusive, b exclusive) where +// anext; - while(it != tile && it->tile.x != tile->tile.x + tile->tile.width) { + int center=tile->tile.y+tile->tile.height/2; + while(it != tile) { + if(it->tile.x== tile->tile.x+tile->tile.width) { + if(is_between_strict(it->tile.y,it->tile.y+it->tile.height,center)||it->tile.y+it->tile.height==center) { + return it; + } + } it = it->next; } - if(it == tile) { - return NULL; - } else { - return it; - } + return NULL; } struct cg_tile * find_left_tile(const struct cg_tile *tile) { - struct cg_tile *it = tile->prev; - while(it != tile && it->tile.x + it->tile.width != tile->tile.x) { - it = it->prev; - } - if(it == tile) { - return NULL; - } else { - return it; + struct cg_tile *it = tile->next; + int center=tile->tile.y+tile->tile.height/2; + while(it != tile) { + if(it->tile.x+it->tile.width == tile->tile.x) { + if(is_between_strict(it->tile.y,it->tile.y+it->tile.height,center)||it->tile.y+it->tile.height==center) { + return it; + } + } + it = it->next; } + return NULL; } struct cg_tile * find_top_tile(const struct cg_tile *tile) { - struct cg_tile *it = tile->prev; - while(it != tile && it->tile.y + it->tile.height != tile->tile.y) { - it = it->prev; - } - if(it == tile) { - return NULL; - } else { - return it; + struct cg_tile *it = tile->next; + int center=tile->tile.x+tile->tile.width/2; + while(it != tile) { + if(it->tile.y+it->tile.height == tile->tile.y) { + if(is_between_strict(it->tile.x,it->tile.x+it->tile.width,center)||it->tile.x+it->tile.width==center) { + return it; + } + } + it = it->next; } + return NULL; } struct cg_tile * find_bottom_tile(const struct cg_tile *tile) { struct cg_tile *it = tile->next; - while(it != tile && it->tile.y != tile->tile.y + tile->tile.height) { + int center=tile->tile.x+tile->tile.width/2; + while(it != tile) { + if(it->tile.y == tile->tile.y+tile->tile.height) { + if(is_between_strict(it->tile.x,it->tile.x+it->tile.width,center)||it->tile.x+it->tile.width==center) { + return it; + } + } it = it->next; } - if(it == tile) { - return NULL; - } else { - return it; - } + return NULL; } void @@ -264,13 +279,6 @@ focus_tile_bottom(struct cg_tile *tile) { focus_tile(tile, find_bottom_tile); } -// Returns whether x is between a and b (a exclusive, b exclusive) where -// atile.x + tile->tile.y - *get_coord(tile); From cb7b551e2435a621ab89f7a8456d995738ff895d Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 19 Feb 2022 09:58:27 +0100 Subject: [PATCH 340/689] Add dump functionality --- keybinding.c | 272 +++++++++++++++++++++++++++++++++++++++++++++++++++ keybinding.h | 1 + parse.c | 2 + seat.c | 17 ++-- seat.h | 4 + 5 files changed, 288 insertions(+), 8 deletions(-) diff --git a/keybinding.c b/keybinding.c index 537f4bd..96c0528 100644 --- a/keybinding.c +++ b/keybinding.c @@ -7,10 +7,12 @@ #include #include #include +#include #include #include #include "input.h" +#include "util.h" #include "input_manager.h" #include "keybinding.h" #include "message.h" @@ -761,6 +763,273 @@ keybinding_show_time(struct cg_server *server) { free(msg); } +struct dyn_str { + uint32_t len; + uint32_t cur_pos; + char **str_arr; +}; + +/*Note that inp is in an invalid state after calling the function * and should no longer be used.*/ +char *dyn_str_to_str(struct dyn_str *inp) { + char *outp=calloc(inp->len+1,sizeof(char)); + if(outp == NULL) { + return NULL; + } + outp[inp->len]='\0'; + uint32_t tmp_pos=0; + for(uint32_t i=0;icur_pos;++i) { + strcat(outp+tmp_pos,inp->str_arr[i]); + tmp_pos+=strlen(inp->str_arr[i]); + free(inp->str_arr[i]); + } + free(inp->str_arr); + return outp; +} + +int +print_str(struct dyn_str *outp, const char *fmt, ...) { + va_list args; + va_start(args, fmt); + char *ret = malloc_vsprintf_va_list(fmt, args); + if(ret == NULL) { + return -1; + } + outp->str_arr[outp->cur_pos]=ret; + ++outp->cur_pos; + outp->len+=strlen(ret); + return 0; +} + +void +print_modes(struct dyn_str *str,char **modes) { + uint32_t len=0; + char **tmp=modes; + uint32_t nmemb=0; + while(*tmp!=NULL) { + len+=strlen(*tmp); + ++nmemb; + ++tmp; + } + /* We are assuming here that we have at least one mode, which is given by the initialization of cagebreak */ + char *modes_str=calloc(len+3*(nmemb-1)+1, sizeof(char)); + modes_str[len+nmemb-1]='\0'; + uint32_t tmp_pos=0; + for(uint32_t i=0;iid); + char *title_str=view->impl->get_title(view); + print_str(&outp_str,"\"title\": \"%s\",\n",title_str==NULL?"":title_str); + print_str(&outp_str,"\"coords\": [\"x\":%d,\"y\":%d],\n",view->ox,view->oy); + print_str(&outp_str,"\"type\": \"%s\",\n",view->type==CG_XWAYLAND_VIEW?"xwayland":"xdg"); + return dyn_str_to_str(&outp_str); +} + +char *print_tile(struct cg_tile *tile) { + struct dyn_str outp_str; + outp_str.len=0; + outp_str.cur_pos=0; + uint32_t nmemb=4; + outp_str.str_arr=calloc(nmemb,sizeof(char *)); + print_str(&outp_str,"\"id\": %d,\n",tile->id); + print_str(&outp_str,"\"coords\": [\"x\":%d,\"y\":%d],\n",tile->tile.x,tile->tile.y); + print_str(&outp_str,"\"size\": [\"width\":%d,\"height\":%d],\n",tile->tile.width,tile->tile.height); + print_str(&outp_str,"\"view\": \"%d\",\n",tile->view==NULL?-1:(int)tile->view->id); + return dyn_str_to_str(&outp_str); +} + +char * +print_views(struct cg_workspace *ws) { + struct dyn_str outp_str; + outp_str.len=0; + outp_str.cur_pos=0; + uint32_t nviews=wl_list_length(&ws->views); + if(nviews==0) { + return strdup("{}"); + } + outp_str.str_arr=calloc(2*nviews-1,sizeof(char *)); + struct cg_view *it; + uint32_t count=0; + wl_list_for_each(it,&ws->views,link) { + if(count!=0) { + print_str(&outp_str,","); + } + ++count; + char *view_str=print_view(it); + if(view_str!=NULL) { + print_str(&outp_str,"{\n%s\n}",view_str); + free(view_str); + } + } + return dyn_str_to_str(&outp_str); +} + +char * +print_tiles(struct cg_workspace *ws) { + struct dyn_str outp_str; + outp_str.len=0; + outp_str.cur_pos=0; + uint32_t ntiles=0; + bool first=true; + for(struct cg_tile *tile=ws->focused_tile;first||tile!=ws->focused_tile;tile=tile->next) { + first=false; + ++ntiles; + } + if(ntiles==0) { + return strdup("{}"); + } + outp_str.str_arr=calloc(2*ntiles-1,sizeof(char *)); + first=true; + for(struct cg_tile *tile=ws->focused_tile;first||tile!=ws->focused_tile;tile=tile->next) { + if(first==false) { + print_str(&outp_str,","); + } + first=false; + char *tile_str=print_tile(tile); + if(tile_str!=NULL) { + print_str(&outp_str,"{\n%s\n}",tile_str); + free(tile_str); + } + } + return dyn_str_to_str(&outp_str); +} + +char * +print_workspace(struct cg_workspace *ws) { + struct dyn_str outp_str; + outp_str.len=0; + outp_str.cur_pos=0; + uint32_t nmemb=6; + outp_str.str_arr=calloc(nmemb,sizeof(char *)); + print_str(&outp_str,"\"views\": ["); + char *views_str=print_views(ws); + if(views_str!=NULL) { + print_str(&outp_str,"%s",views_str); + free(views_str); + } + print_str(&outp_str,"],"); + print_str(&outp_str,"\"tiles\": ["); + char *tiles_str=print_tiles(ws); + if(tiles_str!=NULL) { + print_str(&outp_str,"%s",tiles_str); + free(tiles_str); + } + print_str(&outp_str,"]"); + return dyn_str_to_str(&outp_str); +} + +char * +print_workspaces(struct cg_output *outp) { + struct dyn_str outp_str; + outp_str.len=0; + outp_str.cur_pos=0; + outp_str.str_arr=calloc((2*outp->server->nws-1)+2,sizeof(char *)); + print_str(&outp_str, "\"workspaces\": ["); + for(int i=0;iserver->nws;++i) { + if(i!=0) { + print_str(&outp_str,","); + } + char *ws=print_workspace(outp->workspaces[i]); + if(ws != NULL) { + print_str(&outp_str,"{%s}",ws); + free(ws); + } + } + print_str(&outp_str, "],\n"); + return dyn_str_to_str(&outp_str); +} + +char * +print_output(struct cg_output *outp) { + struct dyn_str outp_str; + outp_str.len=0; + outp_str.cur_pos=0; + uint32_t nmemb=5; + outp_str.str_arr=calloc(nmemb,sizeof(char *)); + print_str(&outp_str,"\"%s\": {\n",outp->wlr_output->name); + print_str(&outp_str,"\"priority\": %d,\n",outp->priority); + print_str(&outp_str,"\"curr_workspace\": %d,\n",outp->curr_workspace); + char *workspaces_str=print_workspaces(outp); + if(workspaces_str!=NULL) { + print_str(&outp_str, "%s",workspaces_str); + free(workspaces_str); + } + print_str(&outp_str,"}"); + return dyn_str_to_str(&outp_str); +} + +char * +print_outputs(struct cg_server *server) { + uint32_t noutps=wl_list_length(&server->outputs); + struct dyn_str outp_str; + outp_str.len=0; + outp_str.cur_pos=0; + outp_str.str_arr=calloc((2*noutps-1)+2,sizeof(char *)); + print_str(&outp_str, "\"outputs\": ["); + struct cg_output *it; + uint32_t count=0; + wl_list_for_each(it,&server->outputs,link) { + if(count!=0) { + print_str(&outp_str,","); + } + ++count; + char *outp=print_output(it); + if(outp == NULL) { + continue; + } + print_str(&outp_str,"%s",outp); + free(outp); + } + print_str(&outp_str, "],\n"); + return dyn_str_to_str(&outp_str); +} + +void +keybinding_dump(struct cg_server *server) { + struct dyn_str str; + str.len=0; + str.cur_pos=0; + uint32_t nmemb=11; + str.str_arr=calloc(nmemb,sizeof(char *)); + + print_str(&str,"{"); + print_str(&str,"\"nws\":%d,\n",server->nws); + print_str(&str,"\"bg_color\":[%f,%f,%f,%f],\n",server->bg_color[0],server->bg_color[1],server->bg_color[2],server->bg_color[3]); + print_str(&str,"\"views_curr_id\":%d,\n",server->views_curr_id); + print_str(&str,"\"tiles_curr_id\":%d,\n",server->tiles_curr_id); + print_str(&str,"\"curr_output\":%s,\n",server->curr_output->wlr_output->name); + print_modes(&str,server->modes); + char *outps_str=print_outputs(server); + print_str(&str,"%s",outps_str); + free(outps_str); + print_str(&str,"\"cursor_coords\":{\"x\":%f,\"y\":%f},\n",server->seat->cursor->x,server->seat->cursor->y); + struct cg_view *focused_view=seat_desktop_view_at(server,server->seat->cursor->x,server->seat->cursor->y,NULL,NULL,NULL); + print_str(&str,"\"cursor_focused_view\":%d,\n",focused_view==NULL?-1:(int) focused_view->id); + print_str(&str,"}"); + + char *send_str=dyn_str_to_str(&str); + if(send_str==NULL) { + wlr_log(WLR_ERROR, "Unable to create output string for \"dump\"."); + } + ipc_send_event(server, send_str); + free(send_str); +} + void keybinding_show_info(struct cg_server *server) { char *msg = server_show_info(server); @@ -1156,6 +1425,9 @@ run_action(enum keybinding_action action, struct cg_server *server, case KEYBINDING_SHOW_TIME: keybinding_show_time(server); break; + case KEYBINDING_DUMP: + keybinding_dump(server); + break; case KEYBINDING_SHOW_INFO: keybinding_show_info(server); break; diff --git a/keybinding.h b/keybinding.h index ebbfae9..82c15ff 100644 --- a/keybinding.h +++ b/keybinding.h @@ -42,6 +42,7 @@ enum keybinding_action { KEYBINDING_MOVE_VIEW_TO_OUTPUT, // data.u is the desired output KEYBINDING_MOVE_VIEW_TO_CYCLE_OUTPUT, // data.b is 0 if forward, 1 if // reverse + KEYBINDING_DUMP, KEYBINDING_SHOW_TIME, KEYBINDING_SHOW_INFO, KEYBINDING_DISPLAY_MESSAGE, diff --git a/parse.c b/parse.c index a28d712..32eb363 100644 --- a/parse.c +++ b/parse.c @@ -711,6 +711,8 @@ parse_command(struct cg_server *server, struct keybinding *keybinding, keybinding->action = KEYBINDING_SPLIT_HORIZONTAL; } else if(strcmp(action, "quit") == 0) { keybinding->action = KEYBINDING_QUIT; + } else if(strcmp(action, "dump") == 0) { + keybinding->action = KEYBINDING_DUMP; } else if(strcmp(action, "show_info") == 0) { keybinding->action = KEYBINDING_SHOW_INFO; } else if(strcmp(action, "close") == 0) { diff --git a/seat.c b/seat.c index e1ed24f..1e0940a 100644 --- a/seat.c +++ b/seat.c @@ -47,18 +47,19 @@ static void drag_icon_update_position(struct cg_drag_icon *drag_icon); -/* If desktop_view_at returns a view, there is also a +/* If seat_desktop_view_at returns a view, there is also a * surface. There cannot be a surface without a view, either. It's * both or nothing. */ -static struct cg_view * -desktop_view_at(const struct cg_server *server, double lx, double ly, +struct cg_view * +seat_desktop_view_at(const struct cg_server *server, double lx, double ly, struct wlr_surface **surface, double *sx, double *sy) { struct wlr_scene_node *node=wlr_scene_node_at(&server->scene->node, lx,ly,sx,sy); if(node == NULL || node->type != WLR_SCENE_NODE_SURFACE) { return NULL; } - *surface = wlr_scene_surface_from_node(node)->surface; - + if(surface!=NULL) { + *surface = wlr_scene_surface_from_node(node)->surface; + } while(node != NULL && node->data == NULL) { node=node->parent; } @@ -531,7 +532,7 @@ handle_touch_down(struct wl_listener *listener, void *data) { double sx, sy; struct wlr_surface *surface; struct cg_view *view = - desktop_view_at(seat->server, lx, ly, &surface, &sx, &sy); + seat_desktop_view_at(seat->server, lx, ly, &surface, &sx, &sy); uint32_t serial = 0; if(view) { @@ -577,7 +578,7 @@ handle_touch_motion(struct wl_listener *listener, void *data) { double sx, sy; struct wlr_surface *surface; struct cg_view *view = - desktop_view_at(seat->server, lx, ly, &surface, &sx, &sy); + seat_desktop_view_at(seat->server, lx, ly, &surface, &sx, &sy); if(view) { wlr_seat_touch_point_focus(seat->seat, surface, event->time_msec, @@ -632,7 +633,7 @@ process_cursor_motion(struct cg_seat *seat, uint32_t time) { struct wlr_seat *wlr_seat = seat->seat; struct wlr_surface *surface = NULL; - struct cg_view *view = desktop_view_at(seat->server, seat->cursor->x, + struct cg_view *view = seat_desktop_view_at(seat->server, seat->cursor->x, seat->cursor->y, &surface, &sx, &sy); if(!view) { diff --git a/seat.h b/seat.h index c581de3..2967292 100644 --- a/seat.h +++ b/seat.h @@ -11,6 +11,7 @@ struct cg_input_device; struct wlr_seat; struct wlr_xcursor_manager; struct wlr_backend; +struct wlr_surface; #define DEFAULT_XCURSOR "left_ptr" #define XCURSOR_SIZE 24 @@ -93,6 +94,9 @@ struct cg_drag_icon { struct wl_listener destroy; }; +struct cg_view * +seat_desktop_view_at(const struct cg_server *server, double lx, double ly, + struct wlr_surface **surface, double *sx, double *sy); struct cg_seat * seat_create(struct cg_server *server, struct wlr_backend *backend); void From e10e09025cf399267e7e5ee1427fce5e07f9c330 Mon Sep 17 00:00:00 2001 From: project-repo Date: Tue, 15 Mar 2022 20:47:53 +0100 Subject: [PATCH 341/689] Fix non-xwayland build --- keybinding.c | 4 ++++ output.c | 2 ++ xwayland.c | 3 +++ 3 files changed, 9 insertions(+) diff --git a/keybinding.c b/keybinding.c index 96c0528..d7c84b2 100644 --- a/keybinding.c +++ b/keybinding.c @@ -836,7 +836,11 @@ char *print_view(struct cg_view *view) { char *title_str=view->impl->get_title(view); print_str(&outp_str,"\"title\": \"%s\",\n",title_str==NULL?"":title_str); print_str(&outp_str,"\"coords\": [\"x\":%d,\"y\":%d],\n",view->ox,view->oy); +#if CG_HAS_XWAYLAND print_str(&outp_str,"\"type\": \"%s\",\n",view->type==CG_XWAYLAND_VIEW?"xwayland":"xdg"); +#else + print_str(&outp_str,"\"type\": \"xdg\",\n"); +#endif return dyn_str_to_str(&outp_str); } diff --git a/output.c b/output.c index a31e575..4e78844 100644 --- a/output.c +++ b/output.c @@ -30,7 +30,9 @@ #include #include #include +#if CG_HAS_XWAYLAND #include +#endif #include "keybinding.h" #include "message.h" diff --git a/xwayland.c b/xwayland.c index 086632f..9f42ce8 100644 --- a/xwayland.c +++ b/xwayland.c @@ -6,6 +6,7 @@ * * See the LICENSE file accompanying this file. */ +#include "config.h" #include #include @@ -13,7 +14,9 @@ #include #include #include +#if CG_HAS_XWAYLAND #include +#endif #include "output.h" #include "server.h" From fe9b22c66be3f71f56347a88dba7a15aaa3aa772 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Wed, 16 Mar 2022 18:57:08 +0100 Subject: [PATCH 342/689] Add missing word in documentation --- man/cagebreak-config.5.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index 2cbef4a..b255171 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -143,7 +143,7 @@ definekey top mode root Enable or disable disable-while-typing for specified input device - *enabled|disabled|disabled_on_external_mouse* + *event enabled|disabled|disabled_on_external_mouse* Enable or disable send_events for specified input device - Disabling send_events disables the input device. From e801f162d68541438baa904a31b40121c4ae7884 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Thu, 17 Mar 2022 22:11:55 +0100 Subject: [PATCH 343/689] Fix style in man page --- man/cagebreak-config.5.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index b255171..4ab4cca 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -187,10 +187,10 @@ definekey top mode root executed. *movetonextscreen* - Move current window to next screen + Move currently focused window to next screen *movetoprevscreen* - Move current window to previous screen + Move currently focused window to previous screen *movetoscreen * Move currently focused window to -th screen From 6e1464127fa382ebd82e2c280757ce262b6801d7 Mon Sep 17 00:00:00 2001 From: project-repo Date: Tue, 29 Mar 2022 10:05:15 +0200 Subject: [PATCH 344/689] Double fork to fix xwayland bug --- cagebreak.c | 10 ---------- keybinding.c | 13 +++++++++++-- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index 09af240..d480b70 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -83,14 +83,6 @@ set_sig_handler(int sig, void (*action)(int)) { } } -void -sig_chld_handler(int signal) { - int pid = 1; - while(pid > 0) { - pid = waitpid(WAIT_ANY, NULL, WNOHANG); - } -} - static bool drop_permissions(void) { if(getuid() != geteuid() || getgid() != getegid()) { @@ -326,8 +318,6 @@ main(int argc, char *argv[]) { wl_event_loop_add_signal(event_loop, SIGALRM, handle_signal, &server); server.event_loop = event_loop; - set_sig_handler(SIGCHLD, sig_chld_handler); - backend = wlr_backend_autocreate(server.wl_display); if(!backend) { wlr_log(WLR_ERROR, "Unable to create the wlroots backend"); diff --git a/keybinding.c b/keybinding.c index d7c84b2..b82176a 100644 --- a/keybinding.c +++ b/keybinding.c @@ -2,6 +2,7 @@ #include #include +#include #include #include #include @@ -1396,8 +1397,16 @@ run_action(enum keybinding_action action, struct cg_server *server, keybinding_split_vertical(server); break; case KEYBINDING_RUN_COMMAND: - if(fork() == 0) { - into_process(data.c); + { + int pid; + if((pid=fork()) == 0) { + if(fork() == 0) { + into_process(data.c); + } + _exit(0); + } else if(pid > 0) { + waitpid(pid,NULL,0); + } } break; case KEYBINDING_CYCLE_VIEWS: From 02368600eb9e4bddbe9854c1f9c197e96fd4491e Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 9 Apr 2022 16:20:22 +0200 Subject: [PATCH 345/689] Fix crash on touch device removal --- seat.c | 1 - 1 file changed, 1 deletion(-) diff --git a/seat.c b/seat.c index 1e0940a..855ae83 100644 --- a/seat.c +++ b/seat.c @@ -95,7 +95,6 @@ remove_touch(struct cg_seat *seat, struct cg_touch *touch) { if(!touch) { return; } - wl_list_remove(&touch->link); wlr_cursor_detach_input_device(seat->cursor, touch->device->wlr_device); --seat->num_touch; free(touch); From f4b7a5a498040fc74bb99a8f63dcae49ff8acaae Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Thu, 14 Apr 2022 17:00:05 +0200 Subject: [PATCH 346/689] Improve README --- README.md | 66 ++++++++++++++++++++++++++++++++----------------------- 1 file changed, 39 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 17e84b1..7c7e59b 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,23 @@ # Cagebreak: A Wayland Tiling Compositor Inspired by Ratpoison -This is Cagebreak, a Wayland tiling compositor. The goal of this project is to -provide a successor to ratpoison for Wayland users. However, this is -no reimplementation of ratpoison. Should you like to know if a feature -will be implemented, open an issue or get in touch with the development team. +This is Cagebreak, a Wayland tiling compositor. + +The goal of this project is to provide a successor to ratpoison for Wayland +users. However, this is no reimplementation of ratpoison. + +Should you like to know if a feature will be implemented, open an issue +or get in touch with the development team. For documentation of Cagebreak, please see -the man pages for [cagebreak](man/cagebreak.1.md) and cagebreak -[configuration](man/cagebreak-config.5.md) and the -[Wiki](https://github.com/project-repo/cagebreak/wiki/). + * the man pages + * [cagebreak](man/cagebreak.1.md) + * [configuration](man/cagebreak-config.5.md) + * also the [FAQ](FAQ.md) Cagebreak is based on [Cage](https://github.com/Hjdskes/cage), a Wayland kiosk compositor. -Cagebreak is currently being developed under Arch Linux and uses the libraries +Cagebreak is developed under Arch Linux and uses the libraries as they are obtained through pacman. However, cagebreak should also work on other distributions given the proper library versions. @@ -21,8 +25,11 @@ other distributions given the proper library versions. If you are using archlinux, just use the PKGBUILDs from the aur: - * Using the `cagebreak` package, Cagebreak is compiled on the target system (since release 1.3.0) - * Using `cagebreak-bin` package, the pre-built binaries are extracted to the appropriate paths on the target system (since release 1.3.2) + * Using [cagebreak](https://aur.archlinux.org/packages/cagebreak), Cagebreak is + compiled on the target system (since release 1.3.0) + * Using [cagebreak-bin](https://aur.archlinux.org/packages/cagebreak-bin), + the pre-built binaries are extracted to + appropriate paths on the target system (since release 1.3.2) See [cagebreak-pkgbuild](https://github.com/project-repo/cagebreak-pkgbuild) for details. @@ -59,7 +66,7 @@ $ ninja -C build By default, this builds a debug build. To build a release build, use `meson build --buildtype=release`. -#### Xwayland Support +##### Xwayland Support Cagebreak comes with compile-time support for XWayland. To enable this, first make sure that your version of wlroots is compiled with this @@ -67,9 +74,16 @@ option. Then, add `-Dxwayland=true` to the `meson` command above. Note that you'll need to have the XWayland binary installed on your system for this to work. -#### Man Pages +#### -D option -Cagebreak has man pages. To use them, make sure that you have `pandoc` +If cagebreak is not a release build, the binary has the -D option, which +enables damage-debug mode. In damage-debug mode, all regions of the screen +which are not rerendered are colored in red in order to facilitate debugging +of damage tracking issues. + +##### Man Pages + +Cagebreak has man pages. To use them, make sure that you have `scdoc` installed. Then, add `-Dman-pages=true` to the `meson` command. ### Running Cagebreak @@ -81,24 +95,22 @@ KMS+DRM backend. For more configuration options, see the man pages. ## Contributing to Cagebreak -Cagebreak is currently developed to fit the needs of its creators. Should you desire -to implement a feature, please let us know in advance by opening an issue. However, -the feature set is intentionally limited (i.e. we removed support for a desktop -background) and will continue to be so in the future. +Cagebreak is currently developed to fit the needs of its creators. Should you +desire to implement a feature, please let us know in advance by opening +an issue. However, the feature set is intentionally limited (i.e. we removed +support for a desktop background) and will continue to be so in the future. -Nonetheless, don't be intimidated by the (slightly lengthy) release checklist or any other -part of this file. Do what you can, open an issue and we will collaborate -toward a solution. +Nonetheless, don't be intimidated by the (slightly lengthy) release checklist +or any other part of this file. Do what you can, open an issue and we will +collaborate toward a solution. ### Branching Strategy and Versioning -All features are to be developed on feature branches, named after the feature. +There exists a branch `development` to which all reasonable code +is comitted for final testing. -There exists a branch `development` to which all reasonable feature branches -are merged for final testing. - -Once `development` is ready for a release, meaning that the release checklist is fulfilled, -it is merged into `master`, creating a new release, which is tagged and signed. +Once `development` is ready for a release, it is merged into `master` (possibly via +a cherry-picked branch), creating a new release, which is tagged and signed. All releases are tagged according to [semantic versioning](https://semver.org) guidelines. @@ -107,7 +119,7 @@ In the past, our git history did not perfectly reflect this scheme. ### Releases The release checklist must be completely fulfilled in one run for a release to -occur. Once any failure occurs the entire checklist must be completed from scratch. +occur. * [ ] `git checkout development` * [ ] `git pull origin development` From 1f9a720809a1e60b25b7ce16375fd8d34a9eee20 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Thu, 14 Apr 2022 17:06:01 +0200 Subject: [PATCH 347/689] Add SECURITY.md relevance check to release checks --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 7c7e59b..b7b7fcf 100644 --- a/README.md +++ b/README.md @@ -134,6 +134,8 @@ occur. * [ ] Set EPOCH to release day in man generation in meson.build * [ ] wiki * [ ] Changelog.md for major and minor releases but not patches + * [ ] Check features for SECURITY.md relevance (changes to socket scope + for example) * [ ] Fixed bugs documented in Bugs.md * [ ] Include issue description from github * [ ] Testing From 132112c2a5c3ab19a994860869cd48fe1c574071 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Thu, 14 Apr 2022 17:40:01 +0200 Subject: [PATCH 348/689] Remove -D option doc --- README.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/README.md b/README.md index b7b7fcf..f5a5df6 100644 --- a/README.md +++ b/README.md @@ -74,13 +74,6 @@ option. Then, add `-Dxwayland=true` to the `meson` command above. Note that you'll need to have the XWayland binary installed on your system for this to work. -#### -D option - -If cagebreak is not a release build, the binary has the -D option, which -enables damage-debug mode. In damage-debug mode, all regions of the screen -which are not rerendered are colored in red in order to facilitate debugging -of damage tracking issues. - ##### Man Pages Cagebreak has man pages. To use them, make sure that you have `scdoc` From a3c5e6baf1c61a7f0542e1910f212fcf79c5bcea Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Thu, 14 Apr 2022 18:02:44 +0200 Subject: [PATCH 349/689] Prepare man page for 1.9.0 --- man/cagebreak.1.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index a7c8d5f..ff3d7e8 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -1,8 +1,8 @@ -cagebreak(1) "Version 1.8.2" "Cagebreak Manual" +cagebreak(1) "Version 1.9.0" "Cagebreak Manual" # NAME -cagebreak - A Wayland tiling compositor to the likes of ratpoison +cagebreak - A Wayland tiling compositor # SYNOPSIS From e5cce909b61ff1caccf023b18ceba174b5929808 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Thu, 14 Apr 2022 18:06:17 +0200 Subject: [PATCH 350/689] Prepare config man page for 1.9.0 --- man/cagebreak-config.5.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index 4ab4cca..2e1fc8f 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -1,4 +1,4 @@ -cagebreak-config(5) "Version 1.8.2" "Cagebreak Manual" +cagebreak-config(5) "Version 1.9.0" "Cagebreak Manual" # NAME From 55ac751fc1d01a64aaf90afb6af80d28172ee258 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Thu, 14 Apr 2022 18:10:38 +0200 Subject: [PATCH 351/689] Add SECURITY.md --- SECURITY.md | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 SECURITY.md diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..1353450 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,64 @@ +# Security + +The main possibility for security bugs to occur in cagebreak is by privilege escalation using the socket. Indeed, any program with access to the socket immediately gains arbitrary code execution rights. As of right now, the socket is world-writable. If you disagree with this threat model, you may contact us via email (See section Email Contact below.) or [open an issue on github](https://github.com/project-repo/cagebreak/issues/new). + +Should any problem with the github issue system arise or any other reason for (potentially confidential) contact with the Cagebreak authors appear, you may contact us via email (See section Email Contact below.). + +## Supported Versions + +The latest release always contains the latest bug fixes and features. There are no official backports for security vulnerabilities. Builds are reproducible under conditions outlined in [README.md](README.md). + +## Bug Reports + +For normal bugs you may [open an issue on github](https://github.com/project-repo/cagebreak/issues/new). + +For everything else, an email contact (with gpg encryption and signature) is available below. + +## Email Contact + +Should you want to get in touch with the developers of cagebreak to report a security vulnerability or anything else via email, contact `cagebreak @ project-repo . co`. + +We will try to respond to everything that is not obvious spam. + +### GPG-Encrypted Emails + +If you can, please encrypt your email with the appropriate GPG key found in `keys/` and sign your message with your own key. + +* B15B92642760E11FE002DE168708D42451A94AB5 +* F8DD9F8DD12B85A28F5827C4678E34D2E753AA3C + +Note that our keys are signed by cagebreak signing keys. + +If you want us to respond via GPG-encrypted email, please include your own public key or provide the fingerprint and directions to obtain the key. + +## Threat Model + +Cagebreak is a wayland compositor, which is run by the user of the system and thus has access to whichever resources this user has access to. Cagebreak can restrict other programs in no way, because this would hamper usability (consider a web browser unable to write a downloaded file to disk for instance). There is no transmission of information by cagebreak other than to the screens, ipc and potentially other documented local channels. + +### STRIDE Threat List + +This is not a thorough analysis, just an overview of the ways in which cagebreak has/does not have an attack surface. + +#### Spoofing + +Not applicable - Using cagebreak already requires a login as a user. + +#### Tampering + +Not applicable - Cagebreak must allow system manipulation for user software. + +#### Repudiation + +Not applicable - There are no prohibited operations (See Tampering above.). While cagebreak does send events over documented channels there is no logging activated by default, though, of course, this can be changed by the user by logging socket output for example. + +#### Information Disclosure + +Not applicable - Information disclosure over documented channels is a feature and any software run by the user may exfiltrate any data the user has access to. + +#### Denial of Service + +Not applicable - Cagebreak offers functionality to terminate itself, which is available to all user software over the socket. + +#### Elevation of privilege + +Software may gain arbitrary code execution rights if it has access to the Cagebreak socket. Privilege escalation to root is unlikely since privileges are dropped before any user input is accepted. \ No newline at end of file From 83b1562a5502d5caad6c4360db1ef2f759b3d3e3 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Thu, 14 Apr 2022 18:15:25 +0200 Subject: [PATCH 352/689] Reformat SECURITY.md --- SECURITY.md | 52 +++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 39 insertions(+), 13 deletions(-) diff --git a/SECURITY.md b/SECURITY.md index 1353450..9fd151a 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -1,43 +1,62 @@ # Security -The main possibility for security bugs to occur in cagebreak is by privilege escalation using the socket. Indeed, any program with access to the socket immediately gains arbitrary code execution rights. As of right now, the socket is world-writable. If you disagree with this threat model, you may contact us via email (See section Email Contact below.) or [open an issue on github](https://github.com/project-repo/cagebreak/issues/new). +The main possibility for security bugs to occur in cagebreak is by privilege +escalation using the socket. Indeed, any program with access to the socket +immediately gains arbitrary code execution rights. As of right now, the socket +is world-writable. If you disagree with this threat model, you may contact +us via email (See section Email Contact below.) or [open an issue on github](https://github.com/project-repo/cagebreak/issues/new). -Should any problem with the github issue system arise or any other reason for (potentially confidential) contact with the Cagebreak authors appear, you may contact us via email (See section Email Contact below.). +Should any problem with the github issue system arise or any other reason +for (potentially confidential) contact with the Cagebreak authors appear, +you may contact us via email (See section Email Contact below.). ## Supported Versions -The latest release always contains the latest bug fixes and features. There are no official backports for security vulnerabilities. Builds are reproducible under conditions outlined in [README.md](README.md). +The latest release always contains the latest bug fixes and features. +There are no official backports for security vulnerabilities. Builds +are reproducible under conditions outlined in [README.md](README.md). ## Bug Reports For normal bugs you may [open an issue on github](https://github.com/project-repo/cagebreak/issues/new). -For everything else, an email contact (with gpg encryption and signature) is available below. +For everything else, an email contact (with gpg encryption and signature) +is available below. ## Email Contact -Should you want to get in touch with the developers of cagebreak to report a security vulnerability or anything else via email, contact `cagebreak @ project-repo . co`. +Should you want to get in touch with the developers of cagebreak to report +a security vulnerability or anything else via email, contact +`cagebreak @ project-repo . co`. We will try to respond to everything that is not obvious spam. ### GPG-Encrypted Emails -If you can, please encrypt your email with the appropriate GPG key found in `keys/` and sign your message with your own key. +If you can, please encrypt your email with the appropriate GPG key found +in `keys/` and sign your message with your own key. * B15B92642760E11FE002DE168708D42451A94AB5 * F8DD9F8DD12B85A28F5827C4678E34D2E753AA3C Note that our keys are signed by cagebreak signing keys. -If you want us to respond via GPG-encrypted email, please include your own public key or provide the fingerprint and directions to obtain the key. +If you want us to respond via GPG-encrypted email, please include your own +public key or provide the fingerprint and directions to obtain the key. ## Threat Model -Cagebreak is a wayland compositor, which is run by the user of the system and thus has access to whichever resources this user has access to. Cagebreak can restrict other programs in no way, because this would hamper usability (consider a web browser unable to write a downloaded file to disk for instance). There is no transmission of information by cagebreak other than to the screens, ipc and potentially other documented local channels. +Cagebreak is a wayland compositor, which is run by the user of the system +and thus has access to whichever resources this user has access to. +Cagebreak can restrict other programs in no way, because this would hamper +usability (consider a web browser unable to write a downloaded file to disk +for instance). There is no transmission of information by cagebreak other +than to the screens, ipc and potentially other documented local channels. ### STRIDE Threat List -This is not a thorough analysis, just an overview of the ways in which cagebreak has/does not have an attack surface. +This is not a thorough analysis, just an overview of the ways in which cagebreak +has/does not have an attack surface. #### Spoofing @@ -49,16 +68,23 @@ Not applicable - Cagebreak must allow system manipulation for user software. #### Repudiation -Not applicable - There are no prohibited operations (See Tampering above.). While cagebreak does send events over documented channels there is no logging activated by default, though, of course, this can be changed by the user by logging socket output for example. +Not applicable - There are no prohibited operations (See Tampering above.). +While cagebreak does send events over documented channels there is no logging +activated by default, though, of course, this can be changed by the user +by logging socket output for example. #### Information Disclosure -Not applicable - Information disclosure over documented channels is a feature and any software run by the user may exfiltrate any data the user has access to. +Not applicable - Information disclosure over documented channels is a feature +and any software run by the user may exfiltrate any data the user has access to. #### Denial of Service -Not applicable - Cagebreak offers functionality to terminate itself, which is available to all user software over the socket. +Not applicable - Cagebreak offers functionality to terminate itself, which is +available to all user software over the socket. #### Elevation of privilege -Software may gain arbitrary code execution rights if it has access to the Cagebreak socket. Privilege escalation to root is unlikely since privileges are dropped before any user input is accepted. \ No newline at end of file +Software may gain arbitrary code execution rights if it has access to the +Cagebreak socket. Privilege escalation to root is unlikely since privileges +are dropped before any user input is accepted. From ce80f86b49b64a231cd8b785bdc44963a8e81483 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Thu, 14 Apr 2022 19:20:52 +0200 Subject: [PATCH 353/689] Add FAQ.md --- FAQ.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 FAQ.md diff --git a/FAQ.md b/FAQ.md new file mode 100644 index 0000000..a494392 --- /dev/null +++ b/FAQ.md @@ -0,0 +1,37 @@ +# Frequently Asked Questions + +## How do I do $thing with cagebreak? + + * Check the man pages + * [cagebreak config](man/cagebreak-config.5.md) (probably where you find the answer) + * [cagebreak](man/cagebreak.1.md) (command line options etc.) + * Check the rest of this FAQ + * [Open an issue](https://wiki.archlinux.org/title/Linux_console/Keyboard_configuration) or otherwise get in touch with the development team (See section Email Contact in [SECURITY.md](SECURITY.md)). + +Note that the feature set of cagebreak is intentionally limited. + +## How do I remap Caps Lock? + +Remapping Caps Lock globally seems to be the best option. +Follow instructions [here](https://wiki.archlinux.org/title/Linux_console/Keyboard_configuration) to achieve this (should be roughly +distribution-agnostic). + +## How do I get firefox to run under wayland? + +Set the following environment variables + + * `MOZ_USE_WAYLAND=1` + * `GDK_BACKEND=wayland` + +to activate wayland support for firefox. + +## Which further resources are available? + + * [Arch Linux Wiki entry for Cagebreak](https://wiki.archlinux.org/title/Cagebreak) + * [Sway Wiki](https://github.com/swaywm/sway/wiki) + * [Cage Wiki](https://github.com/Hjdskes/cage/wiki) + +## This FAQ did not help me. What now? + + * Consider [opening an issue](https://github.com/project-repo/cagebreak/issues/new) on github or getting in touch with the + development team (See section Email Contact in [SECURITY.md](SECURITY.md)). From f31ee224cafd94203cd47f5cac618135201b29ef Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Thu, 14 Apr 2022 19:58:49 +0200 Subject: [PATCH 354/689] Adapt README to upcoming release --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f5a5df6..aee8318 100644 --- a/README.md +++ b/README.md @@ -125,7 +125,7 @@ occur. * [ ] man/cagebreak * [ ] man/cagebreak-config * [ ] Set EPOCH to release day in man generation in meson.build - * [ ] wiki + * [ ] FAQ.md * [ ] Changelog.md for major and minor releases but not patches * [ ] Check features for SECURITY.md relevance (changes to socket scope for example) @@ -134,6 +134,7 @@ occur. * [ ] Testing * [ ] Manual testing * [ ] Libfuzzer testing + * [ ] Build version without xwayland support * [ ] Version Number * [ ] meson.build * [ ] git tag @@ -172,6 +173,9 @@ occur. * [ ] `cp build/cagebreak-config.5 release-artefacts_version/` * [ ] `cp build/cagebreak-config.5.sig release-artefacts_version/` * [ ] `cp LICENSE release-artefacts_version/` + * [ ] `cp README.md release-artefacts_version/` + * [ ] `cp SECURITY.md release-artefacts_version/` + * [ ] `cp FAQ.md release-artefacts_version/` * [ ] `export SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) ; tar --sort=name --mtime= --owner=0 --group=0 --numeric-owner -czf release-artefacts_version.tar.gz release-artefacts_version` * [ ] Checked archive * [ ] tar -xvf release_version.tar.gz From 9bee3fddc468676384e40f0952cca096baca5144 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Thu, 14 Apr 2022 21:02:32 +0200 Subject: [PATCH 355/689] Fix FAQ --- FAQ.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/FAQ.md b/FAQ.md index a494392..1077a69 100644 --- a/FAQ.md +++ b/FAQ.md @@ -1,12 +1,12 @@ # Frequently Asked Questions -## How do I do $thing with cagebreak? +## How do I do a particular thing with cagebreak? * Check the man pages * [cagebreak config](man/cagebreak-config.5.md) (probably where you find the answer) * [cagebreak](man/cagebreak.1.md) (command line options etc.) * Check the rest of this FAQ - * [Open an issue](https://wiki.archlinux.org/title/Linux_console/Keyboard_configuration) or otherwise get in touch with the development team (See section Email Contact in [SECURITY.md](SECURITY.md)). + * [Open an issue](https://github.com/project-repo/cagebreak/issues/new) or otherwise get in touch with the development team (See section Email Contact in [SECURITY.md](SECURITY.md)). Note that the feature set of cagebreak is intentionally limited. From 6f03363507860d825de43d35b50ea01d6f28fecb Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 14 Apr 2022 21:08:13 +0200 Subject: [PATCH 356/689] Update example config --- examples/config | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/examples/config b/examples/config index f701684..e6a6cb5 100644 --- a/examples/config +++ b/examples/config @@ -23,6 +23,7 @@ bind N nextscreen bind P prevscreen bind a time bind C-n movetonextscreen +bind C-p movetoprevscreen bind H exchangeleft bind J exchangedown bind K exchangeup @@ -33,6 +34,7 @@ bind k focusup bind l focusright bind t exec xterm bind C-k close +#bind m message Hello World! definekey resize h resizeleft definekey resize l resizeright definekey resize j resizedown @@ -42,6 +44,20 @@ definekey resize Escape setmode top ###################### #Workspaces ###################### +bind 1 screen 1 +bind 2 screen 2 +bind 3 screen 3 +bind 4 screen 4 +bind 5 screen 5 +bind 6 screen 6 + +bind A-1 movetoscreen 1 +bind A-2 movetoscreen 2 +bind A-3 movetoscreen 3 +bind A-4 movetoscreen 4 +bind A-5 movetoscreen 5 +bind A-6 movetoscreen 6 + definekey top A-1 workspace 1 definekey top A-2 workspace 2 definekey top A-3 workspace 3 @@ -78,6 +94,7 @@ definekey top XF86MonBrightnessUp exec xbacklight -inc 1 #output eDP-1 pos 0 0 res 1366x768 rate 60 #output eDP-1 disable #output eDP-1 enable +#output eDP-1 prio 1 ##################### #Input configuration From 6527d964ef9ab7449df41ee682df4b4c439315d1 Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Thu, 14 Apr 2022 23:50:12 +0200 Subject: [PATCH 357/689] Add new gpg keys --- README.md | 2 + SECURITY.md | 1 + keys/cagebreak@project-repo.co.pub | 193 +++++++----------- ...=> cagebreak@project-repo.co.pub-legacy-1} | 0 keys/cagebreak@project-repo.co.pub-legacy-2 | 123 +++++++++++ ...gebreak_signing_key_10@project-repo.co.pub | 76 +++++++ ...agebreak_signing_key_9@project-repo.co.pub | 64 ++++++ 7 files changed, 339 insertions(+), 120 deletions(-) rename keys/{cagebreak@project-repo.co.pub-legacy => cagebreak@project-repo.co.pub-legacy-1} (100%) create mode 100644 keys/cagebreak@project-repo.co.pub-legacy-2 create mode 100644 keys/cagebreak_signing_key_10@project-repo.co.pub create mode 100644 keys/cagebreak_signing_key_9@project-repo.co.pub diff --git a/README.md b/README.md index aee8318..0c716a6 100644 --- a/README.md +++ b/README.md @@ -245,6 +245,8 @@ keys. * 8F872885968EB8C589A32E9539ACC012896D450F * 896B92AF738C974E0065BF42F2576BD366156BB9 * AA927AFD50AF7C6810E69FE8274F2C605359E31B + * BE2DED372287BC4EB2213E13A0C743848A638955 + * 0F3476E4B2404F95EC41600683D5810F7911B020 Should we at any point retire a key, we will only replace it with keys signed by at least one of the above collection. diff --git a/SECURITY.md b/SECURITY.md index 9fd151a..848c856 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -38,6 +38,7 @@ in `keys/` and sign your message with your own key. * B15B92642760E11FE002DE168708D42451A94AB5 * F8DD9F8DD12B85A28F5827C4678E34D2E753AA3C +* 3ACEA46CCECD59E4C8222F791CBEB493681E8693 Note that our keys are signed by cagebreak signing keys. diff --git a/keys/cagebreak@project-repo.co.pub b/keys/cagebreak@project-repo.co.pub index 6d23cef..c266665 100644 --- a/keys/cagebreak@project-repo.co.pub +++ b/keys/cagebreak@project-repo.co.pub @@ -1,123 +1,76 @@ -----BEGIN PGP PUBLIC KEY BLOCK----- -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 -LA== -=UJ+r +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 +PbvoKi4FeWdszeakeWuqdmKEi/+ltIk= +=uqsg -----END PGP PUBLIC KEY BLOCK----- diff --git a/keys/cagebreak@project-repo.co.pub-legacy b/keys/cagebreak@project-repo.co.pub-legacy-1 similarity index 100% rename from keys/cagebreak@project-repo.co.pub-legacy rename to keys/cagebreak@project-repo.co.pub-legacy-1 diff --git a/keys/cagebreak@project-repo.co.pub-legacy-2 b/keys/cagebreak@project-repo.co.pub-legacy-2 new file mode 100644 index 0000000..6d23cef --- /dev/null +++ b/keys/cagebreak@project-repo.co.pub-legacy-2 @@ -0,0 +1,123 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +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 +LA== +=UJ+r +-----END PGP PUBLIC KEY BLOCK----- diff --git a/keys/cagebreak_signing_key_10@project-repo.co.pub b/keys/cagebreak_signing_key_10@project-repo.co.pub new file mode 100644 index 0000000..c266665 --- /dev/null +++ b/keys/cagebreak_signing_key_10@project-repo.co.pub @@ -0,0 +1,76 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +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 +PbvoKi4FeWdszeakeWuqdmKEi/+ltIk= +=uqsg +-----END PGP PUBLIC KEY BLOCK----- diff --git a/keys/cagebreak_signing_key_9@project-repo.co.pub b/keys/cagebreak_signing_key_9@project-repo.co.pub new file mode 100644 index 0000000..2e99549 --- /dev/null +++ b/keys/cagebreak_signing_key_9@project-repo.co.pub @@ -0,0 +1,64 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +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 +=gLvW +-----END PGP PUBLIC KEY BLOCK----- From 79645a8f2e64d301ee6c05527c6da3b66e3e111c Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Fri, 15 Apr 2022 19:39:30 +0200 Subject: [PATCH 358/689] Add Issues 29-33 to Bugs.md --- Bugs.md | 255 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 255 insertions(+) diff --git a/Bugs.md b/Bugs.md index 328450d..c04b290 100644 --- a/Bugs.md +++ b/Bugs.md @@ -364,3 +364,258 @@ When I type in anything, the text is refreshed and becomes visible only followin ``` Cagebreak had an error with damage tracking. + +### Issue 29 + + * github issue number: #19 + * Fixed: 1.9.0 + +bda65hp: +``` +Hi, +Is there a way to easily change de font? "monospace 10" are too small for my eyes. I've changed them in message.c but can you add a configuration option, please? +Same for the display time of these window. They sometimes disappear too fast (mainly time). +May be a config for the background and foreground color of the message window too? + +cagebreak is great :) +``` + +project-repo: +``` +No, there is currently no easy way to change the font size, background or display +time of the message. + +Adding these ideas as a command is a good idea though. + +To summarize, the release pertaining to #19 will presumably introduce a +command for configuring the cagebreak messages. This command will be +able to set the following: + + * [ ] Font size + * [ ] Font colour + * [ ] Background colour + * [ ] Display time of message + +Another, related, idea would be to have an interface for sending +arbitrary messages over the socket which are then displayed by +cagebreak. This may also be added to the above features. + +We're glad to hear that you enjoy cagebreak! Thank you for helping to +make it even greater. + +cheers +project-repo +``` + +bda65hp: +``` +Awesome :) +Displaying time in locale format (or configurable) will be great too ;) +``` + +project-repo: +``` +Yes, once it is possible to send arbitrary messages via cagebreak over +the socket it will be possible to have the date be displayed however you +like! +cheers +project-repo +``` + +project-repo: +``` +We pushed some code to development implementing this in 348925e (configuration) and f12a161 (message command). Sorry for not writing this much sooner. However, at least it will be part of the upcoming release. + +cheers +project-repo +``` + +### Issue 30 + + * github issue number: #11 + * Fixed: 1.9.0 + +kinleyd: +``` +In my first post I forgot to thank you for cagebreak. I've been evaluating compositors for my needs and have been through kiwmi, japokwm, wayfire, sway and cagebreak. So far I like cagebreak most of all. + +Back to my question: + +You currently support 'movetonextscreen' but there is no equivalent movetoprevscreen. +For multiple 3 to 4 screen configurations the second command would be useful. + +Also, is it not possible to move to a screen directly, like 'movetoscreen 3'? + +The same thing with prevscreen and nextscreen: something like 'focusscreen 3', if it were possible, would be useful. +``` + +project-repo: +``` +Thank you! It's great to hear that cagebreak seems to suit your needs. + +About your question, yes, that absolutely makes sense. The reason this +wasn't implemented earlier is that no-one has needed it up to now, but +seeing as there now appears to be a use-case, we can definitely +implement these features. In future releases, cagebreak will then most +likely support movetoprevscreen and movetoscreen (as these are +distinct functionalities). + +The only issue I see at this point is that the numbering of screens is +not directly canonical. To resolve this, I suggest that per default, +screens are numbered according to the order in which they were added +along with an additional configuration option to specify numbering (this +would most likely be an additional option for the already existent +output command). Does that seem fine to you? +cheers, +project-repo +``` + +kinleyd: +``` +Yes, that would be perfect. Thank you! +``` + +kinleyd: +``` +May I suggest we also have 'screen ' like we have 'workspace '. +``` + +project-repo: +``` +Thank you for this suggestion. This will be implemented in the release +where the rest of this issue is resolved (probably the next one). + +To summarize, presumably the release pertaining to #11 will include: + + * [ ] movetoprevscreen as a command symmetric to movetonextscreen + * [ ] movetoscreen as a command similar to movetoworkspace + * [ ] screen as a command similar to workspace + * [ ] additional output functionality for monitor numbering (of + course backwards-compatible, such that valid configs remain + valid) + +If anything changes with regard to this draft, we will post it here so +you can let us know what you think. + +cheers, +project-repo +``` + +kinleyd: +``` +Super - I greatly look forward to their addition, and thank you for your responsiveness! +``` + +project-repo: +``` +Everything mentioned on our last comment has now been implemented on the +development branch. (More specifically in 851a2f8, +though documentation was added later.) + +The simple commands work as proposed in our previous comment. +The output command has a new feature called prio now, which you can call as follows: + +output prio + +All outputs, regardless of configuration are added once they request to be added +and have a default priority of -1. Using prio, you can set priorities +greater than or equal to 1 for specific outputs and hence order your outputs +as you wish. Note that cagebreak -s might be useful while fiddling around +with this. + +If you like, you can check it out on development and compile it for yourself. +If you're up to it we would be glad to know what you think about it, +especially when output prio is applied to your multi-screen setup and +regarding the readability of the cagebreak-config man page description of +output prio. + +Please note that this is not a release yet and the development branch +might undergo changes. + +cheers +project-repo +``` + +kinleyd: +``` +I took the development branch for a swirl, and it looks good. Thank you! + +Everything works as you had set out: screen, movetoscreen, movetoprevscreen and output screen prio all work as expected. The default screen position now reflects the prio settings and that's great. + +I took a look at the updates to the man page as well and it looks quite clear. + +So hey, thank you for the great work! I look forward to the incorporation of the new features in the master branch when it is ready. + +Happy holidays and a happy new year! +``` + +### Issue 31 + + * github issue number: #25 + * Fixed: 1.9.0 + +``` +The configuration man page for the input send events setting is missing the events word: + +diff --git man/cagebreak-config.5.md man/cagebreak-config.5.md +index 4eea4c5..c618314 100644 +--- man/cagebreak-config.5.md ++++ man/cagebreak-config.5.md +@@ -123,7 +123,7 @@ by prepending a line with the # symbol. + *dwt enabled|disabled* + Enables or disables disable-while-typing for the specified input device. + + - *enabled|disabled|disabled_on_external_mouse* + - + *events enabled|disabled|disabled_on_external_mouse* + Enables or disables send_events for specified input device. Disabling + send_events disables the input device. +Slightly off topic: I was hoping to use this setting to hide the mouse cursor, but it doesn't work. My embedded system must expose a pointer device even though none is connected, altough I can only infer that much because the system is very bare bones and I can't check. Is there a way to do that? +``` + +The word was omitted before 1.9.0. Mouse hiding was relegated to a new issue (#26). + +### Issue 32 + + * github issue number: #24 + * Fixed: 1.9.0 + +``` +The wlr/xwayland.h include in output.c:32 is missing an #if CG_HAS_XWAYLAND guard, which breaks building without xwayland. +``` + +Cagebreak did not build without xwayland. This bug has been fixed and building +without xwayland has been added to the release checklist. + +### Issue 33 + + * github issue number: #23 + * Fixed: 1.9.0 + +``` +Similar to djpohly/dwl#177. Xwayland works fine elsewhere: cage, hikari, kwinft, labwc, phoc, river, sway, wayfire. +``` +$ cagebreak +[...] +00:00:00.085 [xwayland/server.c:92] Starting Xwayland on :0 +00:00:00.116 [render/swapchain.c:105] Allocating new swapchain buffer +00:00:00.118 [render/allocator/gbm.c:142] Allocated 1280x720 GBM buffer (format 0x34325258, modifier 0x100000000000004) +00:00:00.118 [render/gles2/renderer.c:143] Created GL FBO for buffer 1280x720 +00:00:00.160 [types/wlr_surface.c:748] New wlr_surface 0x880d81f80 (res 0x86f22d380) +00:00:00.165 [xwayland/server.c:243] waitpid for Xwayland fork failed: No child processes +(EE) failed to read Wayland events: Broken pipe +xterm: Xt error: Can't open display: :0 + +$ cc --version +FreeBSD clang version 11.0.1 (git@github.com:llvm/llvm-project.git llvmorg-11.0.1-0-g43ff75f2c3fe) +Target: x86_64-unknown-freebsd13.0 +Thread model: posix +InstalledDir: /usr/bin + +$ pkg info -x cagebreak wayland wlroots +cagebreak-1.8.3 +wayland-1.20.0 +wayland-protocols-1.25 +xwayland-devel-21.0.99.1.171 +wlroots-0.15.1 +``` +``` From c1769a2ed49d625a88f5b3b65b56bfe72ca8587c Mon Sep 17 00:00:00 2001 From: Cagebreak Signing Key 7 Date: Fri, 15 Apr 2022 21:02:33 +0200 Subject: [PATCH 359/689] Document new features --- man/cagebreak-config.5.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index 2e1fc8f..bc35944 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -48,6 +48,33 @@ definekey root Close current window - This may be useful for windows of applications which do not offer any method of closing them. +configure_message [font |[f|b]g_color b> |display_time ] + Configure message characteristics - + - font sets + - is + - X core font description or + - FreeType font description via pango + - fg_color sets RGBA of foreground + - bg_color sets RGBA of background + - display_time sets display time in seconds + +``` +# Set font +## Set example X code font +configure_message font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1 +## Set example FreeType font description +configure_message font pango:monospace 10 + +# Set foreground RGBA to red +configure_message fg_color 1.0 0.0 0.0 1.0 + +# Set background RGBA to red +configure_message bg_color 1.0 0.0 0.0 1.0 + +# Set duration for message display to four seconds +configure_message display_time 4 +``` + *definekey * Bind to execute if pressed in - *definekey* is a more general version of *bind*. @@ -182,6 +209,9 @@ definekey top mode root middle click. _lmr_ treats 1 finger as left click, 2 fingers as middle click, and 3 fingers as right click. +message + Display a line of arbitrary text. + *mode * Enter mode "" - Returns to default mode, after a command is executed. From 8afd69d057f4c70f8ef5f59af0a1f1eb5928438d Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 17 Apr 2022 12:18:04 +0200 Subject: [PATCH 360/689] Fix positioning of unmanged xwayland views --- xwayland.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xwayland.c b/xwayland.c index 9f42ce8..c3c3a57 100644 --- a/xwayland.c +++ b/xwayland.c @@ -87,8 +87,10 @@ maximize(struct cg_view *view, int width, int height) { } } - wlr_xwayland_surface_configure(xwayland_view->xwayland_surface, view->ox, - view->oy, width, height); + struct wlr_box *output_box = wlr_output_layout_get_box( + view->server->output_layout, view->server->curr_output->wlr_output); + wlr_xwayland_surface_configure(xwayland_view->xwayland_surface, view->ox+output_box->x, + view->oy+output_box->y, width, height); wlr_xwayland_surface_set_maximized(xwayland_view->xwayland_surface, true); } From 2457a37da8a388b3e2bf1a1986ce80235a7cbc3a Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 24 Apr 2022 15:43:53 +0200 Subject: [PATCH 361/689] Change to json output for ipc messages --- keybinding.c | 54 ++++++++++++++++++++++++---------------------------- output.c | 4 ++-- view.c | 5 ++--- 3 files changed, 29 insertions(+), 34 deletions(-) diff --git a/keybinding.c b/keybinding.c index b82176a..6fba4d0 100644 --- a/keybinding.c +++ b/keybinding.c @@ -225,7 +225,7 @@ swap_tile(struct cg_tile *tile, seat_set_focus(server->seat, swap_tile->view); ipc_send_event( tile->workspace->output->server, - "swap_tile(tile_id:%d,swap_tile_id:%d,workspace:%d,output:%s)", + "{\"event_name\":\"swap_tile\",\"tile_id\":\"%d\",\"swap_tile_id\":\"%d\",\"workspace\":\"%d\",\"output\":\"%s\"}", tile->id, swap_tile->id, tile->workspace->num + 1, tile->workspace->output->wlr_output->name); } @@ -372,8 +372,7 @@ resize(struct cg_tile *tile, const struct cg_tile *parent, int coord_offset, view_maximize(tile->view, tile); } ipc_send_event(tile->workspace->output->server, - "resize_tile(tile_id:%d,old_dims:[%d;%d;%d;%d],new_dims:[%d;" - "%d;%d;%d],workspace:%d,output:%s)", + "{\"event_name\":\"resize_tile\",\"tile_id\":\"%d\",\"old_dims\":\"[%d;%d;%d;%d]\",\"new_dims\":\"[%d;%d;%d;%d]\",\"workspace\":\"%d\",\"output\":\"%s\"}", tile->id, old_x, old_y, old_height, old_width, tile->tile.x, tile->tile.y, tile->tile.height, tile->tile.width, tile->workspace->num + 1, @@ -499,7 +498,7 @@ keybinding_workspace_fullscreen(struct cg_server *server) { seat_set_focus(server->seat, current_view); ipc_send_event(output->server, - "fullscreen(tile_id:%d,workspace:%d,output:%s)", + "{\"event_name\":\"fullscreen\",\"tile_id\":\"%d\",\"workspace\":\"%d\",\"output\":\"%s\"}", output->workspaces[output->curr_workspace]->focused_tile->id, output->workspaces[output->curr_workspace]->num + 1, output->wlr_output->name); @@ -593,7 +592,7 @@ keybinding_split_output(struct cg_output *output, bool vertical) { } ipc_send_event( output->server, - "split(tile_id:%d,new_tile_id:%d,workspace:%d,output:%s,vertical:%d)", + "{\"event_name\":\"split\",\"tile_id\":\"%d\",\"new_tile_id\":\"%d\",\"workspace\":\"%d\",\"output\":\"%s\",\"vertical\":\"%d\"}", curr_workspace->focused_tile->id, new_tile->id, curr_workspace->num + 1, curr_workspace->output->wlr_output->name, vertical); } @@ -609,7 +608,7 @@ keybinding_close_view(struct cg_view *view) { uint32_t ws = view->workspace->num; view->impl->close(view); ipc_send_event(outp->server, - "close(view_id:%d,tile_id:%d,workspace:%d,output:%s)", + "{\"event_name\":\"close\",\"view_id\":\"%d\",\"tile_id\":\"%d\",\"workspace\":\"%d\",\"output\":\"%s\"}", view_id, tile_id, ws + 1, outp->wlr_output->name); } @@ -659,7 +658,7 @@ keybinding_cycle_outputs(struct cg_server *server, bool reverse) { } set_output(server, output); ipc_send_event( - output->server, "cycle_outputs(old_output:%s,new_output:%s,reverse:%d)", + output->server, "{\"event_name\":\"cycle_outputs\",\"old_output\":\"%s\",\"new_output\":\"%s\",\"reverse\":\"%d\"}", old_output->wlr_output->name, output->wlr_output->name, reverse); } @@ -703,8 +702,7 @@ keybinding_cycle_views(struct cg_server *server, bool reverse) { next_view->link.prev, curr_workspace->focused_tile->view, link); seat_set_focus(server->seat, next_view); ipc_send_event(curr_workspace->output->server, - "cycle_views(old_view_id:%d,new_view_id:%d,tile_id:%d," - "workspace:%d,output:%s)", + "{\"event_name\":\"cycle_views\",\"old_view_id\":\"%d\",\"new_view_id\":\"%d\",\"tile_id\":\"%d\",\"workspace\":\"%d\",\"output\":\"%s\"}", current_view->id, next_view->id, next_view->tile->id, curr_workspace->num + 1, curr_workspace->output->wlr_output->name); @@ -725,7 +723,7 @@ keybinding_cycle_tiles(struct cg_server *server, bool reverse) { seat_set_focus(server->seat, next_view); ipc_send_event( output->server, - "cycle_tiles(old_tile_id:%d,new_tile_id:%d,workspace:%d,output:%s)", + "{\"event_name\":\"cycle_tiles\",\"old_tile_id\":\"%d\",\"new_tile_id\":\"%d\",\"workspace\":\"%d\",\"output\":\"%s\"}", old_tile->id, workspace->focused_tile->id, workspace->num + 1, output->wlr_output->name); } @@ -745,7 +743,7 @@ keybinding_switch_ws(struct cg_server *server, uint32_t ws) { server->curr_output->workspaces[ws]->focused_tile->view); message_printf(server->curr_output, "Workspace %d", ws + 1); ipc_send_event(output->server, - "switch_ws(old_workspace:%d,new_workspace:%d,output:%s)", + "{\"event_name\":\"switch_ws\",\"old_workspace\":\"%d\",\"new_workspace\":\"%d\",\"output\":\"%s\"}", old_ws + 1, ws + 1, output->wlr_output->name); return 0; } @@ -1084,7 +1082,7 @@ keybinding_move_view_to_cycle_output(struct cg_server *server, bool reverse) { } ipc_send_event( server, - "move_view_cycle_output(view_id:%d,old_output:%s,new_output:%s)", + "{\"event_name\":\"move_view_cycle_output\",\"view_id\":\"%d\",\"old_output\":\"%s\",\"new_output\":\"%s\"}", view->id, old_outp->wlr_output->name, server->curr_output->wlr_output->name); } @@ -1140,7 +1138,7 @@ keybinding_set_nws(struct cg_server *server, int nws) { server->seat, server->curr_output->workspaces[server->curr_output->curr_workspace] ->focused_tile->view); - ipc_send_event(server, "set_nws(old_nws:%d,new_nws:%d)", old_nws, + ipc_send_event(server, "{\"event_name\":\"set_nws\",\"old_nws\":\"%d\",\"new_nws\":\"%d\"}", old_nws, server->nws); } @@ -1158,19 +1156,19 @@ keybinding_definemode(struct cg_server *server, char *mode) { server->modes[length] = NULL; server->modes[length - 1] = strdup(mode); - ipc_send_event(server, "definemode(mode:%s)", mode); + ipc_send_event(server, "{\"event_name\":\"definemode\",\"mode\":\"%s\"}", mode); } void keybinding_definekey(struct cg_server *server, struct keybinding *kb) { keybinding_list_push(server->keybindings, kb); - ipc_send_event(server, "definekey(modifiers:%d,key:%d,command:%d)", + ipc_send_event(server, "{\"event_name\":\"definekey\",\"modifiers\":\"%d\",\"key\":\"%d\",\"command\":\"%d\"}", kb->modifiers, kb->key, kb->action); } void keybinding_set_background(struct cg_server *server, float *bg) { - ipc_send_event(server, "background(old_bg:[%f,%f,%f],new_bg:[%f,%f,%f])", + ipc_send_event(server, "{\"event_name\":\"background\",\"old_bg\":\"[%f,%f,%f]\",\"new_bg\":\"[%f,%f,%f]\"}", server->bg_color[0], server->bg_color[1], server->bg_color[2], bg[0], bg[1], bg[2]); server->bg_color[0] = bg[0]; @@ -1193,7 +1191,7 @@ keybinding_switch_output(struct cg_server *server, int output) { wl_list_for_each(it, &server->outputs, link) { if(count == output) { set_output(server, it); - ipc_send_event(server, "switch_output(old_output:%s,new_output:%s)", + ipc_send_event(server, "{\"event_name\":\"switch_output\",\"old_output\":\"%s\",\"new_output\":\"%s\"}", old_outp->wlr_output->name, it->wlr_output->name); return; } @@ -1238,8 +1236,7 @@ keybinding_move_view_to_output(struct cg_server *server, int output_num) { view_id = view->id; } ipc_send_event(server, - "move_view_to_output(view_id:%d,old_output:%s,new_output:%s," - "view_title:%s)", + "{\"event_name\":\"move_view_to_output\",\"view_id\":\"%d\",\"old_output\":\"%s\",\"new_output\":\"%s\",\"view_title\":\"%s\"}", view_id, old_outp->wlr_output->name, server->curr_output->wlr_output->name, view_title); } @@ -1273,11 +1270,10 @@ keybinding_move_view_to_workspace(struct cg_server *server, uint32_t ws) { seat_set_focus(server->seat, view); } ipc_send_event(server, - "move_view_to_ws(view_id:%d,old_workspace:%d,new_workspace:%" - "d,output:%s,view_title:%s)", - view->id, old_ws, ws, - view->workspace->output->wlr_output->name, - view->impl->get_title(view)); + "{\"event_name\":\"move_view_to_ws\",\"view_id\":\"%d\",\"old_workspace\":\"%d\",\"new_workspace\":\"%d\",\"output\":\"%s\",\"view_title\":\"%s\"}", + view==NULL?-1:(int)view->id, old_ws, ws, + server->curr_output->wlr_output->name, + view==NULL?"":view->impl->get_title(view)); } void @@ -1326,7 +1322,7 @@ keybinding_configure_output(struct cg_server *server, wl_list_for_each_safe(output, tmp_output, &server->outputs, link) { if(strcmp(config->output_name, output->wlr_output->name) == 0) { output_configure(server, output); - ipc_send_event(output->server, "configure_output(output:%s)", + ipc_send_event(output->server, "{\"event_name\":\"configure_output\",\"output\":\"%s\"}", cfg->output_name); return; } @@ -1334,7 +1330,7 @@ keybinding_configure_output(struct cg_server *server, wl_list_for_each_safe(output, tmp_output, &server->disabled_outputs, link) { if(strcmp(config->output_name, output->wlr_output->name) == 0) { output_configure(server, output); - ipc_send_event(output->server, "configure_output(output:%s)", + ipc_send_event(output->server, "{\"event_name\":\"configure_output\",\"output\":\"%s\"}", cfg->output_name); return; } @@ -1345,7 +1341,7 @@ void keybinding_configure_input(struct cg_server *server, struct cg_input_config *cfg) { cg_input_apply_config(cfg, server); - ipc_send_event(server, "configure_input(input:%s)", cfg->identifier); + ipc_send_event(server, "{\"event_name\":\"configure_input\",\"input\":\"%s\"}", cfg->identifier); } void @@ -1370,7 +1366,7 @@ keybinding_configure_message(struct cg_server *server, server->message_config.fg_color[2] = config->fg_color[2]; server->message_config.fg_color[3] = config->fg_color[3]; } - ipc_send_event(server, "configure_message()"); + ipc_send_event(server, "{\"event_name\":\"configure_message\"}"); } void @@ -1428,7 +1424,7 @@ run_action(enum keybinding_action action, struct cg_server *server, server->seat->mode = data.u; break; case KEYBINDING_SWITCH_DEFAULT_MODE: - ipc_send_event(server, "switch_default_mode(old_mode:%d,mode:%d)", + ipc_send_event(server, "{\"event_name\":\"switch_default_mode\",\"old_mode\":\"%d\",\"mode\":\"%d\"}", server->seat->default_mode, data.u); server->seat->mode = data.u; server->seat->default_mode = data.u; diff --git a/output.c b/output.c index 4e78844..66b644f 100644 --- a/output.c +++ b/output.c @@ -141,7 +141,7 @@ output_destroy(struct cg_output *output) { free(output); if(outp_name != NULL) { - ipc_send_event(server, "new_output(output:%s)", outp_name); + ipc_send_event(server, "{\"event_name\":\"new_output\",\"output\":\"%s\"}", outp_name); free(outp_name); } else { wlr_log(WLR_ERROR, @@ -433,7 +433,7 @@ handle_new_output(struct wl_listener *listener, void *data) { wl_signal_add(&wlr_output->events.commit, &output->commit); output->mode.notify = handle_output_mode; wl_signal_add(&wlr_output->events.mode, &output->mode); - ipc_send_event(server, "new_output(output:%s,priority:%d)", + ipc_send_event(server, "{\"event_name\":\"new_output\",\"output\":\"%s\",\"priority\":\"%d\"}", output->wlr_output->name, output->priority); } #if CG_HAS_FANALYZE diff --git a/view.c b/view.c index e8f63e7..d9bb611 100644 --- a/view.c +++ b/view.c @@ -161,8 +161,7 @@ view_unmap(struct cg_view *view) { view->wlr_surface = NULL; ipc_send_event(view->workspace->server, - "view_unmap(view_id:%d,tile_id:%d,workspace:%d,output:%s," - "view_title:%s)", + "{\"event_name\":\"view_unmap\",\"view_id\":\"%d\",\"tile_id\":\"%d\",\"workspace\":\"%d\",\"output\":\"%s\",\"view_title\":\"%s\"}", id, tile_id, ws + 1, output_name, title); } @@ -204,7 +203,7 @@ view_map(struct cg_view *view, struct wlr_surface *surface, } ipc_send_event( output->server, - "view_map(view_id:%d,tile_id:%d,workspace:%d,output:%s,view_title:%s)", + "{\"event_name\":\"view_map\",\"view_id\":\"%d\",\"tile_id\":\"%d\",\"workspace\":\"%d\",\"output\":\"%s\",\"view_title\":\"%s\"}", view->id, tile_id, view->workspace->num + 1, view->workspace->output->wlr_output->name, view->impl->get_title(view)); } From 33877210d9ffb714d7498aa48e10a712ed5c75ac Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 24 Apr 2022 16:12:04 +0200 Subject: [PATCH 362/689] Fix segmentation fault due to drag icons --- keybinding.c | 4 +--- seat.c | 46 ++++++++++++---------------------------------- seat.h | 3 --- 3 files changed, 13 insertions(+), 40 deletions(-) diff --git a/keybinding.c b/keybinding.c index 6fba4d0..4fff0d3 100644 --- a/keybinding.c +++ b/keybinding.c @@ -1007,7 +1007,7 @@ keybinding_dump(struct cg_server *server) { struct dyn_str str; str.len=0; str.cur_pos=0; - uint32_t nmemb=11; + uint32_t nmemb=10; str.str_arr=calloc(nmemb,sizeof(char *)); print_str(&str,"{"); @@ -1021,8 +1021,6 @@ keybinding_dump(struct cg_server *server) { print_str(&str,"%s",outps_str); free(outps_str); print_str(&str,"\"cursor_coords\":{\"x\":%f,\"y\":%f},\n",server->seat->cursor->x,server->seat->cursor->y); - struct cg_view *focused_view=seat_desktop_view_at(server,server->seat->cursor->x,server->seat->cursor->y,NULL,NULL,NULL); - print_str(&str,"\"cursor_focused_view\":%d,\n",focused_view==NULL?-1:(int) focused_view->id); print_str(&str,"}"); char *send_str=dyn_str_to_str(&str); diff --git a/seat.c b/seat.c index 855ae83..4f82743 100644 --- a/seat.c +++ b/seat.c @@ -47,25 +47,6 @@ static void drag_icon_update_position(struct cg_drag_icon *drag_icon); -/* If seat_desktop_view_at returns a view, there is also a - * surface. There cannot be a surface without a view, either. It's - * both or nothing. */ -struct cg_view * -seat_desktop_view_at(const struct cg_server *server, double lx, double ly, - struct wlr_surface **surface, double *sx, double *sy) { - struct wlr_scene_node *node=wlr_scene_node_at(&server->scene->node, lx,ly,sx,sy); - if(node == NULL || node->type != WLR_SCENE_NODE_SURFACE) { - return NULL; - } - if(surface!=NULL) { - *surface = wlr_scene_surface_from_node(node)->surface; - } - while(node != NULL && node->data == NULL) { - node=node->parent; - } - return node->data; -} - static void update_capabilities(const struct cg_seat *seat) { uint32_t caps = 0; @@ -529,14 +510,12 @@ handle_touch_down(struct wl_listener *listener, void *data) { event->y, &lx, &ly); double sx, sy; - struct wlr_surface *surface; - struct cg_view *view = - seat_desktop_view_at(seat->server, lx, ly, &surface, &sx, &sy); + struct wlr_scene_node *node=wlr_scene_node_at(&seat->server->scene->node, lx,ly,&sx,&sy); uint32_t serial = 0; - if(view) { + if(node&&node->type == WLR_SCENE_NODE_SURFACE) { serial = wlr_seat_touch_notify_down( - seat->seat, surface, event->time_msec, event->touch_id, sx, sy); + seat->seat, wlr_scene_surface_from_node(node)->surface, event->time_msec, event->touch_id, sx, sy); } if(serial && wlr_seat_touch_num_points(seat->seat) == 1) { @@ -575,12 +554,10 @@ handle_touch_motion(struct wl_listener *listener, void *data) { event->y, &lx, &ly); double sx, sy; - struct wlr_surface *surface; - struct cg_view *view = - seat_desktop_view_at(seat->server, lx, ly, &surface, &sx, &sy); + struct wlr_scene_node *node=wlr_scene_node_at(&seat->server->scene->node, lx,ly,&sx,&sy); - if(view) { - wlr_seat_touch_point_focus(seat->seat, surface, event->time_msec, + if(node&&node->type == WLR_SCENE_NODE_SURFACE) { + wlr_seat_touch_point_focus(seat->seat, wlr_scene_surface_from_node(node)->surface, event->time_msec, event->touch_id, sx, sy); wlr_seat_touch_notify_motion(seat->seat, event->time_msec, event->touch_id, sx, sy); @@ -632,18 +609,19 @@ process_cursor_motion(struct cg_seat *seat, uint32_t time) { struct wlr_seat *wlr_seat = seat->seat; struct wlr_surface *surface = NULL; - struct cg_view *view = seat_desktop_view_at(seat->server, seat->cursor->x, - seat->cursor->y, &surface, &sx, &sy); + struct wlr_scene_node *node=wlr_scene_node_at(&seat->server->scene->node, seat->cursor->x,seat->cursor->y,&sx,&sy); - if(!view) { - wlr_seat_pointer_clear_focus(wlr_seat); - } else { + + if(node&&node->type == WLR_SCENE_NODE_SURFACE) { + surface=wlr_scene_surface_from_node(node)->surface; wlr_seat_pointer_notify_enter(wlr_seat, surface, sx, sy); bool focus_changed = wlr_seat->pointer_state.focused_surface != surface; if(!focus_changed && time > 0) { wlr_seat_pointer_notify_motion(wlr_seat, time, sx, sy); } + } else { + wlr_seat_pointer_clear_focus(wlr_seat); } struct cg_drag_icon *drag_icon; diff --git a/seat.h b/seat.h index 2967292..a46348b 100644 --- a/seat.h +++ b/seat.h @@ -94,9 +94,6 @@ struct cg_drag_icon { struct wl_listener destroy; }; -struct cg_view * -seat_desktop_view_at(const struct cg_server *server, double lx, double ly, - struct wlr_surface **surface, double *sx, double *sy); struct cg_seat * seat_create(struct cg_server *server, struct wlr_backend *backend); void From 60dbf4c8b1111264035661a8a07a7f36ea2a1e9a Mon Sep 17 00:00:00 2001 From: project-repo Date: Tue, 26 Apr 2022 07:46:26 +0200 Subject: [PATCH 363/689] Fix tile ordering on split --- view.c | 1 + 1 file changed, 1 insertion(+) diff --git a/view.c b/view.c index d9bb611..9025c3c 100644 --- a/view.c +++ b/view.c @@ -102,6 +102,7 @@ view_maximize(struct cg_view *view, struct cg_tile *tile) { wlr_scene_node_set_position(view->scene_node, view->ox+box->x, view->oy+box->y); view->impl->maximize(view, tile->tile.width, tile->tile.height); view->tile = tile; + wlr_scene_node_raise_to_top(view->scene_node); } void From 00c9c4bb65c19b8fed369ce690719760c7d723d4 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 1 May 2022 21:48:03 +0200 Subject: [PATCH 364/689] Fix segfault on workspace switch --- keybinding.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/keybinding.c b/keybinding.c index 4fff0d3..2cca163 100644 --- a/keybinding.c +++ b/keybinding.c @@ -664,7 +664,7 @@ keybinding_cycle_outputs(struct cg_server *server, bool reverse) { /* Cycle through views, whereby the workspace does not change */ void -keybinding_cycle_views(struct cg_server *server, bool reverse) { +keybinding_cycle_views(struct cg_server *server, bool reverse, bool ipc) { struct cg_workspace *curr_workspace = server->curr_output->workspaces[server->curr_output->curr_workspace]; struct cg_view *current_view = curr_workspace->focused_tile->view; @@ -701,11 +701,13 @@ keybinding_cycle_views(struct cg_server *server, bool reverse) { curr_workspace->focused_tile->view = wl_container_of( next_view->link.prev, curr_workspace->focused_tile->view, link); seat_set_focus(server->seat, next_view); + if(ipc) { ipc_send_event(curr_workspace->output->server, "{\"event_name\":\"cycle_views\",\"old_view_id\":\"%d\",\"new_view_id\":\"%d\",\"tile_id\":\"%d\",\"workspace\":\"%d\",\"output\":\"%s\"}", - current_view->id, next_view->id, next_view->tile->id, + current_view->link.next==curr_workspace->views.next?-1:(int) current_view->id, next_view==NULL?-1:(int) next_view->id, next_view->tile->id, curr_workspace->num + 1, curr_workspace->output->wlr_output->name); + } } void @@ -1061,7 +1063,7 @@ keybinding_move_view_to_cycle_output(struct cg_server *server, bool reverse) { wl_list_remove(&view->link); server->curr_output->workspaces[server->curr_output->curr_workspace] ->focused_tile->view = NULL; - keybinding_cycle_views(server, false); + keybinding_cycle_views(server, false,false); if(server->curr_output->workspaces[server->curr_output->curr_workspace] ->focused_tile->view == NULL) { seat_set_focus(server->seat, NULL); @@ -1209,7 +1211,7 @@ keybinding_move_view_to_output(struct cg_server *server, int output_num) { wl_list_remove(&view->link); server->curr_output->workspaces[server->curr_output->curr_workspace] ->focused_tile->view = NULL; - keybinding_cycle_views(server, false); + keybinding_cycle_views(server, false,false); if(server->curr_output->workspaces[server->curr_output->curr_workspace] ->focused_tile->view == NULL) { seat_set_focus(server->seat, NULL); @@ -1249,7 +1251,7 @@ keybinding_move_view_to_workspace(struct cg_server *server, uint32_t ws) { wl_list_remove(&view->link); server->curr_output->workspaces[server->curr_output->curr_workspace] ->focused_tile->view = NULL; - keybinding_cycle_views(server, false); + keybinding_cycle_views(server, false, false); if(server->curr_output->workspaces[server->curr_output->curr_workspace] ->focused_tile->view == NULL) { seat_set_focus(server->seat, NULL); @@ -1404,7 +1406,7 @@ run_action(enum keybinding_action action, struct cg_server *server, } break; case KEYBINDING_CYCLE_VIEWS: - keybinding_cycle_views(server, data.b); + keybinding_cycle_views(server, data.b,true); break; case KEYBINDING_CYCLE_TILES: keybinding_cycle_tiles(server, data.b); From b649529f67e28485f252dfbbe929c758942e8928 Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 5 May 2022 21:37:09 +0200 Subject: [PATCH 365/689] Add support for primary selection device protocol - Fix issue in which copying from firefox fails --- cagebreak.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cagebreak.c b/cagebreak.c index d480b70..59fb4f1 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -503,6 +504,12 @@ main(int argc, char *argv[]) { goto end; } + if(!wlr_primary_selection_v1_device_manager_create(server.wl_display)) { + wlr_log(WLR_ERROR, "Unable to create the primary selection device manager"); + ret = 1; + goto end; + } + gamma_control_manager = wlr_gamma_control_manager_v1_create(server.wl_display); if(!gamma_control_manager) { From 586b6b5db00c92a8a6335fafc7069d59c1cf4637 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 5 Sep 2022 08:12:32 +0200 Subject: [PATCH 366/689] Fix typo --- ipc_server.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ipc_server.c b/ipc_server.c index 86560b9..e953139 100644 --- a/ipc_server.c +++ b/ipc_server.c @@ -311,7 +311,7 @@ ipc_client_handle_command(struct cg_ipc_client *client) { offset = (nl_pos - client->read_buffer) + 1; } if(offset == 0) { - wlr_log(WLR_ERROR, "Line received was longer that %d, discarding it", + wlr_log(WLR_ERROR, "Line received was longer than %d, discarding it", MAX_LINE_SIZE); client->read_buf_len = 0; client->read_discard = 1; From 424cc0af25c452066eff4694a6d2b69d7e08d68c Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 5 Sep 2022 08:13:46 +0200 Subject: [PATCH 367/689] Adapt output_clear to wlr_scene --- output.c | 33 +++++++++------------------------ 1 file changed, 9 insertions(+), 24 deletions(-) diff --git a/output.c b/output.c index 66b644f..7bc77bc 100644 --- a/output.c +++ b/output.c @@ -71,24 +71,17 @@ output_clear(struct cg_output *output) { first = false; tile->view = NULL; } + struct cg_workspace *ws=server->curr_output->workspaces[server->curr_output->curr_workspace]; wl_list_for_each_safe(view, view_tmp, &output->workspaces[i]->views, link) { wl_list_remove(&view->link); if(wl_list_empty(&server->outputs)) { view->impl->destroy(view); } else { - wl_list_insert( - &server->curr_output - ->workspaces[server->curr_output->curr_workspace] - ->views, - &view->link); - view->workspace = - server->curr_output - ->workspaces[server->curr_output->curr_workspace]; - view->tile = - server->curr_output - ->workspaces[server->curr_output->curr_workspace] - ->focused_tile; + wl_list_insert(&ws->views,&view->link); + wlr_scene_node_reparent(view->scene_node, &ws->scene->node); + view->workspace = ws; + view->tile = ws->focused_tile; if(server->seat->focused_view == NULL) { seat_set_focus(server->seat, view); } @@ -100,18 +93,10 @@ output_clear(struct cg_output *output) { if(wl_list_empty(&server->outputs)) { view->impl->destroy(view); } else { - wl_list_insert( - &server->curr_output - ->workspaces[server->curr_output->curr_workspace] - ->unmanaged_views, - &view->link); - view->workspace = - server->curr_output - ->workspaces[server->curr_output->curr_workspace]; - view->tile = - server->curr_output - ->workspaces[server->curr_output->curr_workspace] - ->focused_tile; + wl_list_insert(&ws->unmanaged_views, &view->link); + wlr_scene_node_reparent(view->scene_node, &ws->scene->node); + view->workspace = ws; + view->tile = ws->focused_tile; } } } From 6461894cbee896f2699ccf47808b66efd0ebb8fa Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 5 Sep 2022 08:14:21 +0200 Subject: [PATCH 368/689] Fix default bg color --- cagebreak.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cagebreak.c b/cagebreak.c index 59fb4f1..39a8a3c 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -355,7 +355,7 @@ main(int argc, char *argv[]) { wlr_renderer_init_wl_display(server.renderer, server.wl_display); - server.bg_color = (float[4]){0, 0, 1, 1}; + server.bg_color = (float[4]){0, 0, 0, 1}; wl_list_init(&server.outputs); wl_list_init(&server.disabled_outputs); From aa8f6b42082eca94af311b44e41dec214e4f02df Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 9 Sep 2022 18:43:56 +0200 Subject: [PATCH 369/689] Print version number on startup --- cagebreak.c | 1 + 1 file changed, 1 insertion(+) diff --git a/cagebreak.c b/cagebreak.c index 39a8a3c..63147f7 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -226,6 +226,7 @@ get_config_file() { int main(int argc, char *argv[]) { + printf("This is cagebreak, version %s\n",CG_VERSION); struct cg_server server = {0}; struct wl_event_loop *event_loop = NULL; struct wl_event_source *sigint_source = NULL; From 36f002dbe0e05eb433a07701c1097e1e455e6c31 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 9 Sep 2022 19:01:16 +0200 Subject: [PATCH 370/689] Fix window positioning when switching to fullscreen --- keybinding.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/keybinding.c b/keybinding.c index 2cca163..0ba174c 100644 --- a/keybinding.c +++ b/keybinding.c @@ -469,14 +469,16 @@ keybinding_workspace_fullscreen(struct cg_server *server) { struct cg_view *current_view = seat_get_focus(server->seat); struct cg_output *output = server->curr_output; - /* We are focused on the background */ - if(current_view == NULL) { - struct cg_view *it = NULL; - wl_list_for_each(it, &output->workspaces[output->curr_workspace]->views, - link) { - if(view_is_visible(it)) { + struct cg_view *it = NULL, *tmp = NULL; + wl_list_for_each_safe(it, tmp, &output->workspaces[output->curr_workspace]->views, + link) { + if(view_is_visible(it)) { + if(current_view == NULL) { current_view = it; - break; + } + if(&it->link!=&output->workspaces[output->curr_workspace]->views) { + wl_list_remove(&it->link); + wl_list_insert(&output->workspaces[output->curr_workspace]->views, &it->link); } } } From 5de047b1413c360424956fa70a2a2edfd105cca4 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 9 Sep 2022 19:03:56 +0200 Subject: [PATCH 371/689] Apply clang-format --- cagebreak.c | 36 ++-- keybinding.c | 498 +++++++++++++++++++++++++++++---------------------- message.c | 52 +++--- output.c | 46 +++-- parse.c | 8 +- seat.c | 35 ++-- server.c | 2 +- util.c | 2 +- view.c | 40 +++-- view.h | 2 +- workspace.c | 13 +- xdg_shell.c | 87 ++++----- xwayland.c | 9 +- 13 files changed, 470 insertions(+), 360 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index 63147f7..b5e1f9f 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -16,29 +16,29 @@ #include #include #include -#include #include +#include #include -#include #include +#include #include -#include #include #include #include #include #include -#include #include #include #include #include -#include -#include #include #include +#include +#include +#include #include #include +#include #if CG_HAS_XWAYLAND #include #endif @@ -226,7 +226,7 @@ get_config_file() { int main(int argc, char *argv[]) { - printf("This is cagebreak, version %s\n",CG_VERSION); + printf("This is cagebreak, version %s\n", CG_VERSION); struct cg_server server = {0}; struct wl_event_loop *event_loop = NULL; struct wl_event_source *sigint_source = NULL; @@ -341,14 +341,15 @@ main(int argc, char *argv[]) { } server.renderer = wlr_renderer_autocreate(backend); - if (!server.renderer) { + if(!server.renderer) { wlr_log(WLR_ERROR, "Unable to create the wlroots renderer"); ret = 1; goto end; } - server.allocator = wlr_allocator_autocreate(server.backend, server.renderer); - if (!server.allocator) { + server.allocator = + wlr_allocator_autocreate(server.backend, server.renderer); + if(!server.allocator) { wlr_log(WLR_ERROR, "Unable to create the wlroots allocator"); ret = 1; goto end; @@ -374,7 +375,7 @@ main(int argc, char *argv[]) { } server.scene = wlr_scene_create(); - if (!server.scene) { + if(!server.scene) { wlr_log(WLR_ERROR, "Unable to create scene"); ret = 1; goto end; @@ -468,28 +469,28 @@ main(int argc, char *argv[]) { server_decoration_manager, WLR_SERVER_DECORATION_MANAGER_MODE_SERVER); viewporter = wlr_viewporter_create(server.wl_display); - if (!viewporter) { + if(!viewporter) { wlr_log(WLR_ERROR, "Unable to create the viewporter interface"); ret = 1; goto end; } presentation = wlr_presentation_create(server.wl_display, server.backend); - if (!presentation) { + if(!presentation) { wlr_log(WLR_ERROR, "Unable to create the presentation interface"); ret = 1; goto end; } wlr_scene_set_presentation(server.scene, presentation); - export_dmabuf_manager = wlr_export_dmabuf_manager_v1_create(server.wl_display); - if (!export_dmabuf_manager) { + export_dmabuf_manager = + wlr_export_dmabuf_manager_v1_create(server.wl_display); + if(!export_dmabuf_manager) { wlr_log(WLR_ERROR, "Unable to create the export DMABUF manager"); ret = 1; goto end; } - screencopy_manager = wlr_screencopy_manager_v1_create(server.wl_display); if(!screencopy_manager) { wlr_log(WLR_ERROR, "Unable to create the screencopy manager"); @@ -506,7 +507,8 @@ main(int argc, char *argv[]) { } if(!wlr_primary_selection_v1_device_manager_create(server.wl_display)) { - wlr_log(WLR_ERROR, "Unable to create the primary selection device manager"); + wlr_log(WLR_ERROR, + "Unable to create the primary selection device manager"); ret = 1; goto end; } diff --git a/keybinding.c b/keybinding.c index 0ba174c..dee4f1f 100644 --- a/keybinding.c +++ b/keybinding.c @@ -1,25 +1,25 @@ #define _POSIX_C_SOURCE 200809L #include -#include #include +#include #include #include #include +#include #include #include -#include #include #include #include "input.h" -#include "util.h" #include "input_manager.h" #include "keybinding.h" #include "message.h" #include "output.h" #include "seat.h" #include "server.h" +#include "util.h" #include "view.h" #include "workspace.h" @@ -145,10 +145,12 @@ is_between_strict(int a, int b, int x) { struct cg_tile * find_right_tile(const struct cg_tile *tile) { struct cg_tile *it = tile->next; - int center=tile->tile.y+tile->tile.height/2; + int center = tile->tile.y + tile->tile.height / 2; while(it != tile) { - if(it->tile.x== tile->tile.x+tile->tile.width) { - if(is_between_strict(it->tile.y,it->tile.y+it->tile.height,center)||it->tile.y+it->tile.height==center) { + if(it->tile.x == tile->tile.x + tile->tile.width) { + if(is_between_strict(it->tile.y, it->tile.y + it->tile.height, + center) || + it->tile.y + it->tile.height == center) { return it; } } @@ -160,10 +162,12 @@ find_right_tile(const struct cg_tile *tile) { struct cg_tile * find_left_tile(const struct cg_tile *tile) { struct cg_tile *it = tile->next; - int center=tile->tile.y+tile->tile.height/2; + int center = tile->tile.y + tile->tile.height / 2; while(it != tile) { - if(it->tile.x+it->tile.width == tile->tile.x) { - if(is_between_strict(it->tile.y,it->tile.y+it->tile.height,center)||it->tile.y+it->tile.height==center) { + if(it->tile.x + it->tile.width == tile->tile.x) { + if(is_between_strict(it->tile.y, it->tile.y + it->tile.height, + center) || + it->tile.y + it->tile.height == center) { return it; } } @@ -175,10 +179,12 @@ find_left_tile(const struct cg_tile *tile) { struct cg_tile * find_top_tile(const struct cg_tile *tile) { struct cg_tile *it = tile->next; - int center=tile->tile.x+tile->tile.width/2; + int center = tile->tile.x + tile->tile.width / 2; while(it != tile) { - if(it->tile.y+it->tile.height == tile->tile.y) { - if(is_between_strict(it->tile.x,it->tile.x+it->tile.width,center)||it->tile.x+it->tile.width==center) { + if(it->tile.y + it->tile.height == tile->tile.y) { + if(is_between_strict(it->tile.x, it->tile.x + it->tile.width, + center) || + it->tile.x + it->tile.width == center) { return it; } } @@ -190,10 +196,12 @@ find_top_tile(const struct cg_tile *tile) { struct cg_tile * find_bottom_tile(const struct cg_tile *tile) { struct cg_tile *it = tile->next; - int center=tile->tile.x+tile->tile.width/2; + int center = tile->tile.x + tile->tile.width / 2; while(it != tile) { - if(it->tile.y == tile->tile.y+tile->tile.height) { - if(is_between_strict(it->tile.x,it->tile.x+it->tile.width,center)||it->tile.x+it->tile.width==center) { + if(it->tile.y == tile->tile.y + tile->tile.height) { + if(is_between_strict(it->tile.x, it->tile.x + it->tile.width, + center) || + it->tile.x + it->tile.width == center) { return it; } } @@ -223,11 +231,11 @@ swap_tile(struct cg_tile *tile, view_maximize(swap_tile->view, swap_tile); } seat_set_focus(server->seat, swap_tile->view); - ipc_send_event( - tile->workspace->output->server, - "{\"event_name\":\"swap_tile\",\"tile_id\":\"%d\",\"swap_tile_id\":\"%d\",\"workspace\":\"%d\",\"output\":\"%s\"}", - tile->id, swap_tile->id, tile->workspace->num + 1, - tile->workspace->output->wlr_output->name); + ipc_send_event(tile->workspace->output->server, + "{\"event_name\":\"swap_tile\",\"tile_id\":\"%d\",\"swap_" + "tile_id\":\"%d\",\"workspace\":\"%d\",\"output\":\"%s\"}", + tile->id, swap_tile->id, tile->workspace->num + 1, + tile->workspace->output->wlr_output->name); } void @@ -372,7 +380,9 @@ resize(struct cg_tile *tile, const struct cg_tile *parent, int coord_offset, view_maximize(tile->view, tile); } ipc_send_event(tile->workspace->output->server, - "{\"event_name\":\"resize_tile\",\"tile_id\":\"%d\",\"old_dims\":\"[%d;%d;%d;%d]\",\"new_dims\":\"[%d;%d;%d;%d]\",\"workspace\":\"%d\",\"output\":\"%s\"}", + "{\"event_name\":\"resize_tile\",\"tile_id\":\"%d\",\"old_" + "dims\":\"[%d;%d;%d;%d]\",\"new_dims\":\"[%d;%d;%d;%d]\"," + "\"workspace\":\"%d\",\"output\":\"%s\"}", tile->id, old_x, old_y, old_height, old_width, tile->tile.x, tile->tile.y, tile->tile.height, tile->tile.width, tile->workspace->num + 1, @@ -470,15 +480,18 @@ keybinding_workspace_fullscreen(struct cg_server *server) { struct cg_output *output = server->curr_output; struct cg_view *it = NULL, *tmp = NULL; - wl_list_for_each_safe(it, tmp, &output->workspaces[output->curr_workspace]->views, - link) { + wl_list_for_each_safe( + it, tmp, &output->workspaces[output->curr_workspace]->views, link) { if(view_is_visible(it)) { if(current_view == NULL) { current_view = it; } - if(&it->link!=&output->workspaces[output->curr_workspace]->views) { + if(&it->link != + &output->workspaces[output->curr_workspace]->views) { wl_list_remove(&it->link); - wl_list_insert(&output->workspaces[output->curr_workspace]->views, &it->link); + wl_list_insert( + &output->workspaces[output->curr_workspace]->views, + &it->link); } } } @@ -500,7 +513,8 @@ keybinding_workspace_fullscreen(struct cg_server *server) { seat_set_focus(server->seat, current_view); ipc_send_event(output->server, - "{\"event_name\":\"fullscreen\",\"tile_id\":\"%d\",\"workspace\":\"%d\",\"output\":\"%s\"}", + "{\"event_name\":\"fullscreen\",\"tile_id\":\"%d\"," + "\"workspace\":\"%d\",\"output\":\"%s\"}", output->workspaces[output->curr_workspace]->focused_tile->id, output->workspaces[output->curr_workspace]->num + 1, output->wlr_output->name); @@ -594,7 +608,8 @@ keybinding_split_output(struct cg_output *output, bool vertical) { } ipc_send_event( output->server, - "{\"event_name\":\"split\",\"tile_id\":\"%d\",\"new_tile_id\":\"%d\",\"workspace\":\"%d\",\"output\":\"%s\",\"vertical\":\"%d\"}", + "{\"event_name\":\"split\",\"tile_id\":\"%d\",\"new_tile_id\":\"%d\"," + "\"workspace\":\"%d\",\"output\":\"%s\",\"vertical\":\"%d\"}", curr_workspace->focused_tile->id, new_tile->id, curr_workspace->num + 1, curr_workspace->output->wlr_output->name, vertical); } @@ -610,7 +625,8 @@ keybinding_close_view(struct cg_view *view) { uint32_t ws = view->workspace->num; view->impl->close(view); ipc_send_event(outp->server, - "{\"event_name\":\"close\",\"view_id\":\"%d\",\"tile_id\":\"%d\",\"workspace\":\"%d\",\"output\":\"%s\"}", + "{\"event_name\":\"close\",\"view_id\":\"%d\",\"tile_id\":" + "\"%d\",\"workspace\":\"%d\",\"output\":\"%s\"}", view_id, tile_id, ws + 1, outp->wlr_output->name); } @@ -659,9 +675,11 @@ keybinding_cycle_outputs(struct cg_server *server, bool reverse) { } } set_output(server, output); - ipc_send_event( - output->server, "{\"event_name\":\"cycle_outputs\",\"old_output\":\"%s\",\"new_output\":\"%s\",\"reverse\":\"%d\"}", - old_output->wlr_output->name, output->wlr_output->name, reverse); + ipc_send_event(output->server, + "{\"event_name\":\"cycle_outputs\",\"old_output\":\"%s\"," + "\"new_output\":\"%s\",\"reverse\":\"%d\"}", + old_output->wlr_output->name, output->wlr_output->name, + reverse); } /* Cycle through views, whereby the workspace does not change */ @@ -704,11 +722,16 @@ keybinding_cycle_views(struct cg_server *server, bool reverse, bool ipc) { next_view->link.prev, curr_workspace->focused_tile->view, link); seat_set_focus(server->seat, next_view); if(ipc) { - ipc_send_event(curr_workspace->output->server, - "{\"event_name\":\"cycle_views\",\"old_view_id\":\"%d\",\"new_view_id\":\"%d\",\"tile_id\":\"%d\",\"workspace\":\"%d\",\"output\":\"%s\"}", - current_view->link.next==curr_workspace->views.next?-1:(int) current_view->id, next_view==NULL?-1:(int) next_view->id, next_view->tile->id, - curr_workspace->num + 1, - curr_workspace->output->wlr_output->name); + ipc_send_event(curr_workspace->output->server, + "{\"event_name\":\"cycle_views\",\"old_view_id\":\"%d\"," + "\"new_view_id\":\"%d\",\"tile_id\":\"%d\"," + "\"workspace\":\"%d\",\"output\":\"%s\"}", + current_view->link.next == curr_workspace->views.next + ? -1 + : (int)current_view->id, + next_view == NULL ? -1 : (int)next_view->id, + next_view->tile->id, curr_workspace->num + 1, + curr_workspace->output->wlr_output->name); } } @@ -727,7 +750,8 @@ keybinding_cycle_tiles(struct cg_server *server, bool reverse) { seat_set_focus(server->seat, next_view); ipc_send_event( output->server, - "{\"event_name\":\"cycle_tiles\",\"old_tile_id\":\"%d\",\"new_tile_id\":\"%d\",\"workspace\":\"%d\",\"output\":\"%s\"}", + "{\"event_name\":\"cycle_tiles\",\"old_tile_id\":\"%d\",\"new_tile_" + "id\":\"%d\",\"workspace\":\"%d\",\"output\":\"%s\"}", old_tile->id, workspace->focused_tile->id, workspace->num + 1, output->wlr_output->name); } @@ -742,12 +766,13 @@ keybinding_switch_ws(struct cg_server *server, uint32_t ws) { } struct cg_output *output = server->curr_output; uint32_t old_ws = server->curr_output->curr_workspace; - workspace_focus(output,ws); + workspace_focus(output, ws); seat_set_focus(server->seat, server->curr_output->workspaces[ws]->focused_tile->view); message_printf(server->curr_output, "Workspace %d", ws + 1); ipc_send_event(output->server, - "{\"event_name\":\"switch_ws\",\"old_workspace\":\"%d\",\"new_workspace\":\"%d\",\"output\":\"%s\"}", + "{\"event_name\":\"switch_ws\",\"old_workspace\":\"%d\"," + "\"new_workspace\":\"%d\",\"output\":\"%s\"}", old_ws + 1, ws + 1, output->wlr_output->name); return 0; } @@ -772,17 +797,19 @@ struct dyn_str { char **str_arr; }; -/*Note that inp is in an invalid state after calling the function * and should no longer be used.*/ -char *dyn_str_to_str(struct dyn_str *inp) { - char *outp=calloc(inp->len+1,sizeof(char)); +/*Note that inp is in an invalid state after calling the function * and should + * no longer be used.*/ +char * +dyn_str_to_str(struct dyn_str *inp) { + char *outp = calloc(inp->len + 1, sizeof(char)); if(outp == NULL) { return NULL; } - outp[inp->len]='\0'; - uint32_t tmp_pos=0; - for(uint32_t i=0;icur_pos;++i) { - strcat(outp+tmp_pos,inp->str_arr[i]); - tmp_pos+=strlen(inp->str_arr[i]); + outp[inp->len] = '\0'; + uint32_t tmp_pos = 0; + for(uint32_t i = 0; i < inp->cur_pos; ++i) { + strcat(outp + tmp_pos, inp->str_arr[i]); + tmp_pos += strlen(inp->str_arr[i]); free(inp->str_arr[i]); } free(inp->str_arr); @@ -797,89 +824,98 @@ print_str(struct dyn_str *outp, const char *fmt, ...) { if(ret == NULL) { return -1; } - outp->str_arr[outp->cur_pos]=ret; + outp->str_arr[outp->cur_pos] = ret; ++outp->cur_pos; - outp->len+=strlen(ret); + outp->len += strlen(ret); return 0; } void -print_modes(struct dyn_str *str,char **modes) { - uint32_t len=0; - char **tmp=modes; - uint32_t nmemb=0; - while(*tmp!=NULL) { - len+=strlen(*tmp); +print_modes(struct dyn_str *str, char **modes) { + uint32_t len = 0; + char **tmp = modes; + uint32_t nmemb = 0; + while(*tmp != NULL) { + len += strlen(*tmp); ++nmemb; ++tmp; } - /* We are assuming here that we have at least one mode, which is given by the initialization of cagebreak */ - char *modes_str=calloc(len+3*(nmemb-1)+1, sizeof(char)); - modes_str[len+nmemb-1]='\0'; - uint32_t tmp_pos=0; - for(uint32_t i=0;iid); - char *title_str=view->impl->get_title(view); - print_str(&outp_str,"\"title\": \"%s\",\n",title_str==NULL?"":title_str); - print_str(&outp_str,"\"coords\": [\"x\":%d,\"y\":%d],\n",view->ox,view->oy); + outp_str.len = 0; + outp_str.cur_pos = 0; + uint32_t nmemb = 4; + outp_str.str_arr = calloc(nmemb, sizeof(char *)); + print_str(&outp_str, "\"id\": %d,\n", view->id); + char *title_str = view->impl->get_title(view); + print_str(&outp_str, "\"title\": \"%s\",\n", + title_str == NULL ? "" : title_str); + print_str(&outp_str, "\"coords\": [\"x\":%d,\"y\":%d],\n", view->ox, + view->oy); #if CG_HAS_XWAYLAND - print_str(&outp_str,"\"type\": \"%s\",\n",view->type==CG_XWAYLAND_VIEW?"xwayland":"xdg"); + print_str(&outp_str, "\"type\": \"%s\",\n", + view->type == CG_XWAYLAND_VIEW ? "xwayland" : "xdg"); #else - print_str(&outp_str,"\"type\": \"xdg\",\n"); + print_str(&outp_str, "\"type\": \"xdg\",\n"); #endif return dyn_str_to_str(&outp_str); } -char *print_tile(struct cg_tile *tile) { +char * +print_tile(struct cg_tile *tile) { struct dyn_str outp_str; - outp_str.len=0; - outp_str.cur_pos=0; - uint32_t nmemb=4; - outp_str.str_arr=calloc(nmemb,sizeof(char *)); - print_str(&outp_str,"\"id\": %d,\n",tile->id); - print_str(&outp_str,"\"coords\": [\"x\":%d,\"y\":%d],\n",tile->tile.x,tile->tile.y); - print_str(&outp_str,"\"size\": [\"width\":%d,\"height\":%d],\n",tile->tile.width,tile->tile.height); - print_str(&outp_str,"\"view\": \"%d\",\n",tile->view==NULL?-1:(int)tile->view->id); + outp_str.len = 0; + outp_str.cur_pos = 0; + uint32_t nmemb = 4; + outp_str.str_arr = calloc(nmemb, sizeof(char *)); + print_str(&outp_str, "\"id\": %d,\n", tile->id); + print_str(&outp_str, "\"coords\": [\"x\":%d,\"y\":%d],\n", tile->tile.x, + tile->tile.y); + print_str(&outp_str, "\"size\": [\"width\":%d,\"height\":%d],\n", + tile->tile.width, tile->tile.height); + print_str(&outp_str, "\"view\": \"%d\",\n", + tile->view == NULL ? -1 : (int)tile->view->id); return dyn_str_to_str(&outp_str); } char * print_views(struct cg_workspace *ws) { struct dyn_str outp_str; - outp_str.len=0; - outp_str.cur_pos=0; - uint32_t nviews=wl_list_length(&ws->views); - if(nviews==0) { + outp_str.len = 0; + outp_str.cur_pos = 0; + uint32_t nviews = wl_list_length(&ws->views); + if(nviews == 0) { return strdup("{}"); } - outp_str.str_arr=calloc(2*nviews-1,sizeof(char *)); + outp_str.str_arr = calloc(2 * nviews - 1, sizeof(char *)); struct cg_view *it; - uint32_t count=0; - wl_list_for_each(it,&ws->views,link) { - if(count!=0) { - print_str(&outp_str,","); + uint32_t count = 0; + wl_list_for_each(it, &ws->views, link) { + if(count != 0) { + print_str(&outp_str, ","); } ++count; - char *view_str=print_view(it); - if(view_str!=NULL) { - print_str(&outp_str,"{\n%s\n}",view_str); + char *view_str = print_view(it); + if(view_str != NULL) { + print_str(&outp_str, "{\n%s\n}", view_str); free(view_str); } } @@ -889,27 +925,29 @@ print_views(struct cg_workspace *ws) { char * print_tiles(struct cg_workspace *ws) { struct dyn_str outp_str; - outp_str.len=0; - outp_str.cur_pos=0; - uint32_t ntiles=0; - bool first=true; - for(struct cg_tile *tile=ws->focused_tile;first||tile!=ws->focused_tile;tile=tile->next) { - first=false; + outp_str.len = 0; + outp_str.cur_pos = 0; + uint32_t ntiles = 0; + bool first = true; + for(struct cg_tile *tile = ws->focused_tile; + first || tile != ws->focused_tile; tile = tile->next) { + first = false; ++ntiles; } - if(ntiles==0) { + if(ntiles == 0) { return strdup("{}"); } - outp_str.str_arr=calloc(2*ntiles-1,sizeof(char *)); - first=true; - for(struct cg_tile *tile=ws->focused_tile;first||tile!=ws->focused_tile;tile=tile->next) { - if(first==false) { - print_str(&outp_str,","); + outp_str.str_arr = calloc(2 * ntiles - 1, sizeof(char *)); + first = true; + for(struct cg_tile *tile = ws->focused_tile; + first || tile != ws->focused_tile; tile = tile->next) { + if(first == false) { + print_str(&outp_str, ","); } - first=false; - char *tile_str=print_tile(tile); - if(tile_str!=NULL) { - print_str(&outp_str,"{\n%s\n}",tile_str); + first = false; + char *tile_str = print_tile(tile); + if(tile_str != NULL) { + print_str(&outp_str, "{\n%s\n}", tile_str); free(tile_str); } } @@ -919,41 +957,41 @@ print_tiles(struct cg_workspace *ws) { char * print_workspace(struct cg_workspace *ws) { struct dyn_str outp_str; - outp_str.len=0; - outp_str.cur_pos=0; - uint32_t nmemb=6; - outp_str.str_arr=calloc(nmemb,sizeof(char *)); - print_str(&outp_str,"\"views\": ["); - char *views_str=print_views(ws); - if(views_str!=NULL) { - print_str(&outp_str,"%s",views_str); + outp_str.len = 0; + outp_str.cur_pos = 0; + uint32_t nmemb = 6; + outp_str.str_arr = calloc(nmemb, sizeof(char *)); + print_str(&outp_str, "\"views\": ["); + char *views_str = print_views(ws); + if(views_str != NULL) { + print_str(&outp_str, "%s", views_str); free(views_str); } - print_str(&outp_str,"],"); - print_str(&outp_str,"\"tiles\": ["); - char *tiles_str=print_tiles(ws); - if(tiles_str!=NULL) { - print_str(&outp_str,"%s",tiles_str); + print_str(&outp_str, "],"); + print_str(&outp_str, "\"tiles\": ["); + char *tiles_str = print_tiles(ws); + if(tiles_str != NULL) { + print_str(&outp_str, "%s", tiles_str); free(tiles_str); } - print_str(&outp_str,"]"); + print_str(&outp_str, "]"); return dyn_str_to_str(&outp_str); } char * print_workspaces(struct cg_output *outp) { struct dyn_str outp_str; - outp_str.len=0; - outp_str.cur_pos=0; - outp_str.str_arr=calloc((2*outp->server->nws-1)+2,sizeof(char *)); + outp_str.len = 0; + outp_str.cur_pos = 0; + outp_str.str_arr = calloc((2 * outp->server->nws - 1) + 2, sizeof(char *)); print_str(&outp_str, "\"workspaces\": ["); - for(int i=0;iserver->nws;++i) { - if(i!=0) { - print_str(&outp_str,","); + for(int i = 0; i < outp->server->nws; ++i) { + if(i != 0) { + print_str(&outp_str, ","); } - char *ws=print_workspace(outp->workspaces[i]); + char *ws = print_workspace(outp->workspaces[i]); if(ws != NULL) { - print_str(&outp_str,"{%s}",ws); + print_str(&outp_str, "{%s}", ws); free(ws); } } @@ -964,42 +1002,42 @@ print_workspaces(struct cg_output *outp) { char * print_output(struct cg_output *outp) { struct dyn_str outp_str; - outp_str.len=0; - outp_str.cur_pos=0; - uint32_t nmemb=5; - outp_str.str_arr=calloc(nmemb,sizeof(char *)); - print_str(&outp_str,"\"%s\": {\n",outp->wlr_output->name); - print_str(&outp_str,"\"priority\": %d,\n",outp->priority); - print_str(&outp_str,"\"curr_workspace\": %d,\n",outp->curr_workspace); - char *workspaces_str=print_workspaces(outp); - if(workspaces_str!=NULL) { - print_str(&outp_str, "%s",workspaces_str); + outp_str.len = 0; + outp_str.cur_pos = 0; + uint32_t nmemb = 5; + outp_str.str_arr = calloc(nmemb, sizeof(char *)); + print_str(&outp_str, "\"%s\": {\n", outp->wlr_output->name); + print_str(&outp_str, "\"priority\": %d,\n", outp->priority); + print_str(&outp_str, "\"curr_workspace\": %d,\n", outp->curr_workspace); + char *workspaces_str = print_workspaces(outp); + if(workspaces_str != NULL) { + print_str(&outp_str, "%s", workspaces_str); free(workspaces_str); } - print_str(&outp_str,"}"); + print_str(&outp_str, "}"); return dyn_str_to_str(&outp_str); } char * print_outputs(struct cg_server *server) { - uint32_t noutps=wl_list_length(&server->outputs); + uint32_t noutps = wl_list_length(&server->outputs); struct dyn_str outp_str; - outp_str.len=0; - outp_str.cur_pos=0; - outp_str.str_arr=calloc((2*noutps-1)+2,sizeof(char *)); + outp_str.len = 0; + outp_str.cur_pos = 0; + outp_str.str_arr = calloc((2 * noutps - 1) + 2, sizeof(char *)); print_str(&outp_str, "\"outputs\": ["); struct cg_output *it; - uint32_t count=0; - wl_list_for_each(it,&server->outputs,link) { - if(count!=0) { - print_str(&outp_str,","); + uint32_t count = 0; + wl_list_for_each(it, &server->outputs, link) { + if(count != 0) { + print_str(&outp_str, ","); } ++count; - char *outp=print_output(it); + char *outp = print_output(it); if(outp == NULL) { continue; } - print_str(&outp_str,"%s",outp); + print_str(&outp_str, "%s", outp); free(outp); } print_str(&outp_str, "],\n"); @@ -1009,26 +1047,29 @@ print_outputs(struct cg_server *server) { void keybinding_dump(struct cg_server *server) { struct dyn_str str; - str.len=0; - str.cur_pos=0; - uint32_t nmemb=10; - str.str_arr=calloc(nmemb,sizeof(char *)); + str.len = 0; + str.cur_pos = 0; + uint32_t nmemb = 10; + str.str_arr = calloc(nmemb, sizeof(char *)); - print_str(&str,"{"); - print_str(&str,"\"nws\":%d,\n",server->nws); - print_str(&str,"\"bg_color\":[%f,%f,%f,%f],\n",server->bg_color[0],server->bg_color[1],server->bg_color[2],server->bg_color[3]); - print_str(&str,"\"views_curr_id\":%d,\n",server->views_curr_id); - print_str(&str,"\"tiles_curr_id\":%d,\n",server->tiles_curr_id); - print_str(&str,"\"curr_output\":%s,\n",server->curr_output->wlr_output->name); - print_modes(&str,server->modes); - char *outps_str=print_outputs(server); - print_str(&str,"%s",outps_str); + print_str(&str, "{"); + print_str(&str, "\"nws\":%d,\n", server->nws); + print_str(&str, "\"bg_color\":[%f,%f,%f,%f],\n", server->bg_color[0], + server->bg_color[1], server->bg_color[2], server->bg_color[3]); + print_str(&str, "\"views_curr_id\":%d,\n", server->views_curr_id); + print_str(&str, "\"tiles_curr_id\":%d,\n", server->tiles_curr_id); + print_str(&str, "\"curr_output\":%s,\n", + server->curr_output->wlr_output->name); + print_modes(&str, server->modes); + char *outps_str = print_outputs(server); + print_str(&str, "%s", outps_str); free(outps_str); - print_str(&str,"\"cursor_coords\":{\"x\":%f,\"y\":%f},\n",server->seat->cursor->x,server->seat->cursor->y); - print_str(&str,"}"); + print_str(&str, "\"cursor_coords\":{\"x\":%f,\"y\":%f},\n", + server->seat->cursor->x, server->seat->cursor->y); + print_str(&str, "}"); - char *send_str=dyn_str_to_str(&str); - if(send_str==NULL) { + char *send_str = dyn_str_to_str(&str); + if(send_str == NULL) { wlr_log(WLR_ERROR, "Unable to create output string for \"dump\"."); } ipc_send_event(server, send_str); @@ -1065,7 +1106,7 @@ keybinding_move_view_to_cycle_output(struct cg_server *server, bool reverse) { wl_list_remove(&view->link); server->curr_output->workspaces[server->curr_output->curr_workspace] ->focused_tile->view = NULL; - keybinding_cycle_views(server, false,false); + keybinding_cycle_views(server, false, false); if(server->curr_output->workspaces[server->curr_output->curr_workspace] ->focused_tile->view == NULL) { seat_set_focus(server->seat, NULL); @@ -1073,7 +1114,9 @@ keybinding_move_view_to_cycle_output(struct cg_server *server, bool reverse) { } keybinding_cycle_outputs(server, reverse); if(view != NULL) { - struct cg_workspace *ws=server->curr_output->workspaces[server->curr_output->curr_workspace]; + struct cg_workspace *ws = + server->curr_output + ->workspaces[server->curr_output->curr_workspace]; wl_list_insert(&ws->views, &view->link); ws->focused_tile->view = view; wlr_scene_node_reparent(view->scene_node, &ws->scene->node); @@ -1082,11 +1125,11 @@ keybinding_move_view_to_cycle_output(struct cg_server *server, bool reverse) { view_maximize(view, view->tile); seat_set_focus(server->seat, view); } - ipc_send_event( - server, - "{\"event_name\":\"move_view_cycle_output\",\"view_id\":\"%d\",\"old_output\":\"%s\",\"new_output\":\"%s\"}", - view->id, old_outp->wlr_output->name, - server->curr_output->wlr_output->name); + ipc_send_event(server, + "{\"event_name\":\"move_view_cycle_output\",\"view_id\":\"%" + "d\",\"old_output\":\"%s\",\"new_output\":\"%s\"}", + view->id, old_outp->wlr_output->name, + server->curr_output->wlr_output->name); } void @@ -1132,7 +1175,7 @@ keybinding_set_nws(struct cg_server *server, int nws) { } if(output->curr_workspace >= nws) { - workspace_focus(output,nws-1); + workspace_focus(output, nws - 1); } } server->nws = nws; @@ -1140,8 +1183,10 @@ keybinding_set_nws(struct cg_server *server, int nws) { server->seat, server->curr_output->workspaces[server->curr_output->curr_workspace] ->focused_tile->view); - ipc_send_event(server, "{\"event_name\":\"set_nws\",\"old_nws\":\"%d\",\"new_nws\":\"%d\"}", old_nws, - server->nws); + ipc_send_event( + server, + "{\"event_name\":\"set_nws\",\"old_nws\":\"%d\",\"new_nws\":\"%d\"}", + old_nws, server->nws); } void @@ -1158,29 +1203,34 @@ keybinding_definemode(struct cg_server *server, char *mode) { server->modes[length] = NULL; server->modes[length - 1] = strdup(mode); - ipc_send_event(server, "{\"event_name\":\"definemode\",\"mode\":\"%s\"}", mode); + ipc_send_event(server, "{\"event_name\":\"definemode\",\"mode\":\"%s\"}", + mode); } void keybinding_definekey(struct cg_server *server, struct keybinding *kb) { keybinding_list_push(server->keybindings, kb); - ipc_send_event(server, "{\"event_name\":\"definekey\",\"modifiers\":\"%d\",\"key\":\"%d\",\"command\":\"%d\"}", + ipc_send_event(server, + "{\"event_name\":\"definekey\",\"modifiers\":\"%d\",\"key\":" + "\"%d\",\"command\":\"%d\"}", kb->modifiers, kb->key, kb->action); } void keybinding_set_background(struct cg_server *server, float *bg) { - ipc_send_event(server, "{\"event_name\":\"background\",\"old_bg\":\"[%f,%f,%f]\",\"new_bg\":\"[%f,%f,%f]\"}", + ipc_send_event(server, + "{\"event_name\":\"background\",\"old_bg\":\"[%f,%f,%f]\"," + "\"new_bg\":\"[%f,%f,%f]\"}", server->bg_color[0], server->bg_color[1], server->bg_color[2], bg[0], bg[1], bg[2]); server->bg_color[0] = bg[0]; server->bg_color[1] = bg[1]; server->bg_color[2] = bg[2]; - struct cg_output *it=NULL; - wl_list_for_each(it,&server->outputs,link) { + struct cg_output *it = NULL; + wl_list_for_each(it, &server->outputs, link) { wlr_scene_rect_set_color(it->bg, server->bg_color); } - wl_list_for_each(it,&server->disabled_outputs,link) { + wl_list_for_each(it, &server->disabled_outputs, link) { wlr_scene_rect_set_color(it->bg, server->bg_color); } } @@ -1193,7 +1243,9 @@ keybinding_switch_output(struct cg_server *server, int output) { wl_list_for_each(it, &server->outputs, link) { if(count == output) { set_output(server, it); - ipc_send_event(server, "{\"event_name\":\"switch_output\",\"old_output\":\"%s\",\"new_output\":\"%s\"}", + ipc_send_event(server, + "{\"event_name\":\"switch_output\",\"old_output\":" + "\"%s\",\"new_output\":\"%s\"}", old_outp->wlr_output->name, it->wlr_output->name); return; } @@ -1213,7 +1265,7 @@ keybinding_move_view_to_output(struct cg_server *server, int output_num) { wl_list_remove(&view->link); server->curr_output->workspaces[server->curr_output->curr_workspace] ->focused_tile->view = NULL; - keybinding_cycle_views(server, false,false); + keybinding_cycle_views(server, false, false); if(server->curr_output->workspaces[server->curr_output->curr_workspace] ->focused_tile->view == NULL) { seat_set_focus(server->seat, NULL); @@ -1237,10 +1289,12 @@ keybinding_move_view_to_output(struct cg_server *server, int output_num) { view_title = view->impl->get_title(view); view_id = view->id; } - ipc_send_event(server, - "{\"event_name\":\"move_view_to_output\",\"view_id\":\"%d\",\"old_output\":\"%s\",\"new_output\":\"%s\",\"view_title\":\"%s\"}", - view_id, old_outp->wlr_output->name, - server->curr_output->wlr_output->name, view_title); + ipc_send_event( + server, + "{\"event_name\":\"move_view_to_output\",\"view_id\":\"%d\",\"old_" + "output\":\"%s\",\"new_output\":\"%s\",\"view_title\":\"%s\"}", + view_id, old_outp->wlr_output->name, + server->curr_output->wlr_output->name, view_title); } void @@ -1272,10 +1326,12 @@ keybinding_move_view_to_workspace(struct cg_server *server, uint32_t ws) { seat_set_focus(server->seat, view); } ipc_send_event(server, - "{\"event_name\":\"move_view_to_ws\",\"view_id\":\"%d\",\"old_workspace\":\"%d\",\"new_workspace\":\"%d\",\"output\":\"%s\",\"view_title\":\"%s\"}", - view==NULL?-1:(int)view->id, old_ws, ws, + "{\"event_name\":\"move_view_to_ws\",\"view_id\":\"%d\"," + "\"old_workspace\":\"%d\",\"new_workspace\":\"%d\"," + "\"output\":\"%s\",\"view_title\":\"%s\"}", + view == NULL ? -1 : (int)view->id, old_ws, ws, server->curr_output->wlr_output->name, - view==NULL?"":view->impl->get_title(view)); + view == NULL ? "" : view->impl->get_title(view)); } void @@ -1324,16 +1380,20 @@ keybinding_configure_output(struct cg_server *server, wl_list_for_each_safe(output, tmp_output, &server->outputs, link) { if(strcmp(config->output_name, output->wlr_output->name) == 0) { output_configure(server, output); - ipc_send_event(output->server, "{\"event_name\":\"configure_output\",\"output\":\"%s\"}", - cfg->output_name); + ipc_send_event( + output->server, + "{\"event_name\":\"configure_output\",\"output\":\"%s\"}", + cfg->output_name); return; } } wl_list_for_each_safe(output, tmp_output, &server->disabled_outputs, link) { if(strcmp(config->output_name, output->wlr_output->name) == 0) { output_configure(server, output); - ipc_send_event(output->server, "{\"event_name\":\"configure_output\",\"output\":\"%s\"}", - cfg->output_name); + ipc_send_event( + output->server, + "{\"event_name\":\"configure_output\",\"output\":\"%s\"}", + cfg->output_name); return; } } @@ -1343,7 +1403,9 @@ void keybinding_configure_input(struct cg_server *server, struct cg_input_config *cfg) { cg_input_apply_config(cfg, server); - ipc_send_event(server, "{\"event_name\":\"configure_input\",\"input\":\"%s\"}", cfg->identifier); + ipc_send_event(server, + "{\"event_name\":\"configure_input\",\"input\":\"%s\"}", + cfg->identifier); } void @@ -1394,21 +1456,19 @@ run_action(enum keybinding_action action, struct cg_server *server, case KEYBINDING_SPLIT_VERTICAL: keybinding_split_vertical(server); break; - case KEYBINDING_RUN_COMMAND: - { - int pid; - if((pid=fork()) == 0) { - if(fork() == 0) { - into_process(data.c); - } - _exit(0); - } else if(pid > 0) { - waitpid(pid,NULL,0); + case KEYBINDING_RUN_COMMAND: { + int pid; + if((pid = fork()) == 0) { + if(fork() == 0) { + into_process(data.c); } + _exit(0); + } else if(pid > 0) { + waitpid(pid, NULL, 0); } - break; + } break; case KEYBINDING_CYCLE_VIEWS: - keybinding_cycle_views(server, data.b,true); + keybinding_cycle_views(server, data.b, true); break; case KEYBINDING_CYCLE_TILES: keybinding_cycle_tiles(server, data.b); @@ -1426,7 +1486,9 @@ run_action(enum keybinding_action action, struct cg_server *server, server->seat->mode = data.u; break; case KEYBINDING_SWITCH_DEFAULT_MODE: - ipc_send_event(server, "{\"event_name\":\"switch_default_mode\",\"old_mode\":\"%d\",\"mode\":\"%d\"}", + ipc_send_event(server, + "{\"event_name\":\"switch_default_mode\",\"old_mode\":" + "\"%d\",\"mode\":\"%d\"}", server->seat->default_mode, data.u); server->seat->mode = data.u; server->seat->default_mode = data.u; @@ -1443,7 +1505,7 @@ run_action(enum keybinding_action action, struct cg_server *server, keybinding_show_info(server); break; case KEYBINDING_DISPLAY_MESSAGE: - keybinding_display_message(server,data.c); + keybinding_display_message(server, data.c); break; case KEYBINDING_RESIZE_TILE_HORIZONTAL: resize_tile(server, data.i, 0); diff --git a/message.c b/message.c index 8e8e0d1..435ded1 100644 --- a/message.c +++ b/message.c @@ -1,17 +1,17 @@ #include #include #include +#include #include #include #include +#include +#include #include #include #include -#include -#include -#include #include -#include +#include #include "message.h" #include "output.h" @@ -26,14 +26,17 @@ struct msg_buffer { size_t stride; }; -static void msg_buffer_destroy(struct wlr_buffer *wlr_buffer) { +static void +msg_buffer_destroy(struct wlr_buffer *wlr_buffer) { struct msg_buffer *buffer = wl_container_of(wlr_buffer, buffer, base); free(buffer->data); free(buffer); } -static bool msg_buffer_begin_data_ptr_access(struct wlr_buffer *wlr_buffer, - uint32_t flags, void **data, uint32_t *format, size_t *stride) { +static bool +msg_buffer_begin_data_ptr_access(struct wlr_buffer *wlr_buffer, uint32_t flags, + void **data, uint32_t *format, + size_t *stride) { struct msg_buffer *buffer = wl_container_of(wlr_buffer, buffer, base); if(data != NULL) { *data = (void *)buffer->data; @@ -47,19 +50,21 @@ static bool msg_buffer_begin_data_ptr_access(struct wlr_buffer *wlr_buffer, return true; } -static void msg_buffer_end_data_ptr_access(struct wlr_buffer *wlr_buffer) { +static void +msg_buffer_end_data_ptr_access(struct wlr_buffer *wlr_buffer) { // This space is intentionally left blank } static const struct wlr_buffer_impl msg_buffer_impl = { - .destroy = msg_buffer_destroy, - .begin_data_ptr_access = msg_buffer_begin_data_ptr_access, - .end_data_ptr_access = msg_buffer_end_data_ptr_access, + .destroy = msg_buffer_destroy, + .begin_data_ptr_access = msg_buffer_begin_data_ptr_access, + .end_data_ptr_access = msg_buffer_end_data_ptr_access, }; -static struct msg_buffer *msg_buffer_create(uint32_t width, uint32_t height, uint32_t stride) { +static struct msg_buffer * +msg_buffer_create(uint32_t width, uint32_t height, uint32_t stride) { struct msg_buffer *buffer = calloc(1, sizeof(*buffer)); - if (buffer == NULL) { + if(buffer == NULL) { return NULL; } @@ -68,7 +73,7 @@ static struct msg_buffer *msg_buffer_create(uint32_t width, uint32_t height, uin buffer->stride = stride; buffer->data = malloc(buffer->stride * height); - if (buffer->data == NULL) { + if(buffer->data == NULL) { free(buffer); return NULL; } @@ -150,14 +155,16 @@ create_message_texture(const char *string, const struct cg_output *output) { unsigned char *data = cairo_image_surface_get_data(surface); int stride = cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, width); - struct msg_buffer *buf=msg_buffer_create(width, height,stride); + struct msg_buffer *buf = msg_buffer_create(width, height, stride); void *data_ptr; - if(!wlr_buffer_begin_data_ptr_access(&buf->base, WLR_BUFFER_DATA_PTR_ACCESS_WRITE,&data_ptr,NULL,NULL)) { + if(!wlr_buffer_begin_data_ptr_access(&buf->base, + WLR_BUFFER_DATA_PTR_ACCESS_WRITE, + &data_ptr, NULL, NULL)) { wlr_log(WLR_ERROR, "Failed to get pointer access to message buffer"); return NULL; } - memcpy(data_ptr,data,stride*height); + memcpy(data_ptr, data, stride * height); wlr_buffer_end_data_ptr_access(&buf->base); cairo_surface_destroy(surface); @@ -217,12 +224,15 @@ message_set_output(struct cg_output *output, const char *string, break; } - message->message=wlr_scene_buffer_create(&output->scene_output->scene->node,&buf->base); + message->message = + wlr_scene_buffer_create(&output->scene_output->scene->node, &buf->base); wlr_scene_node_raise_to_top(&message->message->node); - wlr_scene_node_set_enabled(&message->message->node,true); + wlr_scene_node_set_enabled(&message->message->node, true); struct wlr_box *outp_box = wlr_output_layout_get_box( output->server->output_layout, output->wlr_output); - wlr_scene_node_set_position(&message->message->node, message->position->x+outp_box->x, message->position->y+outp_box->y); + wlr_scene_node_set_position(&message->message->node, + message->position->x + outp_box->x, + message->position->y + outp_box->y); } void @@ -279,7 +289,7 @@ message_clear(struct cg_output *output) { struct cg_message *message, *tmp; wl_list_for_each_safe(message, tmp, &output->messages, link) { wl_list_remove(&message->link); - struct wlr_buffer *buf=message->message->buffer; + struct wlr_buffer *buf = message->message->buffer; wlr_scene_node_destroy(&message->message->node); free(message->position); buf->impl->destroy(buf); diff --git a/output.c b/output.c index 7bc77bc..4694875 100644 --- a/output.c +++ b/output.c @@ -25,9 +25,9 @@ #include #include #include +#include #include #include -#include #include #include #if CG_HAS_XWAYLAND @@ -71,14 +71,16 @@ output_clear(struct cg_output *output) { first = false; tile->view = NULL; } - struct cg_workspace *ws=server->curr_output->workspaces[server->curr_output->curr_workspace]; + struct cg_workspace *ws = + server->curr_output + ->workspaces[server->curr_output->curr_workspace]; wl_list_for_each_safe(view, view_tmp, &output->workspaces[i]->views, link) { wl_list_remove(&view->link); if(wl_list_empty(&server->outputs)) { view->impl->destroy(view); } else { - wl_list_insert(&ws->views,&view->link); + wl_list_insert(&ws->views, &view->link); wlr_scene_node_reparent(view->scene_node, &ws->scene->node); view->workspace = ws; view->tile = ws->focused_tile; @@ -126,7 +128,9 @@ output_destroy(struct cg_output *output) { free(output); if(outp_name != NULL) { - ipc_send_event(server, "{\"event_name\":\"new_output\",\"output\":\"%s\"}", outp_name); + ipc_send_event(server, + "{\"event_name\":\"new_output\",\"output\":\"%s\"}", + outp_name); free(outp_name); } else { wlr_log(WLR_ERROR, @@ -145,13 +149,13 @@ handle_output_destroy(struct wl_listener *listener, void *data) { static void handle_output_frame(struct wl_listener *listener, void *data) { - struct cg_output *output=wl_container_of(listener, output, frame); + struct cg_output *output = wl_container_of(listener, output, frame); if(!output->wlr_output->enabled) { return; } wlr_scene_output_commit(output->scene_output); - struct timespec now={0}; + struct timespec now = {0}; clock_gettime(CLOCK_MONOTONIC, &now); wlr_scene_output_send_frame_done(output->scene_output, &now); } @@ -201,7 +205,10 @@ output_set_mode(struct wlr_output *output, int width, int height, } wlr_output_set_mode(output, best); if(!wlr_output_test(output)) { - wlr_log(WLR_ERROR, "Unable to assign configured mode to %s, picking arbitrary available mode",output->name); + wlr_log(WLR_ERROR, + "Unable to assign configured mode to %s, picking arbitrary " + "available mode", + output->name); struct wlr_output_mode *mode; wl_list_for_each(mode, &output->modes, link) { if(mode == best) { @@ -286,18 +293,20 @@ output_configure(struct cg_server *server, struct cg_output *output) { } } struct wlr_scene_output *scene_output; - wl_list_for_each(scene_output,&output->server->scene->outputs,link) { + wl_list_for_each(scene_output, &output->server->scene->outputs, link) { if(scene_output->output == wlr_output) { - output->scene_output=scene_output; + output->scene_output = scene_output; break; } } - if(output->bg!=NULL) { + if(output->bg != NULL) { wlr_scene_node_destroy(&output->bg->node); } - output->bg=wlr_scene_rect_create(&output->scene_output->scene->node, output->wlr_output->width,output->wlr_output->height, server->bg_color); - struct wlr_box *box = wlr_output_layout_get_box( - server->output_layout, output->wlr_output); + output->bg = wlr_scene_rect_create( + &output->scene_output->scene->node, output->wlr_output->width, + output->wlr_output->height, server->bg_color); + struct wlr_box *box = + wlr_output_layout_get_box(server->output_layout, output->wlr_output); wlr_scene_node_set_position(&output->bg->node, box->x, box->y); wlr_scene_node_lower_to_bottom(&output->bg->node); } @@ -349,7 +358,8 @@ handle_new_output(struct wl_listener *listener, void *data) { struct cg_server *server = wl_container_of(listener, server, new_output); struct wlr_output *wlr_output = data; - if(!wlr_output_init_render(wlr_output,server->allocator,server->renderer)) { + if(!wlr_output_init_render(wlr_output, server->allocator, + server->renderer)) { wlr_log(WLR_ERROR, "Failed to initialize output rendering"); return; } @@ -400,7 +410,7 @@ handle_new_output(struct wl_listener *listener, void *data) { } wlr_scene_node_raise_to_top(&output->workspaces[0]->scene->node); - workspace_focus(output,0); + workspace_focus(output, 0); /* We are the first output. Set the current output to this one. */ if(server->curr_output == NULL) { @@ -418,8 +428,10 @@ handle_new_output(struct wl_listener *listener, void *data) { wl_signal_add(&wlr_output->events.commit, &output->commit); output->mode.notify = handle_output_mode; wl_signal_add(&wlr_output->events.mode, &output->mode); - ipc_send_event(server, "{\"event_name\":\"new_output\",\"output\":\"%s\",\"priority\":\"%d\"}", - output->wlr_output->name, output->priority); + ipc_send_event( + server, + "{\"event_name\":\"new_output\",\"output\":\"%s\",\"priority\":\"%d\"}", + output->wlr_output->name, output->priority); } #if CG_HAS_FANALYZE #pragma GCC diagnostic pop diff --git a/parse.c b/parse.c index 32eb363..9cf68c2 100644 --- a/parse.c +++ b/parse.c @@ -736,8 +736,9 @@ parse_command(struct cg_server *server, struct keybinding *keybinding, } else if(strcmp(action, "message") == 0) { keybinding->action = KEYBINDING_DISPLAY_MESSAGE; if(saveptr == NULL) { - *errstr = log_error("Not enough paramaters to \"message\". Expected " - "string to display."); + *errstr = + log_error("Not enough paramaters to \"message\". Expected " + "string to display."); return -1; } keybinding->data.c = strdup(saveptr); @@ -873,8 +874,7 @@ parse_command(struct cg_server *server, struct keybinding *keybinding, keybinding->action = KEYBINDING_SWITCH_MODE; char *mode = strtok_r(NULL, " ", &saveptr); if(mode == NULL) { - *errstr = - log_error("Expected mode after \"mode\". Got nothing."); + *errstr = log_error("Expected mode after \"mode\". Got nothing."); return -1; } int mode_idx = get_mode_index_from_name(server->modes, mode); diff --git a/seat.c b/seat.c index 4f82743..f928fa4 100644 --- a/seat.c +++ b/seat.c @@ -510,12 +510,14 @@ handle_touch_down(struct wl_listener *listener, void *data) { event->y, &lx, &ly); double sx, sy; - struct wlr_scene_node *node=wlr_scene_node_at(&seat->server->scene->node, lx,ly,&sx,&sy); + struct wlr_scene_node *node = + wlr_scene_node_at(&seat->server->scene->node, lx, ly, &sx, &sy); uint32_t serial = 0; - if(node&&node->type == WLR_SCENE_NODE_SURFACE) { + if(node && node->type == WLR_SCENE_NODE_SURFACE) { serial = wlr_seat_touch_notify_down( - seat->seat, wlr_scene_surface_from_node(node)->surface, event->time_msec, event->touch_id, sx, sy); + seat->seat, wlr_scene_surface_from_node(node)->surface, + event->time_msec, event->touch_id, sx, sy); } if(serial && wlr_seat_touch_num_points(seat->seat) == 1) { @@ -554,11 +556,13 @@ handle_touch_motion(struct wl_listener *listener, void *data) { event->y, &lx, &ly); double sx, sy; - struct wlr_scene_node *node=wlr_scene_node_at(&seat->server->scene->node, lx,ly,&sx,&sy); + struct wlr_scene_node *node = + wlr_scene_node_at(&seat->server->scene->node, lx, ly, &sx, &sy); - if(node&&node->type == WLR_SCENE_NODE_SURFACE) { - wlr_seat_touch_point_focus(seat->seat, wlr_scene_surface_from_node(node)->surface, event->time_msec, - event->touch_id, sx, sy); + if(node && node->type == WLR_SCENE_NODE_SURFACE) { + wlr_seat_touch_point_focus(seat->seat, + wlr_scene_surface_from_node(node)->surface, + event->time_msec, event->touch_id, sx, sy); wlr_seat_touch_notify_motion(seat->seat, event->time_msec, event->touch_id, sx, sy); } else { @@ -609,11 +613,11 @@ process_cursor_motion(struct cg_seat *seat, uint32_t time) { struct wlr_seat *wlr_seat = seat->seat; struct wlr_surface *surface = NULL; - struct wlr_scene_node *node=wlr_scene_node_at(&seat->server->scene->node, seat->cursor->x,seat->cursor->y,&sx,&sy); + struct wlr_scene_node *node = wlr_scene_node_at( + &seat->server->scene->node, seat->cursor->x, seat->cursor->y, &sx, &sy); - - if(node&&node->type == WLR_SCENE_NODE_SURFACE) { - surface=wlr_scene_surface_from_node(node)->surface; + if(node && node->type == WLR_SCENE_NODE_SURFACE) { + surface = wlr_scene_surface_from_node(node)->surface; wlr_seat_pointer_notify_enter(wlr_seat, surface, sx, sy); bool focus_changed = wlr_seat->pointer_state.focused_surface != surface; @@ -676,7 +680,8 @@ drag_icon_update_position(struct cg_drag_icon *drag_icon) { drag_icon->ly = seat->touch_ly; break; } - wlr_scene_node_set_position(drag_icon->scene_node, drag_icon->lx, drag_icon->ly); + wlr_scene_node_set_position(drag_icon->scene_node, drag_icon->lx, + drag_icon->ly); } static void @@ -732,7 +737,8 @@ handle_start_drag(struct wl_listener *listener, void *data) { } drag_icon->seat = seat; drag_icon->wlr_drag_icon = wlr_drag_icon; - drag_icon->scene_node = wlr_scene_subsurface_tree_create(&seat->server->scene->node, wlr_drag_icon->surface); + drag_icon->scene_node = wlr_scene_subsurface_tree_create( + &seat->server->scene->node, wlr_drag_icon->surface); if(!drag_icon->scene_node) { free(drag_icon); return; @@ -966,5 +972,6 @@ seat_set_focus(struct cg_seat *seat, struct cg_view *view) { process_cursor_motion(seat, -1); struct wlr_box *box = wlr_output_layout_get_box( server->output_layout, view->workspace->output->wlr_output); - wlr_scene_node_set_position(&view->workspace->output->bg->node, box->x, box->y); + wlr_scene_node_set_position(&view->workspace->output->bg->node, box->x, + box->y); } diff --git a/server.c b/server.c index 242fd30..e554a3c 100644 --- a/server.c +++ b/server.c @@ -12,8 +12,8 @@ #include #include #include -#include #include +#include #include "input_manager.h" #include "output.h" diff --git a/util.c b/util.c index 4ed180b..95e1ea4 100644 --- a/util.c +++ b/util.c @@ -10,8 +10,8 @@ #include #include "util.h" -#include #include +#include int scale_length(int length, int offset, double scale) { diff --git a/view.c b/view.c index 9025c3c..e5f61d8 100644 --- a/view.c +++ b/view.c @@ -12,13 +12,13 @@ #include #include #include -#include #include #include #include -#include -#include #include +#include +#include +#include #include "ipc_server.h" #include "output.h" @@ -99,7 +99,8 @@ view_maximize(struct cg_view *view, struct cg_tile *tile) { view->oy = tile->tile.y; struct wlr_box *box = wlr_output_layout_get_box( view->server->output_layout, view->workspace->output->wlr_output); - wlr_scene_node_set_position(view->scene_node, view->ox+box->x, view->oy+box->y); + wlr_scene_node_set_position(view->scene_node, view->ox + box->x, + view->oy + box->y); view->impl->maximize(view, tile->tile.width, tile->tile.height); view->tile = tile; wlr_scene_node_raise_to_top(view->scene_node); @@ -119,9 +120,9 @@ view_unmap(struct cg_view *view) { } if(view->tile == NULL) { - tile_id=-1; + tile_id = -1; } else { - tile_id=view->tile->id; + tile_id = view->tile->id; } wlr_scene_node_destroy(view->scene_node); @@ -161,9 +162,11 @@ view_unmap(struct cg_view *view) { wl_list_remove(&view->link); view->wlr_surface = NULL; - ipc_send_event(view->workspace->server, - "{\"event_name\":\"view_unmap\",\"view_id\":\"%d\",\"tile_id\":\"%d\",\"workspace\":\"%d\",\"output\":\"%s\",\"view_title\":\"%s\"}", - id, tile_id, ws + 1, output_name, title); + ipc_send_event( + view->workspace->server, + "{\"event_name\":\"view_unmap\",\"view_id\":\"%d\",\"tile_id\":\"%d\"," + "\"workspace\":\"%d\",\"output\":\"%s\",\"view_title\":\"%s\"}", + id, tile_id, ws + 1, output_name, title); } void @@ -172,12 +175,13 @@ view_map(struct cg_view *view, struct wlr_surface *surface, struct cg_output *output = ws->output; view->wlr_surface = surface; - view->scene_node=wlr_scene_subsurface_tree_create(&ws->scene->node, surface); + view->scene_node = + wlr_scene_subsurface_tree_create(&ws->scene->node, surface); if(!view->scene_node) { wl_resource_post_no_memory(surface->resource); return; } - view->scene_node->data=view; + view->scene_node->data = view; view->workspace = ws; #if CG_HAS_XWAYLAND @@ -187,7 +191,8 @@ view_map(struct cg_view *view, struct wlr_surface *surface, wl_list_insert(&ws->unmanaged_views, &view->link); struct wlr_box *box = wlr_output_layout_get_box( view->server->output_layout, view->workspace->output->wlr_output); - wlr_scene_node_set_position(view->scene_node, view->ox+box->x, view->oy+box->y); + wlr_scene_node_set_position(view->scene_node, view->ox + box->x, + view->oy + box->y); } else #endif { @@ -196,15 +201,16 @@ view_map(struct cg_view *view, struct wlr_surface *surface, wl_list_insert(&ws->views, &view->link); } seat_set_focus(output->server->seat, view); - int tile_id=0; - if(view->tile==NULL) { - tile_id=-1; + int tile_id = 0; + if(view->tile == NULL) { + tile_id = -1; } else { - tile_id=view->tile->id; + tile_id = view->tile->id; } ipc_send_event( output->server, - "{\"event_name\":\"view_map\",\"view_id\":\"%d\",\"tile_id\":\"%d\",\"workspace\":\"%d\",\"output\":\"%s\",\"view_title\":\"%s\"}", + "{\"event_name\":\"view_map\",\"view_id\":\"%d\",\"tile_id\":\"%d\"," + "\"workspace\":\"%d\",\"output\":\"%s\",\"view_title\":\"%s\"}", view->id, tile_id, view->workspace->num + 1, view->workspace->output->wlr_output->name, view->impl->get_title(view)); } diff --git a/view.h b/view.h index 9484d58..47a5221 100644 --- a/view.h +++ b/view.h @@ -20,7 +20,7 @@ enum cg_view_type { struct cg_view { struct cg_workspace *workspace; struct cg_server *server; - struct wl_list link; // server::views + struct wl_list link; // server::views struct wlr_surface *wlr_surface; struct cg_tile *tile; struct wlr_scene_node *scene_node; diff --git a/workspace.c b/workspace.c index 4000545..6b23921 100644 --- a/workspace.c +++ b/workspace.c @@ -12,8 +12,8 @@ #include #include #include -#include #include +#include #include "message.h" #include "output.h" @@ -58,7 +58,8 @@ full_screen_workspace(struct cg_output *output) { } workspace->server = output->server; workspace->num = -1; - workspace->scene = wlr_scene_tree_create(&output->scene_output->scene->node); + workspace->scene = + wlr_scene_tree_create(&output->scene_output->scene->node); if(full_screen_workspace_tiles(output->server->output_layout, output->wlr_output, workspace, &output->server->tiles_curr_id) != 0) { @@ -100,7 +101,9 @@ workspace_free(struct cg_workspace *workspace) { void workspace_focus(struct cg_output *outp, int ws) { - wlr_scene_node_place_above(&outp->bg->node,&outp->workspaces[outp->curr_workspace]->scene->node); - wlr_scene_node_place_above(&outp->workspaces[ws]->scene->node,&outp->bg->node); - outp->curr_workspace=ws; + wlr_scene_node_place_above( + &outp->bg->node, &outp->workspaces[outp->curr_workspace]->scene->node); + wlr_scene_node_place_above(&outp->workspaces[ws]->scene->node, + &outp->bg->node); + outp->curr_workspace = ws; } diff --git a/xdg_shell.c b/xdg_shell.c index b5bc24b..c6ce196 100644 --- a/xdg_shell.c +++ b/xdg_shell.c @@ -9,16 +9,16 @@ #define _POSIX_C_SOURCE 200809L -#include #include +#include #include -#include #include +#include #include #include +#include #include #include -#include #include "output.h" #include "server.h" @@ -29,26 +29,28 @@ static struct cg_view * popup_get_view(struct wlr_xdg_popup *popup) { while(true) { - if(popup->parent == NULL || !wlr_surface_is_xdg_surface(popup->parent)) { + if(popup->parent == NULL || + !wlr_surface_is_xdg_surface(popup->parent)) { return NULL; } - struct wlr_xdg_surface *xdg_surface = wlr_xdg_surface_from_wlr_surface(popup->parent); + struct wlr_xdg_surface *xdg_surface = + wlr_xdg_surface_from_wlr_surface(popup->parent); switch(xdg_surface->role) { - case WLR_XDG_SURFACE_ROLE_TOPLEVEL: - return xdg_surface->data; - case WLR_XDG_SURFACE_ROLE_POPUP: - popup=xdg_surface->popup; - break; - case WLR_XDG_SURFACE_ROLE_NONE: - return NULL; + case WLR_XDG_SURFACE_ROLE_TOPLEVEL: + return xdg_surface->data; + case WLR_XDG_SURFACE_ROLE_POPUP: + popup = xdg_surface->popup; + break; + case WLR_XDG_SURFACE_ROLE_NONE: + return NULL; } } } static void -xdg_decoration_handle_destroy(struct wl_listener *listener, void *data) -{ - struct cg_xdg_decoration *xdg_decoration = wl_container_of(listener, xdg_decoration, destroy); +xdg_decoration_handle_destroy(struct wl_listener *listener, void *data) { + struct cg_xdg_decoration *xdg_decoration = + wl_container_of(listener, xdg_decoration, destroy); wl_list_remove(&xdg_decoration->destroy.link); wl_list_remove(&xdg_decoration->request_mode.link); @@ -196,31 +198,31 @@ handle_xdg_shell_surface_destroy(struct wl_listener *listener, void *_data) { view_destroy(view); } -static const struct cg_view_impl xdg_shell_view_impl = { - .get_title = get_title, - .is_primary = is_primary, - .activate = activate, - .close = close, - .maximize = maximize, - .destroy = destroy -}; - +static const struct cg_view_impl xdg_shell_view_impl = {.get_title = get_title, + .is_primary = + is_primary, + .activate = activate, + .close = close, + .maximize = maximize, + .destroy = destroy}; void -handle_xdg_shell_surface_new(struct wl_listener *listener, void *data) -{ - struct cg_server *server = wl_container_of(listener, server, new_xdg_shell_surface); +handle_xdg_shell_surface_new(struct wl_listener *listener, void *data) { + struct cg_server *server = + wl_container_of(listener, server, new_xdg_shell_surface); struct wlr_xdg_surface *xdg_surface = data; - switch (xdg_surface->role) { + switch(xdg_surface->role) { case WLR_XDG_SURFACE_ROLE_TOPLEVEL:; - struct cg_xdg_shell_view *xdg_shell_view = calloc(1, sizeof(struct cg_xdg_shell_view)); - if (!xdg_shell_view) { + struct cg_xdg_shell_view *xdg_shell_view = + calloc(1, sizeof(struct cg_xdg_shell_view)); + if(!xdg_shell_view) { wlr_log(WLR_ERROR, "Failed to allocate XDG Shell view"); return; } - view_init(&xdg_shell_view->view, CG_XDG_SHELL_VIEW, &xdg_shell_view_impl,server); + view_init(&xdg_shell_view->view, CG_XDG_SHELL_VIEW, + &xdg_shell_view_impl, server); xdg_shell_view->xdg_surface = xdg_surface; @@ -230,21 +232,24 @@ handle_xdg_shell_surface_new(struct wl_listener *listener, void *data) wl_signal_add(&xdg_surface->events.unmap, &xdg_shell_view->unmap); xdg_shell_view->destroy.notify = handle_xdg_shell_surface_destroy; wl_signal_add(&xdg_surface->events.destroy, &xdg_shell_view->destroy); - xdg_shell_view->request_fullscreen.notify = handle_xdg_shell_surface_request_fullscreen; - wl_signal_add(&xdg_surface->toplevel->events.request_fullscreen, &xdg_shell_view->request_fullscreen); + xdg_shell_view->request_fullscreen.notify = + handle_xdg_shell_surface_request_fullscreen; + wl_signal_add(&xdg_surface->toplevel->events.request_fullscreen, + &xdg_shell_view->request_fullscreen); xdg_surface->data = xdg_shell_view; break; case WLR_XDG_SURFACE_ROLE_POPUP:; struct wlr_xdg_popup *popup = xdg_surface->popup; struct cg_view *view = popup_get_view(popup); - if (view == NULL) { + if(view == NULL) { return; } struct wlr_scene_node *parent_scene_node = NULL; - struct wlr_xdg_surface *parent = wlr_xdg_surface_from_wlr_surface(popup->parent); - switch (parent->role) { + struct wlr_xdg_surface *parent = + wlr_xdg_surface_from_wlr_surface(popup->parent); + switch(parent->role) { case WLR_XDG_SURFACE_ROLE_TOPLEVEL:; parent_scene_node = view->scene_node; break; @@ -254,13 +259,15 @@ handle_xdg_shell_surface_new(struct wl_listener *listener, void *data) case WLR_XDG_SURFACE_ROLE_NONE: break; } - if (parent_scene_node == NULL) { + if(parent_scene_node == NULL) { return; } - struct wlr_scene_node *popup_scene_node = wlr_scene_xdg_surface_create(parent_scene_node, xdg_surface); - if (popup_scene_node == NULL) { - wlr_log(WLR_ERROR, "Failed to allocate scene-graph node for XDG popup"); + struct wlr_scene_node *popup_scene_node = + wlr_scene_xdg_surface_create(parent_scene_node, xdg_surface); + if(popup_scene_node == NULL) { + wlr_log(WLR_ERROR, + "Failed to allocate scene-graph node for XDG popup"); return; } diff --git a/xwayland.c b/xwayland.c index c3c3a57..12f38e9 100644 --- a/xwayland.c +++ b/xwayland.c @@ -89,8 +89,9 @@ maximize(struct cg_view *view, int width, int height) { struct wlr_box *output_box = wlr_output_layout_get_box( view->server->output_layout, view->server->curr_output->wlr_output); - wlr_xwayland_surface_configure(xwayland_view->xwayland_surface, view->ox+output_box->x, - view->oy+output_box->y, width, height); + wlr_xwayland_surface_configure(xwayland_view->xwayland_surface, + view->ox + output_box->x, + view->oy + output_box->y, width, height); wlr_xwayland_surface_set_maximized(xwayland_view->xwayland_surface, true); } @@ -129,8 +130,8 @@ handle_xwayland_surface_map(struct wl_listener *listener, void *_data) { struct wlr_output_layout *output_layout = view->server->output_layout; struct wlr_box *output_box = wlr_output_layout_get_box( output_layout, view->server->curr_output->wlr_output); - view->ox = xwayland_view->xwayland_surface->x-output_box->x; - view->oy = xwayland_view->xwayland_surface->y-output_box->y; + view->ox = xwayland_view->xwayland_surface->x - output_box->x; + view->oy = xwayland_view->xwayland_surface->y - output_box->y; } view_map(view, xwayland_view->xwayland_surface->surface, From 346e021dbb1e26b767cbf43e9776d3b7953777c8 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 10 Sep 2022 18:02:59 +0200 Subject: [PATCH 372/689] Amend commit 36f00 --- keybinding.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/keybinding.c b/keybinding.c index dee4f1f..53cbab8 100644 --- a/keybinding.c +++ b/keybinding.c @@ -488,10 +488,7 @@ keybinding_workspace_fullscreen(struct cg_server *server) { } if(&it->link != &output->workspaces[output->curr_workspace]->views) { - wl_list_remove(&it->link); - wl_list_insert( - &output->workspaces[output->curr_workspace]->views, - &it->link); + seat_set_focus(server->seat,it); } } } From cda1d645d23370305b2aa02a0a385cd126d47e30 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 12 Sep 2022 07:36:36 +0200 Subject: [PATCH 373/689] Attempt fallback disable --- output.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/output.c b/output.c index 66b644f..6df0cc0 100644 --- a/output.c +++ b/output.c @@ -182,7 +182,7 @@ output_find_config(struct cg_server *server, struct wlr_output *output) { return NULL; } -static void +static int output_set_mode(struct wlr_output *output, int width, int height, float refresh_rate) { int mhz = (int)(refresh_rate * 1000); @@ -191,7 +191,7 @@ output_set_mode(struct wlr_output *output, int width, int height, wlr_log(WLR_DEBUG, "Assigning custom mode to %s", output->name); wlr_output_set_custom_mode(output, width, height, refresh_rate > 0 ? mhz : 0); - return; + return 0; } struct wlr_output_mode *mode, *best = NULL; @@ -228,6 +228,10 @@ output_set_mode(struct wlr_output *output, int width, int height, } } } + if(!wlr_output_test(output)) { + return 1; + } + return 0; } void @@ -290,8 +294,14 @@ output_configure(struct cg_server *server, struct cg_output *output) { output->priority = config->priority; } if(config->pos.x != -1) { - output_set_mode(wlr_output, config->pos.width, - config->pos.height, config->refresh_rate); + if(output_set_mode(wlr_output, config->pos.width, + config->pos.height, config->refresh_rate)!=0) { + output_clear(output); + wl_list_insert(&server->disabled_outputs,&output->link); + wlr_output_enable(wlr_output, false); + wlr_output_commit(wlr_output); + return; + } wlr_output_layout_add(server->output_layout, wlr_output, config->pos.x, config->pos.y); } From 3b5b85070fbabaf7f4ce6d4bbc869d08b6722ccf Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 18 Sep 2022 10:22:08 +0200 Subject: [PATCH 374/689] Fix sizing of reconfigured outputs --- keybinding.c | 33 ++--------------------- message.c | 6 ++++- output.c | 74 ++++++++++++++++++++++++++++++++++++++++++---------- output.h | 4 +-- workspace.c | 6 ++++- 5 files changed, 74 insertions(+), 49 deletions(-) diff --git a/keybinding.c b/keybinding.c index 2cca163..6b23e65 100644 --- a/keybinding.c +++ b/keybinding.c @@ -466,38 +466,9 @@ resize_tile(struct cg_server *server, int hpixs, int vpixs) { void keybinding_workspace_fullscreen(struct cg_server *server) { - struct cg_view *current_view = seat_get_focus(server->seat); + output_make_workspace_fullscreen(server->curr_output,server->curr_output->curr_workspace); struct cg_output *output = server->curr_output; - - /* We are focused on the background */ - if(current_view == NULL) { - struct cg_view *it = NULL; - wl_list_for_each(it, &output->workspaces[output->curr_workspace]->views, - link) { - if(view_is_visible(it)) { - current_view = it; - break; - } - } - } - - workspace_free_tiles(output->workspaces[output->curr_workspace]); - if(full_screen_workspace_tiles(server->output_layout, output->wlr_output, - output->workspaces[output->curr_workspace], - &server->tiles_curr_id) != 0) { - wlr_log(WLR_ERROR, "Failed to allocate space for fullscreen workspace"); - return; - } - - struct cg_view *it_view; - wl_list_for_each(it_view, - &output->workspaces[output->curr_workspace]->views, link) { - it_view->tile = - output->workspaces[output->curr_workspace]->focused_tile; - } - - seat_set_focus(server->seat, current_view); - ipc_send_event(output->server, + ipc_send_event(server, "{\"event_name\":\"fullscreen\",\"tile_id\":\"%d\",\"workspace\":\"%d\",\"output\":\"%s\"}", output->workspaces[output->curr_workspace]->focused_tile->id, output->workspaces[output->curr_workspace]->num + 1, diff --git a/message.c b/message.c index 8e8e0d1..617f91d 100644 --- a/message.c +++ b/message.c @@ -217,7 +217,11 @@ message_set_output(struct cg_output *output, const char *string, break; } - message->message=wlr_scene_buffer_create(&output->scene_output->scene->node,&buf->base); + struct wlr_scene_output *scene_output = wlr_scene_get_scene_output(output->server->scene,output->wlr_output); + if(scene_output == NULL) { + return; + } + message->message=wlr_scene_buffer_create(&scene_output->scene->node,&buf->base); wlr_scene_node_raise_to_top(&message->message->node); wlr_scene_node_set_enabled(&message->message->node,true); struct wlr_box *outp_box = wlr_output_layout_get_box( diff --git a/output.c b/output.c index 6df0cc0..98ce334 100644 --- a/output.c +++ b/output.c @@ -164,11 +164,15 @@ handle_output_frame(struct wl_listener *listener, void *data) { if(!output->wlr_output->enabled) { return; } - wlr_scene_output_commit(output->scene_output); + struct wlr_scene_output *scene_output=wlr_scene_get_scene_output(output->server->scene,output->wlr_output); + if(scene_output == NULL) { + return; + } + wlr_scene_output_commit(scene_output); struct timespec now={0}; clock_gettime(CLOCK_MONOTONIC, &now); - wlr_scene_output_send_frame_done(output->scene_output, &now); + wlr_scene_output_send_frame_done(scene_output, &now); } struct cg_output_config * @@ -215,6 +219,7 @@ output_set_mode(struct wlr_output *output, int width, int height, wlr_log(WLR_DEBUG, "Assigning configured mode to %s", output->name); } wlr_output_set_mode(output, best); + wlr_output_commit(output); if(!wlr_output_test(output)) { wlr_log(WLR_ERROR, "Unable to assign configured mode to %s, picking arbitrary available mode",output->name); struct wlr_output_mode *mode; @@ -223,13 +228,14 @@ output_set_mode(struct wlr_output *output, int width, int height, continue; } wlr_output_set_mode(output, mode); + wlr_output_commit(output); if(wlr_output_test(output)) { break; } } - } - if(!wlr_output_test(output)) { - return 1; + if(!wlr_output_test(output)) { + return 1; + } } return 0; } @@ -289,13 +295,13 @@ output_configure(struct cg_server *server, struct cg_output *output) { wlr_output_enable(wlr_output, false); wlr_output_commit(wlr_output); } else { - wl_list_remove(&output->link); if(config->priority != -1) { output->priority = config->priority; } if(config->pos.x != -1) { if(output_set_mode(wlr_output, config->pos.width, config->pos.height, config->refresh_rate)!=0) { + wlr_log(WLR_ERROR,"Setting output mode failed, disabling output."); output_clear(output); wl_list_insert(&server->disabled_outputs,&output->link); wlr_output_enable(wlr_output, false); @@ -304,23 +310,26 @@ output_configure(struct cg_server *server, struct cg_output *output) { } wlr_output_layout_add(server->output_layout, wlr_output, config->pos.x, config->pos.y); + /* Since the size of the output may have changed, we reinitialize all workspaces with a fullscreen layout */ + for(unsigned int i = 0; i < output->server->nws; ++i) { + output_make_workspace_fullscreen(output,i); + } } + wl_list_remove(&output->link); output_insert(server, output); wlr_output_enable(wlr_output, true); wlr_output_commit(wlr_output); } } - struct wlr_scene_output *scene_output; - wl_list_for_each(scene_output,&output->server->scene->outputs,link) { - if(scene_output->output == wlr_output) { - output->scene_output=scene_output; - break; - } - } if(output->bg!=NULL) { wlr_scene_node_destroy(&output->bg->node); + output->bg=NULL; } - output->bg=wlr_scene_rect_create(&output->scene_output->scene->node, output->wlr_output->width,output->wlr_output->height, server->bg_color); + struct wlr_scene_output *scene_output = wlr_scene_get_scene_output(output->server->scene,output->wlr_output); + if(scene_output == NULL) { + return; + } + output->bg=wlr_scene_rect_create(&scene_output->scene->node, output->wlr_output->width,output->wlr_output->height, server->bg_color); struct wlr_box *box = wlr_output_layout_get_box( server->output_layout, output->wlr_output); wlr_scene_node_set_position(&output->bg->node, box->x, box->y); @@ -365,6 +374,43 @@ handle_output_mode(struct wl_listener *listener, void *data) { } } +void +output_make_workspace_fullscreen(struct cg_output *output,int ws) { + struct cg_server *server=output->server; + struct cg_view *current_view = seat_get_focus(server->seat); + + /* We are focused on the background */ + if(current_view == NULL||ws != output->curr_workspace) { + struct cg_view *it = NULL; + wl_list_for_each(it, &output->workspaces[ws]->views, + link) { + if(view_is_visible(it)) { + current_view = it; + break; + } + } + } + + workspace_free_tiles(output->workspaces[ws]); + if(full_screen_workspace_tiles(server->output_layout, output->wlr_output, + output->workspaces[ws], + &server->tiles_curr_id) != 0) { + wlr_log(WLR_ERROR, "Failed to allocate space for fullscreen workspace"); + return; + } + + struct cg_view *it_view; + wl_list_for_each(it_view, &output->workspaces[ws]->views, link) { + it_view->tile = output->workspaces[ws]->focused_tile; + } + + if(ws == output->curr_workspace) { + seat_set_focus(server->seat, current_view); + } +} + + + #if CG_HAS_FANALYZE #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wanalyzer-malloc-leak" diff --git a/output.h b/output.h index 787efdd..492700a 100644 --- a/output.h +++ b/output.h @@ -12,7 +12,6 @@ struct wlr_surface; struct cg_output { struct cg_server *server; struct wlr_output *wlr_output; - struct wlr_scene_output *scene_output; struct wlr_scene_rect *bg; struct wl_listener mode; @@ -56,5 +55,6 @@ void output_configure(struct cg_server *server, struct cg_output *output); void output_set_window_title(struct cg_output *output, const char *title); - +void +output_make_workspace_fullscreen(struct cg_output *output,int ws); #endif diff --git a/workspace.c b/workspace.c index 4000545..15de290 100644 --- a/workspace.c +++ b/workspace.c @@ -56,9 +56,13 @@ full_screen_workspace(struct cg_output *output) { if(!workspace) { return NULL; } + struct wlr_scene_output *scene_output=wlr_scene_get_scene_output(output->server->scene,output->wlr_output); + if(scene_output == NULL) { + return NULL; + } workspace->server = output->server; workspace->num = -1; - workspace->scene = wlr_scene_tree_create(&output->scene_output->scene->node); + workspace->scene = wlr_scene_tree_create(&scene_output->scene->node); if(full_screen_workspace_tiles(output->server->output_layout, output->wlr_output, workspace, &output->server->tiles_curr_id) != 0) { From bc9c7a7555e0ece9335425c135ea218fae98b7ff Mon Sep 17 00:00:00 2001 From: project-repo Date: Wed, 21 Sep 2022 19:17:17 +0200 Subject: [PATCH 375/689] Add restack to xwayland view activation --- xwayland.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xwayland.c b/xwayland.c index c3c3a57..5d609ae 100644 --- a/xwayland.c +++ b/xwayland.c @@ -63,6 +63,9 @@ static void activate(struct cg_view *view, bool activate) { struct cg_xwayland_view *xwayland_view = xwayland_view_from_view(view); wlr_xwayland_surface_activate(xwayland_view->xwayland_surface, activate); + if(activate) { + wlr_xwayland_surface_restack(xwayland_view->xwayland_surface, NULL, XCB_STACK_MODE_ABOVE); + } } static void From 5305eead4cf5da59832a2bd1a1eb520096d21d03 Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 22 Sep 2022 19:38:28 +0200 Subject: [PATCH 376/689] Add IPC event for cursor switching output --- seat.c | 6 ++++++ seat.h | 1 + 2 files changed, 7 insertions(+) diff --git a/seat.c b/seat.c index 4f82743..6ce57ec 100644 --- a/seat.c +++ b/seat.c @@ -652,6 +652,12 @@ handle_cursor_motion(struct wl_listener *listener, void *data) { event->delta_y); process_cursor_motion(seat, event->time_msec); wlr_idle_notify_activity(seat->server->idle, seat->seat); + struct wlr_output *c_outp = wlr_output_layout_output_at(seat->server->output_layout,seat->cursor->x,seat->cursor->y); + if(seat->cursor_output != NULL && seat->cursor_output != c_outp) { + ipc_send_event(seat->server, "{\"event_name\":\"cursor_switch_output\",\"old_output\":\"%s\",\"new_output\":\"%s\"}", + seat->cursor_output->name, c_outp->name); + } + seat->cursor_output=c_outp; } static void diff --git a/seat.h b/seat.h index a46348b..66474b6 100644 --- a/seat.h +++ b/seat.h @@ -28,6 +28,7 @@ struct cg_seat { uint16_t num_touch; struct wlr_cursor *cursor; + struct wlr_output *cursor_output; struct wlr_xcursor_manager *xcursor_manager; struct wl_listener cursor_motion; struct wl_listener cursor_motion_absolute; From 97ef5306a1c084b31766db58346e8a2ceed7a859 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 25 Sep 2022 11:05:51 +0200 Subject: [PATCH 377/689] Add ipc message on cursor switching tile --- output.c | 1 - seat.c | 31 +++++++++++++++++++++++++------ seat.h | 2 +- workspace.c | 4 ++++ 4 files changed, 30 insertions(+), 8 deletions(-) diff --git a/output.c b/output.c index b37001b..e815f90 100644 --- a/output.c +++ b/output.c @@ -371,7 +371,6 @@ output_make_workspace_fullscreen(struct cg_output *output,int ws) { struct cg_server *server=output->server; struct cg_view *current_view = seat_get_focus(server->seat); - /* We are focused on the background */ if(current_view == NULL||ws != output->curr_workspace) { struct cg_view *it = NULL; wl_list_for_each(it, &output->workspaces[ws]->views, diff --git a/seat.c b/seat.c index 167ec82..976f6fc 100644 --- a/seat.c +++ b/seat.c @@ -634,6 +634,31 @@ process_cursor_motion(struct cg_seat *seat, uint32_t time) { } wlr_idle_notify_activity(seat->server->idle, seat->seat); + + /* Check if cursor switched tile */ + struct wlr_output *c_outp = wlr_output_layout_output_at(seat->server->output_layout,seat->cursor->x,seat->cursor->y); + struct cg_output *cg_outp = NULL; + wl_list_for_each(cg_outp,&seat->server->outputs,link) { + if(cg_outp->wlr_output == c_outp) { + break; + } + } + struct cg_tile *c_tile; + bool first=true; + for(c_tile = cg_outp->workspaces[cg_outp->curr_workspace]->focused_tile; + first || c_tile != cg_outp->workspaces[cg_outp->curr_workspace]->focused_tile; c_tile = c_tile->next) { + first = false; + double ox=seat->cursor->x,oy=seat->cursor->y; + wlr_output_layout_output_coords(seat->server->output_layout,c_outp,&ox,&oy); + if(c_tile->tile.x<=ox&&c_tile->tile.y<=oy&&c_tile->tile.x+c_tile->tile.width>=ox&&c_tile->tile.y+c_tile->tile.height>=oy) { + break; + } + } + if(seat->cursor_tile != NULL && seat->cursor_tile != c_tile) { + ipc_send_event(seat->server, "{\"event_name\":\"cursor_switch_tile\",\"old_output\":\"%s\",\"old_tile\":\"%d\",\"new_output\":\"%s\",\"new_tile\":\"%d\"}", + seat->cursor_tile->workspace->output->wlr_output->name, seat->cursor_tile->id,c_outp->name,c_tile->id); + } + seat->cursor_tile=c_tile; } static void @@ -656,12 +681,6 @@ handle_cursor_motion(struct wl_listener *listener, void *data) { event->delta_y); process_cursor_motion(seat, event->time_msec); wlr_idle_notify_activity(seat->server->idle, seat->seat); - struct wlr_output *c_outp = wlr_output_layout_output_at(seat->server->output_layout,seat->cursor->x,seat->cursor->y); - if(seat->cursor_output != NULL && seat->cursor_output != c_outp) { - ipc_send_event(seat->server, "{\"event_name\":\"cursor_switch_output\",\"old_output\":\"%s\",\"new_output\":\"%s\"}", - seat->cursor_output->name, c_outp->name); - } - seat->cursor_output=c_outp; } static void diff --git a/seat.h b/seat.h index 66474b6..32ef586 100644 --- a/seat.h +++ b/seat.h @@ -28,7 +28,7 @@ struct cg_seat { uint16_t num_touch; struct wlr_cursor *cursor; - struct wlr_output *cursor_output; + struct cg_tile *cursor_tile; struct wlr_xcursor_manager *xcursor_manager; struct wl_listener cursor_motion; struct wl_listener cursor_motion_absolute; diff --git a/workspace.c b/workspace.c index 53554d6..7bfe929 100644 --- a/workspace.c +++ b/workspace.c @@ -16,6 +16,7 @@ #include #include "message.h" +#include "seat.h" #include "output.h" #include "server.h" #include "workspace.h" @@ -90,6 +91,9 @@ void workspace_free_tiles(struct cg_workspace *workspace) { workspace->focused_tile->prev->next = NULL; while(workspace->focused_tile != NULL) { + if(workspace->output->server->running&&workspace->output->server->seat->cursor_tile==workspace->focused_tile) { + workspace->output->server->seat->cursor_tile=NULL; + } struct cg_tile *next = workspace->focused_tile->next; free(workspace->focused_tile); workspace->focused_tile = next; From 09a6886053c102c43406e6e527e33c4b87642d89 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 25 Sep 2022 11:34:17 +0200 Subject: [PATCH 378/689] Restrict access to ipc socket - Set 700 permissions on socket on startup --- ipc_server.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ipc_server.c b/ipc_server.c index e953139..0125e5e 100644 --- a/ipc_server.c +++ b/ipc_server.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -101,6 +102,7 @@ ipc_init(struct cg_server *server) { return -1; } + chmod(ipc->sockaddr->sun_path, 0700); setenv("CAGEBREAK_SOCKET", ipc->sockaddr->sun_path, 1); wl_list_init(&ipc->client_list); From ca6add83ef48233f90fdf0f49c46f7a58692c9b1 Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 29 Sep 2022 21:22:32 +0200 Subject: [PATCH 379/689] Improve README - Add repology badges - Modify release procedures --- README.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0c716a6..24a7b3f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ # Cagebreak: A Wayland Tiling Compositor Inspired by Ratpoison +[![Packaging status](https://repology.org/badge/tiny-repos/cagebreak.svg)](https://repology.org/project/cagebreak/versions) + +[![AUR package](https://repology.org/badge/version-for-repo/aur/cagebreak.svg?minversion=2.0.0)](https://repology.org/project/cagebreak/versions) + This is Cagebreak, a Wayland tiling compositor. The goal of this project is to provide a successor to ratpoison for Wayland @@ -124,11 +128,13 @@ occur. * [ ] man pages * [ ] man/cagebreak * [ ] man/cagebreak-config + * [ ] man/cagebreak-socket * [ ] Set EPOCH to release day in man generation in meson.build * [ ] FAQ.md * [ ] Changelog.md for major and minor releases but not patches * [ ] Check features for SECURITY.md relevance (changes to socket scope for example) + * [ ] Synchronize any socket changes to cagebreak-socket man page * [ ] Fixed bugs documented in Bugs.md * [ ] Include issue description from github * [ ] Testing @@ -148,6 +154,7 @@ occur. * [ ] `gpg --detach-sign -u keyid cagebreak` * [ ] `gpg --detach-sign -u keyid cagebreak.1` * [ ] `gpg --detach-sign -u keyid cagebreak-config.5` + * [ ] `gpg --detach-sign -u keyid cagebreak-socket.7` * [ ] `git add` relevant files * [ ] `git commit` * [ ] `git push origin development` @@ -160,9 +167,12 @@ occur. * [ ] `git tag -u keyid version HEAD` and insert message * [ ] `git tag -v version` and check output * [ ] `git push --tags origin master` - * [ ] `git checkout development` + * [ ] `git checkout development` (merge to development depends on whether release was a hotfix) * [ ] `git merge master` * [ ] `git push --tags origin development` + * [ ] `git checkout hotfix` (hotfix is to be kept current with master after releases) + * [ ] `git merge master` + * [ ] `git push --tags origin hotfix` * [ ] `git archive --prefix=cagebreak/ -o release_version.tar.gz tags/version .` * [ ] Create release-artefacts_version.tar.gz * [ ] `mkdir release-artefacts_version` @@ -172,6 +182,8 @@ occur. * [ ] `cp build/cagebreak.1.sig release-artefacts_version/` * [ ] `cp build/cagebreak-config.5 release-artefacts_version/` * [ ] `cp build/cagebreak-config.5.sig release-artefacts_version/` + * [ ] `cp build/cagebreak-socket.7 release-artefacts_version/` + * [ ] `cp build/cagebreak-socket.7.sig release-artefacts_version/` * [ ] `cp LICENSE release-artefacts_version/` * [ ] `cp README.md release-artefacts_version/` * [ ] `cp SECURITY.md release-artefacts_version/` From 55d4115c8e785d99d8e96c3322db7f25cd3f7a37 Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 29 Sep 2022 21:30:14 +0200 Subject: [PATCH 380/689] Improve release procedure --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 24a7b3f..3fb0018 100644 --- a/README.md +++ b/README.md @@ -145,6 +145,7 @@ occur. * [ ] meson.build * [ ] git tag * [ ] man pages + * [ ] README.md repology badges minversion * [ ] meson.build reproducible build versions are current archlinux libraries and gcc * [ ] Cagebreak is reproducible on multiple machines * [ ] Documented reproducible build artefacts From c73cc64199083d3f34c28592c0b9aff74b5c07d6 Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 29 Sep 2022 22:14:58 +0200 Subject: [PATCH 381/689] Fix link in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3fb0018..4231379 100644 --- a/README.md +++ b/README.md @@ -354,5 +354,5 @@ See [Changelog.md](Changelog.md) ## License -Please see [LICENSE](https://github.com/project-repo/cagebreak/blob/master/LICENSE# Cagebreak: A Wayland Tiling Compositor Inspired by Ratpoison +Please see [LICENSE](https://github.com/project-repo/cagebreak/blob/master/LICENSE) Cagebreak: A Wayland Tiling Compositor Inspired by Ratpoison From ebe4826d121cfb5ee21cdb966b04bceddd9ef007 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 30 Sep 2022 18:28:49 +0200 Subject: [PATCH 382/689] Fix bugs reported by scan-build --- cagebreak.c | 3 +++ input_manager.c | 1 + keybinding.c | 6 +++++- libinput.c | 50 ------------------------------------------------- parse.c | 3 +++ server.c | 3 ++- workspace.c | 1 + 7 files changed, 15 insertions(+), 52 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index b5e1f9f..954649a 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -274,12 +274,14 @@ main(int argc, char *argv[]) { /* Wayland requires XDG_RUNTIME_DIR to be set. */ if(!getenv("XDG_RUNTIME_DIR")) { wlr_log(WLR_ERROR, "XDG_RUNTIME_DIR is not set in the environment"); + free(server.modes); return 1; } server.wl_display = wl_display_create(); if(!server.wl_display) { wlr_log(WLR_ERROR, "Cannot allocate a Wayland display"); + free(server.modes); return 1; } @@ -292,6 +294,7 @@ main(int argc, char *argv[]) { if(server.modes[0] == NULL || server.modes[1] == NULL || server.modes[2] == NULL) { wlr_log(WLR_ERROR, "Error allocating default modes"); + free(server.modes); return 1; } diff --git a/input_manager.c b/input_manager.c index 2157b43..0eeb253 100644 --- a/input_manager.c +++ b/input_manager.c @@ -64,6 +64,7 @@ input_device_get_identifier(struct wlr_input_device *device) { char *identifier = malloc(len); if(!identifier) { wlr_log(WLR_ERROR, "Unable to allocate unique input device name"); + free(name); return NULL; } diff --git a/keybinding.c b/keybinding.c index afe5609..c1a882f 100644 --- a/keybinding.c +++ b/keybinding.c @@ -1090,10 +1090,14 @@ keybinding_move_view_to_cycle_output(struct cg_server *server, bool reverse) { view_maximize(view, view->tile); seat_set_focus(server->seat, view); } + int id=-1; + if(view != NULL) { + id=view->id; + } ipc_send_event(server, "{\"event_name\":\"move_view_cycle_output\",\"view_id\":\"%" "d\",\"old_output\":\"%s\",\"new_output\":\"%s\"}", - view->id, old_outp->wlr_output->name, + id, old_outp->wlr_output->name, server->curr_output->wlr_output->name); } diff --git a/libinput.c b/libinput.c index f6dd957..6d9aff4 100644 --- a/libinput.c +++ b/libinput.c @@ -368,56 +368,6 @@ cg_input_configure_libinput_device(struct cg_input_device *input_device) { } } -void -cg_input_reset_libinput_device(struct cg_input_device *input_device) { - if(!wlr_input_device_is_libinput(input_device->wlr_device)) { - return; - } - - struct libinput_device *device = - wlr_libinput_get_device_handle(input_device->wlr_device); - wlr_log(WLR_DEBUG, "cg_input_reset_libinput_device(%s)", - input_device->identifier); - bool changed = false; - - changed |= set_send_events( - device, libinput_device_config_send_events_get_default_mode(device)); - changed |= - set_tap(device, libinput_device_config_tap_get_default_enabled(device)); - changed |= set_tap_button_map( - device, libinput_device_config_tap_get_default_button_map(device)); - changed |= set_tap_drag( - device, libinput_device_config_tap_get_default_drag_enabled(device)); - changed |= set_tap_drag_lock( - device, - libinput_device_config_tap_get_default_drag_lock_enabled(device)); - changed |= set_accel_speed( - device, libinput_device_config_accel_get_default_speed(device)); - changed |= set_accel_profile( - device, libinput_device_config_accel_get_default_profile(device)); - changed |= set_natural_scroll( - device, - libinput_device_config_scroll_get_default_natural_scroll_enabled( - device)); - changed |= set_left_handed( - device, libinput_device_config_left_handed_get_default(device)); - changed |= set_click_method( - device, libinput_device_config_click_get_default_method(device)); - changed |= set_middle_emulation( - device, - libinput_device_config_middle_emulation_get_default_enabled(device)); - changed |= set_scroll_method( - device, libinput_device_config_scroll_get_default_method(device)); - changed |= set_scroll_button( - device, libinput_device_config_scroll_get_default_button(device)); - changed |= - set_dwt(device, libinput_device_config_dwt_get_default_enabled(device)); - - float matrix[6]; - libinput_device_config_calibration_get_default_matrix(device, matrix); - changed |= set_calibration_matrix(device, matrix); -} - bool cg_libinput_device_is_builtin(struct cg_input_device *cg_device) { if(!wlr_input_device_is_libinput(cg_device->wlr_device)) { diff --git a/parse.c b/parse.c index 9cf68c2..8f5bddf 100644 --- a/parse.c +++ b/parse.c @@ -691,6 +691,9 @@ parse_message_config(char **saveptr, char **errstr) { return cfg; error: + if(cfg!=NULL) { + free(cfg); + } wlr_log(WLR_ERROR, "Message configuration must be of the form " "'configure_message '"); return NULL; diff --git a/server.c b/server.c index e554a3c..16253d8 100644 --- a/server.c +++ b/server.c @@ -58,14 +58,15 @@ server_show_info(struct cg_server *server) { struct cg_input_device *input; wl_list_for_each(input, &server->input->devices, link) { if(!input_str) { + free(output_str); return NULL; } input_str_tmp = input_str; if(strcmp(input->identifier, "") != 0) { input_str = malloc_vsprintf("%s\t * %s\n", input_str, input->identifier); + free(input_str_tmp); } - free(input_str_tmp); } char *ret = malloc_vsprintf("Outputs:\n%sInputs:\n%s", output_str, input_str); diff --git a/workspace.c b/workspace.c index 7bfe929..f35b4e4 100644 --- a/workspace.c +++ b/workspace.c @@ -59,6 +59,7 @@ full_screen_workspace(struct cg_output *output) { } struct wlr_scene_output *scene_output=wlr_scene_get_scene_output(output->server->scene,output->wlr_output); if(scene_output == NULL) { + free(workspace); return NULL; } workspace->server = output->server; From 4d81403a5078230934f8ddd72fa905b036c8c11c Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 30 Sep 2022 21:06:55 +0200 Subject: [PATCH 383/689] Fix typo --- SECURITY.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SECURITY.md b/SECURITY.md index 848c856..c339078 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -84,7 +84,7 @@ and any software run by the user may exfiltrate any data the user has access to. Not applicable - Cagebreak offers functionality to terminate itself, which is available to all user software over the socket. -#### Elevation of privilege +#### Elevation of Privilege Software may gain arbitrary code execution rights if it has access to the Cagebreak socket. Privilege escalation to root is unlikely since privileges From c72c68a99b96c44fd4393d8689739f9c1efb6ce1 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 30 Sep 2022 21:09:07 +0200 Subject: [PATCH 384/689] Improve release procedure --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 4231379..fae9835 100644 --- a/README.md +++ b/README.md @@ -122,6 +122,7 @@ occur. * [ ] `git pull origin development` * [ ] `git push origin development` * [ ] `ninja -C build clang-format` makes no changes + * [ ] `ninja -C build scan-build` shows no issues * [ ] New version number determined according to [semantic versioning](https://semver.org) guidelines * [ ] Relevant Documentation completed * [ ] New features From 3247d8cfd199225d6fb51c5c0cacb912e3c300f2 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 30 Sep 2022 21:09:51 +0200 Subject: [PATCH 385/689] Apply clang-format --- keybinding.c | 6 ++++-- message.c | 6 ++++-- output.c | 42 +++++++++++++++++++++++------------------- output.h | 2 +- seat.c | 30 ++++++++++++++++++++---------- workspace.c | 11 +++++++---- xwayland.c | 3 ++- 7 files changed, 61 insertions(+), 39 deletions(-) diff --git a/keybinding.c b/keybinding.c index afe5609..dee1913 100644 --- a/keybinding.c +++ b/keybinding.c @@ -476,10 +476,12 @@ resize_tile(struct cg_server *server, int hpixs, int vpixs) { void keybinding_workspace_fullscreen(struct cg_server *server) { - output_make_workspace_fullscreen(server->curr_output,server->curr_output->curr_workspace); + output_make_workspace_fullscreen(server->curr_output, + server->curr_output->curr_workspace); struct cg_output *output = server->curr_output; ipc_send_event(server, - "{\"event_name\":\"fullscreen\",\"tile_id\":\"%d\",\"workspace\":\"%d\",\"output\":\"%s\"}", + "{\"event_name\":\"fullscreen\",\"tile_id\":\"%d\"," + "\"workspace\":\"%d\",\"output\":\"%s\"}", output->workspaces[output->curr_workspace]->focused_tile->id, output->workspaces[output->curr_workspace]->num + 1, output->wlr_output->name); diff --git a/message.c b/message.c index cbafb1c..444406a 100644 --- a/message.c +++ b/message.c @@ -224,11 +224,13 @@ message_set_output(struct cg_output *output, const char *string, break; } - struct wlr_scene_output *scene_output = wlr_scene_get_scene_output(output->server->scene,output->wlr_output); + struct wlr_scene_output *scene_output = + wlr_scene_get_scene_output(output->server->scene, output->wlr_output); if(scene_output == NULL) { return; } - message->message=wlr_scene_buffer_create(&scene_output->scene->node,&buf->base); + message->message = + wlr_scene_buffer_create(&scene_output->scene->node, &buf->base); wlr_scene_node_raise_to_top(&message->message->node); wlr_scene_node_set_enabled(&message->message->node, true); struct wlr_box *outp_box = wlr_output_layout_get_box( diff --git a/output.c b/output.c index e815f90..74201ca 100644 --- a/output.c +++ b/output.c @@ -153,7 +153,8 @@ handle_output_frame(struct wl_listener *listener, void *data) { if(!output->wlr_output->enabled) { return; } - struct wlr_scene_output *scene_output=wlr_scene_get_scene_output(output->server->scene,output->wlr_output); + struct wlr_scene_output *scene_output = + wlr_scene_get_scene_output(output->server->scene, output->wlr_output); if(scene_output == NULL) { return; } @@ -292,19 +293,22 @@ output_configure(struct cg_server *server, struct cg_output *output) { } if(config->pos.x != -1) { if(output_set_mode(wlr_output, config->pos.width, - config->pos.height, config->refresh_rate)!=0) { - wlr_log(WLR_ERROR,"Setting output mode failed, disabling output."); + config->pos.height, + config->refresh_rate) != 0) { + wlr_log(WLR_ERROR, + "Setting output mode failed, disabling output."); output_clear(output); - wl_list_insert(&server->disabled_outputs,&output->link); + wl_list_insert(&server->disabled_outputs, &output->link); wlr_output_enable(wlr_output, false); wlr_output_commit(wlr_output); return; } wlr_output_layout_add(server->output_layout, wlr_output, config->pos.x, config->pos.y); - /* Since the size of the output may have changed, we reinitialize all workspaces with a fullscreen layout */ + /* Since the size of the output may have changed, we + * reinitialize all workspaces with a fullscreen layout */ for(unsigned int i = 0; i < output->server->nws; ++i) { - output_make_workspace_fullscreen(output,i); + output_make_workspace_fullscreen(output, i); } } wl_list_remove(&output->link); @@ -313,17 +317,20 @@ output_configure(struct cg_server *server, struct cg_output *output) { wlr_output_commit(wlr_output); } } - if(output->bg!=NULL) { + if(output->bg != NULL) { wlr_scene_node_destroy(&output->bg->node); - output->bg=NULL; + output->bg = NULL; } - struct wlr_scene_output *scene_output = wlr_scene_get_scene_output(output->server->scene,output->wlr_output); + struct wlr_scene_output *scene_output = + wlr_scene_get_scene_output(output->server->scene, output->wlr_output); if(scene_output == NULL) { return; } - output->bg=wlr_scene_rect_create(&scene_output->scene->node, output->wlr_output->width,output->wlr_output->height, server->bg_color); - struct wlr_box *box = wlr_output_layout_get_box( - server->output_layout, output->wlr_output); + output->bg = wlr_scene_rect_create( + &scene_output->scene->node, output->wlr_output->width, + output->wlr_output->height, server->bg_color); + struct wlr_box *box = + wlr_output_layout_get_box(server->output_layout, output->wlr_output); wlr_scene_node_set_position(&output->bg->node, box->x, box->y); wlr_scene_node_lower_to_bottom(&output->bg->node); } @@ -367,14 +374,13 @@ handle_output_mode(struct wl_listener *listener, void *data) { } void -output_make_workspace_fullscreen(struct cg_output *output,int ws) { - struct cg_server *server=output->server; +output_make_workspace_fullscreen(struct cg_output *output, int ws) { + struct cg_server *server = output->server; struct cg_view *current_view = seat_get_focus(server->seat); - if(current_view == NULL||ws != output->curr_workspace) { + if(current_view == NULL || ws != output->curr_workspace) { struct cg_view *it = NULL; - wl_list_for_each(it, &output->workspaces[ws]->views, - link) { + wl_list_for_each(it, &output->workspaces[ws]->views, link) { if(view_is_visible(it)) { current_view = it; break; @@ -400,8 +406,6 @@ output_make_workspace_fullscreen(struct cg_output *output,int ws) { } } - - #if CG_HAS_FANALYZE #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wanalyzer-malloc-leak" diff --git a/output.h b/output.h index 492700a..390e5f1 100644 --- a/output.h +++ b/output.h @@ -56,5 +56,5 @@ output_configure(struct cg_server *server, struct cg_output *output); void output_set_window_title(struct cg_output *output, const char *title); void -output_make_workspace_fullscreen(struct cg_output *output,int ws); +output_make_workspace_fullscreen(struct cg_output *output, int ws); #endif diff --git a/seat.c b/seat.c index 976f6fc..b161d0b 100644 --- a/seat.c +++ b/seat.c @@ -636,29 +636,39 @@ process_cursor_motion(struct cg_seat *seat, uint32_t time) { wlr_idle_notify_activity(seat->server->idle, seat->seat); /* Check if cursor switched tile */ - struct wlr_output *c_outp = wlr_output_layout_output_at(seat->server->output_layout,seat->cursor->x,seat->cursor->y); + struct wlr_output *c_outp = wlr_output_layout_output_at( + seat->server->output_layout, seat->cursor->x, seat->cursor->y); struct cg_output *cg_outp = NULL; - wl_list_for_each(cg_outp,&seat->server->outputs,link) { + wl_list_for_each(cg_outp, &seat->server->outputs, link) { if(cg_outp->wlr_output == c_outp) { break; } } struct cg_tile *c_tile; - bool first=true; + bool first = true; for(c_tile = cg_outp->workspaces[cg_outp->curr_workspace]->focused_tile; - first || c_tile != cg_outp->workspaces[cg_outp->curr_workspace]->focused_tile; c_tile = c_tile->next) { + first || + c_tile != cg_outp->workspaces[cg_outp->curr_workspace]->focused_tile; + c_tile = c_tile->next) { first = false; - double ox=seat->cursor->x,oy=seat->cursor->y; - wlr_output_layout_output_coords(seat->server->output_layout,c_outp,&ox,&oy); - if(c_tile->tile.x<=ox&&c_tile->tile.y<=oy&&c_tile->tile.x+c_tile->tile.width>=ox&&c_tile->tile.y+c_tile->tile.height>=oy) { + double ox = seat->cursor->x, oy = seat->cursor->y; + wlr_output_layout_output_coords(seat->server->output_layout, c_outp, + &ox, &oy); + if(c_tile->tile.x <= ox && c_tile->tile.y <= oy && + c_tile->tile.x + c_tile->tile.width >= ox && + c_tile->tile.y + c_tile->tile.height >= oy) { break; } } if(seat->cursor_tile != NULL && seat->cursor_tile != c_tile) { - ipc_send_event(seat->server, "{\"event_name\":\"cursor_switch_tile\",\"old_output\":\"%s\",\"old_tile\":\"%d\",\"new_output\":\"%s\",\"new_tile\":\"%d\"}", - seat->cursor_tile->workspace->output->wlr_output->name, seat->cursor_tile->id,c_outp->name,c_tile->id); + ipc_send_event( + seat->server, + "{\"event_name\":\"cursor_switch_tile\",\"old_output\":\"%s\"," + "\"old_tile\":\"%d\",\"new_output\":\"%s\",\"new_tile\":\"%d\"}", + seat->cursor_tile->workspace->output->wlr_output->name, + seat->cursor_tile->id, c_outp->name, c_tile->id); } - seat->cursor_tile=c_tile; + seat->cursor_tile = c_tile; } static void diff --git a/workspace.c b/workspace.c index 7bfe929..94489ba 100644 --- a/workspace.c +++ b/workspace.c @@ -16,8 +16,8 @@ #include #include "message.h" -#include "seat.h" #include "output.h" +#include "seat.h" #include "server.h" #include "workspace.h" @@ -57,7 +57,8 @@ full_screen_workspace(struct cg_output *output) { if(!workspace) { return NULL; } - struct wlr_scene_output *scene_output=wlr_scene_get_scene_output(output->server->scene,output->wlr_output); + struct wlr_scene_output *scene_output = + wlr_scene_get_scene_output(output->server->scene, output->wlr_output); if(scene_output == NULL) { return NULL; } @@ -91,8 +92,10 @@ void workspace_free_tiles(struct cg_workspace *workspace) { workspace->focused_tile->prev->next = NULL; while(workspace->focused_tile != NULL) { - if(workspace->output->server->running&&workspace->output->server->seat->cursor_tile==workspace->focused_tile) { - workspace->output->server->seat->cursor_tile=NULL; + if(workspace->output->server->running && + workspace->output->server->seat->cursor_tile == + workspace->focused_tile) { + workspace->output->server->seat->cursor_tile = NULL; } struct cg_tile *next = workspace->focused_tile->next; free(workspace->focused_tile); diff --git a/xwayland.c b/xwayland.c index 3b829ff..85a6766 100644 --- a/xwayland.c +++ b/xwayland.c @@ -64,7 +64,8 @@ activate(struct cg_view *view, bool activate) { struct cg_xwayland_view *xwayland_view = xwayland_view_from_view(view); wlr_xwayland_surface_activate(xwayland_view->xwayland_surface, activate); if(activate) { - wlr_xwayland_surface_restack(xwayland_view->xwayland_surface, NULL, XCB_STACK_MODE_ABOVE); + wlr_xwayland_surface_restack(xwayland_view->xwayland_surface, NULL, + XCB_STACK_MODE_ABOVE); } } From 7e28cf6b1cc84e68e2d531a90c7c3cc6518506fd Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 30 Sep 2022 21:10:09 +0200 Subject: [PATCH 386/689] Fix man page documentation --- man/cagebreak-config.5.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index bc35944..6c0161f 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -50,13 +50,13 @@ definekey root configure_message [font |[f|b]g_color b> |display_time ] Configure message characteristics - - - font sets - - is - - X core font description or - - FreeType font description via pango - - fg_color sets RGBA of foreground - - bg_color sets RGBA of background - - display_time sets display time in seconds + - font sets + - is + - X core font description or + - FreeType font description via pango + - fg_color sets RGBA of foreground + - bg_color sets RGBA of background + - display_time sets display time in seconds ``` # Set font From 3e572107edd27c2fdb0479a28fec11d3752c4d99 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 30 Sep 2022 21:11:22 +0200 Subject: [PATCH 387/689] Prepare release version numbers --- man/cagebreak-config.5.md | 2 +- man/cagebreak.1.md | 2 +- meson.build | 26 +++++++++++++------------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index 6c0161f..5f3fec9 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -1,4 +1,4 @@ -cagebreak-config(5) "Version 1.9.0" "Cagebreak Manual" +cagebreak-config(5) "Version 2.0.0" "Cagebreak Manual" # NAME diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index ff3d7e8..4067375 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -1,4 +1,4 @@ -cagebreak(1) "Version 1.9.0" "Cagebreak Manual" +cagebreak(1) "Version 2.0.0" "Cagebreak Manual" # NAME diff --git a/meson.build b/meson.build index 61d949e..40b79b1 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('cagebreak', 'c', - version: '1.8.2', + version: '2.0.0', license: 'MIT', default_options: [ 'c_std=c11', @@ -200,17 +200,17 @@ cagebreak_dependencies_dict = { reproducible_build_versions = { 'server_protos': '-1', 'wayland_server': '1.19.0', - 'wayland_client': '1.19.0', - 'wayland_cursor': '1.19.0', - 'wlroots': '0.14.1', - 'xkbcommon': '1.3.1', - 'fontconfig': '2.13.94', - 'libinput': '1.19.2', - 'libevdev': '1.12.0', - 'libudev': '249', - 'pango': '1.50.0', - 'cairo': '1.17.4', - 'pangocairo': '1.50.0', + 'wayland_client': '1.21.0', + 'wayland_cursor': '1.21.0', + 'wlroots': '0.15.1', + 'xkbcommon': '1.4.1', + 'fontconfig': '2.14.0', + 'libinput': '1.21.0', + 'libevdev': '1.13.0', + 'libudev': '251', + 'pango': '1.50.10', + 'cairo': '1.17.6', + 'pangocairo': '1.50.10', 'math': '-1' } @@ -236,7 +236,7 @@ foreach name, dep : cagebreak_dependencies_dict endforeach reproducible_build_compiler = 'gcc' -reproducible_build_compiler_version = '11.1.0' +reproducible_build_compiler_version = '12.2.0' if cc.get_id() != reproducible_build_compiler warning('The compiler "' + cc.get_id() + '" differs from the one used to generate to binary specified in Hashes.md (' + reproducible_build_compiler + ').') From b151ce8fc2c7aa8d9022bce612c71973fff165e9 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 30 Sep 2022 22:02:14 +0200 Subject: [PATCH 388/689] Improve man page compilation --- meson.build | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index 40b79b1..3eaeeff 100644 --- a/meson.build +++ b/meson.build @@ -257,15 +257,18 @@ install_data('examples/config', install_dir : '/etc/xdg/cagebreak') if get_option('man-pages') scdoc = find_program('scdoc') + secssinceepoch = 1664566469 + shcommand = 'export SOURCE_DATE_EPOCH=' + secssinceepoch.to_string() + ' ; @0@ < @INPUT@'.format(scdoc.path()) sh = find_program('sh') mandir1 = join_paths(get_option('mandir'), 'man1') mandir5 = join_paths(get_option('mandir'), 'man5') + mandir7 = join_paths(get_option('mandir'), 'man7') cagebreak_man = custom_target('cagebreak_man', output : 'cagebreak.1', input : 'man/cagebreak.1.md', - capture : true, - command : [sh, '-c', 'export SOURCE_DATE_EPOCH=1638785664 ; @0@ < @INPUT@'.format(scdoc.path())], + capture : true, + command : [sh, '-c', shcommand], install: true, install_dir: mandir1 ) @@ -273,11 +276,20 @@ if get_option('man-pages') cagebreak_man = custom_target('cagebreak_config_man', output : 'cagebreak-config.5', input : 'man/cagebreak-config.5.md', - capture : true, - command : [sh, '-c', 'export SOURCE_DATE_EPOCH=1638785664 ; @0@ < @INPUT@'.format(scdoc.path())], + capture : true, + command : [sh, '-c', shcommand], install: true, install_dir: mandir5 ) + + cagebreak_man = custom_target('cagebreak_socket_man', + output : 'cagebreak-socket.7', + input : 'man/cagebreak-socket.7.md', + capture : true, + command : [sh, '-c', shcommand], + install: true, + install_dir: mandir7 + ) endif if get_option('fuzz') From cffe8e1991c632ce7c033f75b848159e701772fc Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 30 Sep 2022 22:05:19 +0200 Subject: [PATCH 389/689] Add socket man page --- man/cagebreak-config.5.md | 1 + man/cagebreak-socket.7.md | 70 +++++++++++++++++++++++++++++++++++++++ man/cagebreak.1.md | 1 + 3 files changed, 72 insertions(+) create mode 100644 man/cagebreak-socket.7.md diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index 5f3fec9..8429a9c 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -355,6 +355,7 @@ is used. # SEE ALSO *cagebreak(1)* +*cagebreak-socket(7)* # BUGS diff --git a/man/cagebreak-socket.7.md b/man/cagebreak-socket.7.md new file mode 100644 index 0000000..a140a1f --- /dev/null +++ b/man/cagebreak-socket.7.md @@ -0,0 +1,70 @@ +cagebreak-socket(7) "Version 2.0.0" "Cagebreak Manual" + +# NAME + +*cagebreak-socket* — Cagebreak socket + +# SYNOPSIS + +*ipc-socket-capable-tool \$CAGEBREAK_SOCKET* + +# DESCRIPTION + +The cagebreak socket is an ipc socket. + +The socket accepts cagebreak commands as input (see *cagebreak-config(5)* for more information). + +Events are provided as output as specified in this man page. + +## EVENTS + +*foo * + Set x of y - <[x|y|z]> are foos + between 0 and 1. + This is a full sentence. + +``` +# Comment +example +``` + +## SECURITY + +The socket is restricted to the user for reading, writing and execution. + +## EXAMPLES + +*nc -U $CAGEBREAK_SOCKET* + +*ncat -U $CAGEBREAK_SOCKET* + +# SEE ALSO + +*cagebreak(1)* +*cagebreak-config(5)* + +# BUGS + +See GitHub Issues: + +# LICENSE + +Copyright (c) 2022 The Cagebreak authors + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index 4067375..aa6e071 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -68,6 +68,7 @@ are displayed in a message box at the top right of the screen. # SEE ALSO *cagebreak-config(5)* +*cagebreak-socket(7)* # BUGS From a9224567f97aa778e9939bf67dc84e9517ccddfd Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 30 Sep 2022 23:53:57 +0200 Subject: [PATCH 390/689] Improve socket man page --- man/cagebreak-socket.7.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/man/cagebreak-socket.7.md b/man/cagebreak-socket.7.md index a140a1f..bb82d5d 100644 --- a/man/cagebreak-socket.7.md +++ b/man/cagebreak-socket.7.md @@ -30,7 +30,9 @@ example ## SECURITY -The socket is restricted to the user for reading, writing and execution. +The socket is restricted to the user for reading, writing and execution (700). + +All user software can execute arbitrary code while cagebreak is running. ## EXAMPLES From 32e13e13a54b135796f937d48551d40dc28eb032 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 30 Sep 2022 23:54:17 +0200 Subject: [PATCH 391/689] Improve SECURITY.md --- SECURITY.md | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/SECURITY.md b/SECURITY.md index c339078..ddf385a 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -1,10 +1,12 @@ # Security -The main possibility for security bugs to occur in cagebreak is by privilege -escalation using the socket. Indeed, any program with access to the socket -immediately gains arbitrary code execution rights. As of right now, the socket -is world-writable. If you disagree with this threat model, you may contact -us via email (See section Email Contact below.) or [open an issue on github](https://github.com/project-repo/cagebreak/issues/new). +The main possibility for security bugs in cagebreak is by privilege +escalation through the socket. Any program with access to the socket +immediately gains arbitrary code execution rights. The socket +is restricted to the user of the cagebreak process (700). + +If you disagree with this threat model, you may contact us via email (See +section Email Contact below.) or [open an issue on github](https://github.com/project-repo/cagebreak/issues/new). Should any problem with the github issue system arise or any other reason for (potentially confidential) contact with the Cagebreak authors appear, @@ -12,9 +14,9 @@ you may contact us via email (See section Email Contact below.). ## Supported Versions -The latest release always contains the latest bug fixes and features. -There are no official backports for security vulnerabilities. Builds -are reproducible under conditions outlined in [README.md](README.md). +The most recent release always contains the latest bug fixes and features. +There are no official backports for security vulnerabilities. +Builds are reproducible under conditions outlined in [README.md](README.md). ## Bug Reports @@ -25,11 +27,11 @@ is available below. ## Email Contact -Should you want to get in touch with the developers of cagebreak to report +If you want to get in touch with the developers of cagebreak to report a security vulnerability or anything else via email, contact `cagebreak @ project-repo . co`. -We will try to respond to everything that is not obvious spam. +We try to respond to everything that is not obvious spam. ### GPG-Encrypted Emails @@ -47,21 +49,23 @@ public key or provide the fingerprint and directions to obtain the key. ## Threat Model -Cagebreak is a wayland compositor, which is run by the user of the system +Cagebreak is a wayland compositor run by the user of the system and thus has access to whichever resources this user has access to. Cagebreak can restrict other programs in no way, because this would hamper usability (consider a web browser unable to write a downloaded file to disk -for instance). There is no transmission of information by cagebreak other -than to the screens, ipc and potentially other documented local channels. +for instance). + +There is no transmission of information by cagebreak other than to the +screens, ipc and potentially other documented local channels. ### STRIDE Threat List This is not a thorough analysis, just an overview of the ways in which cagebreak -has/does not have an attack surface. +has (no) attack surface. #### Spoofing -Not applicable - Using cagebreak already requires a login as a user. +Not applicable - Using Cagebreak already requires a login as a user. #### Tampering From 3b175f915d068db1ed27a7d8a9f82afc2483f307 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 1 Oct 2022 15:39:12 +0200 Subject: [PATCH 392/689] Improve config man page - Differentiate output and *screen --- man/cagebreak-config.5.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index 8429a9c..ff850ec 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -218,21 +218,26 @@ message *movetonextscreen* Move currently focused window to next screen + See *output* for differences between screen and output. *movetoprevscreen* Move currently focused window to previous screen + See *output* for differences between screen and output. *movetoscreen * Move currently focused window to -th screen + See *output* for differences between screen and output. *movetoworkspace * Move currently focused window to -th workspace + See *output* for differences between screen and output. *next* Focus next window in current tile *nextscreen* Focus next screen + See *output* for differences between screen and output. *only* Remove all splits and make current window fill the entire screen @@ -252,6 +257,14 @@ message to set priorities for outputs, where >= 1. The larger is, the higher the priority is, that is to say, the earlier the output will appear in the list of outputs. + *output* and the *screen* familiy of commands are similar in dealing + with monitors on some level. + - *output* addresses outputs by their name and is vaguely symmetric + to *input*. + - Any *screen* command deals with the number identifying a + monitor within a Cagebreak session either explicitely or + implicitly by changing it in some way (i.e. the + commands containing next and prev). *prev* Focus previous window in current tile @@ -276,6 +289,7 @@ message *screen * Change to -th screen + See *output* for differences between screen and output. *show_info* Display information about the current setup - In particular, print the identifiers From 3e45e1f5bb70d3dc5472a4139403a5af71e4a48a Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 2 Oct 2022 11:41:27 +0200 Subject: [PATCH 393/689] Remove unused code --- input.h | 3 - render.c | 274 ------------------------------------------------------- 2 files changed, 277 deletions(-) delete mode 100644 render.c diff --git a/input.h b/input.h index 0b6eb7e..22db599 100644 --- a/input.h +++ b/input.h @@ -13,9 +13,6 @@ cg_input_configure_libinput_device(struct cg_input_device *device); void cg_input_apply_config(struct cg_input_config *config, struct cg_server *server); -bool -cg_input_reset_libinput_device(struct cg_input_device *device); - bool cg_libinput_device_is_builtin(struct cg_input_device *device); diff --git a/render.c b/render.c deleted file mode 100644 index 53ed0ea..0000000 --- a/render.c +++ /dev/null @@ -1,274 +0,0 @@ -/* - * Cagebreak: A Wayland tiling compositor. - * - * Copyright (C) 2020-2022 The Cagebreak Authors - * Copyright (C) 2018-2020 Jente Hidskes - * Copyright (C) 2019 The Sway authors - * - * See the LICENSE file accompanying this file. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "message.h" -#include "output.h" -#include "seat.h" -#include "server.h" -#include "util.h" -#include "view.h" -#include "workspace.h" - -static void -scissor_output(struct wlr_output *output, pixman_box32_t *rect, - struct wlr_renderer *renderer) { - - struct wlr_box box = { - .x = rect->x1, - .y = rect->y1, - .width = rect->x2 - rect->x1, - .height = rect->y2 - rect->y1, - }; - - int output_width, output_height; - wlr_output_transformed_resolution(output, &output_width, &output_height); - enum wl_output_transform transform = - wlr_output_transform_invert(output->transform); - wlr_box_transform(&box, &box, transform, output_width, output_height); - - wlr_renderer_scissor(renderer, &box); -} - -struct render_data { - pixman_region32_t *damage; - int tile_width, tile_height; -}; - -static void -render_texture(struct wlr_output *wlr_output, pixman_region32_t *output_damage, - struct wlr_texture *texture, const struct wlr_box *box, - const float matrix[static 9], struct wlr_renderer *renderer) { - pixman_region32_t damage; - pixman_region32_init(&damage); - pixman_region32_union_rect(&damage, &damage, box->x, box->y, box->width, - box->height); - pixman_region32_intersect(&damage, &damage, output_damage); - if(!pixman_region32_not_empty(&damage)) { - goto damage_finish; - } - - int nrects; - pixman_box32_t *rects = pixman_region32_rectangles(&damage, &nrects); - for(int i = 0; i < nrects; i++) { - scissor_output(wlr_output, &rects[i], renderer); - wlr_render_texture_with_matrix(renderer, texture, matrix, 1.0F); - } - -damage_finish: - pixman_region32_fini(&damage); -} - -static void -render_surface_iterator(struct cg_output *output, struct wlr_surface *surface, - struct wlr_box *box, void *user_data) { - struct render_data *data = user_data; - struct wlr_output *wlr_output = output->wlr_output; - pixman_region32_t *output_damage = data->damage; - - struct wlr_texture *texture = wlr_surface_get_texture(surface); - if(!texture) { - wlr_log(WLR_DEBUG, "Cannot obtain surface texture"); - return; - } - - scale_box(box, wlr_output->scale); - - float matrix[9]; - enum wl_output_transform transform = - wlr_output_transform_invert(surface->current.transform); - wlr_matrix_project_box(matrix, box, transform, 0.0F, - wlr_output->transform_matrix); - - if(data->tile_width != 0) { - box->width = - box->width > data->tile_width ? data->tile_width : box->width; - } - if(data->tile_height != 0) { - box->height = - box->height > data->tile_height ? data->tile_height : box->height; - } - render_texture(wlr_output, output_damage, texture, box, matrix, - output->server->renderer); -} - -static void -render_drag_icons(struct cg_output *output, pixman_region32_t *damage, - struct wl_list *drag_icons) { - struct render_data data = { - .damage = damage, - .tile_width = 0, - .tile_height = 0, - }; - output_drag_icons_for_each_surface(output, drag_icons, - render_surface_iterator, &data); -} - -/** - * Render all toplevels without descending into popups. - */ -static void -render_view_toplevels(struct cg_view *view, struct cg_output *output, - pixman_region32_t *damage) { - struct render_data data = { - .damage = damage, - .tile_width = 0, - .tile_height = 0, - }; - struct cg_tile *view_tile = view_get_tile(view); - if(view_tile != NULL) { - if(view_tile->tile.width != view->wlr_surface->current.width || - view_tile->tile.height != view->wlr_surface->current.height) { - view_damage_whole(view); - } - data.tile_width = view_tile->tile.width; - data.tile_height = view_tile->tile.height; - } - - double ox, oy; - ox = view->ox; - oy = view->oy; - output_surface_for_each_surface(output, view->wlr_surface, ox, oy, - render_surface_iterator, &data); -} - -static void -render_popup_iterator(struct cg_output *output, struct wlr_surface *surface, - struct wlr_box *box, void *data) { - /* Render this popup's surface. */ - render_surface_iterator(output, surface, box, data); - - /* Render this popup's child toplevels. */ - output_surface_for_each_surface(output, surface, box->x, box->y, - render_surface_iterator, data); -} - -static void -render_view_popups(struct cg_view *view, struct cg_output *output, - pixman_region32_t *damage) { - struct render_data data = { - .damage = damage, - .tile_width = 0, - .tile_height = 0, - }; - output_view_for_each_popup(output, view, render_popup_iterator, &data); -} - -void -output_render(struct cg_output *output, pixman_region32_t *damage) { - struct cg_server *server = output->server; - struct wlr_output *wlr_output = output->wlr_output; - - struct wlr_renderer *renderer = output->server->renderer; - if(!renderer) { - wlr_log(WLR_DEBUG, "Expected the output backend to have a renderer"); - return; - } - - wlr_renderer_begin(renderer, wlr_output->width, wlr_output->height); - - if(!pixman_region32_not_empty(damage)) { - wlr_log(WLR_DEBUG, "Output isn't damaged but needs a buffer swap"); - goto renderer_end; - } - -#ifdef DEBUG - if(server->debug_damage_tracking) { - wlr_renderer_clear(renderer, (float[]){1.0F, 0.0F, 0.0F, 1.0F}); - } -#endif - - int nrects; - pixman_box32_t *rects = pixman_region32_rectangles(damage, &nrects); - for(int i = 0; i < nrects; i++) { - scissor_output(wlr_output, &rects[i], renderer); - wlr_renderer_clear(renderer, server->bg_color); - } - - bool first = true; - for(struct cg_tile *tile = - output->workspaces[output->curr_workspace]->focused_tile; - first || - tile != output->workspaces[output->curr_workspace]->focused_tile; - tile = tile->next) { - first = false; - /* Only render visible views */ - if(tile->view != NULL) { - render_view_toplevels(tile->view, output, damage); - } - } - - struct cg_view *view; - wl_list_for_each_reverse( - view, &output->workspaces[output->curr_workspace]->unmanaged_views, - link) { - render_view_toplevels(view, output, damage); - } - - struct cg_view *focused_view = seat_get_focus(server->seat); - if(focused_view != NULL) { - render_view_popups(focused_view, output, damage); - } - - struct cg_message *message; - wl_list_for_each_reverse(message, &output->messages, link) { - float matrix[9]; - wlr_matrix_project_box(matrix, message->position, - WL_OUTPUT_TRANSFORM_NORMAL, 0.0F, - wlr_output->transform_matrix); - render_texture(output->wlr_output, damage, message->message, - message->position, matrix, renderer); - } - render_drag_icons(output, damage, &server->seat->drag_icons); - -renderer_end: - /* Draw software cursor in case hardware cursors aren't - available. This is a no-op when they are. */ - wlr_output_render_software_cursors(wlr_output, damage); - wlr_renderer_scissor(renderer, NULL); - wlr_renderer_end(renderer); - - int output_width, output_height; - wlr_output_transformed_resolution(wlr_output, &output_width, - &output_height); - - pixman_region32_t frame_damage; - pixman_region32_init(&frame_damage); - - enum wl_output_transform transform = - wlr_output_transform_invert(wlr_output->transform); - wlr_region_transform(&frame_damage, &output->damage->current, transform, - output_width, output_height); - -#ifdef DEBUG - if(server->debug_damage_tracking) { - pixman_region32_union_rect(&frame_damage, &frame_damage, 0, 0, - output_width, output_height); - } -#endif - - wlr_output_set_damage(wlr_output, &frame_damage); - pixman_region32_fini(&frame_damage); - - if(!wlr_output_commit(wlr_output)) { - wlr_log(WLR_ERROR, "Could not commit output"); - } -} From 4e40cf955d2e0abbe7cb3a22cf3a030a2188ba90 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 2 Oct 2022 11:45:56 +0200 Subject: [PATCH 394/689] Apply clang-format --- keybinding.c | 4 ++-- parse.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/keybinding.c b/keybinding.c index c2ad1ca..6ebbc5a 100644 --- a/keybinding.c +++ b/keybinding.c @@ -1092,9 +1092,9 @@ keybinding_move_view_to_cycle_output(struct cg_server *server, bool reverse) { view_maximize(view, view->tile); seat_set_focus(server->seat, view); } - int id=-1; + int id = -1; if(view != NULL) { - id=view->id; + id = view->id; } ipc_send_event(server, "{\"event_name\":\"move_view_cycle_output\",\"view_id\":\"%" diff --git a/parse.c b/parse.c index be114f1..474a456 100644 --- a/parse.c +++ b/parse.c @@ -692,7 +692,7 @@ parse_message_config(char **saveptr, char **errstr) { return cfg; error: - if(cfg!=NULL) { + if(cfg != NULL) { free(cfg); } wlr_log(WLR_ERROR, "Message configuration must be of the form " From 6b3bcdb659b65d2bcf15d41b8879aa44a598902e Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 2 Oct 2022 13:00:35 +0200 Subject: [PATCH 395/689] Reword distinction between screen and output --- man/cagebreak-config.5.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index 98ca1ad..252388f 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -257,14 +257,13 @@ message to set priorities for outputs, where >= 1. The larger is, the higher the priority is, that is to say, the earlier the output will appear in the list of outputs. - *output* and the *screen* familiy of commands are similar in dealing - with monitors on some level. + *output* and the *screen* family of commands are similar in that they + both deal with monitors on some level. - *output* addresses outputs by their name and is vaguely symmetric to *input*. - Any *screen* command deals with the number identifying a - monitor within a Cagebreak session either explicitely or - implicitly by changing it in some way (i.e. the - commands containing next and prev). + monitor within a Cagebreak session either explicitly or + implicitly (i.e. the commands containing next and prev). *prev* Focus previous window in current tile From 77dfee19e75b0c63e5ceedf4a59693ecc712792c Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 2 Oct 2022 15:10:30 +0200 Subject: [PATCH 396/689] Fix man page alignment --- man/cagebreak-config.5.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index 252388f..1f0293f 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -258,7 +258,7 @@ message the higher the priority is, that is to say, the earlier the output will appear in the list of outputs. *output* and the *screen* family of commands are similar in that they - both deal with monitors on some level. + both deal with monitors on some level. - *output* addresses outputs by their name and is vaguely symmetric to *input*. - Any *screen* command deals with the number identifying a From c4704659f2ce4829faaf12a5749901d15a297c3f Mon Sep 17 00:00:00 2001 From: project-repo Date: Tue, 4 Oct 2022 20:57:52 +0200 Subject: [PATCH 397/689] Add Anser to FAQ --- FAQ.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/FAQ.md b/FAQ.md index 1077a69..21c44f4 100644 --- a/FAQ.md +++ b/FAQ.md @@ -25,6 +25,23 @@ Set the following environment variables to activate wayland support for firefox. +## How are applications launched in Cagebreak? + +There are multiple ways to launch external programs in cagebreak. + + * Using a terminal emulator is a perfectly valid way to launch + applications. If you want to be able to close the terminal + you used to start the program, you may use `&disown`, which should + be available in every shell. + * Using the `exec` command in the cagebreak config, it is possible to + launch programs when cagebreak is started. Moreover, as this command + can be combined with commands such as `bind`, it can be used to + create custom keybindings which execute external programs. (See also + the man page `cagebreak-config`). + * All commands mentioned previously are also available over the socket + which allows the creation of (arbitrary) keybindings on the fly and + a fortiori keybindings running arbitrary commands. + ## Which further resources are available? * [Arch Linux Wiki entry for Cagebreak](https://wiki.archlinux.org/title/Cagebreak) From 395cbc7c1a1a96999d1a52602730830cedf2ccf5 Mon Sep 17 00:00:00 2001 From: project-repo Date: Tue, 4 Oct 2022 20:58:11 +0200 Subject: [PATCH 398/689] Set version in meson.build --- meson.build | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/meson.build b/meson.build index 3eaeeff..88fff34 100644 --- a/meson.build +++ b/meson.build @@ -1,10 +1,9 @@ -project('cagebreak', 'c', - version: '2.0.0', - license: 'MIT', - default_options: [ - 'c_std=c11', - 'warning_level=3', - ], +project( + 'cagebreak', + 'c', +version : '2.0.0', +license : 'MIT', +default_options : ['c_std=c11', 'warning_level=3'] ) add_project_arguments( From f3ad7bae635f7ab4ffa83999e1a4b3ee8e960e1c Mon Sep 17 00:00:00 2001 From: project-repo Date: Tue, 4 Oct 2022 21:02:32 +0200 Subject: [PATCH 399/689] Link cb-socket man page in FAQ --- FAQ.md | 1 + 1 file changed, 1 insertion(+) diff --git a/FAQ.md b/FAQ.md index 21c44f4..3f9e9db 100644 --- a/FAQ.md +++ b/FAQ.md @@ -5,6 +5,7 @@ * Check the man pages * [cagebreak config](man/cagebreak-config.5.md) (probably where you find the answer) * [cagebreak](man/cagebreak.1.md) (command line options etc.) + * [cagebreak-socket](man/cagebreak-socket.7.md) (socket information, mostly useful for scritping) * Check the rest of this FAQ * [Open an issue](https://github.com/project-repo/cagebreak/issues/new) or otherwise get in touch with the development team (See section Email Contact in [SECURITY.md](SECURITY.md)). From a33c0328388aa49595e8f0d0af6b84e048579e37 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 8 Oct 2022 15:15:23 +0200 Subject: [PATCH 400/689] Add OpenSSF Badge to README --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index dfa94d5..645fe86 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Cagebreak: A Wayland Tiling Compositor Inspired by Ratpoison +[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/6532/badge)](https://bestpractices.coreinfrastructure.org/projects/6532) + [![Packaging status](https://repology.org/badge/tiny-repos/cagebreak.svg)](https://repology.org/project/cagebreak/versions) [![AUR package](https://repology.org/badge/version-for-repo/aur/cagebreak.svg?minversion=2.0.0)](https://repology.org/project/cagebreak/versions) From 88630bbad6b9cb866ae89c0bfc280cdf71375b97 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 8 Oct 2022 18:05:34 +0200 Subject: [PATCH 401/689] Fix typo in README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 645fe86..7d9b535 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ For documentation of Cagebreak, please see * the man pages * [cagebreak](man/cagebreak.1.md) * [configuration](man/cagebreak-config.5.md) + * [socket](man/cagebreak-socket.7.md) * also the [FAQ](FAQ.md) Cagebreak is based on [Cage](https://github.com/Hjdskes/cage), a Wayland kiosk From 4c7e21b1c13328eb4a005a2338176537454beef4 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 8 Oct 2022 18:08:07 +0200 Subject: [PATCH 402/689] Add links to README --- README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 7d9b535..116ed25 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,9 @@ [![AUR package](https://repology.org/badge/version-for-repo/aur/cagebreak.svg?minversion=2.0.0)](https://repology.org/project/cagebreak/versions) This is Cagebreak, a Wayland tiling compositor. +This is Cagebreak, a [Wayland](https://wayland.freedesktop.org/) tiling compositor. -The goal of this project is to provide a successor to ratpoison for Wayland +The goal of this project is to provide a successor to [ratpoison](https://www.nongnu.org/ratpoison/) for Wayland users. However, this is no reimplementation of ratpoison. Should you like to know if a feature will be implemented, open an issue @@ -24,8 +25,8 @@ For documentation of Cagebreak, please see Cagebreak is based on [Cage](https://github.com/Hjdskes/cage), a Wayland kiosk compositor. -Cagebreak is developed under Arch Linux and uses the libraries -as they are obtained through pacman. However, cagebreak should also work on +Cagebreak is developed under [Arch Linux](https://archlinux.org/) and uses the libraries +as they are obtained through [pacman](https://wiki.archlinux.org/title/Pacman). However, cagebreak should also work on other distributions given the proper library versions. ## Installation @@ -44,8 +45,8 @@ See [cagebreak-pkgbuild](https://github.com/project-repo/cagebreak-pkgbuild) for There are different ways to obtain cagebreak source: - * git clone (for all releases) - * download release asset tarballs (starting at release 1.2.1) + * [git clone](https://github.com/project-repo/cagebreak) (for all releases) + * [download release asset tarballs](https://github.com/project-repo/cagebreak/releases) (starting at release 1.2.1) ### Verifying Source Code From 60141498f27762f4d47b748d0c3d21c251b2b7e8 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 8 Oct 2022 18:10:03 +0200 Subject: [PATCH 403/689] Reformat Badges in README --- README.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/README.md b/README.md index 116ed25..38523f5 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,7 @@ # Cagebreak: A Wayland Tiling Compositor Inspired by Ratpoison -[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/6532/badge)](https://bestpractices.coreinfrastructure.org/projects/6532) +[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/6532/badge)](https://bestpractices.coreinfrastructure.org/projects/6532) [![Packaging status](https://repology.org/badge/tiny-repos/cagebreak.svg)](https://repology.org/project/cagebreak/versions) [![AUR package](https://repology.org/badge/version-for-repo/aur/cagebreak.svg?minversion=2.0.0)](https://repology.org/project/cagebreak/versions) -[![Packaging status](https://repology.org/badge/tiny-repos/cagebreak.svg)](https://repology.org/project/cagebreak/versions) - -[![AUR package](https://repology.org/badge/version-for-repo/aur/cagebreak.svg?minversion=2.0.0)](https://repology.org/project/cagebreak/versions) - -This is Cagebreak, a Wayland tiling compositor. This is Cagebreak, a [Wayland](https://wayland.freedesktop.org/) tiling compositor. The goal of this project is to provide a successor to [ratpoison](https://www.nongnu.org/ratpoison/) for Wayland From caafee6e0aecfd3835db8b27a9115440a32459d4 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 8 Oct 2022 19:12:03 +0200 Subject: [PATCH 404/689] Improve README through restructuring. --- README.md | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 38523f5..ad3d4c6 100644 --- a/README.md +++ b/README.md @@ -2,13 +2,16 @@ [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/6532/badge)](https://bestpractices.coreinfrastructure.org/projects/6532) [![Packaging status](https://repology.org/badge/tiny-repos/cagebreak.svg)](https://repology.org/project/cagebreak/versions) [![AUR package](https://repology.org/badge/version-for-repo/aur/cagebreak.svg?minversion=2.0.0)](https://repology.org/project/cagebreak/versions) +## Quick Introduction + This is Cagebreak, a [Wayland](https://wayland.freedesktop.org/) tiling compositor. +### Goal + The goal of this project is to provide a successor to [ratpoison](https://www.nongnu.org/ratpoison/) for Wayland users. However, this is no reimplementation of ratpoison. -Should you like to know if a feature will be implemented, open an issue -or get in touch with the development team. +### Documentation For documentation of Cagebreak, please see * the man pages @@ -17,16 +20,28 @@ For documentation of Cagebreak, please see * [socket](man/cagebreak-socket.7.md) * also the [FAQ](FAQ.md) -Cagebreak is based on [Cage](https://github.com/Hjdskes/cage), a Wayland kiosk -compositor. +### New Features + +Should you like to know if a feature will be implemented, open an issue +or get in touch with the development team. + +### Compatibility & Development Distribution Cagebreak is developed under [Arch Linux](https://archlinux.org/) and uses the libraries as they are obtained through [pacman](https://wiki.archlinux.org/title/Pacman). However, cagebreak should also work on other distributions given the proper library versions. +### History + +Cagebreak is based on [Cage](https://github.com/Hjdskes/cage), a Wayland kiosk +compositor. + +This also explains the name Cagebreak, since it breaks the +kiosk into tiles. + ## Installation -If you are using archlinux, just use the PKGBUILDs from the aur: +If you are using Arch Linux, just use the PKGBUILDs from the aur: * Using [cagebreak](https://aur.archlinux.org/packages/cagebreak), Cagebreak is compiled on the target system (since release 1.3.0) From 751b947a66cc92f132a365095b9a50f445107295 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 8 Oct 2022 20:39:02 +0200 Subject: [PATCH 405/689] Improve README --- README.md | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index ad3d4c6..f0faaee 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,24 @@ -# Cagebreak: A Wayland Tiling Compositor Inspired by Ratpoison +# Cagebreak: A Wayland Tiling Compositor [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/6532/badge)](https://bestpractices.coreinfrastructure.org/projects/6532) [![Packaging status](https://repology.org/badge/tiny-repos/cagebreak.svg)](https://repology.org/project/cagebreak/versions) [![AUR package](https://repology.org/badge/version-for-repo/aur/cagebreak.svg?minversion=2.0.0)](https://repology.org/project/cagebreak/versions) -## Quick Introduction +## Quick Introduction to Cagebreak -This is Cagebreak, a [Wayland](https://wayland.freedesktop.org/) tiling compositor. +This is Cagebreak. + +Cagebreak is a [Wayland](https://wayland.freedesktop.org/) tiling compositor +based on [Cage](https://github.com/Hjdskes/cage) and inspired by [ratpoison](https://www.nongnu.org/ratpoison/). ### Goal The goal of this project is to provide a successor to [ratpoison](https://www.nongnu.org/ratpoison/) for Wayland users. However, this is no reimplementation of ratpoison. +#### New Features + +Should you like to know if a feature will be implemented, open an issue +or get in touch with the development team. + ### Documentation For documentation of Cagebreak, please see @@ -20,21 +28,21 @@ For documentation of Cagebreak, please see * [socket](man/cagebreak-socket.7.md) * also the [FAQ](FAQ.md) -### New Features - -Should you like to know if a feature will be implemented, open an issue -or get in touch with the development team. - ### Compatibility & Development Distribution -Cagebreak is developed under [Arch Linux](https://archlinux.org/) and uses the libraries -as they are obtained through [pacman](https://wiki.archlinux.org/title/Pacman). However, cagebreak should also work on -other distributions given the proper library versions. +Cagebreak supports [Arch Linux](https://archlinux.org/) and uses the libraries +(and software versions) as they are obtained through [pacman](https://wiki.archlinux.org/title/Pacman) +at the time of release. Any other use is out of scope. -### History +Everything else probably works with a bit of luck. We +make no guarantees. + +### Naming Cagebreak is based on [Cage](https://github.com/Hjdskes/cage), a Wayland kiosk -compositor. +compositor. Since it breaks the +kiosk into tiles the name . + This also explains the name Cagebreak, since it breaks the kiosk into tiles. From d9f8630a52d966fb005cbe7abd5643616e39e01a Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 8 Oct 2022 21:04:23 +0200 Subject: [PATCH 406/689] Improve Quick Introduction section in README. --- README.md | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index f0faaee..c47aa26 100644 --- a/README.md +++ b/README.md @@ -14,19 +14,12 @@ based on [Cage](https://github.com/Hjdskes/cage) and inspired by [ratpoison](htt The goal of this project is to provide a successor to [ratpoison](https://www.nongnu.org/ratpoison/) for Wayland users. However, this is no reimplementation of ratpoison. -#### New Features +#### New Features, Bugs and Contact Information -Should you like to know if a feature will be implemented, open an issue -or get in touch with the development team. +Should you want to know if a feature will be implemented, file a bug or +otherwise get in touch, [open an issue](https://github.com/project-repo/cagebreak/issues/new) +or get in touch with the development team (See [SECURITY.md](SECURITY.md) for details.). -### Documentation - -For documentation of Cagebreak, please see - * the man pages - * [cagebreak](man/cagebreak.1.md) - * [configuration](man/cagebreak-config.5.md) - * [socket](man/cagebreak-socket.7.md) - * also the [FAQ](FAQ.md) ### Compatibility & Development Distribution @@ -37,6 +30,26 @@ at the time of release. Any other use is out of scope. Everything else probably works with a bit of luck. We make no guarantees. +### Quick Installation + +This assumes Arch Linux: + +1. Use the [cagebreak PKGBUILD](https://aur.archlinux.org/packages/cagebreak). +2. Add an example config such as [config](examples/config) to `$USER/.config/cagebreak/config` +3. Execute cagebreak like any other binary. + +See the [ArchWiki](https://wiki.archlinux.org/title/Cagebreak#Getting_started) for +details on getting started and the documentation for everything else. + +### Documentation + +For documentation on Cagebreak, please see + * man pages + * [cagebreak](man/cagebreak.1.md) + * [configuration](man/cagebreak-config.5.md) + * [socket](man/cagebreak-socket.7.md) + * [FAQ](FAQ.md) + ### Naming Cagebreak is based on [Cage](https://github.com/Hjdskes/cage), a Wayland kiosk From 5f636ef13f1ed47fec017c72fc04301ebbf17a74 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 8 Oct 2022 21:05:40 +0200 Subject: [PATCH 407/689] Fix minor wording/formatting in README --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c47aa26..7330a46 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ kiosk into tiles. ## Installation -If you are using Arch Linux, just use the PKGBUILDs from the aur: +On Arch Linux, just use the PKGBUILDs from the [AUR](https://aur.archlinux.org/): * Using [cagebreak](https://aur.archlinux.org/packages/cagebreak), Cagebreak is compiled on the target system (since release 1.3.0) @@ -367,8 +367,7 @@ In the meantime, add `-Db_detect-leaks=0` to the meson command to exclude memory ## Bugs -For any bug, please [create an -issue](https://github.com/project-repo/cagebreak/issues/new) on +For any bug, please [create an issue](https://github.com/project-repo/cagebreak/issues/new) on [GitHub](https://github.com/project-repo/cagebreak). Fixed bugs are to be assigned a number and summarized inside Bugs.md for future reference From 6b6e50ff4502a60c563da90944600f97c830c045 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 8 Oct 2022 21:09:25 +0200 Subject: [PATCH 408/689] Improve Quick Introduction in README. --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 7330a46..75a291c 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,6 @@ ## Quick Introduction to Cagebreak -This is Cagebreak. - Cagebreak is a [Wayland](https://wayland.freedesktop.org/) tiling compositor based on [Cage](https://github.com/Hjdskes/cage) and inspired by [ratpoison](https://www.nongnu.org/ratpoison/). @@ -21,7 +19,7 @@ otherwise get in touch, [open an issue](https://github.com/project-repo/cagebrea or get in touch with the development team (See [SECURITY.md](SECURITY.md) for details.). -### Compatibility & Development Distribution +#### Compatibility & Development Distribution Cagebreak supports [Arch Linux](https://archlinux.org/) and uses the libraries (and software versions) as they are obtained through [pacman](https://wiki.archlinux.org/title/Pacman) From 66dca96991417d974e69f947e800b8c5f35fc105 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 8 Oct 2022 21:11:22 +0200 Subject: [PATCH 409/689] Rename Goal->Purpose section in README. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 75a291c..bbb46b2 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Cagebreak is a [Wayland](https://wayland.freedesktop.org/) tiling compositor based on [Cage](https://github.com/Hjdskes/cage) and inspired by [ratpoison](https://www.nongnu.org/ratpoison/). -### Goal +### Purpose The goal of this project is to provide a successor to [ratpoison](https://www.nongnu.org/ratpoison/) for Wayland users. However, this is no reimplementation of ratpoison. From 6a03ea553e1f275e028bb45b3b9dfaf2986f9695 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 8 Oct 2022 21:29:04 +0200 Subject: [PATCH 410/689] Improve README. --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bbb46b2..b2dba70 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ users. However, this is no reimplementation of ratpoison. Should you want to know if a feature will be implemented, file a bug or otherwise get in touch, [open an issue](https://github.com/project-repo/cagebreak/issues/new) -or get in touch with the development team (See [SECURITY.md](SECURITY.md) for details.). +or write an e-mail (See [SECURITY.md](SECURITY.md) for details.). #### Compatibility & Development Distribution @@ -42,12 +42,19 @@ details on getting started and the documentation for everything else. ### Documentation For documentation on Cagebreak, please see + * this file * man pages * [cagebreak](man/cagebreak.1.md) * [configuration](man/cagebreak-config.5.md) * [socket](man/cagebreak-socket.7.md) * [FAQ](FAQ.md) +### Contributing + +Just [open an issue](https://github.com/project-repo/cagebreak/issues/new) +and state your feature request. +Don't write something and open a pull request because we may not +accept it for many reasons. ### Naming Cagebreak is based on [Cage](https://github.com/Hjdskes/cage), a Wayland kiosk From 40115efe1efe9496fdd521120abd8883b6da218c Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 8 Oct 2022 21:42:50 +0200 Subject: [PATCH 411/689] Reword Quick Introduction.Documentation in README. --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b2dba70..e77299a 100644 --- a/README.md +++ b/README.md @@ -41,13 +41,14 @@ details on getting started and the documentation for everything else. ### Documentation -For documentation on Cagebreak, please see - * this file - * man pages +Please see: + * the rest of this file + * the man pages: * [cagebreak](man/cagebreak.1.md) * [configuration](man/cagebreak-config.5.md) * [socket](man/cagebreak-socket.7.md) - * [FAQ](FAQ.md) + * the [FAQ](FAQ.md) + ### Contributing From aacb7eb125f1c494158361d7990fd2fc8db8661a Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 8 Oct 2022 21:48:22 +0200 Subject: [PATCH 412/689] Add Changelog to Documentation section in README. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index e77299a..5498d2a 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,7 @@ Please see: * [configuration](man/cagebreak-config.5.md) * [socket](man/cagebreak-socket.7.md) * the [FAQ](FAQ.md) + * the [Changelog](Changelog.md) ### Contributing From c7630bfddbbed98a473725c201ba62838ffe5e44 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 8 Oct 2022 23:32:16 +0200 Subject: [PATCH 413/689] Improve Purpose section of README. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5498d2a..5ca9c10 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,8 @@ based on [Cage](https://github.com/Hjdskes/cage) and inspired by [ratpoison](htt ### Purpose -The goal of this project is to provide a successor to [ratpoison](https://www.nongnu.org/ratpoison/) for Wayland -users. However, this is no reimplementation of ratpoison. +The goal of this project is to provide a successor to [ratpoison](https://www.nongnu.org/ratpoison/) for Wayland. +However, this is no reimplementation of ratpoison. #### New Features, Bugs and Contact Information From a71406b23eb90d270ca709d845a5b450e47d3846 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 8 Oct 2022 23:32:43 +0200 Subject: [PATCH 414/689] Improve compatibility description --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5ca9c10..fdc4af9 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Cagebreak supports [Arch Linux](https://archlinux.org/) and uses the libraries (and software versions) as they are obtained through [pacman](https://wiki.archlinux.org/title/Pacman) at the time of release. Any other use is out of scope. -Everything else probably works with a bit of luck. We +Most other setups probably work with a bit of luck. We make no guarantees. ### Quick Installation From 4c93f3cc9b224e735357265fb48c5b08e7ca0cd4 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 8 Oct 2022 23:33:15 +0200 Subject: [PATCH 415/689] Add SECURITY.md to list of Documentation. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index fdc4af9..a9962d1 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,7 @@ Please see: * [configuration](man/cagebreak-config.5.md) * [socket](man/cagebreak-socket.7.md) * the [FAQ](FAQ.md) + * [SECURITY.md](SECURITY.md) * the [Changelog](Changelog.md) From afaae1554ed5cd00b5c77edff3d5093f326f4984 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 8 Oct 2022 23:36:02 +0200 Subject: [PATCH 416/689] Improve Name section in README. --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a9962d1..b825d59 100644 --- a/README.md +++ b/README.md @@ -58,15 +58,15 @@ Just [open an issue](https://github.com/project-repo/cagebreak/issues/new) and state your feature request. Don't write something and open a pull request because we may not accept it for many reasons. -### Naming + +### Name Cagebreak is based on [Cage](https://github.com/Hjdskes/cage), a Wayland kiosk compositor. Since it breaks the -kiosk into tiles the name . +kiosk into tiles the name Cagebreak seemed appropriate. + -This also explains the name Cagebreak, since it breaks the -kiosk into tiles. ## Installation From aa3c503ac2f4520a2ee65b77ba2f82cd5fdea1b0 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 9 Oct 2022 15:47:51 +0200 Subject: [PATCH 417/689] Improve Quick Introduction in README --- README.md | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index b825d59..3748d57 100644 --- a/README.md +++ b/README.md @@ -9,15 +9,16 @@ based on [Cage](https://github.com/Hjdskes/cage) and inspired by [ratpoison](htt ### Purpose -The goal of this project is to provide a successor to [ratpoison](https://www.nongnu.org/ratpoison/) for Wayland. +The goal of this project is to provide a successor to ratpoison for Wayland. However, this is no reimplementation of ratpoison. #### New Features, Bugs and Contact Information Should you want to know if a feature will be implemented, file a bug or -otherwise get in touch, [open an issue](https://github.com/project-repo/cagebreak/issues/new) +get in touch, [open an issue](https://github.com/project-repo/cagebreak/issues/new) or write an e-mail (See [SECURITY.md](SECURITY.md) for details.). +The Roadmap section outlines what is planned for the future. #### Compatibility & Development Distribution @@ -41,7 +42,6 @@ details on getting started and the documentation for everything else. ### Documentation -Please see: * the rest of this file * the man pages: * [cagebreak](man/cagebreak.1.md) @@ -51,13 +51,23 @@ Please see: * [SECURITY.md](SECURITY.md) * the [Changelog](Changelog.md) +### Uninstallation + +`pacman -R cagebreak` should be sufficient. ### Contributing -Just [open an issue](https://github.com/project-repo/cagebreak/issues/new) -and state your feature request. -Don't write something and open a pull request because we may not -accept it for many reasons. + * Just [open an issue](https://github.com/project-repo/cagebreak/issues/new) and state your feature request. + We will consider the proposal and get back to you. + * Don't open a pull request. We might not accept your code and + it would be sad to waste the effort. + * Respect the Code of Conduct (TODO link) (To date, we never + had to intervene - Keep it that way!) + +Reviewing the project in any aspect is always welcome. + +If you have ideas on improving the testing and quality assurance +aspects, your input is particularly welcome. ### Name From cfa83a38d13953beba3681c66f40e0209761f342 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 10 Oct 2022 13:42:31 +0200 Subject: [PATCH 418/689] Fix License statement in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3748d57..95103a0 100644 --- a/README.md +++ b/README.md @@ -406,5 +406,5 @@ See [Changelog.md](Changelog.md) ## License -Please see [LICENSE](https://github.com/project-repo/cagebreak/blob/master/LICENSE) Cagebreak: A Wayland Tiling Compositor Inspired by Ratpoison +Please see [LICENSE](https://github.com/project-repo/cagebreak/blob/master/LICENSE) From b9a284730b7646b9a6bfdae8136a9a5e099c4b4d Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 10 Oct 2022 14:37:59 +0200 Subject: [PATCH 419/689] Fix Quick Intro title in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 95103a0..1d707a3 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/6532/badge)](https://bestpractices.coreinfrastructure.org/projects/6532) [![Packaging status](https://repology.org/badge/tiny-repos/cagebreak.svg)](https://repology.org/project/cagebreak/versions) [![AUR package](https://repology.org/badge/version-for-repo/aur/cagebreak.svg?minversion=2.0.0)](https://repology.org/project/cagebreak/versions) -## Quick Introduction to Cagebreak +## Quick Introduction Cagebreak is a [Wayland](https://wayland.freedesktop.org/) tiling compositor based on [Cage](https://github.com/Hjdskes/cage) and inspired by [ratpoison](https://www.nongnu.org/ratpoison/). From 211e65e3538113026cc15de7700c0a3f874e3829 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 10 Oct 2022 15:27:25 +0200 Subject: [PATCH 420/689] Remove information from Quick Intro --- README.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/README.md b/README.md index 1d707a3..047416c 100644 --- a/README.md +++ b/README.md @@ -64,11 +64,6 @@ details on getting started and the documentation for everything else. * Respect the Code of Conduct (TODO link) (To date, we never had to intervene - Keep it that way!) -Reviewing the project in any aspect is always welcome. - -If you have ideas on improving the testing and quality assurance -aspects, your input is particularly welcome. - ### Name Cagebreak is based on [Cage](https://github.com/Hjdskes/cage), a Wayland kiosk From 23e0accf9a4f93b5a08d05fce7518a8fd821b154 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 10 Oct 2022 15:28:07 +0200 Subject: [PATCH 421/689] Improve Contributing section --- README.md | 53 +++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 39 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 047416c..2b49655 100644 --- a/README.md +++ b/README.md @@ -138,26 +138,51 @@ within an existing X11 or Wayland session, it will open in a virtual output as a window in your existing session. If you run it in a TTY, it'll run with the KMS+DRM backend. For more configuration options, see the man pages. -## Contributing to Cagebreak +## Contributing -Cagebreak is currently developed to fit the needs of its creators. Should you -desire to implement a feature, please let us know in advance by opening -an issue. However, the feature set is intentionally limited (i.e. we removed -support for a desktop background) and will continue to be so in the future. + * Just [open an issue](https://github.com/project-repo/cagebreak/issues/new) and state your feature request. + We will consider the proposal and get back to you. + * Don't open a pull request. We might not accept your code and + it would be sad to waste the effort. + * Respect the Code of Conduct (TODO link) (To date, we never + had to intervene - Keep it that way!) -Nonetheless, don't be intimidated by the (slightly lengthy) release checklist -or any other part of this file. Do what you can, open an issue and we will -collaborate toward a solution. +### Good First Contributions -### Branching Strategy and Versioning + * Reviewing the project is always welcome. + * Read the code. + * Read the documentation. + * Test whether the documentation matches the code. + * Test Cagebreak in more esoteric setups (many monitors, for instance). + * Compile the code. + * Ideas on improving the testing and quality assurance are particularly + welcome. + * The points above still apply. -There exists a branch `development` to which all reasonable code -is comitted for final testing. +### Philosophy -Once `development` is ready for a release, it is merged into `master` (possibly via -a cherry-picked branch), creating a new release, which is tagged and signed. +Cagebreak is currently developed to fit the needs of its creators. -All releases are tagged according to [semantic versioning](https://semver.org) guidelines. +The feature set is intentionally limited - we removed +support for a desktop background image for example. + +Nonetheless, don't be intimidated by any other part of this file. +Do your best and we will collaborate toward a solution. + +### Versioning & Branching Strategy + +Cagebreak uses [semantic versioning](https://semver.org). + +There are three permanent branches in cagebreak: + + * `master` (for releases) + * `development` (for polishing code between releases) + * `hotfix` (for small emergent releases, usually up-to-date with master) + +Releases are merged to master as per the release procedure, with +reasonable exceptions as the situation requires. + +The release commit is tagged with the release version. In the past, our git history did not perfectly reflect this scheme. From 70f0ed07cdf40b146db03ec37aebc4190e80b3dc Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 10 Oct 2022 15:28:52 +0200 Subject: [PATCH 422/689] Improve Release Procedure --- README.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 2b49655..e44a24c 100644 --- a/README.md +++ b/README.md @@ -186,23 +186,26 @@ The release commit is tagged with the release version. In the past, our git history did not perfectly reflect this scheme. -### Releases +### Release Procedure -The release checklist must be completely fulfilled in one run for a release to +The release procedure outlines the process for a release to occur. * [ ] `git checkout development` * [ ] `git pull origin development` * [ ] `git push origin development` - * [ ] `ninja -C build clang-format` makes no changes - * [ ] `ninja -C build scan-build` shows no issues - * [ ] New version number determined according to [semantic versioning](https://semver.org) guidelines + * [ ] New semantic version number determined + * [ ] Adjust version number + * [ ] meson.build + * [ ] git tag + * [ ] man pages + * [ ] README.md repology badges minversion * [ ] Relevant Documentation completed * [ ] New features * [ ] man pages - * [ ] man/cagebreak - * [ ] man/cagebreak-config - * [ ] man/cagebreak-socket + * [ ] cagebreak + * [ ] cagebreak-config + * [ ] cagebreak-socket * [ ] Set EPOCH to release day in man generation in meson.build * [ ] FAQ.md * [ ] Changelog.md for major and minor releases but not patches @@ -210,17 +213,14 @@ occur. for example) * [ ] Synchronize any socket changes to cagebreak-socket man page * [ ] Fixed bugs documented in Bugs.md - * [ ] Include issue description from github + * [ ] Include issue discussion from github, where applicable * [ ] Testing * [ ] Manual testing * [ ] Libfuzzer testing * [ ] Build version without xwayland support - * [ ] Version Number - * [ ] meson.build - * [ ] git tag - * [ ] man pages - * [ ] README.md repology badges minversion * [ ] meson.build reproducible build versions are current archlinux libraries and gcc + * [ ] `ninja -C build clang-format` makes no changes + * [ ] `ninja -C build scan-build` shows no issues * [ ] Cagebreak is reproducible on multiple machines * [ ] Documented reproducible build artefacts * [ ] Hashes of the artefacts in Hashes.md From 68a74115ed2ee8c894b9fee9f51a61ed849ccb03 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 10 Oct 2022 15:29:26 +0200 Subject: [PATCH 423/689] Add Roadmap to README --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index e44a24c..bcc840d 100644 --- a/README.md +++ b/README.md @@ -403,6 +403,15 @@ Currently, there are memory leaks which do not seem to stem from our code but ra the code of wl-roots or some other library we depend on. We are working on the problem. In the meantime, add `-Db_detect-leaks=0` to the meson command to exclude memory leaks. +## Roadmap + +Cagebreak plans to do or keep doing the following things +in the future: + + * React to all issues. + * Add or modify features, which the authors find convenient or important. + * Improve the [OpenSSF Best Practices Badge Program](https://bestpractices.coreinfrastructure.org/en) level + ## Bugs For any bug, please [create an issue](https://github.com/project-repo/cagebreak/issues/new) on From fb01ae953a1b844718bf24a6ebdf1a0a5d82d2b1 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 10 Oct 2022 15:30:16 +0200 Subject: [PATCH 424/689] Improve License section. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index bcc840d..dca4e23 100644 --- a/README.md +++ b/README.md @@ -435,5 +435,7 @@ See [Changelog.md](Changelog.md) ## License +MIT + Please see [LICENSE](https://github.com/project-repo/cagebreak/blob/master/LICENSE) From d99ff361b15c2bb39116e41e463e15f04eeeae00 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 10 Oct 2022 15:31:04 +0200 Subject: [PATCH 425/689] Add compatibility information to README --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index dca4e23..9f73f56 100644 --- a/README.md +++ b/README.md @@ -412,6 +412,20 @@ in the future: * Add or modify features, which the authors find convenient or important. * Improve the [OpenSSF Best Practices Badge Program](https://bestpractices.coreinfrastructure.org/en) level + +## Compatibility & Development Distribution + +Cagebreak supports [Arch Linux](https://archlinux.org/) and uses the libraries +(and software versions) as they are obtained through [pacman](https://wiki.archlinux.org/title/Pacman) +at the time of release. Any other use is out of scope. + +However, Cagebreak may also work on other distributions given the +proper library versions (Some package maintainers have done this and it +seems to work (To date, we dealt with a few Issues and never felt the +need to ask for the distribution the user was having the issue on.)). + +[![Packaging status](https://repology.org/badge/vertical-allrepos/cagebreak.svg)](https://repology.org/project/cagebreak/versions) + ## Bugs For any bug, please [create an issue](https://github.com/project-repo/cagebreak/issues/new) on From b0ea3c5e5b4d317d715c5f406b17bce2682358df Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 10 Oct 2022 15:36:12 +0200 Subject: [PATCH 426/689] Add draft of Governance section to README --- README.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/README.md b/README.md index 9f73f56..dcbae26 100644 --- a/README.md +++ b/README.md @@ -412,6 +412,47 @@ in the future: * Add or modify features, which the authors find convenient or important. * Improve the [OpenSSF Best Practices Badge Program](https://bestpractices.coreinfrastructure.org/en) level +## Governance + +Cagebreak is managed by project-repo. + +Project-repo is a pseudonym of at least two individuals acting +as benevolent dictators for the project by the others mutual consent. + +The individuals comprising project-repo are not otherwise associated +by payment from any organisation or grant. + +For all intents and purposes consider project-repo as a single +benevolent dictator for life that happens to occupy at least two brains. + +### Roles + +There are members of project-repo and those who are not. + +There are no specific roles forced unto anyone. + +### Bus Factor + +The Bus Factor is a measure of how many people have to be +incapacitated for a project to be unable to continue. + +The current bus factor for Cagebreak is: 1 + +Project-repo could still react to issues (even confidential +e-mails) and fix easier issues if any one individual were +incapacitated. + +However, not all aspects of the code or release engineering +are fully resilient to the loss of any one individual. + +We strive to improve the Bus Factor to at least two in all +aspects of Cagebreak. + +### Governance Issues + +Anyone can use the information in [SECURITY.md](SECURITY.md) to +contact the members of project-repo to bring governance +issues to their attention. ## Compatibility & Development Distribution From 7699666076cb22656efb33edbf0affa7b99744f3 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 10 Oct 2022 15:36:28 +0200 Subject: [PATCH 427/689] Remove whitespace --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index dcbae26..420cec9 100644 --- a/README.md +++ b/README.md @@ -70,9 +70,6 @@ Cagebreak is based on [Cage](https://github.com/Hjdskes/cage), a Wayland kiosk compositor. Since it breaks the kiosk into tiles the name Cagebreak seemed appropriate. - - - ## Installation On Arch Linux, just use the PKGBUILDs from the [AUR](https://aur.archlinux.org/): From 9ef5922d4c07822d589f9cf0f921b2b4a49af04e Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 10 Oct 2022 20:07:12 +0200 Subject: [PATCH 428/689] Move Changelog inside README --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 420cec9..8bde54a 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,10 @@ details on getting started and the documentation for everything else. * Respect the Code of Conduct (TODO link) (To date, we never had to intervene - Keep it that way!) +### What's New? + +See [Changelog.md](Changelog.md) + ### Name Cagebreak is based on [Cage](https://github.com/Hjdskes/cage), a Wayland kiosk @@ -475,10 +479,6 @@ independent of github, in case this service is unavailable. For other means of contacting the Cagebreak authors and for security issues see [SECURITY.md](SECURITY.md). -## Changelog - -See [Changelog.md](Changelog.md) - ## Contributors * Aisha Tammy From 6f3952e88314c765e9639be0adf666ee9bcc7861 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 14 Oct 2022 17:22:46 +0200 Subject: [PATCH 429/689] Improve wording for Governance Issues --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8bde54a..450beaa 100644 --- a/README.md +++ b/README.md @@ -452,7 +452,7 @@ aspects of Cagebreak. ### Governance Issues Anyone can use the information in [SECURITY.md](SECURITY.md) to -contact the members of project-repo to bring governance +contact the members of project-repo and bring governance issues to their attention. ## Compatibility & Development Distribution From f9cd517bfeca7f437696d307f1de615f286b9e16 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 14 Oct 2022 18:10:12 +0200 Subject: [PATCH 430/689] Improve dev distro section in README --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 450beaa..2eaf339 100644 --- a/README.md +++ b/README.md @@ -468,6 +468,9 @@ need to ask for the distribution the user was having the issue on.)). [![Packaging status](https://repology.org/badge/vertical-allrepos/cagebreak.svg)](https://repology.org/project/cagebreak/versions) +You should use Arch Linux if you want to modify Cagebreak +for yourself. + ## Bugs For any bug, please [create an issue](https://github.com/project-repo/cagebreak/issues/new) on From 10f842a8ee5b329c59f08ab85744eb80413cb480 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 14 Oct 2022 18:15:04 +0200 Subject: [PATCH 431/689] Improve Contrib section in README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 2eaf339..756cdb5 100644 --- a/README.md +++ b/README.md @@ -141,6 +141,7 @@ KMS+DRM backend. For more configuration options, see the man pages. ## Contributing + * Read this document. * Just [open an issue](https://github.com/project-repo/cagebreak/issues/new) and state your feature request. We will consider the proposal and get back to you. * Don't open a pull request. We might not accept your code and From e2b790d5710dcae94afd9b1dd0f33fac9c1fb7a0 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 14 Oct 2022 18:15:58 +0200 Subject: [PATCH 432/689] Create development section in README - Move compat & dev dist into dev --- README.md | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 756cdb5..4e82762 100644 --- a/README.md +++ b/README.md @@ -171,6 +171,24 @@ support for a desktop background image for example. Nonetheless, don't be intimidated by any other part of this file. Do your best and we will collaborate toward a solution. +## Development + +### Compatibility & Development Distribution + +Cagebreak supports [Arch Linux](https://archlinux.org/) and uses the libraries +(and software versions) as they are obtained through [pacman](https://wiki.archlinux.org/title/Pacman) +at the time of release. Any other use is out of scope. + +However, Cagebreak may also work on other distributions given the +proper library versions (Some package maintainers have done this and it +seems to work (To date, we dealt with a few Issues and never felt the +need to ask for the distribution the user was having the issue on.)). + +[![Packaging status](https://repology.org/badge/vertical-allrepos/cagebreak.svg)](https://repology.org/project/cagebreak/versions) + +You should use Arch Linux if you want to modify Cagebreak +for yourself. + ### Versioning & Branching Strategy Cagebreak uses [semantic versioning](https://semver.org). @@ -456,22 +474,6 @@ Anyone can use the information in [SECURITY.md](SECURITY.md) to contact the members of project-repo and bring governance issues to their attention. -## Compatibility & Development Distribution - -Cagebreak supports [Arch Linux](https://archlinux.org/) and uses the libraries -(and software versions) as they are obtained through [pacman](https://wiki.archlinux.org/title/Pacman) -at the time of release. Any other use is out of scope. - -However, Cagebreak may also work on other distributions given the -proper library versions (Some package maintainers have done this and it -seems to work (To date, we dealt with a few Issues and never felt the -need to ask for the distribution the user was having the issue on.)). - -[![Packaging status](https://repology.org/badge/vertical-allrepos/cagebreak.svg)](https://repology.org/project/cagebreak/versions) - -You should use Arch Linux if you want to modify Cagebreak -for yourself. - ## Bugs For any bug, please [create an issue](https://github.com/project-repo/cagebreak/issues/new) on From c8656d2744a4752ec46a3007ccffcb4648b4bb7e Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 14 Oct 2022 18:22:58 +0200 Subject: [PATCH 433/689] Reorder developmnet subsections in README --- README.md | 254 +++++++++++++++++++++++++++--------------------------- 1 file changed, 127 insertions(+), 127 deletions(-) diff --git a/README.md b/README.md index 4e82762..9fc5ec5 100644 --- a/README.md +++ b/README.md @@ -189,6 +189,133 @@ need to ask for the distribution the user was having the issue on.)). You should use Arch Linux if you want to modify Cagebreak for yourself. +### GCC and -fanalyzer + +Cagebreak should compile with any reasonably new gcc or clang. Consider +a gcc version of at least [10.1](https://gcc.gnu.org/gcc-10/changes.html) if +you want to get the benefit of the brand-new +[-fanalyzer](https://gcc.gnu.org/onlinedocs/gcc/Static-Analyzer-Options.html) +flag. However, this new flag sometimes produces false-postives and we +selectively disable warnings for affected code segments as described below. + +Meson is configured to set `CG_HAS_FANALYZE` if `-fanalyzer` is available. +Therefore, to maintain portability, false-positive fanalyzer warnings are to be +disabled using the following syntax: + +``` +#if CG_HAS_FANALYZE +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "WARNING OPTION" +#endif +``` +and after + +``` +#if CG_HAS_FANALYZE +#pragma GCC diagnostic pop +#endif +``` + +### Fuzzing + +Along with the project source code, a fuzzing framework based on `libfuzzer` is +supplied. This allows for the testing of the parsing code responsible for reading +the `cagebreak` configuration file. When `libfuzzer` is available (please +use the `clang` compiler to enable it), building the fuzz-testing software can +be enabled by passing `-Dfuzz=true` to meson. This generates a `build/fuzz/fuzz-parse` +binary according to the `libfuzzer` specifications. Further documentation on +how to run this binary can be found [here](https://llvm.org/docs/LibFuzzer.html). + +Here is an example workflow: + +``` +rm -rf build +CC=clang meson build -Dfuzz=true -Db_sanitize=address,undefined -Db_lundef=false +ninja -C build/ +mkdir build/fuzz_corpus +cp examples/config build/fuzz_corpus/ +WLR_BACKENDS=headless ./build/fuzz/fuzz-parse -jobs=12 -max_len=50000 -close_fd_mask=3 build/fuzz_corpus/ +``` + +You may want to tweak `-jobs` or add other options depending on your own setup. +We have found code path discovery to increase rapidly when the fuzzer is supplied +with an initial config file. We are working on improving our fuzzing coverage to +find bugs in other areas of the code. + +#### Caveat + +Currently, there are memory leaks which do not seem to stem from our code but rather +the code of wl-roots or some other library we depend on. We are working on the problem. +In the meantime, add `-Db_detect-leaks=0` to the meson command to exclude memory leaks. + +### Reproducible Builds + +Cagebreak offers reproducible builds given the exact library versions specified +in `meson.build`. Should a version mismatch occur, a warning will be emitted. We have +decided on this compromise to allow flexibility and security. In general we will +adapt the versions to the packages available under Arch Linux at the time of +release. + +There are reproducibility issues up to and including release `1.2.0`. See +`Issue 5` in [Bugs.md](Bugs.md). + +#### Reproducible Build Instructions + +All hashes and signatures are provided for the following build instructions. + +``` +meson build -Dxwayland=true -Dman-pages=true --buildtype=release +ninja -C build +``` + +#### Hashes for Builds + +For every release after 1.0.5, hashes will be provided. + +For every release after 1.7.0, hashes will be provided for man pages too. + +See [Hashes.md](Hashes.md) + +#### GPG Signatures + +For every release after 1.0.5, a GPG signature will be provided in `signatures`. + +The current signature is called `cagebreak.sig`, whereas all older signatures +will be named after their release version. + +Due to errors in the release process, the releases 1.7.1 and 1.7.2 did not include the release +signatures in the appropriate folder of the git repository. However, signatures were provided +as release-artefacts at the time of release. The signatures were introduced into the +repository with 1.7.3. The integrity of cagebreak is still the same because the signatures were +provided as release-artefacts (which were themselves signed) and the hashes in Hashes.md +are part of a signed release tag. + +#### Signing Keys + +All releases are signed by at least one of the following collection of +keys. + + * E79F6D9E113529F4B1FFE4D5C4F974D70CEC2C5B + * 4739D329C9187A1C2795C20A02ABFDEC3A40545F + * 7535AB89220A5C15A728B75F74104CC7DCA5D7A8 + * 827BC2320D535AEAD0540E6E2E66F65D99761A6F + * A88D7431E5BAAD0B6EAE550AC8D61D8BD4FA3C46 + * 8F872885968EB8C589A32E9539ACC012896D450F + * 896B92AF738C974E0065BF42F2576BD366156BB9 + * AA927AFD50AF7C6810E69FE8274F2C605359E31B + * BE2DED372287BC4EB2213E13A0C743848A638955 + * 0F3476E4B2404F95EC41600683D5810F7911B020 + +Should we at any point retire a key, we will only replace it with keys signed +by at least one of the above collection. + +We registered project-repo.co and added mail addresses after release `1.3.0`. + +We now have a mail address and its key is signed by signing keys. See Security +Bugs for details. + +The full public keys can be found in `keys/` along with any revocation certificates. + ### Versioning & Branching Strategy Cagebreak uses [semantic versioning](https://semver.org). @@ -296,133 +423,6 @@ occur. * [ ] `gpg --detach-sign -u keyid release-artefacts_version.tar.gz` * [ ] Upload archives and signatures as release assets -### Reproducible Builds - -Cagebreak offers reproducible builds given the exact library versions specified -in `meson.build`. Should a version mismatch occur, a warning will be emitted. We have -decided on this compromise to allow flexibility and security. In general we will -adapt the versions to the packages available under Arch Linux at the time of -release. - -There are reproducibility issues up to and including release `1.2.0`. See -`Issue 5` in [Bugs.md](Bugs.md). - -#### Reproducible Build Instructions - -All hashes and signatures are provided for the following build instructions. - -``` -meson build -Dxwayland=true -Dman-pages=true --buildtype=release -ninja -C build -``` - -#### Hashes for Builds - -For every release after 1.0.5, hashes will be provided. - -For every release after 1.7.0, hashes will be provided for man pages too. - -See [Hashes.md](Hashes.md) - -#### GPG Signatures - -For every release after 1.0.5, a GPG signature will be provided in `signatures`. - -The current signature is called `cagebreak.sig`, whereas all older signatures -will be named after their release version. - -Due to errors in the release process, the releases 1.7.1 and 1.7.2 did not include the release -signatures in the appropriate folder of the git repository. However, signatures were provided -as release-artefacts at the time of release. The signatures were introduced into the -repository with 1.7.3. The integrity of cagebreak is still the same because the signatures were -provided as release-artefacts (which were themselves signed) and the hashes in Hashes.md -are part of a signed release tag. - -#### Signing Keys - -All releases are signed by at least one of the following collection of -keys. - - * E79F6D9E113529F4B1FFE4D5C4F974D70CEC2C5B - * 4739D329C9187A1C2795C20A02ABFDEC3A40545F - * 7535AB89220A5C15A728B75F74104CC7DCA5D7A8 - * 827BC2320D535AEAD0540E6E2E66F65D99761A6F - * A88D7431E5BAAD0B6EAE550AC8D61D8BD4FA3C46 - * 8F872885968EB8C589A32E9539ACC012896D450F - * 896B92AF738C974E0065BF42F2576BD366156BB9 - * AA927AFD50AF7C6810E69FE8274F2C605359E31B - * BE2DED372287BC4EB2213E13A0C743848A638955 - * 0F3476E4B2404F95EC41600683D5810F7911B020 - -Should we at any point retire a key, we will only replace it with keys signed -by at least one of the above collection. - -We registered project-repo.co and added mail addresses after release `1.3.0`. - -We now have a mail address and its key is signed by signing keys. See Security -Bugs for details. - -The full public keys can be found in `keys/` along with any revocation certificates. - -### GCC and -fanalyzer - -Cagebreak should compile with any reasonably new gcc or clang. Consider -a gcc version of at least [10.1](https://gcc.gnu.org/gcc-10/changes.html) if -you want to get the benefit of the brand-new -[-fanalyzer](https://gcc.gnu.org/onlinedocs/gcc/Static-Analyzer-Options.html) -flag. However, this new flag sometimes produces false-postives and we -selectively disable warnings for affected code segments as described below. - -Meson is configured to set `CG_HAS_FANALYZE` if `-fanalyzer` is available. -Therefore, to maintain portability, false-positive fanalyzer warnings are to be -disabled using the following syntax: - -``` -#if CG_HAS_FANALYZE -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "WARNING OPTION" -#endif -``` -and after - -``` -#if CG_HAS_FANALYZE -#pragma GCC diagnostic pop -#endif -``` - -### Fuzzing - -Along with the project source code, a fuzzing framework based on `libfuzzer` is -supplied. This allows for the testing of the parsing code responsible for reading -the `cagebreak` configuration file. When `libfuzzer` is available (please -use the `clang` compiler to enable it), building the fuzz-testing software can -be enabled by passing `-Dfuzz=true` to meson. This generates a `build/fuzz/fuzz-parse` -binary according to the `libfuzzer` specifications. Further documentation on -how to run this binary can be found [here](https://llvm.org/docs/LibFuzzer.html). - -Here is an example workflow: - -``` -rm -rf build -CC=clang meson build -Dfuzz=true -Db_sanitize=address,undefined -Db_lundef=false -ninja -C build/ -mkdir build/fuzz_corpus -cp examples/config build/fuzz_corpus/ -WLR_BACKENDS=headless ./build/fuzz/fuzz-parse -jobs=12 -max_len=50000 -close_fd_mask=3 build/fuzz_corpus/ -``` - -You may want to tweak `-jobs` or add other options depending on your own setup. -We have found code path discovery to increase rapidly when the fuzzer is supplied -with an initial config file. We are working on improving our fuzzing coverage to -find bugs in other areas of the code. - -#### Caveat - -Currently, there are memory leaks which do not seem to stem from our code but rather -the code of wl-roots or some other library we depend on. We are working on the problem. -In the meantime, add `-Db_detect-leaks=0` to the meson command to exclude memory leaks. - ## Roadmap Cagebreak plans to do or keep doing the following things From 34d1e764f194f1c41c25f4833f1909d752a2e3a6 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 16 Oct 2022 10:58:28 +0200 Subject: [PATCH 434/689] Move Changelog in README. --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9fc5ec5..acab5cd 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,10 @@ details on getting started and the documentation for everything else. * [socket](man/cagebreak-socket.7.md) * the [FAQ](FAQ.md) * [SECURITY.md](SECURITY.md) - * the [Changelog](Changelog.md) + +### What's new? + +See the [Changelog](Changelog.md) ### Uninstallation @@ -64,10 +67,6 @@ details on getting started and the documentation for everything else. * Respect the Code of Conduct (TODO link) (To date, we never had to intervene - Keep it that way!) -### What's New? - -See [Changelog.md](Changelog.md) - ### Name Cagebreak is based on [Cage](https://github.com/Hjdskes/cage), a Wayland kiosk From 0744d3a19ab8cc7b61f86873ab9d0d3a0f73d763 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 16 Oct 2022 11:01:02 +0200 Subject: [PATCH 435/689] Move Changelog to subsection. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index acab5cd..be5406c 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ details on getting started and the documentation for everything else. * the [FAQ](FAQ.md) * [SECURITY.md](SECURITY.md) -### What's new? +#### What's new? See the [Changelog](Changelog.md) From aa73eb44ae31ec66cecd8da5d2c59422c6a927ea Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 16 Oct 2022 11:31:48 +0200 Subject: [PATCH 436/689] Fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index be5406c..7754ee2 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ details on getting started and the documentation for everything else. #### What's new? -See the [Changelog](Changelog.md) +See the [Changelog](Changelog.md). ### Uninstallation From ee81b89467edf528b4a4f42a1f49fc29cf22e564 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 16 Oct 2022 23:36:49 +0200 Subject: [PATCH 437/689] Add Code of Conduct --- CODE_OF_CONDUCT.md | 15 +++++++++++++++ README.md | 4 ++-- 2 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 CODE_OF_CONDUCT.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..f094d9a --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,15 @@ +# Code of Conduct + +As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, and other activities. + +We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion. + +Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct. + +Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team. + +This code of conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting project-repo (See [SECURITY.md](SECURITY.md) for an e-mail contact.). + +This Code of Conduct is adapted from Curl, available at https://curl.se/docs/code-of-conduct.html and transitively the Contributor Covenant, version 1.1.0, available at https://contributor-covenant.org/version/1/1/0/ diff --git a/README.md b/README.md index 7754ee2..e4b157b 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ See the [Changelog](Changelog.md). We will consider the proposal and get back to you. * Don't open a pull request. We might not accept your code and it would be sad to waste the effort. - * Respect the Code of Conduct (TODO link) (To date, we never + * Respect the [Code of Conduct](CODE_OF_CONDUCT.md) (To date, we never had to intervene - Keep it that way!) ### Name @@ -145,7 +145,7 @@ KMS+DRM backend. For more configuration options, see the man pages. We will consider the proposal and get back to you. * Don't open a pull request. We might not accept your code and it would be sad to waste the effort. - * Respect the Code of Conduct (TODO link) (To date, we never + * Respect the [Code of Conduct](CODE_OF_CONDUCT.md) (To date, we never had to intervene - Keep it that way!) ### Good First Contributions From 6c9e309c1697908768c8314867b25bcfb7e7886d Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 16 Oct 2022 23:37:02 +0200 Subject: [PATCH 438/689] Improve Contributing Quick Intro --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e4b157b..259eab3 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ See the [Changelog](Changelog.md). ### Contributing - * Just [open an issue](https://github.com/project-repo/cagebreak/issues/new) and state your feature request. + * Just [open an issue](https://github.com/project-repo/cagebreak/issues/new) and state your idea. We will consider the proposal and get back to you. * Don't open a pull request. We might not accept your code and it would be sad to waste the effort. From 0514c521c2d0df42e98a958a9b263d79ebd352fa Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 16 Oct 2022 23:52:13 +0200 Subject: [PATCH 439/689] Update reproducible build versions --- meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 88fff34..37b28c8 100644 --- a/meson.build +++ b/meson.build @@ -207,9 +207,9 @@ reproducible_build_versions = { 'libinput': '1.21.0', 'libevdev': '1.13.0', 'libudev': '251', - 'pango': '1.50.10', + 'pango': '1.50.11', 'cairo': '1.17.6', - 'pangocairo': '1.50.10', + 'pangocairo': '1.50.11', 'math': '-1' } From 1c4b72f97ee91e749fa3dc1469e54e71c3030fa7 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 17 Oct 2022 01:20:43 +0200 Subject: [PATCH 440/689] Add Hashes template for 2.0.0 --- Hashes.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Hashes.md b/Hashes.md index 97d6217..2c75bc0 100644 --- a/Hashes.md +++ b/Hashes.md @@ -1,5 +1,25 @@ # Hashes +2.0.0 cagebreak + + * sha 256: TODO + * sha 512: TODO + +2.0.0 cagebreak.1 + + * sha 256: TODO + * sha 512: TODO + +2.0.0 cagebreak-config.5 + + * sha 256: TODO + * sha 512: TODO + +2.0.0 cagebreak-socket.7 + + * sha 256: TODO + * sha 512: TODO + 1.9.1 cagebreak * sha 256: 262c67170eb2a39174d40f97d940707029dca0b2b613b514a1cca29152a12665 From 8e831fe878e69a57424be064fd876e7174b72f9b Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 17 Oct 2022 01:21:01 +0200 Subject: [PATCH 441/689] Sync security characteristics to socket man page --- man/cagebreak-socket.7.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/man/cagebreak-socket.7.md b/man/cagebreak-socket.7.md index bb82d5d..bad6bd6 100644 --- a/man/cagebreak-socket.7.md +++ b/man/cagebreak-socket.7.md @@ -49,6 +49,14 @@ All user software can execute arbitrary code while cagebreak is running. See GitHub Issues: +Mail contact: `cagebreak @ project-repo . co` + +GPG Fingerprints: + +- B15B92642760E11FE002DE168708D42451A94AB5 +- F8DD9F8DD12B85A28F5827C4678E34D2E753AA3C +- 3ACEA46CCECD59E4C8222F791CBEB493681E8693 + # LICENSE Copyright (c) 2022 The Cagebreak authors From 44f9ce3502f42b9d464d7ae4458d976665ec8a37 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 17 Oct 2022 13:43:03 +0200 Subject: [PATCH 442/689] Add AUR vote as first contrib idea iff satisfied. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 259eab3..c1d7de8 100644 --- a/README.md +++ b/README.md @@ -158,6 +158,8 @@ KMS+DRM backend. For more configuration options, see the man pages. * Compile the code. * Ideas on improving the testing and quality assurance are particularly welcome. + * Iff you are happy with Cagebreak and use Arch Linux, you may vote for + [Cagebreak in the AUR](https://aur.archlinux.org/packages/cagebreak). * The points above still apply. ### Philosophy From 4077064bc8574f186cc776d909b4a02186b903fe Mon Sep 17 00:00:00 2001 From: project-repo Date: Tue, 18 Oct 2022 20:03:28 +0200 Subject: [PATCH 443/689] Add Issues 38,39,40,41. Correspondence to github issue numbers is as follows: 38 <-> #31 39 <-> #30 40 <-> #20 41 <-> #12 --- Bugs.md | 348 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 348 insertions(+) diff --git a/Bugs.md b/Bugs.md index 822f3f6..93496db 100644 --- a/Bugs.md +++ b/Bugs.md @@ -652,3 +652,351 @@ This issue was not present in earlier releases. Cagebreak 1.9.0 broke the screen/movetoscreen functionality. This issue was not present in earlier releases. +## Issue 38 + + * github issue number: #31 + * Fixed: 2.0.0 + +Cagebreak terminology was unclear up to and including 1.9.1. + +The following are extracts from the github issue discussion: + +kinleyd: +``` +This isn't an issue per se, but concerns cagebreak terminology. +I won't try to cover the entire range of terms used but stick +to the ones that concern me at the moment: + +OK, so I get the use of the terms 'output', 'workspace' and 'tile'. + +So my question: In cagebreak, what exactly is a 'screen'? At the +moment, the use of nextscreen, prevscreen, movetoscreen, +movetonextscreen, movetoprevscreen all seem to suggest that +'screen' is the same as 'output'. If so, shouldn't all the +aforementioned commands have screen replaced with output? +eg. nextoutput, prevoutput, etc. +``` + +project-repo +``` +You make an interesting point. + +We have considered this and the tricky bit is that both output and *screen are +defined cagebreak commands. It would be difficult to merge these two +commands in a reasonable way (even with the freedom of breaking changes). + +Additionally, there is a sort of informal symmetry between output and input +we would like to maintain. + +Our current conclusion is that we will leave the commands unmodified. +The now ex-post defined distinction between output and *screen is that +the *screen stuff works with the natural number uniquely identifying the +output within a given cagebreak session (but not across sessions, "nextscreen" +and "prevscreen" do so internally by in-/decrementing this number), whereas +output always deals with an output name as does input with an input name. + +Please feel free to point out any other inconsistencies in cagebreak or better +solutions than outlined above in this issue. + +You can post your suggestions here. + +We will close this issue once 2.0.0 is released where the points mentioned above +will be outlined in the documentation. Please leave it open in +the mean time. Afterwards, you may open a new issue. + +cheers +project-repo +``` + +kinleyd: +``` +> Our current conclusion is that we will leave the commands unmodified. +> The now ex-post defined distinction between output and *screen is +> that the *screen stuff works with the natural number uniquely +> identifying the output within a given cagebreak session (but not +> across sessions, "nextscreen" and "prevscreen" do so internally +> by in-/decrementing this number), whereas output always deals +> with an output name as does input with an input name. + +That makes perfect sense. Additionally, I also realize that there +is the virtual display for which the concept of 'screen' as +distinct from 'output' is necessary as a screen could then be +a fraction of an output, or combine multiple outputs. + +> We will close this issue once 2.0.0 is released where the points +> mentioned above will be outlined in the documentation. Please +> leave it open in the mean time. Afterwards, you may open a new issue. + +Hey, I look forward to version 2.0.0! +``` + +project-repo: +``` +We have now modified the cagebreak-config man page on the development +branch to clarify the relationship of output and the screen family of +commands. + +Please let us know if anything can be improved in that regard. + +cheers +project-repo +``` + +## Issue 39 + + * github issue number: #30 + * Fixed: 2.0.0 + +Cagebreak 1.9.1 had an issue where clicks did not evoke +any response under some very specific circumstances. + +This was remediated by switching Cagebreak to `wlr_scene`. + +There was extensive discussion inside the github issue +but this is omitted here due to irrelevance. + +## Issue 40 + + * github issue number: #20 + * Fixed: 2.0.0 + +nor-0 proposed a more intuitive way to switch focus. This +is a breaking change and as such is introduced on a major +release. + +Details are described in the github issue discussion, which +is reproduced here: + +nor-0: +``` +Hello, + +I think switching focus is a bit confusing in some situations. +When focus is switched in a direction, it can end up diagonally +instead of the frame next to the previously focused one. +The minimal example for this is with four frames, but it +also applies in layouts with more than four of them. + +Let´s say I press the keybindings for these actions: +`vsplit`, `hsplit`, `focusright`, `hsplit`. +This leaves me with a layout of four simple quarters: + +> +-----+-----+ +> | 1 | 2 | +> +-----+-----+ +> | 3 | 4 | +> +-----+-----+ + +Now, using `focuslefton` frame 2 brings me to frame 3 instead +of one. Likewise, `focusright` on frame 3 brings me to frame +2 instead of frame 4. + +As soon as I resize a width, switching works as expected and +desired. The oddness however reappears whenever the vertical +frame edges are realigned. + +The same trouble happens when creating the layout with the +keybindings for `hsplit`, `vsplit`, `focusdown`, `vsplit`. +Now, focusing up from frame 3 brings me two frame 2 instead +of 1, and same with the symmetrical opposite again +(2 downwards is 3 instead of 4). Now resizing heights is what +helps until the horizontal edges are realigned. + +As said before, similar things occur with more complex layouts. +I use those much less frequently of course, but intuitive +navigation is even more important then. In these two minimal +examples, reaching the frames 1 and 4 is also often more +tedious then necessary. + +I understand this is due to the way the frames were created +and makes some sense in this regard. However, unless there +is some reason to keep this behavior (which disappears by +some resize options anyways), I´d suggest to change it to +be more intuitive. + +I imagine an approach for this could be to determine the +frames center point and then looking for an adjacent frame +in horizontal (vertical) direction from there when +`focusright` or `focusleft` (`focusdown` or `focusup`) is used. + +(Everything said about `focus[direction]` also applies to +`exchange[direction]`.) +``` + +project-repo: +``` +Thanks for the suggestion! Yes, I agree that the current implementation +is not a very satisfying solution... The reason it is handled like this +is simply because it was easiest to implement. Fortunately however, +changing this should not require too much coding since the +determination of the tile to jump to is handled globally by a single +function for each direction. + +I like your idea with considering the center of the frame and then +looking for the one adjacent to it which is at the height of the center, +since such a frame is always guaranteed to exist (unless we are at the +edge of the screen in which case there is nothing to jump to). +Of course, this would have to involve some kind of tie-breaking when +two adjacent frames share a border at the height of the center (which is +bound to occur often if you never resize the tiles). I'm currently +leaning towards simply taking the top/left one in this case (or some +similar scheme) but if anyone else has thoughts on this, we'd be glad to +hear! + +Some notes: + + * This would be a breaking change, so the version number would jump to 2.0.0. + * Also, due to limited developer capacity at the moment and + the ongoing porting of cagebreak to the wlr_scene API it may be a + while until we are able to implement this, so bear with us! + +cheers +project-repo +``` + +project-repo: +``` +We pushed some code to development implementing this in `ed5cca9`. +Sorry for not writing this much sooner. + +To anyone who reads this: This feature will remain on the development +branch for some time, partially due to some unresolved xwayland and +wlr_scene bugs and partially to allow breaking changes. So if anyone +would like to see something changed, please feel free to let us know! + +cheers +project-repo +``` + +## Issue 41 + + * github issue number: #12 + * Fixed: 2.0.0 + +kinleyd raised the issue of changing the focussed screen +on mouse hover. The Cagebreak philosophy is completely +keyboard-oriented and this feature request was denied. +However, this line of inquiry led to the idea of implementing +an ipc socket which would report key events and an information +dump functionality which would enable almost arbitrary scripting. + +Related Material: +- [cagebreak-config man page](man/cagebreak-config.md) +- [cagebreak-socket man page](man/cagebreak-socket.md) +- scripting examples TODO + +The github issue discussion is partially reproduced below: + +kinleyd: +``` +While fully recognizing - and appreciating - Cagebreak's keyboard orientation, would it be possible to accommodate support for screen change on mouse over? This would help avoid a series of key presses on multi-screen setups and improve overall ergonomics. + +Thanks. +``` + +project-repo: +``` +As you correctly recognised, cagebreak is designed to be completely +keyboard-oriented. However, I understand that for the multi-monitor +setup you describe it may be useful to have some kind of +mouse-compositor interaction. To accommodate this, we are considering +implementing a command which allows to obtain the current cagebreak +state from the ipc socket, including the current cursor position. +That way, by implementing a script which listens for cursor events +and acts accordingly, it should be possible to implement the behaviour +you describe externally (provided #11 is implemented as intended). +What do you think? + +If you have any other ideas, don't hesitate to let us know! + +cheers +project-repo +``` + +project-repo +``` +There has been much talk about #12 and how it would improve all sorts of +use cases, once implemented. While much remains to be determined, we would +like to give an update. + +First, #12 is secondary in priority to #11, which is presumably easier +to implement and much clearer in its scope. + +Once implemented, cagebreak will communicate the state of at least the +following internal properties: + + * [ ] Current cursor position (allowing setting of the current screen + as per navigating screens question and suggestion #11 + * [ ] IDs for graphical programs along with position on screen + * [ ] IDs for tiles on particular screens + * [ ] Currently focussed tile, screen, etc. + * [ ] Events such as "new window", "screen split", etc. + +In which format this information will be provided is yet to be +determined, but we are considering at least the following: + + * full blob of data upon request via ipc socket + * partial information on events + +To improve user experience, the release of #12 will include examples of +how to use the new API over the socket for real world use cases, +analogous to the current example config. + + * [ ] Example script "Current screen follows cursor on click" + * [ ] Example script "Setup multi screen environment with graphical programs on + specific tiles" + +Note that this is just the current state of planning, +the final properties of cagebreak are specified in the man pages upon +release and cagebreak is provided as is, as specified in the LICENSE. + +cheers +project-repo +``` + +project-repo: +``` +Some but not all features mentioned in our previous comment have now been implemented on +the development branch. + +Information on current events is provided through the ipc socket +now. The types of events which are reported are still subject to change and the +feature is not yet documented but you may check it out nonetheless. Let +us know if there is any additional information you would like to obtain +for the different events. + +Current format displayed on the socket is as follows: + +'cg-ipc<4 bytes denoting message length>(:,:,...,:)' + +Consider it a proof of concept. + +A full dump of the current cagebreak state is not yet possible. + +Happy new year to you too! +cheers +project-repo +``` + +project-repo: +``` +We pushed some code to development implementing the dump +functionality. This should contain the information you require since it +gives you the view currently focussed by the pointer from which you can +deduce the output the cursor is currently hovering over by looking up +the output on which the view is placed. Note that this only works when +the cursor is actually hovering over a view (i.e. not when it is on an +empty tile). Alternatively, you could read the cursor coordinates and +compare these with the coordinates of the different outputs, though atm +the coordinates of the outputs are not dumped (we aim to add this later). + +To anyone who reads this: This feature will remain on the development +branch for some time, partially due to some unresolved xwayland and +wlr_scene bugs and partially to allow breaking changes +(removing/changing data outputted by dump and other information sent by +IPC). So if anyone would like to see something changed, please feel free +to let us know (either by posting here or opening a new issue)! + +cheers +project-repo +``` From 29943b50e69a882cbdedb2bcf78212aa9c06f437 Mon Sep 17 00:00:00 2001 From: Oliver Friedmann Date: Mon, 28 Nov 2022 15:23:41 -0500 Subject: [PATCH 444/689] Add output scaling (#34) * feat: output scaling * chore: update man file * fix: message when scaling --- Dockerfile | 7 +++++++ examples/config | 1 + man/cagebreak-config.5.md | 3 ++- message.c | 8 ++++---- output.c | 8 ++++++-- output.h | 1 + parse.c | 14 ++++++++++++++ 7 files changed, 35 insertions(+), 7 deletions(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..521d1a0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +FROM debian:bookworm +RUN apt-get update +RUN apt-get install -y libwlroots-dev xwayland meson cmake libcairo2-dev libpango1.0-dev +ADD * ./ +ADD examples ./examples +RUN meson build +RUN ninja -C build \ No newline at end of file diff --git a/examples/config b/examples/config index e6a6cb5..7eddad1 100644 --- a/examples/config +++ b/examples/config @@ -95,6 +95,7 @@ definekey top XF86MonBrightnessUp exec xbacklight -inc 1 #output eDP-1 disable #output eDP-1 enable #output eDP-1 prio 1 +#output eDP-2 pos 0 0 res 1366x768 rate 60 scale 2.0 ##################### #Input configuration diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index 1f0293f..ba8b3b0 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -242,12 +242,13 @@ message *only* Remove all splits and make current window fill the entire screen -*output [[pos res x rate ] | enable | disable | prio ]* +*output [[pos res x rate [scale ]] | enable | disable | prio ]* Configure output "" - - and are the position of the monitor in pixels. The top-left monitor should have the coordinates 0 0. - and specify the resolution in pixels. - sets the refresh rate of the monitor (often this is 50 or 60). + - sets the output scale (default is 1.0) - enable and disable enable or disable . Note that if is the only enabled output, *output disable* has no effect. diff --git a/message.c b/message.c index 444406a..f80dcef 100644 --- a/message.c +++ b/message.c @@ -140,7 +140,6 @@ create_message_texture(const char *string, const struct cg_output *output) { float *bg_col = output->server->message_config.bg_color; cairo_set_source_rgba(cairo, bg_col[0], bg_col[1], bg_col[2], bg_col[3]); cairo_paint(cairo); - PangoContext *pango = pango_cairo_create_context(cairo); float *fg_col = output->server->message_config.fg_color; cairo_set_source_rgba(cairo, fg_col[0], fg_col[1], fg_col[2], fg_col[3]); cairo_set_line_width(cairo, 2); @@ -168,7 +167,6 @@ create_message_texture(const char *string, const struct cg_output *output) { wlr_buffer_end_data_ptr_access(&buf->base); cairo_surface_destroy(surface); - g_object_unref(pango); cairo_destroy(cairo); return buf; } @@ -196,8 +194,9 @@ message_set_output(struct cg_output *output, const char *string, message->position = box; wl_list_insert(&output->messages, &message->link); - int width = buf->base.width; - int height = buf->base.height; + double scale = output->wlr_output->scale; + int width = buf->base.width/scale; + int height = buf->base.height/scale; message->position->width = width; message->position->height = height; switch(align) { @@ -235,6 +234,7 @@ message_set_output(struct cg_output *output, const char *string, wlr_scene_node_set_enabled(&message->message->node, true); struct wlr_box *outp_box = wlr_output_layout_get_box( output->server->output_layout, output->wlr_output); + wlr_scene_buffer_set_dest_size(message->message,width,height); wlr_scene_node_set_position(&message->message->node, message->position->x + outp_box->x, message->position->y + outp_box->y); diff --git a/output.c b/output.c index 74201ca..aa3d87a 100644 --- a/output.c +++ b/output.c @@ -178,7 +178,7 @@ output_find_config(struct cg_server *server, struct wlr_output *output) { static int output_set_mode(struct wlr_output *output, int width, int height, - float refresh_rate) { + float refresh_rate, float *scale) { int mhz = (int)(refresh_rate * 1000); if(wl_list_empty(&output->modes)) { @@ -209,6 +209,10 @@ output_set_mode(struct wlr_output *output, int width, int height, wlr_log(WLR_DEBUG, "Assigning configured mode to %s", output->name); } wlr_output_set_mode(output, best); + if (scale != NULL) { + wlr_log(WLR_INFO, "Setting output scale to %f", *scale); + wlr_output_set_scale(output, *scale); + } wlr_output_commit(output); if(!wlr_output_test(output)) { wlr_log(WLR_ERROR, @@ -294,7 +298,7 @@ output_configure(struct cg_server *server, struct cg_output *output) { if(config->pos.x != -1) { if(output_set_mode(wlr_output, config->pos.width, config->pos.height, - config->refresh_rate) != 0) { + config->refresh_rate, config->scale) != 0) { wlr_log(WLR_ERROR, "Setting output mode failed, disabling output."); output_clear(output); diff --git a/output.h b/output.h index 390e5f1..f53821f 100644 --- a/output.h +++ b/output.h @@ -40,6 +40,7 @@ struct cg_output_config { struct wlr_box pos; char *output_name; float refresh_rate; + float *scale; int priority; struct wl_list link; // cg_server::output_config }; diff --git a/parse.c b/parse.c index 474a456..29d4fe1 100644 --- a/parse.c +++ b/parse.c @@ -532,6 +532,7 @@ parse_output_config(char **saveptr, char **errstr) { cfg->output_name = NULL; cfg->refresh_rate = 0; cfg->priority = -1; + cfg->scale = NULL; char *name = strtok_r(NULL, " ", saveptr); if(name == NULL) { *errstr = @@ -619,6 +620,19 @@ parse_output_config(char **saveptr, char **errstr) { goto error; } + char *scale_str = strtok_r(NULL, " ", saveptr); + if(scale_str != NULL && strcmp(scale_str, "scale") == 0) { + cfg->scale = malloc(sizeof(float)); + *cfg->scale = parse_float(saveptr, " "); + if(*cfg->scale <= 0.0) { + *errstr = + log_error("Error parsing scale of output configuration for " + "output %s, expected positive float", + name); + goto error; + } + } + cfg->output_name = strdup(name); return cfg; error: From 1ac785b781b6b766d6b1770eba1fcb50b045a915 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 28 Nov 2022 21:27:18 +0100 Subject: [PATCH 445/689] Add Oliver Friedmann as Contributor --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index c1d7de8..4eabd27 100644 --- a/README.md +++ b/README.md @@ -491,6 +491,9 @@ see [SECURITY.md](SECURITY.md). * Aisha Tammy * [make man pages optional](https://github.com/project-repo/cagebreak/pull/4), released in 1.6.0 with slight modifications + * Oliver Friedmann + * [Add output scaling](https://github.com/project-repo/cagebreak/pull/34), released + in 2.0.0 ## License From 559009f7804fbf79ce65a6cd2c2a6d2d2e04079a Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 28 Nov 2022 21:32:59 +0100 Subject: [PATCH 446/689] Remove Dockerfile --- Dockerfile | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 521d1a0..0000000 --- a/Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM debian:bookworm -RUN apt-get update -RUN apt-get install -y libwlroots-dev xwayland meson cmake libcairo2-dev libpango1.0-dev -ADD * ./ -ADD examples ./examples -RUN meson build -RUN ninja -C build \ No newline at end of file From 9a60bef105909ab3430ee1d5f6d4e203d2777522 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 28 Nov 2022 21:35:31 +0100 Subject: [PATCH 447/689] Apply clang-format --- message.c | 6 +++--- output.c | 6 +++--- parse.c | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/message.c b/message.c index f80dcef..29d28da 100644 --- a/message.c +++ b/message.c @@ -195,8 +195,8 @@ message_set_output(struct cg_output *output, const char *string, wl_list_insert(&output->messages, &message->link); double scale = output->wlr_output->scale; - int width = buf->base.width/scale; - int height = buf->base.height/scale; + int width = buf->base.width / scale; + int height = buf->base.height / scale; message->position->width = width; message->position->height = height; switch(align) { @@ -234,7 +234,7 @@ message_set_output(struct cg_output *output, const char *string, wlr_scene_node_set_enabled(&message->message->node, true); struct wlr_box *outp_box = wlr_output_layout_get_box( output->server->output_layout, output->wlr_output); - wlr_scene_buffer_set_dest_size(message->message,width,height); + wlr_scene_buffer_set_dest_size(message->message, width, height); wlr_scene_node_set_position(&message->message->node, message->position->x + outp_box->x, message->position->y + outp_box->y); diff --git a/output.c b/output.c index aa3d87a..bbb685d 100644 --- a/output.c +++ b/output.c @@ -209,7 +209,7 @@ output_set_mode(struct wlr_output *output, int width, int height, wlr_log(WLR_DEBUG, "Assigning configured mode to %s", output->name); } wlr_output_set_mode(output, best); - if (scale != NULL) { + if(scale != NULL) { wlr_log(WLR_INFO, "Setting output scale to %f", *scale); wlr_output_set_scale(output, *scale); } @@ -297,8 +297,8 @@ output_configure(struct cg_server *server, struct cg_output *output) { } if(config->pos.x != -1) { if(output_set_mode(wlr_output, config->pos.width, - config->pos.height, - config->refresh_rate, config->scale) != 0) { + config->pos.height, config->refresh_rate, + config->scale) != 0) { wlr_log(WLR_ERROR, "Setting output mode failed, disabling output."); output_clear(output); diff --git a/parse.c b/parse.c index 29d4fe1..8d97aed 100644 --- a/parse.c +++ b/parse.c @@ -623,12 +623,12 @@ parse_output_config(char **saveptr, char **errstr) { char *scale_str = strtok_r(NULL, " ", saveptr); if(scale_str != NULL && strcmp(scale_str, "scale") == 0) { cfg->scale = malloc(sizeof(float)); - *cfg->scale = parse_float(saveptr, " "); + *cfg->scale = parse_float(saveptr, " "); if(*cfg->scale <= 0.0) { *errstr = - log_error("Error parsing scale of output configuration for " - "output %s, expected positive float", - name); + log_error("Error parsing scale of output configuration for " + "output %s, expected positive float", + name); goto error; } } From cce8121595e874f5c57cf29bcaff3c5ac552fe33 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 28 Nov 2022 21:35:44 +0100 Subject: [PATCH 448/689] Reformat README --- README.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4eabd27..349c347 100644 --- a/README.md +++ b/README.md @@ -92,14 +92,14 @@ There are different ways to obtain cagebreak source: * [git clone](https://github.com/project-repo/cagebreak) (for all releases) * [download release asset tarballs](https://github.com/project-repo/cagebreak/releases) (starting at release 1.2.1) -### Verifying Source Code +#### Verifying Source Code There are corresponding methods of verifying that you obtained the correct code: * our git history includes signed tags for releases * release assets starting at release 1.2.1 contain a signature for the tarball -### Building Cagebreak +## Building Cagebreak You can build Cagebreak with the [meson](https://mesonbuild.com/) build system. It requires wayland, wlroots and xkbcommon to be installed. Note that Cagebreak is @@ -497,7 +497,5 @@ see [SECURITY.md](SECURITY.md). ## License -MIT - -Please see [LICENSE](https://github.com/project-repo/cagebreak/blob/master/LICENSE) +MIT, please see [LICENSE](https://github.com/project-repo/cagebreak/blob/master/LICENSE). From ee71d0bde97c2caa0d9c3c14a370d73f8e0ef627 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 24 Dec 2022 08:03:06 +0100 Subject: [PATCH 449/689] Add check to prevent buffer overflow --- keybinding.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/keybinding.c b/keybinding.c index 6ebbc5a..9a3f908 100644 --- a/keybinding.c +++ b/keybinding.c @@ -807,6 +807,10 @@ print_modes(struct dyn_str *str, char **modes) { ++nmemb; ++tmp; } + if(nmemb==0) { + wlr_log(WLR_ERROR,"This is a bug: Cagebreak has no valid modes. This should not occur, since default modes are defined on startup."); + return; + } /* We are assuming here that we have at least one mode, which is given by * the initialization of cagebreak */ char *modes_str = calloc(len + 3 * (nmemb - 1) + 1, sizeof(char)); From baeb39579bd0ff98e58a8244d0db8c506719983c Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 24 Dec 2022 14:52:12 +0100 Subject: [PATCH 450/689] Set cursor to box when not in default mode --- cagebreak.c | 30 ++++++++++++++---------------- keybinding.c | 6 ++++++ seat.c | 25 +++++++++++++++++++++---- server.h | 1 + 4 files changed, 42 insertions(+), 20 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index 954649a..5eb95f0 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -39,14 +39,12 @@ #include #include #include -#if CG_HAS_XWAYLAND -#include -#endif #include #include #include #include #if CG_HAS_XWAYLAND +#include #include #endif @@ -247,7 +245,6 @@ main(int argc, char *argv[]) { struct wlr_xdg_shell *xdg_shell = NULL; #if CG_HAS_XWAYLAND struct wlr_xwayland *xwayland = NULL; - struct wlr_xcursor_manager *xcursor_manager = NULL; #endif int ret = 0; @@ -285,6 +282,17 @@ main(int argc, char *argv[]) { return 1; } + server.xcursor_size=XCURSOR_SIZE; + const char *env_cursor_size = getenv("XCURSOR_SIZE"); + if (env_cursor_size && strlen(env_cursor_size) > 0) { + errno = 0; + char *end; + unsigned size = strtoul(env_cursor_size, &end, 10); + if (!*end && errno == 0) { + server.xcursor_size = size; + } + } + server.running = true; server.modes[0] = strdup("top"); @@ -534,13 +542,6 @@ main(int argc, char *argv[]) { server.new_xwayland_surface.notify = handle_xwayland_surface_new; wl_signal_add(&xwayland->events.new_surface, &server.new_xwayland_surface); - xcursor_manager = wlr_xcursor_manager_create(DEFAULT_XCURSOR, XCURSOR_SIZE); - if(!xcursor_manager) { - wlr_log(WLR_ERROR, "Cannot create XWayland XCursor manager"); - ret = 1; - goto end; - } - if(setenv("DISPLAY", xwayland->display_name, true) < 0) { wlr_log_errno(WLR_ERROR, "Unable to set DISPLAY for XWayland.", "Clients may not be able to connect"); @@ -549,11 +550,9 @@ main(int argc, char *argv[]) { xwayland->display_name); } - if(!wlr_xcursor_manager_load(xcursor_manager, 1)) { - wlr_log(WLR_ERROR, "Cannot load XWayland XCursor theme"); - } struct wlr_xcursor *xcursor = - wlr_xcursor_manager_get_xcursor(xcursor_manager, DEFAULT_XCURSOR, 1); + wlr_xcursor_manager_get_xcursor(server.seat->xcursor_manager, DEFAULT_XCURSOR, 1); + if(xcursor) { struct wlr_xcursor_image *image = xcursor->images[0]; wlr_xwayland_set_cursor(xwayland, image->buffer, image->width * 4, @@ -644,7 +643,6 @@ main(int argc, char *argv[]) { #if CG_HAS_XWAYLAND wlr_xwayland_destroy(xwayland); - wlr_xcursor_manager_destroy(xcursor_manager); #endif wl_display_destroy_clients(server.wl_display); diff --git a/keybinding.c b/keybinding.c index 9a3f908..0211a0f 100644 --- a/keybinding.c +++ b/keybinding.c @@ -11,6 +11,7 @@ #include #include #include +#include #include "input.h" #include "input_manager.h" @@ -1458,6 +1459,11 @@ run_action(enum keybinding_action action, struct cg_server *server, keybinding_switch_output(server, data.u); break; case KEYBINDING_SWITCH_MODE: + if(data.u!=server->seat->default_mode) { + wlr_seat_pointer_notify_clear_focus(server->seat->seat); + wlr_xcursor_manager_set_cursor_image(server->seat->xcursor_manager, + "dot_box_mask", server->seat->cursor); + } server->seat->mode = data.u; break; case KEYBINDING_SWITCH_DEFAULT_MODE: diff --git a/seat.c b/seat.c index b161d0b..89b1eb8 100644 --- a/seat.c +++ b/seat.c @@ -197,9 +197,26 @@ handle_command_key_bindings(struct cg_server *server, xkb_keysym_t sym, struct keybinding **keybinding = find_keybinding( server->keybindings, &(struct keybinding){.key = sym, .mode = mode, .modifiers = modifiers}); - server->seat->mode = - server->seat - ->default_mode; // Return to mode we are currently in by default + if(server->seat->mode != server->seat->default_mode) { + server->seat->mode = + server->seat + ->default_mode; // Return to mode we are currently in by default + double sx, sy; + struct wlr_seat *wlr_seat = server->seat->seat; + struct wlr_surface *surface = NULL; + + struct wlr_scene_node *node = wlr_scene_node_at( + &server->scene->node, server->seat->cursor->x, server->seat->cursor->y, &sx, &sy); + if(node && node->type == WLR_SCENE_NODE_SURFACE) { + surface = wlr_scene_surface_from_node(node)->surface; + wlr_seat_pointer_notify_enter(wlr_seat, surface, sx, sy); + } else { + wlr_xcursor_manager_set_cursor_image(server->seat->xcursor_manager, + "left_ptr", server->seat->cursor); + + } + } + if(keybinding) { wlr_log( WLR_DEBUG, @@ -851,7 +868,7 @@ seat_create(struct cg_server *server, struct wlr_backend *backend) { wlr_cursor_attach_output_layout(seat->cursor, server->output_layout); if(!seat->xcursor_manager) { - seat->xcursor_manager = wlr_xcursor_manager_create(NULL, XCURSOR_SIZE); + seat->xcursor_manager = wlr_xcursor_manager_create(NULL, server->xcursor_size); if(!seat->xcursor_manager) { wlr_log(WLR_ERROR, "Cannot create XCursor manager"); wlr_cursor_destroy(seat->cursor); diff --git a/server.h b/server.h index fbaab40..551f726 100644 --- a/server.h +++ b/server.h @@ -60,6 +60,7 @@ struct cg_server { float *bg_color; uint32_t views_curr_id; uint32_t tiles_curr_id; + uint32_t xcursor_size; }; void From ed575c36ab4a7002c2ee07755fe66b27f3de0442 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 24 Dec 2022 16:38:29 +0100 Subject: [PATCH 451/689] Fix behaviour on config file load failure --- cagebreak.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index 5eb95f0..628b6af 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -608,7 +608,7 @@ main(int argc, char *argv[]) { int conf_ret = set_configuration(&server, config_file); // Configurtion file not found - if(conf_ret == 1) { + if(conf_ret != 0) { char *default_conf = "/etc/xdg/cagebreak/config"; wlr_log(WLR_ERROR, "Loading default configuration file: \"%s\"", default_conf); @@ -641,9 +641,6 @@ main(int argc, char *argv[]) { wl_display_run(server.wl_display); -#if CG_HAS_XWAYLAND - wlr_xwayland_destroy(xwayland); -#endif wl_display_destroy_clients(server.wl_display); end: @@ -651,11 +648,18 @@ end: #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wanalyzer-double-free" #endif + server.running=false; for(unsigned int i = 0; server.modes[i] != NULL; ++i) { free(server.modes[i]); } free(server.modes); +#if CG_HAS_XWAYLAND + if(xwayland!=NULL) { + wlr_xwayland_destroy(xwayland); + } +#endif + struct cg_output_config *output_config, *output_config_tmp; wl_list_for_each_safe(output_config, output_config_tmp, &server.output_config, link) { From 39505dc8b27f9fcce90ba0e3c0083abb1fcea9a0 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 25 Dec 2022 15:09:25 +0100 Subject: [PATCH 452/689] Fix grouping of virtual keyboards --- input_manager.c | 74 +++++++++++++------------------------------------ seat.c | 58 +++++++++++++++++++++++++++++--------- 2 files changed, 64 insertions(+), 68 deletions(-) diff --git a/input_manager.c b/input_manager.c index 0eeb253..1385f25 100644 --- a/input_manager.c +++ b/input_manager.c @@ -92,12 +92,7 @@ input_manager_handle_device_destroy(struct wl_listener *listener, void *data) { } static void -handle_new_input(struct wl_listener *listener, void *data) { - struct cg_input_manager *input = - wl_container_of(listener, input, new_input); - struct cg_server *server = input->server; - struct wlr_input_device *device = data; - +new_input(struct cg_input_manager *input, struct wlr_input_device *device, bool virtual) { struct cg_input_device *input_device = calloc(1, sizeof(struct cg_input_device)); if(!input_device) { @@ -106,9 +101,10 @@ handle_new_input(struct wl_listener *listener, void *data) { } device->data = input_device; + input_device->is_virtual=virtual; input_device->wlr_device = device; input_device->identifier = input_device_get_identifier(device); - input_device->server = server; + input_device->server = input->server; input_device->pointer = NULL; input_device->touch = NULL; @@ -119,39 +115,28 @@ handle_new_input(struct wl_listener *listener, void *data) { wl_signal_add(&device->events.destroy, &input_device->device_destroy); input_device->device_destroy.notify = input_manager_handle_device_destroy; - struct cg_seat *seat = server->seat; + struct cg_seat *seat = input->server->seat; seat_add_device(seat, input_device); } +static void +handle_new_input(struct wl_listener *listener, void *data) { + struct cg_input_manager *input = + wl_container_of(listener, input, new_input); + struct wlr_input_device *device = data; + + new_input(input,device,false); +} + void handle_virtual_keyboard(struct wl_listener *listener, void *data) { - struct cg_input_manager *input_manager = - wl_container_of(listener, input_manager, virtual_keyboard_new); + + struct cg_input_manager *input = + wl_container_of(listener, input, virtual_keyboard_new); struct wlr_virtual_keyboard_v1 *keyboard = data; struct wlr_input_device *device = &keyboard->input_device; - struct cg_seat *seat = input_manager->server->seat; - - struct cg_input_device *input_device = - calloc(1, sizeof(struct cg_input_device)); - if(!input_device) { - wlr_log(WLR_ERROR, "could not allocate input device"); - return; - } - device->data = input_device; - - input_device->is_virtual = true; - input_device->wlr_device = device; - input_device->identifier = input_device_get_identifier(device); - wl_list_insert(&input_manager->devices, &input_device->link); - input_device->server = input_manager->server; - input_device->pointer = NULL; - input_device->touch = NULL; - - wl_signal_add(&device->events.destroy, &input_device->device_destroy); - input_device->device_destroy.notify = input_manager_handle_device_destroy; - - seat_add_device(seat, input_device); + new_input(input,device,true); } void @@ -162,31 +147,10 @@ handle_virtual_pointer(struct wl_listener *listener, void *data) { struct wlr_virtual_pointer_v1 *pointer = event->new_pointer; struct wlr_input_device *device = &pointer->input_device; - struct cg_seat *seat = input_manager->server->seat; - - struct cg_input_device *input_device = - calloc(1, sizeof(struct cg_input_device)); - if(!input_device) { - wlr_log(WLR_ERROR, "could not allocate input device"); - return; - } - device->data = input_device; - - input_device->is_virtual = true; - input_device->wlr_device = device; - input_device->identifier = input_device_get_identifier(device); - wl_list_insert(&input_manager->devices, &input_device->link); - input_device->server = input_manager->server; - input_device->pointer = NULL; - input_device->touch = NULL; - - wl_signal_add(&device->events.destroy, &input_device->device_destroy); - input_device->device_destroy.notify = input_manager_handle_device_destroy; - - seat_add_device(seat, input_device); + new_input(input_manager,device,true); if(event->suggested_output) { - wlr_cursor_map_input_to_output(seat->cursor, device, + wlr_cursor_map_input_to_output(input_manager->server->seat->cursor, device, event->suggested_output); } } diff --git a/seat.c b/seat.c index 89b1eb8..8fd485e 100644 --- a/seat.c +++ b/seat.c @@ -326,15 +326,24 @@ handle_keyboard_group_modifiers(struct wl_listener *listener, void *_data) { handle_modifier_event(group->wlr_group->input_device, group->seat); } +static bool repeat_info_match(struct wlr_keyboard *a, struct wlr_keyboard *b) { + return a->repeat_info.rate == b->repeat_info.rate && + a->repeat_info.delay == b->repeat_info.delay; +} + static void -cg_keyboard_group_add(struct wlr_input_device *device, struct cg_seat *seat) { +cg_keyboard_group_add(struct cg_input_device *input_device, struct cg_seat *seat) { + struct wlr_input_device *device=input_device->wlr_device; struct wlr_keyboard *wlr_keyboard = device->keyboard; - struct cg_keyboard_group *group; - wl_list_for_each(group, &seat->keyboard_groups, link) { - struct wlr_keyboard_group *wlr_group = group->wlr_group; - if(wlr_keyboard_group_add_keyboard(wlr_group, wlr_keyboard)) { - wlr_log(WLR_DEBUG, "Adding keyboard to existing group."); - return; + // Virtual devices should not be grouped + if(!input_device->is_virtual) { + struct cg_keyboard_group *group; + wl_list_for_each(group, &seat->keyboard_groups, link) { + struct wlr_keyboard_group *wlr_group = group->wlr_group; + if(wlr_keyboard_keymaps_match(wlr_keyboard->keymap,wlr_group->keyboard.keymap) && repeat_info_match(wlr_keyboard,&wlr_group->keyboard) && wlr_keyboard_group_add_keyboard(wlr_group, wlr_keyboard)) { + wlr_log(WLR_DEBUG, "Adding keyboard to existing group."); + return; + } } } /* This is reached if and only if the keyboard could not be inserted into @@ -406,7 +415,7 @@ new_keyboard(struct cg_seat *seat, struct cg_input_device *input_device) { xkb_context_unref(context); wlr_keyboard_set_repeat_info(device->keyboard, 25, 600); - cg_keyboard_group_add(device, seat); + cg_keyboard_group_add(input_device, seat); ++seat->num_keyboards; wlr_seat_set_keyboard(seat->seat, device); @@ -436,6 +445,10 @@ seat_add_device(struct cg_seat *seat, struct cg_input_device *device) { update_capabilities(seat); } +static void destroy_empty_wlr_keyboard_group(void *data) { + wlr_keyboard_group_destroy(data); +} + void remove_keyboard(struct cg_seat *seat, struct cg_input_device *keyboard) { if(!keyboard) { @@ -443,12 +456,31 @@ remove_keyboard(struct cg_seat *seat, struct cg_input_device *keyboard) { } struct wlr_seat *wlr_seat = seat->seat; struct wlr_keyboard *wlr_keyboard = keyboard->wlr_device->keyboard; - if(keyboard->wlr_device->keyboard->group) { - wlr_keyboard_group_remove_keyboard(wlr_keyboard->group, wlr_keyboard); - } - if(wlr_seat_get_keyboard(wlr_seat) == wlr_keyboard) { - wlr_seat_set_keyboard(wlr_seat, NULL); + struct wlr_keyboard_group *wlr_group = wlr_keyboard->group; + if(wlr_group) { + wlr_keyboard_group_remove_keyboard(wlr_group, wlr_keyboard); + + if (wl_list_empty(&wlr_group->devices)) { + wlr_log(DEBUG, "Destroying empty keyboard group %p", + wlr_group); + struct cg_keyboard_group *group = wlr_group->data; + if(wlr_seat_get_keyboard(wlr_seat) == &wlr_group->keyboard) { + wlr_seat_set_keyboard(wlr_seat, NULL); + } + wlr_group->data = NULL; + wl_list_remove(&group->link); + wl_list_remove(&group->key.link); + wl_list_remove(&group->modifiers.link); + free(group); + + // To prevent use-after-free conditions when handling key events, defer + // freeing the wlr_keyboard_group until idle + wl_event_loop_add_idle(seat->server->event_loop, + destroy_empty_wlr_keyboard_group, wlr_group); + + } } + --seat->num_keyboards; } From 32095b42534aaa00a687dc91771bbe2b5b47d95a Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 26 Dec 2022 08:14:57 +0100 Subject: [PATCH 453/689] Refactor output configuration * Allow independent rotation of different outputs * Allow specification of scale independent of mode * Clean up output configuration code --- cagebreak.c | 10 +-- output.c | 199 ++++++++++++++++++++++++++++++++++++---------------- output.h | 3 +- parse.c | 47 +++++++++---- server.h | 2 - 5 files changed, 175 insertions(+), 86 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index 628b6af..b5f9da1 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -128,8 +128,6 @@ usage(FILE *file, const char *const cage) { fprintf(file, "Usage: %s [OPTIONS]\n" "\n" - " -r\t Rotate the output 90 degrees clockwise, specify up to three " - "times\n" " -h\t Display this help message\n" " -v\t Show the version number and exit\n" " -s\t Show information about the current setup and exit\n", @@ -139,14 +137,8 @@ usage(FILE *file, const char *const cage) { static bool parse_args(struct cg_server *server, int argc, char *argv[]) { int c; - while((c = getopt(argc, argv, "rhvs")) != -1) { + while((c = getopt(argc, argv, "hvs")) != -1) { switch(c) { - case 'r': - server->output_transform++; - if(server->output_transform > WL_OUTPUT_TRANSFORM_270) { - server->output_transform = WL_OUTPUT_TRANSFORM_NORMAL; - } - break; case 'h': usage(stdout, argv[0]); return false; diff --git a/output.c b/output.c index bbb685d..8a94b6c 100644 --- a/output.c +++ b/output.c @@ -165,20 +165,9 @@ handle_output_frame(struct wl_listener *listener, void *data) { wlr_scene_output_send_frame_done(scene_output, &now); } -struct cg_output_config * -output_find_config(struct cg_server *server, struct wlr_output *output) { - struct cg_output_config *config; - wl_list_for_each(config, &server->output_config, link) { - if(strcmp(config->output_name, output->name) == 0) { - return config; - } - } - return NULL; -} - static int output_set_mode(struct wlr_output *output, int width, int height, - float refresh_rate, float *scale) { + float refresh_rate) { int mhz = (int)(refresh_rate * 1000); if(wl_list_empty(&output->modes)) { @@ -209,10 +198,6 @@ output_set_mode(struct wlr_output *output, int width, int height, wlr_log(WLR_DEBUG, "Assigning configured mode to %s", output->name); } wlr_output_set_mode(output, best); - if(scale != NULL) { - wlr_log(WLR_INFO, "Setting output scale to %f", *scale); - wlr_output_set_scale(output, *scale); - } wlr_output_commit(output); if(!wlr_output_test(output)) { wlr_log(WLR_ERROR, @@ -261,19 +246,43 @@ output_insert(struct cg_server *server, struct cg_output *output) { } void -output_configure(struct cg_server *server, struct cg_output *output) { +output_apply_config(struct cg_server *server, struct cg_output *output, struct cg_output_config *config) { struct wlr_output *wlr_output = output->wlr_output; - struct cg_output_config *config = output_find_config(server, wlr_output); - /* Refuse to disable the only output */ - if(config != NULL && config->status == OUTPUT_DISABLE && - wl_list_length(&server->outputs) == 1) { - return; - } + if(output->wlr_output->enabled) { wlr_output_layout_remove(server->output_layout, wlr_output); } - if(config == NULL) { + if(config->priority != -1) { + output->priority = config->priority; + } + + if(config->angle != -1) { + wlr_output_set_transform(wlr_output, config->angle); + } + if(config->scale != -1) { + wlr_log(WLR_INFO, "Setting output scale to %f", config->scale); + wlr_output_set_scale(wlr_output, config->scale); + } + if(config->pos.x != -1) { + if(output_set_mode(wlr_output, config->pos.width, + config->pos.height, config->refresh_rate) != 0) { + wlr_log(WLR_ERROR, + "Setting output mode failed, disabling output."); + output_clear(output); + wl_list_insert(&server->disabled_outputs, &output->link); + wlr_output_enable(wlr_output, false); + wlr_output_commit(wlr_output); + return; + } + wlr_output_layout_add(server->output_layout, wlr_output, + config->pos.x, config->pos.y); + /* Since the size of the output may have changed, we + * reinitialize all workspaces with a fullscreen layout */ + for(unsigned int i = 0; i < output->server->nws; ++i) { + output_make_workspace_fullscreen(output, i); + } + } else { wlr_output_layout_add_auto(server->output_layout, wlr_output); struct wlr_output_mode *preferred_mode = @@ -281,46 +290,20 @@ output_configure(struct cg_server *server, struct cg_output *output) { if(preferred_mode) { wlr_output_set_mode(wlr_output, preferred_mode); } + } + /* Refuse to disable the only output */ + if(config->status == OUTPUT_DISABLE&&wl_list_length(&server->outputs)>1) { + output_clear(output); + wl_list_insert(&server->disabled_outputs, &output->link); + wlr_output_enable(wlr_output, false); + wlr_output_commit(wlr_output); + } else { wl_list_remove(&output->link); output_insert(server, output); wlr_output_enable(wlr_output, true); wlr_output_commit(wlr_output); - } else { - if(config->status == OUTPUT_DISABLE) { - output_clear(output); - wl_list_insert(&server->disabled_outputs, &output->link); - wlr_output_enable(wlr_output, false); - wlr_output_commit(wlr_output); - } else { - if(config->priority != -1) { - output->priority = config->priority; - } - if(config->pos.x != -1) { - if(output_set_mode(wlr_output, config->pos.width, - config->pos.height, config->refresh_rate, - config->scale) != 0) { - wlr_log(WLR_ERROR, - "Setting output mode failed, disabling output."); - output_clear(output); - wl_list_insert(&server->disabled_outputs, &output->link); - wlr_output_enable(wlr_output, false); - wlr_output_commit(wlr_output); - return; - } - wlr_output_layout_add(server->output_layout, wlr_output, - config->pos.x, config->pos.y); - /* Since the size of the output may have changed, we - * reinitialize all workspaces with a fullscreen layout */ - for(unsigned int i = 0; i < output->server->nws; ++i) { - output_make_workspace_fullscreen(output, i); - } - } - wl_list_remove(&output->link); - output_insert(server, output); - wlr_output_enable(wlr_output, true); - wlr_output_commit(wlr_output); - } } + if(output->bg != NULL) { wlr_scene_node_destroy(&output->bg->node); output->bg = NULL; @@ -339,6 +322,102 @@ output_configure(struct cg_server *server, struct cg_output *output) { wlr_scene_node_lower_to_bottom(&output->bg->node); } +struct cg_output_config *empty_output_config() { + struct cg_output_config *cfg = calloc(1, sizeof(struct cg_output_config)); + if(cfg==NULL) { + wlr_log(WLR_ERROR,"Could not allocate output configuration."); + return NULL; + } + + cfg->status = OUTPUT_DEFAULT; + cfg->pos.x = -1; + cfg->pos.y = -1; + cfg->pos.width = -1; + cfg->pos.height = -1; + cfg->output_name = NULL; + cfg->refresh_rate = 0; + cfg->priority = -1; + cfg->scale = -1; + cfg->angle = -1; + + return cfg; +} + +/* cfg1 has precedence over cfg2 */ +struct cg_output_config *merge_output_configs(struct cg_output_config *cfg1, struct cg_output_config *cfg2) { + struct cg_output_config *out_cfg=empty_output_config(); + if(cfg1->status==out_cfg->status) { + out_cfg->status = cfg2->status; + } else { + out_cfg->status = cfg1->status; + } + if(cfg1->pos.x==out_cfg->pos.x) { + out_cfg->pos.x = cfg2->pos.x; + out_cfg->pos.y = cfg2->pos.y; + out_cfg->pos.width = cfg2->pos.width; + out_cfg->pos.height = cfg2->pos.height; + } else { + out_cfg->pos.x = cfg1->pos.x; + out_cfg->pos.y = cfg1->pos.y; + out_cfg->pos.width = cfg1->pos.width; + out_cfg->pos.height = cfg1->pos.height; + } + if(cfg1->output_name == NULL) { + if(cfg2->output_name == NULL) { + out_cfg->output_name = NULL; + } else { + out_cfg->output_name = strdup(cfg2->output_name); + } + } else { + out_cfg->output_name = strdup(cfg1->output_name); + } + if(cfg1->refresh_rate==out_cfg->refresh_rate) { + out_cfg->refresh_rate = cfg2->refresh_rate; + } else { + out_cfg->refresh_rate = cfg1->refresh_rate; + } + if(cfg1->priority==out_cfg->priority) { + out_cfg->priority = cfg2->priority; + } else { + out_cfg->priority = cfg1->priority; + } + if(cfg1->scale==out_cfg->scale) { + out_cfg->scale = cfg2->scale; + } else { + out_cfg->scale = cfg1->scale; + } + if(cfg1->angle==out_cfg->angle) { + out_cfg->status = cfg2->angle; + } else { + out_cfg->angle = cfg1->angle; + } + return out_cfg; +} + +void +output_configure(struct cg_server *server, struct cg_output *output) { + struct cg_output_config *tot_config=empty_output_config(); + struct cg_output_config *config; + wl_list_for_each(config, &server->output_config, link) { + if(strcmp(config->output_name, output->wlr_output->name) == 0) { + if(tot_config == NULL) { + return; + } + struct cg_output_config *prev_config=tot_config; + tot_config=merge_output_configs(config,tot_config); + if(prev_config->output_name != NULL) { + free(prev_config->output_name); + } + free(prev_config); + } + } + if(tot_config != NULL) { + output_apply_config(server,output,tot_config); + } + free(tot_config->output_name); + free(tot_config); +} + static void handle_output_commit(struct wl_listener *listener, void *data) { struct cg_output *output = wl_container_of(listener, output, commit); @@ -443,7 +522,7 @@ handle_new_output(struct wl_listener *listener, void *data) { } } output->priority = prio; - wlr_output_set_transform(wlr_output, server->output_transform); + wlr_output_set_transform(wlr_output, WL_OUTPUT_TRANSFORM_NORMAL); output->workspaces = NULL; wl_list_init(&output->messages); diff --git a/output.h b/output.h index f53821f..5f75805 100644 --- a/output.h +++ b/output.h @@ -40,8 +40,9 @@ struct cg_output_config { struct wlr_box pos; char *output_name; float refresh_rate; - float *scale; + float scale; int priority; + int angle;//enum wl_output_transform, -1 signifies "unspecified" struct wl_list link; // cg_server::output_config }; diff --git a/parse.c b/parse.c index 8d97aed..4f27674 100644 --- a/parse.c +++ b/parse.c @@ -509,6 +509,10 @@ parse_output_config_keyword(char *key_str, enum output_status *status) { *status = OUTPUT_DEFAULT; } else if(strcmp(key_str, "prio") == 0) { *status = OUTPUT_DEFAULT; + } else if(strcmp(key_str, "angle") == 0) { + *status = OUTPUT_DEFAULT; + } else if(strcmp(key_str, "scale") == 0) { + *status = OUTPUT_DEFAULT; } else if(strcmp(key_str, "enable") == 0) { *status = OUTPUT_ENABLE; } else if(strcmp(key_str, "disable") == 0) { @@ -532,7 +536,8 @@ parse_output_config(char **saveptr, char **errstr) { cfg->output_name = NULL; cfg->refresh_rate = 0; cfg->priority = -1; - cfg->scale = NULL; + cfg->scale = -1; + cfg->angle = -1; char *name = strtok_r(NULL, " ", saveptr); if(name == NULL) { *errstr = @@ -551,6 +556,20 @@ parse_output_config(char **saveptr, char **errstr) { return cfg; } + if(strcmp(key_str, "angle") == 0) { + uint32_t angle = parse_uint(saveptr, " "); + //360 degrees is equivalent to 0 degrees + cfg->angle = angle%4; + if(cfg->angle < 0) { + *errstr = log_error( + "Error parsing angle specification for output %s", + name); + goto error; + } + cfg->output_name=strdup(name); + return cfg; + } + if(strcmp(key_str, "prio") == 0) { cfg->priority = parse_uint(saveptr, " "); if(cfg->priority < 0) { @@ -563,6 +582,19 @@ parse_output_config(char **saveptr, char **errstr) { return cfg; } + if(strcmp(key_str, "scale") == 0) { + cfg->scale = parse_float(saveptr, " "); + if(cfg->scale <= 0.0) { + *errstr = + log_error("Error parsing scale of output configuration for " + "output %s, expected positive float", + name); + goto error; + } + cfg->output_name = strdup(name); + return cfg; + } + cfg->pos.x = parse_uint(saveptr, " "); if(cfg->pos.x < 0) { *errstr = log_error( @@ -620,19 +652,6 @@ parse_output_config(char **saveptr, char **errstr) { goto error; } - char *scale_str = strtok_r(NULL, " ", saveptr); - if(scale_str != NULL && strcmp(scale_str, "scale") == 0) { - cfg->scale = malloc(sizeof(float)); - *cfg->scale = parse_float(saveptr, " "); - if(*cfg->scale <= 0.0) { - *errstr = - log_error("Error parsing scale of output configuration for " - "output %s, expected positive float", - name); - goto error; - } - } - cfg->output_name = strdup(name); return cfg; error: diff --git a/server.h b/server.h index 551f726..92ee933 100644 --- a/server.h +++ b/server.h @@ -50,8 +50,6 @@ struct cg_server { struct wl_list input_config; struct cg_message_config message_config; - enum wl_output_transform output_transform; - struct cg_ipc_handle ipc; bool running; From 73e0a421d20f83a783044080b1d13aeb069b91c4 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 26 Dec 2022 11:26:46 +0100 Subject: [PATCH 454/689] Increase maximal configuration line length --- parse.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parse.h b/parse.h index 798d732..cffb795 100644 --- a/parse.h +++ b/parse.h @@ -2,7 +2,7 @@ #define PARSE_H -#define MAX_LINE_SIZE 256 +#define MAX_LINE_SIZE 512 #include From 494fd6444bb019ed5daaa756470f72fb4eb08e82 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 26 Dec 2022 11:44:05 +0100 Subject: [PATCH 455/689] Update view focus logic --- keybinding.c | 56 ++++++++++++++++++---------------------------------- output.c | 2 +- seat.c | 21 +++++--------------- view.c | 7 +------ workspace.c | 16 ++++++++++++++- workspace.h | 2 ++ 6 files changed, 43 insertions(+), 61 deletions(-) diff --git a/keybinding.c b/keybinding.c index 0211a0f..17dbf6e 100644 --- a/keybinding.c +++ b/keybinding.c @@ -220,17 +220,13 @@ swap_tile(struct cg_tile *tile, return; } struct cg_view *tmp_view = tile->view; - tile->view = swap_tile->view; - swap_tile->view = tmp_view; - if(tile->view != NULL) { - view_maximize(tile->view, tile); - } + struct cg_view *tmp_swap_view = swap_tile->view; + workspace_tile_update_view(tile,NULL); + workspace_tile_update_view(swap_tile,tmp_view); + workspace_tile_update_view(tile,tmp_swap_view); workspace_focus_tile( server->curr_output->workspaces[server->curr_output->curr_workspace], swap_tile); - if(swap_tile->view != NULL) { - view_maximize(swap_tile->view, swap_tile); - } seat_set_focus(server->seat, swap_tile->view); ipc_send_event(tile->workspace->output->server, "{\"event_name\":\"swap_tile\",\"tile_id\":\"%d\",\"swap_" @@ -558,7 +554,7 @@ keybinding_split_output(struct cg_output *output, bool vertical) { new_tile->tile.height = y + height - new_y; new_tile->prev = curr_workspace->focused_tile; new_tile->next = curr_workspace->focused_tile->next; - new_tile->view = next_view; + workspace_tile_update_view(new_tile,next_view); new_tile->workspace = curr_workspace; curr_workspace->focused_tile->next->prev = new_tile; curr_workspace->focused_tile->next = new_tile; @@ -657,27 +653,20 @@ keybinding_cycle_views(struct cg_server *server, bool reverse, bool ipc) { server->curr_output->workspaces[server->curr_output->curr_workspace]; struct cg_view *current_view = curr_workspace->focused_tile->view; - if(current_view == NULL) { - current_view = - wl_container_of(&curr_workspace->views, current_view, link); - } struct cg_view *it_view, *next_view = NULL; if(reverse) { - next_view = view_get_prev_view(current_view); - } else { - struct wl_list *it; - it = current_view->link.next; - while(it != ¤t_view->link) { - if(it == &curr_workspace->views) { - it = it->next; - continue; - } - it_view = wl_container_of(it, it_view, link); + wl_list_for_each(it_view,&curr_workspace->views,link) { if(!view_is_visible(it_view)) { - next_view = it_view; + next_view=it_view; + break; + } + } + } else { + wl_list_for_each_reverse(it_view,&curr_workspace->views,link) { + if(!view_is_visible(it_view)) { + next_view=it_view; break; } - it = it->next; } } @@ -685,9 +674,6 @@ keybinding_cycle_views(struct cg_server *server, bool reverse, bool ipc) { return; } - /* Prevent seat_set_focus from reordering the views */ - curr_workspace->focused_tile->view = wl_container_of( - next_view->link.prev, curr_workspace->focused_tile->view, link); seat_set_focus(server->seat, next_view); if(ipc) { ipc_send_event(curr_workspace->output->server, @@ -1090,11 +1076,9 @@ keybinding_move_view_to_cycle_output(struct cg_server *server, bool reverse) { server->curr_output ->workspaces[server->curr_output->curr_workspace]; wl_list_insert(&ws->views, &view->link); - ws->focused_tile->view = view; wlr_scene_node_reparent(view->scene_node, &ws->scene->node); + workspace_tile_update_view(ws->focused_tile,view); view->workspace = ws; - view->tile = view->workspace->focused_tile; - view_maximize(view, view->tile); seat_set_focus(server->seat, view); } int id = -1; @@ -1238,9 +1222,9 @@ keybinding_move_view_to_output(struct cg_server *server, int output_num) { server->curr_output->workspaces[server->curr_output->curr_workspace] ->focused_tile->view; if(view != NULL) { + workspace_tile_update_view(server->curr_output->workspaces[server->curr_output->curr_workspace] + ->focused_tile,NULL); wl_list_remove(&view->link); - server->curr_output->workspaces[server->curr_output->curr_workspace] - ->focused_tile->view = NULL; keybinding_cycle_views(server, false, false); if(server->curr_output->workspaces[server->curr_output->curr_workspace] ->focused_tile->view == NULL) { @@ -1255,8 +1239,7 @@ keybinding_move_view_to_output(struct cg_server *server, int output_num) { view->workspace = ws; wl_list_insert(&ws->views, &view->link); wlr_scene_node_reparent(view->scene_node, &ws->scene->node); - ws->focused_tile->view = view; - view_maximize(view, ws->focused_tile); + workspace_tile_update_view(ws->focused_tile,view); seat_set_focus(server->seat, view); } char *view_title = ""; @@ -1297,8 +1280,7 @@ keybinding_move_view_to_workspace(struct cg_server *server, uint32_t ws) { view->workspace = ws; wl_list_insert(&ws->views, &view->link); wlr_scene_node_reparent(view->scene_node, &ws->scene->node); - ws->focused_tile->view = view; - view_maximize(view, ws->focused_tile); + workspace_tile_update_view(ws->focused_tile,view); seat_set_focus(server->seat, view); } ipc_send_event(server, diff --git a/output.c b/output.c index 8a94b6c..ed422b9 100644 --- a/output.c +++ b/output.c @@ -69,7 +69,7 @@ output_clear(struct cg_output *output) { first || output->workspaces[i]->focused_tile != tile; tile = tile->next) { first = false; - tile->view = NULL; + workspace_tile_update_view(tile,NULL); } struct cg_workspace *ws = server->curr_output diff --git a/seat.c b/seat.c index 8fd485e..d507e3e 100644 --- a/seat.c +++ b/seat.c @@ -986,8 +986,7 @@ seat_set_focus(struct cg_seat *seat, struct cg_view *view) { /* Focusing the background */ if(view == NULL) { - server->curr_output->workspaces[server->curr_output->curr_workspace] - ->focused_tile->view = NULL; + workspace_tile_update_view(server->curr_output->workspaces[server->curr_output->curr_workspace]->focused_tile,NULL); seat->focused_view = NULL; if(prev_view != NULL) { view_activate(prev_view, false); @@ -1000,21 +999,11 @@ seat_set_focus(struct cg_seat *seat, struct cg_view *view) { if(view->type != CG_XWAYLAND_VIEW || xwayland_view_should_manage(view)) #endif { - /* Always resize the view, even if prev_view == view */ - struct cg_workspace *curr_workspace = - server->curr_output + struct cg_workspace *curr_workspace = server->curr_output ->workspaces[server->curr_output->curr_workspace]; - view_maximize(view, curr_workspace->focused_tile); - if(!view_is_visible(view)) { - wl_list_remove(&view->link); - if(curr_workspace->focused_tile->view != NULL) { - wl_list_insert(&curr_workspace->focused_tile->view->link, - &view->link); - } else { - wl_list_insert(curr_workspace->views.prev, &view->link); - } - curr_workspace->focused_tile->view = view; - } + workspace_tile_update_view(curr_workspace->focused_tile,view); + wl_list_remove(&curr_workspace->views); + wl_list_insert(&view->link,&curr_workspace->views); } #if CG_HAS_XWAYLAND diff --git a/view.c b/view.c index e5f61d8..b0fabe2 100644 --- a/view.c +++ b/view.c @@ -142,10 +142,7 @@ view_unmap(struct cg_view *view) { } struct cg_tile *view_tile = view_get_tile(view); if(view_tile != NULL) { - view_tile->view = prev; - if(prev != NULL) { - view_maximize(prev, view_tile); - } + workspace_tile_update_view(view_tile,prev); } } #if CG_HAS_XWAYLAND @@ -196,8 +193,6 @@ view_map(struct cg_view *view, struct wlr_surface *surface, } else #endif { - view->tile = view->workspace->focused_tile; - view_maximize(view, view->tile); wl_list_insert(&ws->views, &view->link); } seat_set_focus(output->server->seat, view); diff --git a/workspace.c b/workspace.c index 4788bae..3b2b8e9 100644 --- a/workspace.c +++ b/workspace.c @@ -20,6 +20,20 @@ #include "seat.h" #include "server.h" #include "workspace.h" +#include "view.h" + +void +workspace_tile_update_view(struct cg_tile *tile, struct cg_view *view) { + if(tile->view!=NULL) { + wlr_scene_node_set_enabled(tile->view->scene_node,false); + tile->view->tile=NULL; + } + tile->view=view; + if(view!=NULL) { + view_maximize(view,tile); + wlr_scene_node_set_enabled(view->scene_node,true); + } +} #if CG_HAS_FANALYZE #pragma GCC diagnostic push @@ -42,7 +56,7 @@ full_screen_workspace_tiles(struct wlr_output_layout *layout, struct wlr_box *output_box = wlr_output_layout_get_box(layout, output); workspace->focused_tile->tile.width = output_box->width; workspace->focused_tile->tile.height = output_box->height; - workspace->focused_tile->view = NULL; + workspace_tile_update_view(workspace->focused_tile,NULL); workspace->focused_tile->id = *tiles_curr_id; ++(*tiles_curr_id); return 0; diff --git a/workspace.h b/workspace.h index 77a9b00..94cc989 100644 --- a/workspace.h +++ b/workspace.h @@ -41,5 +41,7 @@ void workspace_focus_tile(struct cg_workspace *ws, struct cg_tile *tile); void workspace_focus(struct cg_output *outp, int ws); +void +workspace_tile_update_view(struct cg_tile *tile, struct cg_view *view); #endif From d586fba128dbb35ff1f05e9b916816be3dc2aef0 Mon Sep 17 00:00:00 2001 From: project-repo Date: Tue, 27 Dec 2022 10:35:10 +0100 Subject: [PATCH 456/689] Add reports for bugs found using scan-build --- Bugs.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/Bugs.md b/Bugs.md index 93496db..2d70cdf 100644 --- a/Bugs.md +++ b/Bugs.md @@ -1000,3 +1000,44 @@ to let us know (either by posting here or opening a new issue)! cheers project-repo ``` + +## Issue 42 + + * github issue number: N/A + * Fixed: 2.0.0 + +When Cagebreak exited due to an error on startup, it was possible for +memory leaks to occur since `server.modes` was not freed correctly. The +same applies to the variable `name` in `input_manager.c`. + +This bug was found using the scan-build utility. + +## Issue 43 + + * github issue number: N/A + * Fixed: 2.0.0 + +In `keybinding_move_view_to_cycle_output`, it was previously possible for a +null pointer dereference to occur, when no view to be moved was focussed. + +This bug was found using the scan-build utility. + +## Issue 44 + + * github issue number: N/A + * Fixed: 2.0.0 + +`cg_input_reset_libinput_device` was removed as it was unused code. + +This bug was found using the scan-build utility. + +## Issue 45 + + * github issue number: N/A + * Fixed: 2.0.0 + +Various memory leaks in `parse_message_config`, `full_screen_workspace` +and `server_show_info` were fixed. + +This bug was found using the scan-build utility. + From b16a5d64c4a2c3e431794a2f7767b516883ff200 Mon Sep 17 00:00:00 2001 From: project-repo Date: Tue, 27 Dec 2022 12:16:33 +0100 Subject: [PATCH 457/689] Fix Bugs.md highlighting --- Bugs.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/Bugs.md b/Bugs.md index 2d70cdf..fcb97b2 100644 --- a/Bugs.md +++ b/Bugs.md @@ -591,7 +591,6 @@ without xwayland has been added to the release checklist. * github issue number: #23 * Fixed: 1.9.0 -``` Similar to djpohly/dwl#177. Xwayland works fine elsewhere: cage, hikari, kwinft, labwc, phoc, river, sway, wayfire. ``` $ cagebreak @@ -618,7 +617,6 @@ wayland-protocols-1.25 xwayland-devel-21.0.99.1.171 wlroots-0.15.1 ``` -``` ## Issue 34 From b9fe176f3c21eb76376e0c5aea02fac44de9834c Mon Sep 17 00:00:00 2001 From: project-repo Date: Tue, 27 Dec 2022 13:19:27 +0100 Subject: [PATCH 458/689] Add cagebreak start FAQ entry --- FAQ.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/FAQ.md b/FAQ.md index 3f9e9db..29edf21 100644 --- a/FAQ.md +++ b/FAQ.md @@ -26,6 +26,22 @@ Set the following environment variables to activate wayland support for firefox. +## How is Cagebreak launched? + +The documentation says to start Cagebreak like any other binary. + +If you want to start Cagebreak on login, you can use your shells +equivalent of a `.bash_profile`. In BASH appending cagebreak +(given that it is installed in the path) to `.bash_profile` +is fine. + +If you want to start Cagebreak using systemd you could use a +service started on user login, though the development team once ran +into some issues with permissions for the services. + +Please note that Cagebreak does not solve the problem of +locking the screen or login in general. + ## How are applications launched in Cagebreak? There are multiple ways to launch external programs in cagebreak. From 1fc026a6f31e0da8426da54f38d1a19a9b92c971 Mon Sep 17 00:00:00 2001 From: project-repo Date: Tue, 27 Dec 2022 14:01:42 +0100 Subject: [PATCH 459/689] Add documentation for output rotate --- man/cagebreak-config.5.md | 19 ++++++++++++++++++- parse.c | 6 +++--- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index ba8b3b0..a23d155 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -242,7 +242,7 @@ message *only* Remove all splits and make current window fill the entire screen -*output [[pos res x rate [scale ]] | enable | disable | prio ]* +*output [[pos res x rate [scale ]] | enable | disable | prio | rotate ]* Configure output "" - - and are the position of the monitor in pixels. The top-left monitor should have the coordinates 0 0. @@ -258,6 +258,23 @@ message to set priorities for outputs, where >= 1. The larger is, the higher the priority is, that is to say, the earlier the output will appear in the list of outputs. + - rotate is used to rotate the output by mod 4 * 90 degrees + counter-clockwise. + +``` +# Don't rotate +output DP-1 rotate 0 + +# rotate 90 degrees counter-clockwise +output DP-1 rotate 1 + +# rotate 180 degrees counter-clockwise +output DP-1 rotate 2 + +# rotate 270 degrees counter-clockwise +output DP-1 rotate 3 +``` + *output* and the *screen* family of commands are similar in that they both deal with monitors on some level. - *output* addresses outputs by their name and is vaguely symmetric diff --git a/parse.c b/parse.c index 4f27674..08a0ebb 100644 --- a/parse.c +++ b/parse.c @@ -509,7 +509,7 @@ parse_output_config_keyword(char *key_str, enum output_status *status) { *status = OUTPUT_DEFAULT; } else if(strcmp(key_str, "prio") == 0) { *status = OUTPUT_DEFAULT; - } else if(strcmp(key_str, "angle") == 0) { + } else if(strcmp(key_str, "rotate") == 0) { *status = OUTPUT_DEFAULT; } else if(strcmp(key_str, "scale") == 0) { *status = OUTPUT_DEFAULT; @@ -556,13 +556,13 @@ parse_output_config(char **saveptr, char **errstr) { return cfg; } - if(strcmp(key_str, "angle") == 0) { + if(strcmp(key_str, "rotate") == 0) { uint32_t angle = parse_uint(saveptr, " "); //360 degrees is equivalent to 0 degrees cfg->angle = angle%4; if(cfg->angle < 0) { *errstr = log_error( - "Error parsing angle specification for output %s", + "Error parsing option rotate for output %s", name); goto error; } From 9dd07b1caf92c6e0071352981fe57bdc2b88107f Mon Sep 17 00:00:00 2001 From: project-repo Date: Tue, 27 Dec 2022 14:15:15 +0100 Subject: [PATCH 460/689] Document removal of -r option --- man/cagebreak.1.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index 1ee0438..bb3f62b 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -35,9 +35,6 @@ are displayed in a message box at the top right of the screen. *-h* Display help message and exit -*-r* - Rotate the output 90 degrees clockwise, can be specified up to three times - *-s* Show all available inputs and outputs From be38bcf232a1e57546f70745c8cb4c8642980e55 Mon Sep 17 00:00:00 2001 From: project-repo Date: Tue, 27 Dec 2022 14:29:08 +0100 Subject: [PATCH 461/689] Fix man page --- man/cagebreak-config.5.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index a23d155..f73d362 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -258,7 +258,7 @@ message to set priorities for outputs, where >= 1. The larger is, the higher the priority is, that is to say, the earlier the output will appear in the list of outputs. - - rotate is used to rotate the output by mod 4 * 90 degrees + - rotate is used to rotate the output by ` mod 4 x 90` degrees counter-clockwise. ``` From e02ab558ec5924f60e6c49fb2bb9f340df3f0e7b Mon Sep 17 00:00:00 2001 From: project-repo Date: Tue, 27 Dec 2022 14:29:23 +0100 Subject: [PATCH 462/689] Update release version numbers --- meson.build | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/meson.build b/meson.build index 37b28c8..cf7794b 100644 --- a/meson.build +++ b/meson.build @@ -203,13 +203,13 @@ reproducible_build_versions = { 'wayland_cursor': '1.21.0', 'wlroots': '0.15.1', 'xkbcommon': '1.4.1', - 'fontconfig': '2.14.0', - 'libinput': '1.21.0', + 'fontconfig': '2.14.1', + 'libinput': '1.22.0', 'libevdev': '1.13.0', - 'libudev': '251', - 'pango': '1.50.11', + 'libudev': '252', + 'pango': '1.50.12', 'cairo': '1.17.6', - 'pangocairo': '1.50.11', + 'pangocairo': '1.50.12', 'math': '-1' } From 379c41d8e7afee84fcf4b81ab86341d27d1d3956 Mon Sep 17 00:00:00 2001 From: project-repo Date: Tue, 27 Dec 2022 14:29:42 +0100 Subject: [PATCH 463/689] Move to meson setup --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 349c347..bd29720 100644 --- a/README.md +++ b/README.md @@ -109,14 +109,14 @@ breaking changes as soon as they occur. Simply execute the following steps to build Cagebreak: ``` -$ meson build +$ meson setup build $ ninja -C build ``` #### Release Build By default, this builds a debug build. To build a release build, use `meson -build --buildtype=release`. +setup build --buildtype=release`. ##### Xwayland Support @@ -265,7 +265,7 @@ There are reproducibility issues up to and including release `1.2.0`. See All hashes and signatures are provided for the following build instructions. ``` -meson build -Dxwayland=true -Dman-pages=true --buildtype=release +meson setup build -Dxwayland=true -Dman-pages=true --buildtype=release ninja -C build ``` @@ -415,7 +415,7 @@ occur. * [ ] Checked archive * [ ] tar -xvf release_version.tar.gz * [ ] cd cagebreak - * [ ] meson build -Dxwayland=true -Dman-pages=true --buildtype=release + * [ ] meson setup build -Dxwayland=true -Dman-pages=true --buildtype=release * [ ] ninja -C build * [ ] gpg --verify ../signatures/cagebreak.sig build/cagebreak * [ ] cd .. From 1ab70173b05fa66ecdfa930038a35019de3c7362 Mon Sep 17 00:00:00 2001 From: project-repo Date: Tue, 27 Dec 2022 14:30:47 +0100 Subject: [PATCH 464/689] Fix DEBUG<->WLR_DEBUG --- seat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seat.c b/seat.c index d507e3e..9f399ae 100644 --- a/seat.c +++ b/seat.c @@ -461,7 +461,7 @@ remove_keyboard(struct cg_seat *seat, struct cg_input_device *keyboard) { wlr_keyboard_group_remove_keyboard(wlr_group, wlr_keyboard); if (wl_list_empty(&wlr_group->devices)) { - wlr_log(DEBUG, "Destroying empty keyboard group %p", + wlr_log(WLR_DEBUG, "Destroying empty keyboard group %p", wlr_group); struct cg_keyboard_group *group = wlr_group->data; if(wlr_seat_get_keyboard(wlr_seat) == &wlr_group->keyboard) { From 52195268e6c4b2037ae4450a6103ef7e39ad48ed Mon Sep 17 00:00:00 2001 From: project-repo Date: Tue, 27 Dec 2022 14:50:52 +0100 Subject: [PATCH 465/689] Implement keyboard configuration - Allow disabling command interpretation for specific keyboards --- cagebreak.c | 10 +++ input_manager.c | 186 ++++++++++++++++++++++++++++++++++++++++++++++++ input_manager.h | 15 +++- keybinding.c | 76 +++++++++++++++++--- libinput.c | 149 ++++++++++++++++---------------------- parse.c | 35 ++++----- seat.c | 21 +++++- seat.h | 4 +- 8 files changed, 374 insertions(+), 122 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index b5f9da1..fa051f1 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -660,6 +660,16 @@ end: free(output_config); } + struct cg_input_config *input_config, *input_config_tmp; + wl_list_for_each_safe(input_config, input_config_tmp, + &server.input_config, link) { + wl_list_remove(&input_config->link); + if(input_config->identifier != NULL) { + free(input_config->identifier); + } + free(input_config); + } + keybinding_list_free(server.keybindings); wl_event_source_remove(sigint_source); wl_event_source_remove(sigterm_source); diff --git a/input_manager.c b/input_manager.c index 1385f25..016a52a 100644 --- a/input_manager.c +++ b/input_manager.c @@ -18,6 +18,8 @@ #include #include #include +#include +#include #include #include #include @@ -91,6 +93,190 @@ input_manager_handle_device_destroy(struct wl_listener *listener, void *data) { free(input_device); } +struct cg_input_config* +input_manager_create_empty_input_config() { + struct cg_input_config *cfg = calloc(1, sizeof(struct cg_input_config)); + if(cfg == NULL) { + return NULL; + } + /* Libinput devices */ + cfg->tap = INT_MIN; + cfg->tap_button_map = INT_MIN; + cfg->drag = INT_MIN; + cfg->drag_lock = INT_MIN; + cfg->dwt = INT_MIN; + cfg->send_events = INT_MIN; + cfg->click_method = INT_MIN; + cfg->middle_emulation = INT_MIN; + cfg->natural_scroll = INT_MIN; + cfg->accel_profile = INT_MIN; + cfg->pointer_accel = FLT_MIN; + cfg->scroll_factor = FLT_MIN; + cfg->scroll_button = INT_MIN; + cfg->scroll_method = INT_MIN; + cfg->left_handed = INT_MIN; + /*cfg->repeat_delay = INT_MIN; + cfg->repeat_rate = INT_MIN; + cfg->xkb_numlock = INT_MIN; + cfg->xkb_capslock = INT_MIN; + cfg->xkb_file_is_set = false; + wl_list_init(&cfg->tools);*/ + + /* Keyboards */ + cfg->enable_keybindings=-1; + return cfg; +} + +/* cfg1 has precedence */ +struct cg_input_config* +input_manager_merge_input_configs(struct cg_input_config* cfg1, struct cg_input_config* cfg2) { + struct cg_input_config *out_cfg = calloc(1, sizeof(struct cg_input_config)); + if(cfg1->identifier==NULL) { + if(cfg2->identifier!=NULL) { + out_cfg->identifier=strdup(cfg2->identifier); + } + } else { + out_cfg->identifier=strdup(cfg1->identifier); + } + if(out_cfg == NULL) { + return NULL; + } + if(cfg1->tap == INT_MIN) { + out_cfg->tap=cfg2->tap; + } else { + out_cfg->tap=cfg1->tap; + } + if(cfg1->send_events == INT_MIN) { + out_cfg->send_events=cfg2->send_events; + } else { + out_cfg->send_events=cfg1->send_events; + } + if(cfg1->dwt == INT_MIN) { + out_cfg->dwt=cfg2->dwt; + } else { + out_cfg->dwt=cfg1->dwt; + } + if(cfg1->drag_lock == INT_MIN) { + out_cfg->drag_lock=cfg2->drag_lock; + } else { + out_cfg->drag_lock=cfg1->drag_lock; + } + if(cfg1->drag == INT_MIN) { + out_cfg->drag=cfg2->drag; + } else { + out_cfg->drag=cfg1->drag; + } + if(cfg1->tap_button_map == INT_MIN) { + out_cfg->tap_button_map=cfg2->tap_button_map; + } else { + out_cfg->tap_button_map=cfg1->tap_button_map; + } + if(cfg1->left_handed == INT_MIN) { + out_cfg->left_handed=cfg2->left_handed; + } else { + out_cfg->left_handed=cfg1->left_handed; + } + if(cfg1->scroll_method == INT_MIN) { + out_cfg->scroll_method=cfg2->scroll_method; + } else { + out_cfg->scroll_method=cfg1->scroll_method; + } + if(cfg1->scroll_button == INT_MIN) { + out_cfg->scroll_button=cfg2->scroll_button; + } else { + out_cfg->scroll_button=cfg1->scroll_button; + } + if(cfg1->scroll_factor == FLT_MIN) { + out_cfg->scroll_factor=cfg2->scroll_factor; + } else { + out_cfg->scroll_factor=cfg1->scroll_factor; + } + if(cfg1->pointer_accel == FLT_MIN) { + out_cfg->pointer_accel=cfg2->pointer_accel; + } else { + out_cfg->pointer_accel=cfg1->pointer_accel; + } + if(cfg1->accel_profile == INT_MIN) { + out_cfg->accel_profile=cfg2->accel_profile; + } else { + out_cfg->accel_profile=cfg1->accel_profile; + } + if(cfg1->natural_scroll == INT_MIN) { + out_cfg->natural_scroll=cfg2->natural_scroll; + } else { + out_cfg->natural_scroll=cfg1->natural_scroll; + } + if(cfg1->middle_emulation == INT_MIN) { + out_cfg->middle_emulation=cfg2->middle_emulation; + } else { + out_cfg->middle_emulation=cfg1->middle_emulation; + } + if(cfg1->click_method == INT_MIN) { + out_cfg->click_method=cfg2->click_method; + } else { + out_cfg->click_method=cfg1->click_method; + } + if(cfg1->enable_keybindings == -1) { + out_cfg->enable_keybindings=cfg2->enable_keybindings; + } else { + out_cfg->enable_keybindings=cfg1->enable_keybindings; + } + return out_cfg; +} + +void +apply_keyboard_group_config(struct cg_input_config *config, + struct cg_keyboard_group *group) { + if(group->enable_keybindings!=-1) { + group->enable_keybindings=config->enable_keybindings; + } +} + +void +cg_input_manager_configure_keyboard_group(struct cg_keyboard_group *group) { + struct cg_server *server = group->seat->server; + struct cg_input_config *tot_cfg=input_manager_create_empty_input_config(); + if(tot_cfg==NULL) { + return; + } + + struct cg_input_config *tmp_cfg, *config = NULL; + wl_list_for_each(config, &server->input_config, link) { + if(strcmp(config->identifier, group->identifier) == 0 || strcmp(config->identifier, "*")==0 + || (strncmp(config->identifier, "type:", 5) == 0 && + strcmp(config->identifier + 5, "keyboard") == 0)) { + tmp_cfg=tot_cfg; + if(tot_cfg->identifier==NULL || strcmp(tot_cfg->identifier,"*")==0 || strcmp(config->identifier,group->identifier)) { + tot_cfg=input_manager_merge_input_configs(config,tot_cfg); + } else { + tot_cfg=input_manager_merge_input_configs(tot_cfg,config); + } + if(tmp_cfg->identifier!=NULL) { + free(tmp_cfg->identifier); + } + free(tmp_cfg); + } + } + apply_keyboard_group_config(tot_cfg, group); + if(tot_cfg->identifier!=NULL) { + free(tot_cfg->identifier); + } + free(tot_cfg); +} + + +void +cg_input_manager_configure(struct cg_server *server) { + struct cg_input_device *device = NULL; + wl_list_for_each(device, &server->input->devices, link) { + cg_input_configure_libinput_device(device); + } + struct cg_keyboard_group *group = NULL; + wl_list_for_each(group, &server->seat->keyboard_groups, link) { + cg_input_manager_configure_keyboard_group(group); + } +} + static void new_input(struct cg_input_manager *input, struct wlr_input_device *device, bool virtual) { struct cg_input_device *input_device = diff --git a/input_manager.h b/input_manager.h index 35318f6..c96998d 100644 --- a/input_manager.h +++ b/input_manager.h @@ -8,12 +8,19 @@ struct cg_input_manager * input_manager_create(struct cg_server *server); -struct cg_input_config * -input_device_get_config(struct cg_input_device *device); void input_manager_handle_device_destroy(struct wl_listener *listener, void *data); uint32_t input_manager_get_mouse_button(const char *name, char **error); +struct cg_input_config* +input_manager_create_empty_input_config(); +struct cg_input_config* +input_manager_merge_input_configs(struct cg_input_config* cfg1, struct cg_input_config* cfg2); +void +cg_input_manager_configure(struct cg_server *server); +void +cg_input_manager_configure_keyboard_group(struct cg_keyboard_group *group); + struct cg_input_manager { struct wl_list devices; @@ -50,6 +57,7 @@ enum cg_input_config_mapped_to { struct cg_input_config { char *identifier; + /* Libinput devices */ int accel_profile; struct calibration_matrix calibration_matrix; int click_method; @@ -92,6 +100,9 @@ struct cg_input_config { bool capturable; struct wlr_box region; + + /* Keyboards */ + int enable_keybindings; }; struct cg_input_device { diff --git a/keybinding.c b/keybinding.c index 17dbf6e..388ad4e 100644 --- a/keybinding.c +++ b/keybinding.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -1002,12 +1003,56 @@ print_outputs(struct cg_server *server) { return dyn_str_to_str(&outp_str); } +char * +print_keyboard_group(struct cg_keyboard_group *grp) { + struct dyn_str outp_str; + outp_str.len = 0; + outp_str.cur_pos = 0; + uint32_t nmemb = 4; + outp_str.str_arr = calloc(nmemb, sizeof(char *)); + if(grp->identifier!=NULL) { + print_str(&outp_str, "\"%s\": {\n", grp->identifier); + } else { + print_str(&outp_str, "\"NULL\": {\n"); + } + print_str(&outp_str, "\"repeat_delay\": %d,\n", grp->wlr_group->keyboard.repeat_info.delay); + print_str(&outp_str, "\"repeat_rate\": %d,\n", grp->wlr_group->keyboard.repeat_info.rate); + print_str(&outp_str, "}"); + return dyn_str_to_str(&outp_str); +} + +char * +print_keyboard_groups(struct cg_server *server) { + uint32_t ninps = wl_list_length(&server->seat->keyboard_groups); + struct dyn_str outp_str; + outp_str.len = 0; + outp_str.cur_pos = 0; + outp_str.str_arr = calloc((2 * ninps - 1) + 2, sizeof(char *)); + print_str(&outp_str, "\"keyboards\": ["); + struct cg_keyboard_group *it; + uint32_t count = 0; + wl_list_for_each(it, &server->seat->keyboard_groups, link) { + if(count != 0) { + print_str(&outp_str, ","); + } + ++count; + char *outp = print_keyboard_group(it); + if(outp == NULL) { + continue; + } + print_str(&outp_str, "%s", outp); + free(outp); + } + print_str(&outp_str, "],\n"); + return dyn_str_to_str(&outp_str); +} + void keybinding_dump(struct cg_server *server) { struct dyn_str str; str.len = 0; str.cur_pos = 0; - uint32_t nmemb = 10; + uint32_t nmemb = 11; str.str_arr = calloc(nmemb, sizeof(char *)); print_str(&str, "{"); @@ -1020,8 +1065,15 @@ keybinding_dump(struct cg_server *server) { server->curr_output->wlr_output->name); print_modes(&str, server->modes); char *outps_str = print_outputs(server); - print_str(&str, "%s", outps_str); - free(outps_str); + if(outps_str!=NULL) { + print_str(&str, "%s", outps_str); + free(outps_str); + } + char *keyboards_str = print_keyboard_groups(server); + if(keyboards_str!=NULL) { + print_str(&str, "%s", keyboards_str); + free(keyboards_str); + } print_str(&str, "\"cursor_coords\":{\"x\":%f,\"y\":%f},\n", server->seat->cursor->x, server->seat->cursor->y); print_str(&str, "}"); @@ -1360,7 +1412,19 @@ keybinding_configure_output(struct cg_server *server, void keybinding_configure_input(struct cg_server *server, struct cg_input_config *cfg) { - cg_input_apply_config(cfg, server); + struct cg_input_config *tcfg=input_manager_create_empty_input_config(); + if(tcfg==NULL) { + wlr_log(WLR_ERROR,"Could not allocate temporary empty input configuration."); + return; + } + struct cg_input_config *ocfg=input_manager_merge_input_configs(cfg,tcfg); + free(tcfg); + if(ocfg==NULL) { + wlr_log(WLR_ERROR,"Could not allocate input configuration for merging."); + return; + } + wl_list_insert(&server->input_config,&ocfg->link); + cg_input_manager_configure(server); ipc_send_event(server, "{\"event_name\":\"configure_input\",\"input\":\"%s\"}", cfg->identifier); @@ -1391,10 +1455,6 @@ keybinding_configure_message(struct cg_server *server, ipc_send_event(server, "{\"event_name\":\"configure_message\"}"); } -void -keybinding_configure_input_dev(struct cg_server *server, - struct cg_input_config *cfg) {} - /* Hint: see keybinding.h for details on "data" */ int run_action(enum keybinding_action action, struct cg_server *server, diff --git a/libinput.c b/libinput.c index 6d9aff4..fbc37e1 100644 --- a/libinput.c +++ b/libinput.c @@ -262,89 +262,69 @@ input_device_get_type(struct cg_input_device *device) { void apply_config_to_device(struct cg_input_config *config, struct cg_input_device *input_device) { - if(!wlr_input_device_is_libinput(input_device->wlr_device)) { - return; - } - struct libinput_device *device = - wlr_libinput_get_device_handle(input_device->wlr_device); - if(config->mapped_to_output && - !output_by_name_or_id(config->mapped_to_output, input_device->server)) { - wlr_log(WLR_DEBUG, - "'%s' is mapped to offline output '%s'; disabling input", - config->identifier, config->mapped_to_output); - set_send_events(device, LIBINPUT_CONFIG_SEND_EVENTS_DISABLED); - } else if(config->send_events != INT_MIN) { - set_send_events(device, config->send_events); - } else { - // Have to reset to the default mode here, otherwise if ic->send_events - // is unset and a mapped output just came online after being disabled, - // we'd remain stuck sending no events. - set_send_events( - device, - libinput_device_config_send_events_get_default_mode(device)); - } - - if(config->tap != INT_MIN) { - set_tap(device, config->tap); - } - if(config->tap_button_map != INT_MIN) { - set_tap_button_map(device, config->tap_button_map); - } - if(config->drag != INT_MIN) { - set_tap_drag(device, config->drag); - } - if(config->drag_lock != INT_MIN) { - set_tap_drag_lock(device, config->drag_lock); - } - if(config->pointer_accel != FLT_MIN) { - set_accel_speed(device, config->pointer_accel); - } - if(config->accel_profile != INT_MIN) { - set_accel_profile(device, config->accel_profile); - } - if(config->natural_scroll != INT_MIN) { - set_natural_scroll(device, config->natural_scroll); - } - if(config->left_handed != INT_MIN) { - set_left_handed(device, config->left_handed); - } - if(config->click_method != INT_MIN) { - set_click_method(device, config->click_method); - } - if(config->middle_emulation != INT_MIN) { - set_middle_emulation(device, config->middle_emulation); - } - if(config->scroll_method != INT_MIN) { - set_scroll_method(device, config->scroll_method); - } - if(config->scroll_button != INT_MIN) { - set_scroll_button(device, config->scroll_button); - } - if(config->dwt != INT_MIN) { - set_dwt(device, config->dwt); - } - if(config->calibration_matrix.configured) { - set_calibration_matrix(device, config->calibration_matrix.matrix); - } -} - -void -cg_input_apply_config(struct cg_input_config *config, - struct cg_server *server) { - struct cg_input_device *device = NULL; - wl_list_for_each(device, &server->input->devices, link) { - if(strcmp(config->identifier, device->identifier) != 0 && - strcmp(config->identifier, "*") != 0) { - continue; + if(wlr_input_device_is_libinput(input_device->wlr_device)) { + struct libinput_device *device = + wlr_libinput_get_device_handle(input_device->wlr_device); + if(config->mapped_to_output && + !output_by_name_or_id(config->mapped_to_output, input_device->server)) { + wlr_log(WLR_DEBUG, + "'%s' is mapped to offline output '%s'; disabling input", + config->identifier, config->mapped_to_output); + set_send_events(device, LIBINPUT_CONFIG_SEND_EVENTS_DISABLED); + } else if(config->send_events != INT_MIN) { + set_send_events(device, config->send_events); + } else { + // Have to reset to the default mode here, otherwise if ic->send_events + // is unset and a mapped output just came online after being disabled, + // we'd remain stuck sending no events. + set_send_events( + device, + libinput_device_config_send_events_get_default_mode(device)); } - const char *device_type = input_device_get_type(device); - if(strncmp(config->identifier, "type:", 5) == 0 && - strcmp(config->identifier + 5, device_type) != 0) { - continue; + if(config->tap != INT_MIN) { + set_tap(device, config->tap); + } + if(config->tap_button_map != INT_MIN) { + set_tap_button_map(device, config->tap_button_map); + } + if(config->drag != INT_MIN) { + set_tap_drag(device, config->drag); + } + if(config->drag_lock != INT_MIN) { + set_tap_drag_lock(device, config->drag_lock); + } + if(config->pointer_accel != FLT_MIN) { + set_accel_speed(device, config->pointer_accel); + } + if(config->accel_profile != INT_MIN) { + set_accel_profile(device, config->accel_profile); + } + if(config->natural_scroll != INT_MIN) { + set_natural_scroll(device, config->natural_scroll); + } + if(config->left_handed != INT_MIN) { + set_left_handed(device, config->left_handed); + } + if(config->click_method != INT_MIN) { + set_click_method(device, config->click_method); + } + if(config->middle_emulation != INT_MIN) { + set_middle_emulation(device, config->middle_emulation); + } + if(config->scroll_method != INT_MIN) { + set_scroll_method(device, config->scroll_method); + } + if(config->scroll_button != INT_MIN) { + set_scroll_button(device, config->scroll_button); + } + if(config->dwt != INT_MIN) { + set_dwt(device, config->dwt); + } + if(config->calibration_matrix.configured) { + set_calibration_matrix(device, config->calibration_matrix.matrix); } - apply_config_to_device(config, device); } } @@ -354,17 +334,12 @@ cg_input_configure_libinput_device(struct cg_input_device *input_device) { struct cg_input_config *config = NULL; wl_list_for_each(config, &server->input_config, link) { - if(strcmp(config->identifier, input_device->identifier) != 0 && - strcmp(config->identifier, "*") != 0) { - continue; - } - const char *device_type = input_device_get_type(input_device); - if(!(strncmp(config->identifier, "type:", 5) && + if(strcmp(config->identifier, input_device->identifier) == 0 || + strcmp(config->identifier, "*") == 0||(strncmp(config->identifier, "type:", 5) == 0&& strcmp(config->identifier + 5, device_type) == 0)) { - continue; + apply_config_to_device(config, input_device); } - apply_config_to_device(config, input_device); } } diff --git a/parse.c b/parse.c index 4f27674..ae5523f 100644 --- a/parse.c +++ b/parse.c @@ -13,6 +13,7 @@ #include "parse.h" #include "server.h" #include "util.h" +#include "input_manager.h" char * log_error(const char *fmt, ...) { @@ -118,7 +119,7 @@ parse_float(char **saveptr, const char *delim) { struct cg_input_config * parse_input_config(char **saveptr, char **errstr) { - struct cg_input_config *cfg = calloc(1, sizeof(struct cg_input_config)); + struct cg_input_config *cfg=input_manager_create_empty_input_config(); char *value = NULL; char *ident = NULL; if(cfg == NULL) { @@ -127,28 +128,6 @@ parse_input_config(char **saveptr, char **errstr) { goto error; } - cfg->tap = INT_MIN; - cfg->tap_button_map = INT_MIN; - cfg->drag = INT_MIN; - cfg->drag_lock = INT_MIN; - cfg->dwt = INT_MIN; - cfg->send_events = INT_MIN; - cfg->click_method = INT_MIN; - cfg->middle_emulation = INT_MIN; - cfg->natural_scroll = INT_MIN; - cfg->accel_profile = INT_MIN; - cfg->pointer_accel = FLT_MIN; - cfg->scroll_factor = FLT_MIN; - cfg->scroll_button = INT_MIN; - cfg->scroll_method = INT_MIN; - cfg->left_handed = INT_MIN; - /*cfg->repeat_delay = INT_MIN; - cfg->repeat_rate = INT_MIN; - cfg->xkb_numlock = INT_MIN; - cfg->xkb_capslock = INT_MIN; - cfg->xkb_file_is_set = false; - wl_list_init(&cfg->tools);*/ - ident = strtok_r(NULL, " ", saveptr); if(ident == NULL) { @@ -341,6 +320,16 @@ parse_input_config(char **saveptr, char **errstr) { "Invalid option \"%s\" to setting \"tap_button_map\"", value); goto error; } + } else if(strcmp(setting, "keybindings") == 0) { + if(strcmp(value, "enable") == 0) { + cfg->enable_keybindings = true; + } else if(strcmp(value, "disable") == 0) { + cfg->enable_keybindings = false; + } else { + *errstr = log_error( + "Invalid option \"%s\" to setting \"keybindings\"", value); + goto error; + } } else { *errstr = log_error("Invalid option to command \"input\""); goto error; diff --git a/seat.c b/seat.c index 9f399ae..390b3ba 100644 --- a/seat.c +++ b/seat.c @@ -7,7 +7,7 @@ * See the LICENSE file accompanying this file. */ -#define _POSIX_C_SOURCE 200112L +#define _POSIX_C_SOURCE 200812L #include "config.h" @@ -194,6 +194,9 @@ static bool handle_command_key_bindings(struct cg_server *server, xkb_keysym_t sym, uint32_t modifiers, uint32_t mode, struct cg_keyboard_group *group) { + if(group->enable_keybindings==false) { + return false; + } struct keybinding **keybinding = find_keybinding( server->keybindings, &(struct keybinding){.key = sym, .mode = mode, .modifiers = modifiers}); @@ -367,6 +370,11 @@ cg_keyboard_group_add(struct cg_input_device *input_device, struct cg_seat *seat wlr_keyboard_set_repeat_info(&cg_group->wlr_group->keyboard, device->keyboard->repeat_info.rate, device->keyboard->repeat_info.delay); + if(input_device->identifier != NULL) { + cg_group->identifier=strdup(input_device->identifier); + } else { + cg_group->identifier=NULL; + } wlr_log(WLR_DEBUG, "Created keyboard group."); wlr_keyboard_group_add_keyboard(cg_group->wlr_group, wlr_keyboard); @@ -382,12 +390,17 @@ cg_keyboard_group_add(struct cg_input_device *input_device, struct cg_seat *seat seat->server->event_loop, handle_keyboard_repeat, cg_group); cg_group->modifiers.notify = handle_keyboard_group_modifiers; + cg_group->enable_keybindings=true; + cg_input_manager_configure_keyboard_group(cg_group); return; cleanup: if(cg_group && cg_group->wlr_group) { wlr_keyboard_group_destroy(cg_group->wlr_group); } + if(cg_group&&cg_group->identifier) { + free(cg_group->identifier); + } free(cg_group); } @@ -471,6 +484,9 @@ remove_keyboard(struct cg_seat *seat, struct cg_input_device *keyboard) { wl_list_remove(&group->link); wl_list_remove(&group->key.link); wl_list_remove(&group->modifiers.link); + if(group->identifier!=NULL) { + free(group->identifier); + } free(group); // To prevent use-after-free conditions when handling key events, defer @@ -846,6 +862,9 @@ handle_destroy(struct wl_listener *listener, void *_data) { wl_list_remove(&group->link); wlr_keyboard_group_destroy(group->wlr_group); wl_event_source_remove(group->key_repeat_timer); + if(group->identifier) { + free(group->identifier); + } free(group); } diff --git a/seat.h b/seat.h index 32ef586..e450cb6 100644 --- a/seat.h +++ b/seat.h @@ -12,6 +12,7 @@ struct wlr_seat; struct wlr_xcursor_manager; struct wlr_backend; struct wlr_surface; +struct cg_input_config; #define DEFAULT_XCURSOR "left_ptr" #define XCURSOR_SIZE 24 @@ -62,6 +63,8 @@ struct cg_seat { struct cg_keyboard_group { struct wlr_keyboard_group *wlr_group; struct cg_seat *seat; + char *identifier; + int enable_keybindings; struct wl_listener key; struct wl_listener modifiers; @@ -107,5 +110,4 @@ void seat_add_device(struct cg_seat *seat, struct cg_input_device *device); void seat_remove_device(struct cg_seat *seat, struct cg_input_device *device); - #endif From 806c37098744bc7807a0fca7850d31ce9a276080 Mon Sep 17 00:00:00 2001 From: project-repo Date: Tue, 27 Dec 2022 15:00:51 +0100 Subject: [PATCH 466/689] Remove unnecessary function calls --- seat.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/seat.c b/seat.c index 390b3ba..03a940c 100644 --- a/seat.c +++ b/seat.c @@ -79,8 +79,6 @@ remove_touch(struct cg_seat *seat, struct cg_touch *touch) { wlr_cursor_detach_input_device(seat->cursor, touch->device->wlr_device); --seat->num_touch; free(touch); - - update_capabilities(seat); } static void @@ -118,8 +116,6 @@ remove_pointer(struct cg_seat *seat, struct cg_pointer *pointer) { wlr_cursor_detach_input_device(seat->cursor, pointer->device->wlr_device); --seat->num_pointers; free(pointer); - - update_capabilities(seat); } static void From 1ff7d3f60ad551d271956f90eec19d343afd0789 Mon Sep 17 00:00:00 2001 From: project-repo Date: Tue, 27 Dec 2022 18:39:26 +0100 Subject: [PATCH 467/689] Add information on output to dump output --- keybinding.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/keybinding.c b/keybinding.c index 388ad4e..608aa8f 100644 --- a/keybinding.c +++ b/keybinding.c @@ -963,10 +963,16 @@ print_output(struct cg_output *outp) { struct dyn_str outp_str; outp_str.len = 0; outp_str.cur_pos = 0; - uint32_t nmemb = 5; + uint32_t nmemb = 8; + struct wlr_box *outp_box=wlr_output_layout_get_box(outp->server->output_layout,outp->wlr_output); outp_str.str_arr = calloc(nmemb, sizeof(char *)); print_str(&outp_str, "\"%s\": {\n", outp->wlr_output->name); print_str(&outp_str, "\"priority\": %d,\n", outp->priority); + if(outp_box!=NULL) { + print_str(&outp_str, "\"coords\": [\"x\":%d,\"y\":%d],\n", outp_box->x,outp_box->y); + } + print_str(&outp_str, "\"size\": [\"width\":%d,\"height\":%d]\n", 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, "\"curr_workspace\": %d,\n", outp->curr_workspace); char *workspaces_str = print_workspaces(outp); if(workspaces_str != NULL) { From c78607a4fdff5c72d0eae1707a53c3b74eb3fcab Mon Sep 17 00:00:00 2001 From: project-repo Date: Tue, 27 Dec 2022 18:41:16 +0100 Subject: [PATCH 468/689] Add event name for dump event --- keybinding.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keybinding.c b/keybinding.c index 608aa8f..db908f4 100644 --- a/keybinding.c +++ b/keybinding.c @@ -1061,7 +1061,7 @@ keybinding_dump(struct cg_server *server) { uint32_t nmemb = 11; str.str_arr = calloc(nmemb, sizeof(char *)); - print_str(&str, "{"); + print_str(&str, "{\"event_name\":\"dump\","); print_str(&str, "\"nws\":%d,\n", server->nws); print_str(&str, "\"bg_color\":[%f,%f,%f,%f],\n", server->bg_color[0], server->bg_color[1], server->bg_color[2], server->bg_color[3]); From fef49429f56c412fdf27d3a7d37f0b0b0691a358 Mon Sep 17 00:00:00 2001 From: project-repo Date: Wed, 28 Dec 2022 10:08:23 +0100 Subject: [PATCH 469/689] Remove maximal line length in configuration file --- cagebreak.c | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index fa051f1..5474c15 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -7,6 +7,7 @@ */ #define _POSIX_C_SOURCE 200812L +#define _DEFAULT_SOURCE #include "config.h" @@ -165,30 +166,47 @@ parse_args(struct cg_server *server, int argc, char *argv[]) { /* Parse config file. Lines longer than "max_line_size" are ignored */ int set_configuration(struct cg_server *server, - const char *const config_file_path) { + const char *const config_file_path) { FILE *config_file = fopen(config_file_path, "r"); if(config_file == NULL) { wlr_log(WLR_ERROR, "Could not open config file \"%s\"", - config_file_path); + config_file_path); return 1; } - char line[MAX_LINE_SIZE * sizeof(char)]; - for(unsigned int line_num = 1; - fgets(line, MAX_LINE_SIZE, config_file) != NULL; ++line_num) { + uint32_t line_length=64; + char *line=calloc(line_length,sizeof(char)); + for(unsigned int line_num = 1;; ++line_num) { + do { + line_length*=2; + line=reallocarray(line,line_length,sizeof(char)); + if(line == NULL) { + wlr_log(WLR_ERROR, "Could not allocate buffer for reading configuration file."); + return 1; + } + if(fgets(line+strlen(line), line_length-strlen(line), config_file)) { + break; + } + } while(strcspn(line,"\n")==line_length-1); + if(strlen(line)==0) { + break; + } line[strcspn(line, "\n")] = '\0'; if(*line != '\0' && *line != '#') { char *errstr; if(parse_rc_line(server, line, &errstr) != 0) { wlr_log(WLR_ERROR, "Error in config file \"%s\", line %d\n", - config_file_path, line_num); + config_file_path, line_num); fclose(config_file); if(errstr != NULL) { free(errstr); } + free(line); return -1; } } + memset(line,0,line_length*sizeof(char)); } + free(line); fclose(config_file); return 0; } From 29011ac79232633c2b7ef7c95d4c0cf9b1eaf095 Mon Sep 17 00:00:00 2001 From: project-repo Date: Wed, 28 Dec 2022 11:08:23 +0100 Subject: [PATCH 470/689] Remove length restriction for ipc commands --- ipc_server.c | 34 +++++++++++++++++++--------------- ipc_server.h | 1 + parse.h | 2 -- 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/ipc_server.c b/ipc_server.c index 0125e5e..7d455d9 100644 --- a/ipc_server.c +++ b/ipc_server.c @@ -8,6 +8,7 @@ */ #define _POSIX_C_SOURCE 200112L +#define _DEFAULT_SOURCE #include "ipc_server.h" #include "message.h" @@ -193,8 +194,8 @@ ipc_handle_connection(int fd, uint32_t mask, void *data) { close(client_fd); return 0; } - // +1 for \n and +1 for \0 - client->read_buffer = malloc(sizeof(char) * (MAX_LINE_SIZE + 2)); + client->read_buf_cap=64; + client->read_buffer = calloc(client->read_buf_cap,sizeof(char)); client->read_buf_len = 0; client->read_discard = 0; client->server = server; @@ -241,12 +242,18 @@ ipc_client_handle_readable(int client_fd, uint32_t mask, void *data) { return 0; } - int read_size = read_available < MAX_LINE_SIZE + 1 - client->read_buf_len - ? read_available - : MAX_LINE_SIZE + 1 - client->read_buf_len; + while(read_available+client->read_buf_len>(int32_t) client->read_buf_cap-1) { + client->read_buf_cap*=2; + client->read_buffer=reallocarray(client->read_buffer,client->read_buf_cap,sizeof(char)); + if(client->read_buffer == NULL) { + wlr_log(WLR_ERROR, "Unable to allocate buffer large enough to hold client read data"); + ipc_client_disconnect(client); + return 0; + } + } // Append to buffer ssize_t received = recv( - client_fd, client->read_buffer + client->read_buf_len, read_size, 0); + client_fd, client->read_buffer + client->read_buf_len, read_available, 0); if(received == -1) { wlr_log(WLR_ERROR, "Unable to receive data from IPC client"); ipc_client_disconnect(client); @@ -274,8 +281,12 @@ ipc_client_disconnect(struct cg_ipc_client *client) { wl_event_source_remove(client->writable_event_source); } wl_list_remove(&client->link); - free(client->write_buffer); - free(client->read_buffer); + if(client->write_buffer != NULL) { + free(client->write_buffer); + } + if(client->read_buffer != NULL) { + free(client->read_buffer); + } close(client->fd); free(client); } @@ -312,13 +323,6 @@ ipc_client_handle_command(struct cg_ipc_client *client) { } offset = (nl_pos - client->read_buffer) + 1; } - if(offset == 0) { - wlr_log(WLR_ERROR, "Line received was longer than %d, discarding it", - MAX_LINE_SIZE); - client->read_buf_len = 0; - client->read_discard = 1; - return; - } if(offset < client->read_buf_len) { memmove(client->read_buffer, client->read_buffer + offset, client->read_buf_len - offset); diff --git a/ipc_server.h b/ipc_server.h index 61ba631..7fc9d60 100644 --- a/ipc_server.h +++ b/ipc_server.h @@ -21,6 +21,7 @@ struct cg_ipc_client { char *write_buffer; // The following is for storing data between event_loop calls uint16_t read_buf_len; + size_t read_buf_cap; uint8_t read_discard; // 1 if the current line is to be discarded char *read_buffer; }; diff --git a/parse.h b/parse.h index cffb795..b1e6c59 100644 --- a/parse.h +++ b/parse.h @@ -2,8 +2,6 @@ #define PARSE_H -#define MAX_LINE_SIZE 512 - #include struct cg_server; From d66b2ee6ab47665ed9e3092cb4ca86fd29bf4664 Mon Sep 17 00:00:00 2001 From: project-repo Date: Wed, 28 Dec 2022 14:19:31 +0100 Subject: [PATCH 471/689] Add entries to FAQ: - Keybindings with characters not on current keybaord - Cursor size management with env vars --- FAQ.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/FAQ.md b/FAQ.md index 29edf21..d8918a0 100644 --- a/FAQ.md +++ b/FAQ.md @@ -26,6 +26,32 @@ Set the following environment variables to activate wayland support for firefox. +## How do I map characters which are not on the Keyboard? + +Suppose you want to use a command like `bind` for a character +which is likely not on your keyboard like "ы" - you should write +it as "Cyrillic_yeru". + +These names can be obtained by running xev and pressing the respective +key(s) (combinations). + +## How do I change the size of the cursor? + +The size and shape of the cursor is determined by the application, however, +most applications respect the environment variables `XCURSOR_SIZE` and +`XCURSOR_THEME` + +To change the cursor size, one could use: + +``` +export XCURSOR_SIZE=1 +``` + +If you are using an application which inherits its environment variables +from something outside the scope of the export (such as a daemon for +emacs might), you can usually specify your environment variables in +the applications respective configuration. + ## How is Cagebreak launched? The documentation says to start Cagebreak like any other binary. From ebbc3f2431bf2dfa13d04539122dda862736ba47 Mon Sep 17 00:00:00 2001 From: project-repo Date: Wed, 28 Dec 2022 14:40:09 +0100 Subject: [PATCH 472/689] Adjust ipc - Handle SIGPIPE - Change syntax to null-terminated strings --- cagebreak.c | 2 ++ ipc_server.c | 11 +++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index 954649a..73fbf51 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -321,6 +321,8 @@ main(int argc, char *argv[]) { wl_event_loop_add_signal(event_loop, SIGTERM, handle_signal, &server); sigalrm_source = wl_event_loop_add_signal(event_loop, SIGALRM, handle_signal, &server); + sigalrm_source = + wl_event_loop_add_signal(event_loop, SIGPIPE, handle_signal, &server); server.event_loop = event_loop; backend = wlr_backend_autocreate(server.wl_display); diff --git a/ipc_server.c b/ipc_server.c index 0125e5e..32168b9 100644 --- a/ipc_server.c +++ b/ipc_server.c @@ -26,7 +26,7 @@ static const char ipc_magic[] = {'c', 'g', '-', 'i', 'p', 'c'}; -#define IPC_HEADER_SIZE (sizeof(ipc_magic) + 4) +#define IPC_HEADER_SIZE sizeof(ipc_magic) static void handle_display_destroy(struct wl_listener *listener, void *data) { @@ -134,6 +134,9 @@ ipc_client_handle_writable(int client_fd, uint32_t mask, void *data) { return 0; } + if(fcntl(client->fd, F_GETFD) == -1) { + return 0; + } ssize_t written = write(client->fd, client->write_buffer, client->write_buffer_len); @@ -332,7 +335,9 @@ ipc_send_event_client(struct cg_ipc_client *client, const char *payload, char data[IPC_HEADER_SIZE]; memcpy(data, ipc_magic, sizeof(ipc_magic)); - memcpy(data + sizeof(ipc_magic), &payload_length, sizeof(payload_length)); + + // Terminating null character + payload_length+=1; while(client->write_buffer_len + IPC_HEADER_SIZE + payload_length >= client->write_buffer_size) { @@ -361,6 +366,8 @@ ipc_send_event_client(struct cg_ipc_client *client, const char *payload, memcpy(client->write_buffer + client->write_buffer_len, payload, payload_length); client->write_buffer_len += payload_length; + memcpy(client->write_buffer + client->write_buffer_len, "\0", 1); + client->write_buffer_len += 1; } void From f2ebea72de49488b7f1737c6da69d9c6bb8cdea0 Mon Sep 17 00:00:00 2001 From: project-repo Date: Wed, 28 Dec 2022 15:03:37 +0100 Subject: [PATCH 473/689] Fix ipc syntax --- ipc_server.c | 6 ++---- keybinding.c | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/ipc_server.c b/ipc_server.c index 32168b9..d0d432f 100644 --- a/ipc_server.c +++ b/ipc_server.c @@ -336,10 +336,8 @@ ipc_send_event_client(struct cg_ipc_client *client, const char *payload, memcpy(data, ipc_magic, sizeof(ipc_magic)); - // Terminating null character - payload_length+=1; - - while(client->write_buffer_len + IPC_HEADER_SIZE + payload_length >= + // +1 for terminating null character + while(client->write_buffer_len + IPC_HEADER_SIZE + payload_length +1 >= client->write_buffer_size) { client->write_buffer_size *= 2; } diff --git a/keybinding.c b/keybinding.c index 6ebbc5a..5b9eaf7 100644 --- a/keybinding.c +++ b/keybinding.c @@ -835,13 +835,13 @@ print_view(struct cg_view *view) { char *title_str = view->impl->get_title(view); print_str(&outp_str, "\"title\": \"%s\",\n", title_str == NULL ? "" : title_str); - print_str(&outp_str, "\"coords\": [\"x\":%d,\"y\":%d],\n", view->ox, + print_str(&outp_str, "\"coords\": {\"x\":%d,\"y\":%d},\n", view->ox, view->oy); #if CG_HAS_XWAYLAND - print_str(&outp_str, "\"type\": \"%s\",\n", + print_str(&outp_str, "\"type\": \"%s\"\n", view->type == CG_XWAYLAND_VIEW ? "xwayland" : "xdg"); #else - print_str(&outp_str, "\"type\": \"xdg\",\n"); + print_str(&outp_str, "\"type\": \"xdg\"\n"); #endif return dyn_str_to_str(&outp_str); } @@ -854,11 +854,11 @@ print_tile(struct cg_tile *tile) { uint32_t nmemb = 4; outp_str.str_arr = calloc(nmemb, sizeof(char *)); print_str(&outp_str, "\"id\": %d,\n", tile->id); - print_str(&outp_str, "\"coords\": [\"x\":%d,\"y\":%d],\n", tile->tile.x, + print_str(&outp_str, "\"coords\": {\"x\":%d,\"y\":%d},\n", tile->tile.x, tile->tile.y); - print_str(&outp_str, "\"size\": [\"width\":%d,\"height\":%d],\n", + print_str(&outp_str, "\"size\": {\"width\":%d,\"height\":%d},\n", tile->tile.width, tile->tile.height); - print_str(&outp_str, "\"view\": \"%d\",\n", + print_str(&outp_str, "\"view\": \"%d\"\n", tile->view == NULL ? -1 : (int)tile->view->id); return dyn_str_to_str(&outp_str); } @@ -962,7 +962,7 @@ print_workspaces(struct cg_output *outp) { free(ws); } } - print_str(&outp_str, "],\n"); + print_str(&outp_str, "]\n"); return dyn_str_to_str(&outp_str); } @@ -992,7 +992,7 @@ print_outputs(struct cg_server *server) { outp_str.len = 0; outp_str.cur_pos = 0; outp_str.str_arr = calloc((2 * noutps - 1) + 2, sizeof(char *)); - print_str(&outp_str, "\"outputs\": ["); + print_str(&outp_str, "\"outputs\": {"); struct cg_output *it; uint32_t count = 0; wl_list_for_each(it, &server->outputs, link) { @@ -1007,7 +1007,7 @@ print_outputs(struct cg_server *server) { print_str(&outp_str, "%s", outp); free(outp); } - print_str(&outp_str, "],\n"); + print_str(&outp_str, "},\n"); return dyn_str_to_str(&outp_str); } @@ -1025,13 +1025,13 @@ keybinding_dump(struct cg_server *server) { server->bg_color[1], server->bg_color[2], server->bg_color[3]); print_str(&str, "\"views_curr_id\":%d,\n", server->views_curr_id); print_str(&str, "\"tiles_curr_id\":%d,\n", server->tiles_curr_id); - print_str(&str, "\"curr_output\":%s,\n", + print_str(&str, "\"curr_output\":\"%s\",\n", server->curr_output->wlr_output->name); print_modes(&str, server->modes); char *outps_str = print_outputs(server); print_str(&str, "%s", outps_str); free(outps_str); - print_str(&str, "\"cursor_coords\":{\"x\":%f,\"y\":%f},\n", + print_str(&str, "\"cursor_coords\":{\"x\":%f,\"y\":%f}\n", server->seat->cursor->x, server->seat->cursor->y); print_str(&str, "}"); From 85c85972249cb6f223fe747a423137c2549bd3fe Mon Sep 17 00:00:00 2001 From: project-repo Date: Wed, 28 Dec 2022 16:01:14 +0100 Subject: [PATCH 474/689] Add explanation for gpg to SECURITY.md --- SECURITY.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/SECURITY.md b/SECURITY.md index ddf385a..e1e04d8 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -93,3 +93,18 @@ available to all user software over the socket. Software may gain arbitrary code execution rights if it has access to the Cagebreak socket. Privilege escalation to root is unlikely since privileges are dropped before any user input is accepted. + +## GPG Keys of the Cagebreak Repository + +All Cagebreak project keys are found under keys/ in the cagebreak +repository (the public keys anyway). + +The most trusted keys of the Cagebreak project are its signing keys, +all signing keys are signed by at least one of its predecessors and at +least one non-expired signing key is used at the time of release to +sign the commit tag and the release code tarball. + +Signing keys are also used to lend credence to other keys in the Cagebreak +project, such as the keys for email correspondence and the key used in the +cagebreak-pkgbuild repository. + From 4d5acdb4a6c28a631c30c874e4404c0fc675b336 Mon Sep 17 00:00:00 2001 From: project-repo Date: Wed, 28 Dec 2022 16:54:59 +0100 Subject: [PATCH 475/689] Fix config file parsing --- cagebreak.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index 2f839a1..43b8e43 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -176,17 +176,20 @@ set_configuration(struct cg_server *server, uint32_t line_length=64; char *line=calloc(line_length,sizeof(char)); for(unsigned int line_num = 1;; ++line_num) { - do { + while(true) { + if(fgets(line+strlen(line), line_length-strlen(line), config_file) == NULL) { + break; + } + if(strcspn(line,"\n")!=line_length-1) { + break; + } line_length*=2; line=reallocarray(line,line_length,sizeof(char)); if(line == NULL) { wlr_log(WLR_ERROR, "Could not allocate buffer for reading configuration file."); return 1; } - if(fgets(line+strlen(line), line_length-strlen(line), config_file)) { - break; - } - } while(strcspn(line,"\n")==line_length-1); + } if(strlen(line)==0) { break; } From f7d9e69d31dd92f5f049d4b322334acd7beb34ac Mon Sep 17 00:00:00 2001 From: project-repo Date: Wed, 28 Dec 2022 17:40:34 +0100 Subject: [PATCH 476/689] Add option for specifying config file path --- cagebreak.c | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index 43b8e43..e4ca76c 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -129,6 +129,7 @@ usage(FILE *file, const char *const cage) { fprintf(file, "Usage: %s [OPTIONS]\n" "\n" + " -c \t Load configuration file from \n" " -h\t Display this help message\n" " -v\t Show the version number and exit\n" " -s\t Show information about the current setup and exit\n", @@ -136,9 +137,9 @@ usage(FILE *file, const char *const cage) { } static bool -parse_args(struct cg_server *server, int argc, char *argv[]) { +parse_args(struct cg_server *server, int argc, char *argv[], char **config_path) { int c; - while((c = getopt(argc, argv, "hvs")) != -1) { + while((c = getopt(argc, argv, "c:hvs")) != -1) { switch(c) { case 'h': usage(stdout, argv[0]); @@ -149,6 +150,9 @@ parse_args(struct cg_server *server, int argc, char *argv[]) { case 's': show_info = true; break; + case 'c': + *config_path=strdup(optarg); + break; default: usage(stderr, argv[0]); return false; @@ -215,7 +219,10 @@ set_configuration(struct cg_server *server, } char * -get_config_file() { +get_config_file(char *udef_path) { + if(udef_path != NULL) { + return strdup(udef_path); + } const char *config_home_path = getenv("XDG_CONFIG_HOME"); char *addition = "/cagebreak/config"; if(config_home_path == NULL || config_home_path[0] == '\0') { @@ -261,7 +268,8 @@ main(int argc, char *argv[]) { #endif int ret = 0; - if(!parse_args(&server, argc, argv)) { + char *config_path = NULL; + if(!parse_args(&server, argc, argv,&config_path)) { return 1; } @@ -283,9 +291,7 @@ main(int argc, char *argv[]) { /* Wayland requires XDG_RUNTIME_DIR to be set. */ if(!getenv("XDG_RUNTIME_DIR")) { - wlr_log(WLR_ERROR, "XDG_RUNTIME_DIR is not set in the environment"); - free(server.modes); - return 1; + wlr_log(WLR_INFO, "XDG_RUNTIME_DIR is not set in the environment"); } server.wl_display = wl_display_create(); @@ -614,7 +620,7 @@ main(int argc, char *argv[]) { } { // config_file should only be visible as long as it is valid - char *config_file = get_config_file(); + char *config_file = get_config_file(config_path); if(config_file == NULL) { wlr_log(WLR_ERROR, "Unable to get path to config file"); ret = 1; @@ -624,10 +630,14 @@ main(int argc, char *argv[]) { // Configurtion file not found if(conf_ret != 0) { - char *default_conf = "/etc/xdg/cagebreak/config"; - wlr_log(WLR_ERROR, "Loading default configuration file: \"%s\"", - default_conf); - conf_ret = set_configuration(&server, default_conf); + if(config_file == NULL) { + char *default_conf = "/etc/xdg/cagebreak/config"; + wlr_log(WLR_INFO, "Loading default configuration file: \"%s\"", + default_conf); + conf_ret = set_configuration(&server, default_conf); + } else { + conf_ret = 1; + } } if(conf_ret != 0) { @@ -669,6 +679,10 @@ end: } free(server.modes); + if(config_path != NULL) { + free(config_path); + } + #if CG_HAS_XWAYLAND if(xwayland!=NULL) { wlr_xwayland_destroy(xwayland); From dce1f9ee8d4c767c098ee7a3823632ba9d00ec3b Mon Sep 17 00:00:00 2001 From: project-repo Date: Wed, 28 Dec 2022 17:50:55 +0100 Subject: [PATCH 477/689] Add -c option doc to man page --- man/cagebreak.1.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index bb3f62b..a0a04c3 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -32,6 +32,9 @@ are displayed in a message box at the top right of the screen. # OPTIONS +*-c* + Load configuration file from + *-h* Display help message and exit From 8e735264d1639c37be29b64a3db2a7474ac682c8 Mon Sep 17 00:00:00 2001 From: project-repo Date: Wed, 28 Dec 2022 17:57:53 +0100 Subject: [PATCH 478/689] Reformat usage message --- cagebreak.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index e4ca76c..d1ef242 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -130,9 +130,9 @@ usage(FILE *file, const char *const cage) { "Usage: %s [OPTIONS]\n" "\n" " -c \t Load configuration file from \n" - " -h\t Display this help message\n" - " -v\t Show the version number and exit\n" - " -s\t Show information about the current setup and exit\n", + " -h\t\t Display this help message\n" + " -v\t\t Show the version number and exit\n" + " -s\t\t Show information about the current setup and exit\n", cage); } From 50bef0e8f1bf9e652f2f2255800ca74a4a737c78 Mon Sep 17 00:00:00 2001 From: project-repo Date: Wed, 28 Dec 2022 20:33:03 +0100 Subject: [PATCH 479/689] Add dump command to config man page --- man/cagebreak-config.5.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index f73d362..29ebacb 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -89,6 +89,9 @@ definemode foo definekey foo C-t abort ``` +*dump* + Triggers the *dump" event, see *cagebreak-socket(7)* for details + *escape * Set to switch to root mode to execute one command From e1c89b311be4b96fc9036f4b30fd49e862810287 Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 29 Dec 2022 15:47:49 +0100 Subject: [PATCH 480/689] Add support for focussing arbitrary tile --- cagebreak.c | 4 ++-- keybinding.c | 43 ++++++++++++++++++++++++++++++------------- keybinding.h | 1 + parse.c | 15 +++++++++++++++ 4 files changed, 48 insertions(+), 15 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index d1ef242..71b7b61 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -326,8 +326,8 @@ main(int argc, char *argv[]) { } server.nws = 1; - server.views_curr_id = 0; - server.tiles_curr_id = 0; + server.views_curr_id = 1; + server.tiles_curr_id = 1; server.message_config.fg_color[0] = 0.0; server.message_config.fg_color[1] = 0.0; server.message_config.fg_color[2] = 0.0; diff --git a/keybinding.c b/keybinding.c index 08fbea3..9106442 100644 --- a/keybinding.c +++ b/keybinding.c @@ -691,24 +691,38 @@ keybinding_cycle_views(struct cg_server *server, bool reverse, bool ipc) { } void -keybinding_cycle_tiles(struct cg_server *server, bool reverse) { +keybinding_focus_tile(struct cg_server *server, uint32_t tile_id) { struct cg_output *output = server->curr_output; struct cg_workspace *workspace = output->workspaces[output->curr_workspace]; struct cg_tile *old_tile = workspace->focused_tile; - if(reverse) { - workspace_focus_tile(workspace, workspace->focused_tile->prev); - } else { - workspace_focus_tile(workspace, workspace->focused_tile->next); + bool first = true; + for(struct cg_tile *tile = workspace->focused_tile; + first || tile != workspace->focused_tile; tile = tile->next) { + first = false; + if(tile->id==tile_id) { + workspace_focus_tile(workspace, tile); + struct cg_view *next_view = workspace->focused_tile->view; + seat_set_focus(server->seat, next_view); + ipc_send_event( + output->server, + "{\"event_name\":\"focus_tile\",\"old_tile_id\":\"%d\",\"new_tile_" + "id\":\"%d\",\"workspace\":\"%d\",\"output\":\"%s\"}", + old_tile->id, workspace->focused_tile->id, workspace->num + 1, + output->wlr_output->name); + break; + } } - struct cg_view *next_view = workspace->focused_tile->view; +} - seat_set_focus(server->seat, next_view); - ipc_send_event( - output->server, - "{\"event_name\":\"cycle_tiles\",\"old_tile_id\":\"%d\",\"new_tile_" - "id\":\"%d\",\"workspace\":\"%d\",\"output\":\"%s\"}", - old_tile->id, workspace->focused_tile->id, workspace->num + 1, - output->wlr_output->name); +void +keybinding_cycle_tiles(struct cg_server *server, bool reverse) { + struct cg_output *output = server->curr_output; + struct cg_workspace *workspace = output->workspaces[output->curr_workspace]; + if(reverse) { + keybinding_focus_tile(server, workspace->focused_tile->prev->id); + } else { + keybinding_focus_tile(server, workspace->focused_tile->next->id); + } } int @@ -1628,6 +1642,9 @@ run_action(enum keybinding_action action, struct cg_server *server, server->curr_output->workspaces[server->curr_output->curr_workspace] ->focused_tile->view); break; + case KEYBINDING_FOCUS_TILE: + keybinding_focus_tile(server,data.u); + break; default: { wlr_log(WLR_ERROR, "run_action was called with a value not present in \"enum " diff --git a/keybinding.h b/keybinding.h index 82c15ff..e168e0d 100644 --- a/keybinding.h +++ b/keybinding.h @@ -56,6 +56,7 @@ enum keybinding_action { KEYBINDING_FOCUS_RIGHT, KEYBINDING_FOCUS_TOP, KEYBINDING_FOCUS_BOTTOM, + KEYBINDING_FOCUS_TILE, KEYBINDING_DEFINEKEY, // data.kb is the keybinding definition KEYBINDING_BACKGROUND, // data.color is the background color diff --git a/parse.c b/parse.c index 6abc196..f08295b 100644 --- a/parse.c +++ b/parse.c @@ -743,6 +743,21 @@ parse_command(struct cg_server *server, struct keybinding *keybinding, keybinding->action = KEYBINDING_SHOW_INFO; } else if(strcmp(action, "close") == 0) { keybinding->action = KEYBINDING_CLOSE_VIEW; + } else if(strcmp(action, "focus_tile") == 0) { + keybinding->action = KEYBINDING_FOCUS_TILE; + char *nws_str = strtok_r(NULL, " ", &saveptr); + if(nws_str == NULL) { + *errstr = log_error( + "Expected argument for \"focus_tile\" action, got none."); + return -1; + } + + long tile_id = strtol(nws_str, NULL, 10); + if(tile_id < 1) { + *errstr = log_error("Tile id for focus_tile must be a positive integer. Got %l\n", tile_id); + return -1; + } + keybinding->data.u = tile_id; } else if(strcmp(action, "focus") == 0) { keybinding->action = KEYBINDING_CYCLE_TILES; keybinding->data.b = false; From c83aed67284fe4f51e79a4fb638ac9c91dbef337 Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 29 Dec 2022 16:09:33 +0100 Subject: [PATCH 481/689] Remove view_title - Do not set window title, as it cannot be read - Print PID in event instead of title to prevent information leaks --- keybinding.c | 16 +++++++--------- output.c | 13 ------------- seat.c | 4 ---- view.c | 19 +++++-------------- view.h | 4 +--- xdg_shell.c | 14 ++++++++------ xwayland.c | 12 ++++++------ 7 files changed, 27 insertions(+), 55 deletions(-) diff --git a/keybinding.c b/keybinding.c index 9106442..a9047e5 100644 --- a/keybinding.c +++ b/keybinding.c @@ -838,9 +838,7 @@ print_view(struct cg_view *view) { uint32_t nmemb = 4; outp_str.str_arr = calloc(nmemb, sizeof(char *)); print_str(&outp_str, "\"id\": %d,\n", view->id); - char *title_str = view->impl->get_title(view); - print_str(&outp_str, "\"title\": \"%s\",\n", - title_str == NULL ? "" : title_str); + print_str(&outp_str, "\"pid\": \"%d\",\n", view->impl->get_pid(view)); print_str(&outp_str, "\"coords\": {\"x\":%d,\"y\":%d},\n", view->ox, view->oy); #if CG_HAS_XWAYLAND @@ -1314,18 +1312,18 @@ keybinding_move_view_to_output(struct cg_server *server, int output_num) { workspace_tile_update_view(ws->focused_tile,view); seat_set_focus(server->seat, view); } - char *view_title = ""; + pid_t view_pid = -1; int view_id = -1; if(view != NULL) { - view_title = view->impl->get_title(view); + view_pid = view->impl->get_pid(view); view_id = view->id; } ipc_send_event( server, "{\"event_name\":\"move_view_to_output\",\"view_id\":\"%d\",\"old_" - "output\":\"%s\",\"new_output\":\"%s\",\"view_title\":\"%s\"}", + "output\":\"%s\",\"new_output\":\"%s\",\"view_pid\":\"%d\"}", view_id, old_outp->wlr_output->name, - server->curr_output->wlr_output->name, view_title); + server->curr_output->wlr_output->name, view_pid); } void @@ -1358,10 +1356,10 @@ keybinding_move_view_to_workspace(struct cg_server *server, uint32_t ws) { ipc_send_event(server, "{\"event_name\":\"move_view_to_ws\",\"view_id\":\"%d\"," "\"old_workspace\":\"%d\",\"new_workspace\":\"%d\"," - "\"output\":\"%s\",\"view_title\":\"%s\"}", + "\"output\":\"%s\",\"view_pid\":\"%d\"}", view == NULL ? -1 : (int)view->id, old_ws, ws, server->curr_output->wlr_output->name, - view == NULL ? "" : view->impl->get_title(view)); + view == NULL ? 0 : view->impl->get_pid(view)); } void diff --git a/output.c b/output.c index ed422b9..ed7855f 100644 --- a/output.c +++ b/output.c @@ -576,16 +576,3 @@ handle_new_output(struct wl_listener *listener, void *data) { #if CG_HAS_FANALYZE #pragma GCC diagnostic pop #endif - -void -output_set_window_title(struct cg_output *output, const char *title) { - struct wlr_output *wlr_output = output->wlr_output; - - if(wlr_output_is_wl(wlr_output)) { - wlr_wl_output_set_title(wlr_output, title); -#if WLR_HAS_X11_BACKEND - } else if(wlr_output_is_x11(wlr_output)) { - wlr_x11_output_set_title(wlr_output, title); -#endif - } -} diff --git a/seat.c b/seat.c index 03a940c..875287b 100644 --- a/seat.c +++ b/seat.c @@ -1040,10 +1040,6 @@ seat_set_focus(struct cg_seat *seat, struct cg_view *view) { } view_activate(view, true); - char *title = view_get_title(view); - - output_set_window_title(server->curr_output, title); - free(title); struct wlr_keyboard *keyboard = wlr_seat_get_keyboard(wlr_seat); wlr_seat_keyboard_end_grab(wlr_seat); diff --git a/view.c b/view.c index b0fabe2..8afb697 100644 --- a/view.c +++ b/view.c @@ -52,15 +52,6 @@ view_get_prev_view(struct cg_view *view) { return prev; } -char * -view_get_title(const struct cg_view *view) { - const char *title = view->impl->get_title(view); - if(!title) { - return NULL; - } - return strndup(title, strlen(title)); -} - bool view_is_primary(const struct cg_view *view) { return view->impl->is_primary(view); @@ -113,7 +104,7 @@ view_unmap(struct cg_view *view) { uint32_t tile_id = 0; uint32_t ws = view->workspace->num; char *output_name = view->workspace->output->wlr_output->name; - char *title = view->impl->get_title(view); + pid_t pid = view->impl->get_pid(view); /* If the view is not mapped, do nothing */ if(view->wlr_surface == NULL) { return; @@ -162,8 +153,8 @@ view_unmap(struct cg_view *view) { ipc_send_event( view->workspace->server, "{\"event_name\":\"view_unmap\",\"view_id\":\"%d\",\"tile_id\":\"%d\"," - "\"workspace\":\"%d\",\"output\":\"%s\",\"view_title\":\"%s\"}", - id, tile_id, ws + 1, output_name, title); + "\"workspace\":\"%d\",\"output\":\"%s\",\"view_pid\":\"%d\"}", + id, tile_id, ws + 1, output_name, pid); } void @@ -205,9 +196,9 @@ view_map(struct cg_view *view, struct wlr_surface *surface, ipc_send_event( output->server, "{\"event_name\":\"view_map\",\"view_id\":\"%d\",\"tile_id\":\"%d\"," - "\"workspace\":\"%d\",\"output\":\"%s\",\"view_title\":\"%s\"}", + "\"workspace\":\"%d\",\"output\":\"%s\",\"view_pid\":\"%d\"}", view->id, tile_id, view->workspace->num + 1, - view->workspace->output->wlr_output->name, view->impl->get_title(view)); + view->workspace->output->wlr_output->name, view->impl->get_pid(view)); } void diff --git a/view.h b/view.h index 47a5221..df41547 100644 --- a/view.h +++ b/view.h @@ -35,7 +35,7 @@ struct cg_view { }; struct cg_view_impl { - char *(*get_title)(const struct cg_view *view); + pid_t (*get_pid)(const struct cg_view *view); bool (*is_primary)(const struct cg_view *view); void (*activate)(struct cg_view *view, bool activate); void (*close)(struct cg_view *view); @@ -43,8 +43,6 @@ struct cg_view_impl { void (*destroy)(struct cg_view *view); }; -char * -view_get_title(const struct cg_view *view); struct cg_tile * view_get_tile(const struct cg_view *view); bool diff --git a/xdg_shell.c b/xdg_shell.c index c6ce196..4c32142 100644 --- a/xdg_shell.c +++ b/xdg_shell.c @@ -106,11 +106,13 @@ xdg_shell_view_from_const_view(const struct cg_view *view) { return (const struct cg_xdg_shell_view *)view; } -static char * -get_title(const struct cg_view *view) { - const struct cg_xdg_shell_view *xdg_shell_view = - xdg_shell_view_from_const_view(view); - return xdg_shell_view->xdg_surface->toplevel->title; +static pid_t +get_pid(const struct cg_view *view) { + pid_t pid; + struct wl_client *client = + wl_resource_get_client(view->wlr_surface->resource); + wl_client_get_credentials(client, &pid, NULL, NULL); + return pid; } static bool @@ -198,7 +200,7 @@ handle_xdg_shell_surface_destroy(struct wl_listener *listener, void *_data) { view_destroy(view); } -static const struct cg_view_impl xdg_shell_view_impl = {.get_title = get_title, +static const struct cg_view_impl xdg_shell_view_impl = {.get_pid = get_pid, .is_primary = is_primary, .activate = activate, diff --git a/xwayland.c b/xwayland.c index 88db55f..42344a0 100644 --- a/xwayland.c +++ b/xwayland.c @@ -44,11 +44,11 @@ xwayland_view_should_manage(const struct cg_view *view) { return !xwayland_surface->override_redirect; } -static char * -get_title(const struct cg_view *view) { - const struct cg_xwayland_view *xwayland_view = - xwayland_view_from_const_view(view); - return xwayland_view->xwayland_surface->title; +static pid_t +get_pid(const struct cg_view *view) { + struct wlr_xwayland_surface *surf = + wlr_xwayland_surface_from_wlr_surface(view->wlr_surface); + return surf->pid; } static bool @@ -160,7 +160,7 @@ handle_xwayland_surface_destroy(struct wl_listener *listener, void *_data) { } static const struct cg_view_impl xwayland_view_impl = { - .get_title = get_title, + .get_pid = get_pid, .is_primary = is_primary, .activate = activate, .close = close, From 3a66943513f64eb340e19a2c05ddacc561162a97 Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 29 Dec 2022 16:20:12 +0100 Subject: [PATCH 482/689] Add option for disabling socket --- cagebreak.c | 7 ++++++- ipc_server.c | 6 ++++++ server.h | 1 + 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/cagebreak.c b/cagebreak.c index 71b7b61..c44b2eb 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -130,6 +130,7 @@ usage(FILE *file, const char *const cage) { "Usage: %s [OPTIONS]\n" "\n" " -c \t Load configuration file from \n" + " -d\t\t Disable socket\n" " -h\t\t Display this help message\n" " -v\t\t Show the version number and exit\n" " -s\t\t Show information about the current setup and exit\n", @@ -139,7 +140,8 @@ usage(FILE *file, const char *const cage) { static bool parse_args(struct cg_server *server, int argc, char *argv[], char **config_path) { int c; - while((c = getopt(argc, argv, "c:hvs")) != -1) { + server->enable_socket=true; + while((c = getopt(argc, argv, "c:hvsd")) != -1) { switch(c) { case 'h': usage(stdout, argv[0]); @@ -153,6 +155,9 @@ parse_args(struct cg_server *server, int argc, char *argv[], char **config_path) case 'c': *config_path=strdup(optarg); break; + case 'd': + server->enable_socket=false; + break; default: usage(stderr, argv[0]); return false; diff --git a/ipc_server.c b/ipc_server.c index 02ff68e..55ddfad 100644 --- a/ipc_server.c +++ b/ipc_server.c @@ -50,6 +50,9 @@ handle_display_destroy(struct wl_listener *listener, void *data) { int ipc_init(struct cg_server *server) { + if(server->enable_socket == false) { + return 0; + } struct cg_ipc_handle *ipc = &server->ipc; ipc->socket = socket(AF_UNIX, SOCK_STREAM, 0); if(ipc->socket == -1) { @@ -374,6 +377,9 @@ ipc_send_event_client(struct cg_ipc_client *client, const char *payload, void ipc_send_event(struct cg_server *server, const char *fmt, ...) { + if(server->enable_socket == false) { + return; + } if(wl_list_empty(&server->ipc.client_list)) { return; } diff --git a/server.h b/server.h index 92ee933..a15048c 100644 --- a/server.h +++ b/server.h @@ -52,6 +52,7 @@ struct cg_server { struct cg_ipc_handle ipc; + bool enable_socket; bool running; char **modes; uint16_t nws; From 46671bb8fa0e707a45b492f01852176342587d8b Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 29 Dec 2022 21:15:18 +0100 Subject: [PATCH 483/689] Fix compilation error for man page --- man/cagebreak-config.5.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index 29ebacb..2d8bb8c 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -90,7 +90,7 @@ definekey foo C-t abort ``` *dump* - Triggers the *dump" event, see *cagebreak-socket(7)* for details + Triggers the *dump* event, see *cagebreak-socket(7)* for details *escape * Set to switch to root mode to execute one command From 18e6569712ef6f77a35ddc50899dc292f557a679 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 30 Dec 2022 07:42:23 +0100 Subject: [PATCH 484/689] Add support for customizing keyboard repeat info --- input_manager.c | 23 ++++++++++++++++++++- input_manager.h | 2 ++ keybinding.c | 3 ++- parse.c | 54 ++++++++++++++++++++++++++++++++----------------- seat.c | 1 - 5 files changed, 61 insertions(+), 22 deletions(-) diff --git a/input_manager.c b/input_manager.c index 016a52a..8e65e4d 100644 --- a/input_manager.c +++ b/input_manager.c @@ -29,6 +29,7 @@ #include #include #include +#include #include void @@ -124,6 +125,8 @@ input_manager_create_empty_input_config() { /* Keyboards */ cfg->enable_keybindings=-1; + cfg->repeat_delay=-1; + cfg->repeat_rate=-1; return cfg; } @@ -221,15 +224,33 @@ input_manager_merge_input_configs(struct cg_input_config* cfg1, struct cg_input_ } else { out_cfg->enable_keybindings=cfg1->enable_keybindings; } + if(cfg1->repeat_delay == -1) { + out_cfg->repeat_delay=cfg2->repeat_delay; + } else { + out_cfg->repeat_delay=cfg1->repeat_delay; + } + if(cfg1->repeat_rate == -1) { + out_cfg->repeat_rate=cfg2->repeat_rate; + } else { + out_cfg->repeat_rate=cfg1->repeat_rate; + } return out_cfg; } void apply_keyboard_group_config(struct cg_input_config *config, struct cg_keyboard_group *group) { - if(group->enable_keybindings!=-1) { + if(config->enable_keybindings!=-1) { group->enable_keybindings=config->enable_keybindings; } + int repeat_delay=600,repeat_rate=25; + if(config->repeat_delay != -1) { + repeat_delay=config->repeat_delay; + } + if(config->repeat_rate != -1) { + repeat_rate=config->repeat_rate; + } + wlr_keyboard_set_repeat_info(&group->wlr_group->keyboard, repeat_rate, repeat_delay); } void diff --git a/input_manager.h b/input_manager.h index c96998d..bf74a10 100644 --- a/input_manager.h +++ b/input_manager.h @@ -103,6 +103,8 @@ struct cg_input_config { /* Keyboards */ int enable_keybindings; + int repeat_delay; + int repeat_rate; }; struct cg_input_device { diff --git a/keybinding.c b/keybinding.c index a9047e5..0ee70a1 100644 --- a/keybinding.c +++ b/keybinding.c @@ -1026,13 +1026,14 @@ print_keyboard_group(struct cg_keyboard_group *grp) { struct dyn_str outp_str; outp_str.len = 0; outp_str.cur_pos = 0; - uint32_t nmemb = 4; + uint32_t nmemb = 5; outp_str.str_arr = calloc(nmemb, sizeof(char *)); if(grp->identifier!=NULL) { print_str(&outp_str, "\"%s\": {\n", grp->identifier); } else { print_str(&outp_str, "\"NULL\": {\n"); } + print_str(&outp_str, "\"commands_enabled\": %d,\n", grp->enable_keybindings); print_str(&outp_str, "\"repeat_delay\": %d,\n", grp->wlr_group->keyboard.repeat_info.delay); print_str(&outp_str, "\"repeat_rate\": %d\n", grp->wlr_group->keyboard.repeat_info.rate); print_str(&outp_str, "}"); diff --git a/parse.c b/parse.c index f08295b..a504dbf 100644 --- a/parse.c +++ b/parse.c @@ -117,6 +117,25 @@ parse_float(char **saveptr, const char *delim) { } } +int +parse_uint(char **saveptr, const char *delim) { + char *uint_str = strtok_r(NULL, delim, saveptr); + if(uint_str == NULL) { + wlr_log(WLR_ERROR, "Expected a non-negative integer, got nothing"); + return -1; + } + long uint = strtol(uint_str, NULL, 10); + if(uint >= 0 && uint <= INT_MAX) { + return uint; + } else { + wlr_log(WLR_ERROR, + "Error parsing non-negative integer. Must be a number larger " + "or equal to 0 and less or equal to %d", + INT_MAX); + return -1; + } +} + struct cg_input_config * parse_input_config(char **saveptr, char **errstr) { struct cg_input_config *cfg=input_manager_create_empty_input_config(); @@ -330,6 +349,22 @@ parse_input_config(char **saveptr, char **errstr) { "Invalid option \"%s\" to setting \"keybindings\"", value); goto error; } + } else if(strcmp(setting, "repeat_delay") == 0) { + cfg->repeat_delay = parse_uint(saveptr, " "); + if(cfg->repeat_delay < 0 ) { + *errstr = log_error("Invalid option \"%s\" to setting " + "\"repeat_delay\", expected positive integer", + value); + goto error; + } + } else if(strcmp(setting, "repeat_rate") == 0) { + cfg->repeat_rate = parse_uint(saveptr, " "); + if(cfg->repeat_rate < 0 ) { + *errstr = log_error("Invalid option \"%s\" to setting " + "\"repeat_rate\", expected positive integer", + value); + goto error; + } } else { *errstr = log_error("Invalid option to command \"input\""); goto error; @@ -470,25 +505,6 @@ parse_workspaces(char **saveptr, char **errstr) { return nws; } -int -parse_uint(char **saveptr, const char *delim) { - char *uint_str = strtok_r(NULL, delim, saveptr); - if(uint_str == NULL) { - wlr_log(WLR_ERROR, "Expected a non-negative integer, got nothing"); - return -1; - } - long uint = strtol(uint_str, NULL, 10); - if(uint >= 0 && uint <= INT_MAX) { - return uint; - } else { - wlr_log(WLR_ERROR, - "Error parsing non-negative integer. Must be a number larger " - "or equal to 0 and less or equal to %d", - INT_MAX); - return -1; - } -} - int parse_output_config_keyword(char *key_str, enum output_status *status) { if(key_str == NULL) { diff --git a/seat.c b/seat.c index 875287b..7fac95b 100644 --- a/seat.c +++ b/seat.c @@ -422,7 +422,6 @@ new_keyboard(struct cg_seat *seat, struct cg_input_device *input_device) { xkb_keymap_unref(keymap); xkb_context_unref(context); - wlr_keyboard_set_repeat_info(device->keyboard, 25, 600); cg_keyboard_group_add(input_device, seat); ++seat->num_keyboards; From 22068b3bbf41ca5fd7dae02797adfd31513db00d Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 30 Dec 2022 17:52:33 +0100 Subject: [PATCH 485/689] Add socket documentation --- man/cagebreak-socket.7.md | 210 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 210 insertions(+) diff --git a/man/cagebreak-socket.7.md b/man/cagebreak-socket.7.md index bad6bd6..a83c4e1 100644 --- a/man/cagebreak-socket.7.md +++ b/man/cagebreak-socket.7.md @@ -18,6 +18,23 @@ Events are provided as output as specified in this man page. ## EVENTS +Events have a general structure as follows: + +``` +cg-ipca json object depending on the eventNULL +``` + +Here is an example of how this works using only as a command over the socket + +``` +only +cg-ipc{"event_name":"fullscreen","tile_id":"2","workspace":"1","output":"eDP-1"}cg-ipc{"event_name":"cycle_views","old_view_id":"6","new_view_id":"0","tile_id":"2","workspace":"1","output":"eDP-1"} +``` + +This documentation includes the trigger for the event, the keys and the data +type of the values of each event. + +TODO *foo * Set x of y - <[x|y|z]> are foos between 0 and 1. @@ -28,6 +45,199 @@ Events are provided as output as specified in this man page. example ``` +*background* + - Trigger: Setting new Background via *background* command + - JSON + - event_name: "background" + - old_bg: list of three floating point numbers denoting the old background in rgb + - new_bg: list of three floating point numbers denoting the new background in rgb + +``` +background 0 1.0 0 +cg-ipc{"event_name":"background","old_bg":"[0.000000,1.000000,1.000000]","new_bg":"[0.000000,1.000000,0.000000]"} +``` + +*close* + - Trigger: Closure of a view via *close* command + - JSON + - event_name: "close" + - view_id: view id as an integer + - title_id: title id as an integer + - workspace: workspace number as an integer + - output: name of the output as a string + +``` +close +cg-ipc{"event_name":"close","view_id":"47","tile_id":"47","workspace":"1","output":"eDP-1"} +``` + +*configure_input* + + +*configure_message* + +configure_output + +*cursor_switch_tile* + - Trigger: Cursor crosses the border between tiles + - JSON + - event_name: "cursor_switch_tile" + - old_output: name of the old output as a string + - old_tile: number of the old tile as an integer + - new_output: name of the new output as a string + - new_tile: number of the new tile as an integer + +``` +# Cursor switches tile +cg-ipc{"event_name":"cursor_switch_tile","old_output":"eDP-1","old_tile":"2","new_output":"eDP-1","new_tile":"3"} +``` + +*cycle_outputs* + +cycle_views + +definekey + +definemode + +dump + - Trigger: *dump* command + - JSON + - event_name: "dump" + - nws: number of workspaces as an integer + - bg_color: list of three floating point numbers denoting the new background in rgba + - views_curr_id: TODO + - tiles_curr_id: TODO + - curr_output: current output as a string + - modes: list of names of modes as strings + - outputs: object of objects for each output + - output name as string + - priority: priority as per *output* prio in *cagebreak-config(5)* or default + - coords: object of x and y coordinates of output + - TODO + - size: object of width and height as integers TODO + - refresh_rate: refresh rate as float TODO + - curr_workspace: current workspace as an integer + - workspaces: list of objects for each workspace + - views: list of objects for each view + - id: view id as an integer + - pid: pid of the process which opened the view as an integer + - coords: object of x and y coordinates + - type: ["xdg"|"xwayland"] + - tiles: list of objects for all tiles + - id: tile id as an integer + - coords: object of x and y coordinates + - size: object of width and height + - view: view id as an integer + - keyboards: object of objects for each keyboard + - name_of_keyboard: object for a keyboard + - repeat_delay: repeat delay in milliseconds as an integer + - repeat_rate: repeat rate in hertz as an integer + - cursor_coords: object of x and y coordinates + +``` +dump +cg-ipc{"event_name":"dump","nws":1, +"bg_color":[0.000000,0.000000,0.000000,1.000000], +"views_curr_id":9, +"tiles_curr_id":3, +"curr_output":"eDP-1", +"modes":["top","root","resize"], +"outputs": {"eDP-1": { +"priority": -1, +"coords": {"x":0,"y":0}, +"size": {"width":2560,"height":1440}, +"refresh_rate": 60.012000, +"curr_workspace": 0, +"workspaces": [{"views": [{ +"id": 4, +"pid": "37878", +"coords": {"x":0,"y":0}, +"type": "xwayland" + +},{ +"id": 8, +"pid": "38279", +"coords": {"x":1280,"y":0}, +"type": "xdg" + +}],"tiles": [{ +"id": 2, +"coords": {"x":1280,"y":0}, +"size": {"width":1280,"height":1440}, +"view": "8" + +},{ +"id": 1, +"coords": {"x":0,"y":0}, +"size": {"width":1280,"height":1440}, +"view": "4" + +}]}] +}} +,"keyboards": {"0:1:Power_Button": { +"repeat_delay": 600, +"repeat_rate": 25 +}} +,"cursor_coords":{"x":1737.440431,"y":677.906813} +} +``` + +focus_tile + +*fullscreen* + - Trigger: *only* command + - JSON + - event_name: "fullscreen" + - tile_id: tile id as an integer + - workspace: workspace number as an integer + - output: output as a string + +``` +only +cg-ipc{"event_name":"fullscreen","tile_id":"3","workspace":"1","output":"eDP-1"} +``` + +move_view_cycle_output + +move_view_to_output + +move_view_to_ws + +new_output + +resize_tile + +set_nws + +split + - Trigger: *split* command + - JSON + - event_name: "split" + - tile_id: old tile id as an integer + - new_tile_id: new tile id as an integer + - workspace: workspace number as an integer + - output: output as a string + - vertical: "0" if horizontal split, "1" if not + +``` +hsplit +cg-ipc{"event_name":"split","tile_id":"11","new_tile_id":"12","workspace":"1","output":"eDP-1","vertical":"0"} +``` + +*swap_tile* + - Trigger: + +switch_default_mode + +switch_output + +switch_ws + +view_map + +view_unmap + ## SECURITY The socket is restricted to the user for reading, writing and execution (700). From 7555b379e33fade0c4091458e8ad241e8eae9a31 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 30 Dec 2022 18:09:00 +0100 Subject: [PATCH 486/689] Add documentation for socket --- man/cagebreak-socket.7.md | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/man/cagebreak-socket.7.md b/man/cagebreak-socket.7.md index a83c4e1..e2b27d7 100644 --- a/man/cagebreak-socket.7.md +++ b/man/cagebreak-socket.7.md @@ -234,9 +234,35 @@ switch_output switch_ws -view_map +*view_map* + - Trigger: view is opened by a process + - JSON + - event_name: "view_map" + - view_id: view id as an integer + - tile_id: tile id as an integer + - workspace: workspace number as an integer + - output: name of the output as a string + - view_pid: pid of the process -view_unmap +``` +# process opens a view +cg-ipc{"event_name":"view_map","view_id":"28","tile_id":"14","workspace":"1","output":"eDP-1","view_pid":"39827"} +``` + +*view_unmap* + - Trigger: view is closed by a process + - JSON + - event_name: "view_unmap* + - view_id: view id as an integer + - tile_id: tile id as an integer + - workspace: workspace number as an integer + - output: name of the output as a string + - view_pid: pid of the process + +``` +# view is closed by the process +cg-ipc{"event_name":"view_unmap","view_id":"24","tile_id":"13","workspace":"1","output":"eDP-1","view_pid":"39544"} +``` ## SECURITY From 134ba83f0048a0b6c77184a502de5101c40ee005 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 30 Dec 2022 18:14:58 +0100 Subject: [PATCH 487/689] Fix typo in socket man page --- man/cagebreak-socket.7.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/man/cagebreak-socket.7.md b/man/cagebreak-socket.7.md index e2b27d7..befc4f2 100644 --- a/man/cagebreak-socket.7.md +++ b/man/cagebreak-socket.7.md @@ -210,7 +210,7 @@ resize_tile set_nws -split +*split* - Trigger: *split* command - JSON - event_name: "split" @@ -252,7 +252,7 @@ cg-ipc{"event_name":"view_map","view_id":"28","tile_id":"14","workspace":"1","ou *view_unmap* - Trigger: view is closed by a process - JSON - - event_name: "view_unmap* + - event_name: "view_unmap" - view_id: view id as an integer - tile_id: tile id as an integer - workspace: workspace number as an integer From 7e6fb865e7e828bcad0cbaafd51d6397bf84ad95 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 30 Dec 2022 18:17:58 +0100 Subject: [PATCH 488/689] Fix socket man page --- man/cagebreak-socket.7.md | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/man/cagebreak-socket.7.md b/man/cagebreak-socket.7.md index befc4f2..d0b0190 100644 --- a/man/cagebreak-socket.7.md +++ b/man/cagebreak-socket.7.md @@ -21,30 +21,19 @@ Events are provided as output as specified in this man page. Events have a general structure as follows: ``` -cg-ipca json object depending on the eventNULL +"cg-ipc"json object depending on the eventNULL ``` Here is an example of how this works using only as a command over the socket ``` only -cg-ipc{"event_name":"fullscreen","tile_id":"2","workspace":"1","output":"eDP-1"}cg-ipc{"event_name":"cycle_views","old_view_id":"6","new_view_id":"0","tile_id":"2","workspace":"1","output":"eDP-1"} +cg-ipc{"event_name":"fullscreen","tile_id":"2","workspace":"1","output":"eDP-1"} ``` This documentation includes the trigger for the event, the keys and the data type of the values of each event. -TODO -*foo * - Set x of y - <[x|y|z]> are foos - between 0 and 1. - This is a full sentence. - -``` -# Comment -example -``` - *background* - Trigger: Setting new Background via *background* command - JSON From 0c335e84d30132dc4560a38cd379195a6e3386a3 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 30 Dec 2022 19:14:04 +0100 Subject: [PATCH 489/689] Add input devices to dump output --- input_manager.h | 2 +- keybinding.c | 51 ++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 51 insertions(+), 2 deletions(-) diff --git a/input_manager.h b/input_manager.h index bf74a10..9a82ce3 100644 --- a/input_manager.h +++ b/input_manager.h @@ -111,7 +111,7 @@ struct cg_input_device { char *identifier; struct cg_server *server; struct wlr_input_device *wlr_device; - struct wl_list link; + struct wl_list link;//input_manager::devices struct wl_listener device_destroy; bool is_virtual; diff --git a/keybinding.c b/keybinding.c index 0ee70a1..91eefbe 100644 --- a/keybinding.c +++ b/keybinding.c @@ -1066,12 +1066,56 @@ print_keyboard_groups(struct cg_server *server) { return dyn_str_to_str(&outp_str); } +char * +print_input_device(struct cg_input_device *dev) { + struct dyn_str outp_str; + outp_str.len = 0; + outp_str.cur_pos = 0; + uint32_t nmemb = 4; + outp_str.str_arr = calloc(nmemb, sizeof(char *)); + if(dev->identifier!=NULL) { + print_str(&outp_str, "\"%s\": {\n", dev->identifier); + } else { + print_str(&outp_str, "\"NULL\": {\n"); + } + print_str(&outp_str, "\"is_virtual\": %d,\n", dev->is_virtual); + print_str(&outp_str, "\"type\": \"%s\",\n", dev->wlr_device->type==WLR_INPUT_DEVICE_POINTER?"pointer":dev->wlr_device->type==WLR_INPUT_DEVICE_SWITCH?"switch":dev->wlr_device->type==WLR_INPUT_DEVICE_TABLET_PAD?"tablet pad":dev->wlr_device->type==WLR_INPUT_DEVICE_TABLET_TOOL?"tablet tool":dev->wlr_device->type==WLR_INPUT_DEVICE_TOUCH?"touch":dev->wlr_device->type==WLR_INPUT_DEVICE_KEYBOARD?"keyboard":"unknown"); + print_str(&outp_str, "}"); + return dyn_str_to_str(&outp_str); +} + +char * +print_input_devices(struct cg_server *server) { + uint32_t ninps = wl_list_length(&server->input->devices); + struct dyn_str outp_str; + outp_str.len = 0; + outp_str.cur_pos = 0; + outp_str.str_arr = calloc((2 * ninps - 1) + 2, sizeof(char *)); + print_str(&outp_str, "\"input_devices\": {"); + struct cg_input_device *it; + uint32_t count = 0; + wl_list_for_each(it, &server->input->devices, link) { + if(count != 0) { + print_str(&outp_str, ","); + } + ++count; + char *outp = print_input_device(it); + if(outp == NULL) { + continue; + } + print_str(&outp_str, "%s", outp); + free(outp); + } + print_str(&outp_str, "}\n"); + return dyn_str_to_str(&outp_str); +} + void keybinding_dump(struct cg_server *server) { struct dyn_str str; str.len = 0; str.cur_pos = 0; - uint32_t nmemb = 11; + uint32_t nmemb = 12; str.str_arr = calloc(nmemb, sizeof(char *)); print_str(&str, "{\"event_name\":\"dump\","); @@ -1093,6 +1137,11 @@ keybinding_dump(struct cg_server *server) { print_str(&str, "%s,", keyboards_str); free(keyboards_str); } + char *input_dev_str = print_input_devices(server); + if(input_dev_str!=NULL) { + print_str(&str, "%s,", input_dev_str); + free(input_dev_str); + } print_str(&str, "\"cursor_coords\":{\"x\":%f,\"y\":%f}\n", server->seat->cursor->x, server->seat->cursor->y); print_str(&str, "}"); From 8d78a173200056d3fa419d275fbd651ee8b8adfd Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 30 Dec 2022 19:15:26 +0100 Subject: [PATCH 490/689] Change socket to opt-in --- cagebreak.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index c44b2eb..2de648c 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -130,7 +130,7 @@ usage(FILE *file, const char *const cage) { "Usage: %s [OPTIONS]\n" "\n" " -c \t Load configuration file from \n" - " -d\t\t Disable socket\n" + " -e\t\t Enable socket\n" " -h\t\t Display this help message\n" " -v\t\t Show the version number and exit\n" " -s\t\t Show information about the current setup and exit\n", @@ -140,8 +140,8 @@ usage(FILE *file, const char *const cage) { static bool parse_args(struct cg_server *server, int argc, char *argv[], char **config_path) { int c; - server->enable_socket=true; - while((c = getopt(argc, argv, "c:hvsd")) != -1) { + server->enable_socket=false; + while((c = getopt(argc, argv, "c:hvse")) != -1) { switch(c) { case 'h': usage(stdout, argv[0]); @@ -155,8 +155,8 @@ parse_args(struct cg_server *server, int argc, char *argv[], char **config_path) case 'c': *config_path=strdup(optarg); break; - case 'd': - server->enable_socket=false; + case 'e': + server->enable_socket=true; break; default: usage(stderr, argv[0]); From 7da953ca20e0a8b378561b734e3fb92578e085d4 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 30 Dec 2022 19:45:25 +0100 Subject: [PATCH 491/689] Add option for disabling cursor --- keybinding.c | 21 +++++++++++++++++++-- keybinding.h | 1 + parse.c | 19 +++++++++++++++++++ seat.c | 20 +++++++++++++------- seat.h | 1 + 5 files changed, 53 insertions(+), 9 deletions(-) diff --git a/keybinding.c b/keybinding.c index 91eefbe..94b0ca4 100644 --- a/keybinding.c +++ b/keybinding.c @@ -1523,6 +1523,18 @@ keybinding_configure_message(struct cg_server *server, ipc_send_event(server, "{\"event_name\":\"configure_message\"}"); } +void +set_cursor(bool enabled,struct cg_seat* seat) { + if(enabled==true) { + seat->enable_cursor=true; + wlr_xcursor_manager_set_cursor_image(seat->xcursor_manager, + DEFAULT_XCURSOR, seat->cursor); + } else { + seat->enable_cursor=false; + wlr_cursor_set_image(seat->cursor, NULL, 0, 0, 0, 0, 0, 0); + } +} + /* Hint: see keybinding.h for details on "data" */ int run_action(enum keybinding_action action, struct cg_server *server, @@ -1533,6 +1545,9 @@ run_action(enum keybinding_action action, struct cg_server *server, break; case KEYBINDING_CHANGE_TTY: return keybinding_switch_vt(server->backend, data.u); + case KEYBINDING_CURSOR: + set_cursor(data.i,server->seat); + break; case KEYBINDING_LAYOUT_FULLSCREEN: keybinding_workspace_fullscreen(server); break; @@ -1571,8 +1586,10 @@ run_action(enum keybinding_action action, struct cg_server *server, case KEYBINDING_SWITCH_MODE: if(data.u!=server->seat->default_mode) { wlr_seat_pointer_notify_clear_focus(server->seat->seat); - wlr_xcursor_manager_set_cursor_image(server->seat->xcursor_manager, - "dot_box_mask", server->seat->cursor); + if(server->seat->enable_cursor==true) { + wlr_xcursor_manager_set_cursor_image(server->seat->xcursor_manager, + "dot_box_mask", server->seat->cursor); + } } server->seat->mode = data.u; break; diff --git a/keybinding.h b/keybinding.h index e168e0d..45784b5 100644 --- a/keybinding.h +++ b/keybinding.h @@ -46,6 +46,7 @@ enum keybinding_action { KEYBINDING_SHOW_TIME, KEYBINDING_SHOW_INFO, KEYBINDING_DISPLAY_MESSAGE, + KEYBINDING_CURSOR, KEYBINDING_SWAP_LEFT, KEYBINDING_SWAP_RIGHT, diff --git a/parse.c b/parse.c index a504dbf..bd8ebae 100644 --- a/parse.c +++ b/parse.c @@ -478,6 +478,19 @@ parse_escape(char **saveptr, char **errstr) { return keybinding; } +int +parse_cursor(char **saveptr, char **errstr) { + if(strcmp(*saveptr,"enable")==0) { + return 1; + } else if(strcmp(*saveptr,"disable")==0) { + return 0; + } else { + wlr_log(WLR_ERROR, + "Invalid option \"%s\" for \"cursor\". Expected \"enable\" or \"disable\".", *saveptr); + return -1; + } +} + char * parse_definemode(char **saveptr, char **errstr) { char *mode = strtok_r(NULL, " ", saveptr); @@ -979,6 +992,12 @@ parse_command(struct cg_server *server, struct keybinding *keybinding, if(keybinding->data.kb == NULL) { return -1; } + } else if(strcmp(action, "cursor") == 0) { + keybinding->action = KEYBINDING_CURSOR; + keybinding->data.i = parse_cursor(&saveptr, errstr); + if(keybinding->data.i < 0) { + return -1; + } } else if(strcmp(action, "definemode") == 0) { keybinding->action = KEYBINDING_DEFINEMODE; keybinding->data.c = parse_definemode(&saveptr, errstr); diff --git a/seat.c b/seat.c index 7fac95b..ad60682 100644 --- a/seat.c +++ b/seat.c @@ -63,7 +63,7 @@ update_capabilities(const struct cg_seat *seat) { wlr_seat_set_capabilities(seat->seat, caps); /* Hide cursor if the seat doesn't have pointer capability. */ - if((caps & WL_SEAT_CAPABILITY_POINTER) == 0) { + if(((caps & WL_SEAT_CAPABILITY_POINTER) == 0) || seat->enable_cursor == false) { wlr_cursor_set_image(seat->cursor, NULL, 0, 0, 0, 0, 0, 0); } else { wlr_xcursor_manager_set_cursor_image(seat->xcursor_manager, @@ -206,13 +206,15 @@ handle_command_key_bindings(struct cg_server *server, xkb_keysym_t sym, struct wlr_scene_node *node = wlr_scene_node_at( &server->scene->node, server->seat->cursor->x, server->seat->cursor->y, &sx, &sy); - if(node && node->type == WLR_SCENE_NODE_SURFACE) { - surface = wlr_scene_surface_from_node(node)->surface; - wlr_seat_pointer_notify_enter(wlr_seat, surface, sx, sy); - } else { - wlr_xcursor_manager_set_cursor_image(server->seat->xcursor_manager, - "left_ptr", server->seat->cursor); + if(server->seat->enable_cursor) { + if(node && node->type == WLR_SCENE_NODE_SURFACE) { + surface = wlr_scene_surface_from_node(node)->surface; + wlr_seat_pointer_notify_enter(wlr_seat, surface, sx, sy); + } else { + wlr_xcursor_manager_set_cursor_image(server->seat->xcursor_manager, + "left_ptr", server->seat->cursor); + } } } @@ -542,6 +544,9 @@ handle_request_set_selection(struct wl_listener *listener, void *data) { static void handle_request_set_cursor(struct wl_listener *listener, void *data) { struct cg_seat *seat = wl_container_of(listener, seat, request_set_cursor); + if(seat->enable_cursor==false) { + return; + } struct wlr_seat_pointer_request_set_cursor_event *event = data; struct wlr_surface *focused_surface = event->seat_client->seat->pointer_state.focused_surface; @@ -894,6 +899,7 @@ seat_create(struct cg_server *server, struct wlr_backend *backend) { return NULL; } + seat->enable_cursor=true; seat->seat = wlr_seat_create(server->wl_display, "seat0"); if(!seat->seat) { wlr_log(WLR_ERROR, "Cannot allocate seat0"); diff --git a/seat.h b/seat.h index e450cb6..cfbc869 100644 --- a/seat.h +++ b/seat.h @@ -28,6 +28,7 @@ struct cg_seat { uint16_t num_pointers; uint16_t num_touch; + bool enable_cursor; struct wlr_cursor *cursor; struct cg_tile *cursor_tile; struct wlr_xcursor_manager *xcursor_manager; From 9b712e27fffd0cc2ad0fd701679eb8a9d3c039f8 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 30 Dec 2022 21:16:33 +0100 Subject: [PATCH 492/689] Document socket option --- man/cagebreak.1.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index a0a04c3..f980497 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -32,8 +32,11 @@ are displayed in a message box at the top right of the screen. # OPTIONS -*-c* - Load configuration file from +*-c* + Load configuration file from + +-e + Enable socket *-h* Display help message and exit From 78b287153cb6c05d28c970b0bdd9016450ca7003 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 30 Dec 2022 21:34:14 +0100 Subject: [PATCH 493/689] Fix version reporting --- cagebreak.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index 2de648c..e9f81a4 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -249,7 +249,6 @@ get_config_file(char *udef_path) { int main(int argc, char *argv[]) { - printf("This is cagebreak, version %s\n", CG_VERSION); struct cg_server server = {0}; struct wl_event_loop *event_loop = NULL; struct wl_event_source *sigint_source = NULL; @@ -604,9 +603,7 @@ main(int argc, char *argv[]) { wlr_log_errno(WLR_ERROR, "Unable to set WAYLAND_DISPLAY.", "Clients may not be able to connect"); } else { - wlr_log(WLR_DEBUG, - "Cagebreak " CG_VERSION " is running on Wayland display %s", - socket); + fprintf(stderr, "Cagebreak " CG_VERSION " is running on Wayland display %s\n", socket); } #if CG_HAS_XWAYLAND From 80073faac859ba65fdcebd4cd4615a313266f4b0 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 30 Dec 2022 21:43:26 +0100 Subject: [PATCH 494/689] Alphabetize -h option --- cagebreak.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index 2de648c..a7ee505 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -132,8 +132,8 @@ usage(FILE *file, const char *const cage) { " -c \t Load configuration file from \n" " -e\t\t Enable socket\n" " -h\t\t Display this help message\n" - " -v\t\t Show the version number and exit\n" - " -s\t\t Show information about the current setup and exit\n", + " -s\t\t Show information about the current setup and exit\n" + " -v\t\t Show the version number and exit\n", cage); } From 468d7df9b9f7cccea6db9900b4399eb9ad95b3ce Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 30 Dec 2022 21:46:22 +0100 Subject: [PATCH 495/689] Fix cagebreak man page --- man/cagebreak.1.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index f980497..0537367 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -32,10 +32,10 @@ are displayed in a message box at the top right of the screen. # OPTIONS -*-c* +*-c * Load configuration file from --e +*-e* Enable socket *-h* From 8f811e980983974e84e2c4fed9fc4f840e098762 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 30 Dec 2022 21:46:42 +0100 Subject: [PATCH 496/689] Add docuemntation --- man/cagebreak-socket.7.md | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/man/cagebreak-socket.7.md b/man/cagebreak-socket.7.md index d0b0190..a39ce91 100644 --- a/man/cagebreak-socket.7.md +++ b/man/cagebreak-socket.7.md @@ -61,6 +61,15 @@ cg-ipc{"event_name":"close","view_id":"47","tile_id":"47","workspace":"1","outpu ``` *configure_input* + - Trigger: *input* command + - JSON + - event_name: "configure_input" + - input: the input as a string as per cagebreak-config(5) + +``` +input * accel_profile flat +cg-ipc{"event_name":"configure_input","input":"*"} +``` *configure_message* @@ -95,17 +104,16 @@ dump - event_name: "dump" - nws: number of workspaces as an integer - bg_color: list of three floating point numbers denoting the new background in rgba - - views_curr_id: TODO - - tiles_curr_id: TODO + - views_curr_id: id of the currently focussed view as an integer + - tiles_curr_id: id of the currently focussed tile as in integer - curr_output: current output as a string - modes: list of names of modes as strings - outputs: object of objects for each output - output name as string - priority: priority as per *output* prio in *cagebreak-config(5)* or default - coords: object of x and y coordinates of output - - TODO - - size: object of width and height as integers TODO - - refresh_rate: refresh rate as float TODO + - size: object of width and height as integers + - refresh_rate: refresh rate as float - curr_workspace: current workspace as an integer - workspaces: list of objects for each workspace - views: list of objects for each view @@ -121,8 +129,9 @@ dump - keyboards: object of objects for each keyboard - name_of_keyboard: object for a keyboard - repeat_delay: repeat delay in milliseconds as an integer - - repeat_rate: repeat rate in hertz as an integer + - repeat_rate: repeat rate in 1/sec as an integer - cursor_coords: object of x and y coordinates + - TODO ``` dump @@ -172,7 +181,16 @@ cg-ipc{"event_name":"dump","nws":1, } ``` -focus_tile +*focus_tile* + - Trigger: *focus* command + - JSON + - event_name: "focus_tile" + - old_tile_id + +``` +focus +cg-ipc{"event_name":"focus_tile","old_tile_id":"14","new_tile_id":"13","workspace":"1","output":"eDP-1"} +``` *fullscreen* - Trigger: *only* command From 9fdbc769b5220bc8ad49d65ddc93680f6a85d773 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 30 Dec 2022 22:37:31 +0100 Subject: [PATCH 497/689] Add documentation --- man/cagebreak-socket.7.md | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/man/cagebreak-socket.7.md b/man/cagebreak-socket.7.md index a39ce91..ae6a091 100644 --- a/man/cagebreak-socket.7.md +++ b/man/cagebreak-socket.7.md @@ -71,10 +71,26 @@ input * accel_profile flat cg-ipc{"event_name":"configure_input","input":"*"} ``` - *configure_message* + - Trigger: *configure_message* command + - JSON + - event_name: "configure_message" -configure_output +``` +configure_message fg_color 1.0 1.0 0 0 +[cg ipc](cg-ipc){"event_name":"configure_message"} +``` + +*configure_output* + - Trigger: *output* command + - JSON + - event_name: "configure_output" + - output: name of the output as a string + +``` +output eDP-1 rotate 0 +cg-ipc{"event_name":"configure_output","output":"eDP-1"} +``` *cursor_switch_tile* - Trigger: Cursor crosses the border between tiles From 7162b62b981646121039ec2999dacbf1ff469572 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 30 Dec 2022 23:03:15 +0100 Subject: [PATCH 498/689] Add documentation --- man/cagebreak-socket.7.md | 56 +++++++++++++++++++++++++++++++++++---- 1 file changed, 51 insertions(+), 5 deletions(-) diff --git a/man/cagebreak-socket.7.md b/man/cagebreak-socket.7.md index ae6a091..2b7d808 100644 --- a/man/cagebreak-socket.7.md +++ b/man/cagebreak-socket.7.md @@ -35,7 +35,7 @@ This documentation includes the trigger for the event, the keys and the data type of the values of each event. *background* - - Trigger: Setting new Background via *background* command + - Trigger: *background* command - JSON - event_name: "background" - old_bg: list of three floating point numbers denoting the old background in rgb @@ -47,7 +47,7 @@ cg-ipc{"event_name":"background","old_bg":"[0.000000,1.000000,1.000000]","new_bg ``` *close* - - Trigger: Closure of a view via *close* command + - Trigger: *close* command - JSON - event_name: "close" - view_id: view id as an integer @@ -107,14 +107,60 @@ cg-ipc{"event_name":"cursor_switch_tile","old_output":"eDP-1","old_tile":"2","ne ``` *cycle_outputs* + - Trigger: *nextscreen* and *prevscreen* commands + - JSON + - event_name: "cycle_outputs" + - old_output: old output name as string + - new_output: new output name as string + - reverse: "0" if *nextscreen* or "1" if *prevscreen* + +``` +nextscreen +cg-ipc{"event_name":"cycle_outputs","old_output":"eDP-1","new_output":"HDMI-A-1","reverse":"0"} +``` cycle_views + - Trigger: *next* and *prev* commands + - JSON + - event_name: "cycle_views" + - old_view_id: old view id as an integer + - new_view_id: new view id as an interger + - tile_id: new tile is as an integer + - workspace: workspace number as an integer + - output: name of the output as a string -definekey +``` +next +cg-ipc{"event_name":"cycle_views","old_view_id":"11","new_view_id":"4","tile_id":"13","workspace":"1","output":"eDP-1"} +``` -definemode +*definekey* + - Trigger: *definekey* command + - JSON + - event_name: "definekey" + - modifiers: TODO + - key: key as a number + - command: command as a number TODO -dump +``` +definemode foo +cg-ipc{"event_name":"definemode","mode":"foo"} +definekey foo e only +cg-ipc{"event_name":"definekey","modifiers":"0","key":"101","command":"5"} +``` + +*definemode* + - Trigger: *definemode* command + - JSON + - event_name: "definemode" + - mode: name of mode as string + +``` +definemode foo +cg-ipc{"event_name":"definemode","mode":"foo"} +``` + +*dump* - Trigger: *dump* command - JSON - event_name: "dump" From 41af11ecbbfdc01c077f14858dc7654d5b41c2bf Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 30 Dec 2022 23:26:41 +0100 Subject: [PATCH 499/689] Add socket documentation --- man/cagebreak-socket.7.md | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/man/cagebreak-socket.7.md b/man/cagebreak-socket.7.md index 2b7d808..fd6235b 100644 --- a/man/cagebreak-socket.7.md +++ b/man/cagebreak-socket.7.md @@ -12,6 +12,8 @@ cagebreak-socket(7) "Version 2.0.0" "Cagebreak Manual" The cagebreak socket is an ipc socket. +The socket is enabled if cagebreak is invoked with the `-e` flag. + The socket accepts cagebreak commands as input (see *cagebreak-config(5)* for more information). Events are provided as output as specified in this man page. @@ -267,17 +269,37 @@ only cg-ipc{"event_name":"fullscreen","tile_id":"3","workspace":"1","output":"eDP-1"} ``` -move_view_cycle_output +*move_view_cycle_output* + - Trigger: *movetonextscreen* and similar commands -move_view_to_output +``` +movetonextscreen +cg-ipc{"event_name":"cycle_outputs","old_output":"eDP-1","new_output":"HDMI-A-1","reverse":"0"} +g-ipc{"event_name":"move_view_cycle_output","view_id":"11","old_output":"eDP-1","new_output":"HDMI-A-1"} +``` -move_view_to_ws +*move_view_to_output* + - Trigger: *movetoscreen* command + - JSON + - event_name: "move_view_to_output" + - view_id: view id as an integer + - old_output: old output name as string + - new_output: new output name as string + - view_pid: pid of the process -new_output +``` +movetoscreen 2 +cg-ipc{"event_name":"switch_output","old_output":"eDP-1","new_output":"HDMI-A-1"} +cg-ipc{"event_name":"move_view_to_output","view_id":"113","old_output":"eDP-1","new_output":"HDMI-A-1","view_pid":"50526"} +``` -resize_tile +*move_view_to_ws* -set_nws +*new_output* + +*resize_tile* + +*set_nws* *split* - Trigger: *split* command @@ -295,7 +317,7 @@ cg-ipc{"event_name":"split","tile_id":"11","new_tile_id":"12","workspace":"1","o ``` *swap_tile* - - Trigger: + - Trigger switch_default_mode From b8098046575a6adf55852246955ab293f0b1f1e6 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 31 Dec 2022 09:34:34 +0100 Subject: [PATCH 500/689] Add cursor to doc --- man/cagebreak-config.5.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index 2d8bb8c..6d2ff7a 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -48,7 +48,7 @@ definekey root Close current window - This may be useful for windows of applications which do not offer any method of closing them. -configure_message [font |[f|b]g_color b> |display_time ] +*configure_message [font |[f|b]g_color b> |display_time ]* Configure message characteristics - - font sets - is @@ -75,6 +75,11 @@ configure_message bg_color 1.0 0.0 0.0 1.0 configure_message display_time 4 ``` +*cursor [enable|disable]* + Enable or disable cursor + This simply hides the cursor. Pointing and clicking is + still possible. + *definekey * Bind to execute if pressed in - *definekey* is a more general version of *bind*. From e8a868e7f33667fd1c661978fb1b7ec165f001e3 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 31 Dec 2022 10:32:45 +0100 Subject: [PATCH 501/689] Add socket documentation --- man/cagebreak-socket.7.md | 64 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 60 insertions(+), 4 deletions(-) diff --git a/man/cagebreak-socket.7.md b/man/cagebreak-socket.7.md index fd6235b..870d2cf 100644 --- a/man/cagebreak-socket.7.md +++ b/man/cagebreak-socket.7.md @@ -121,7 +121,7 @@ nextscreen cg-ipc{"event_name":"cycle_outputs","old_output":"eDP-1","new_output":"HDMI-A-1","reverse":"0"} ``` -cycle_views +*cycle_views* - Trigger: *next* and *prev* commands - JSON - event_name: "cycle_views" @@ -249,7 +249,10 @@ cg-ipc{"event_name":"dump","nws":1, - Trigger: *focus* command - JSON - event_name: "focus_tile" - - old_tile_id + - old_tile_id: old tile id as an integer + - new_tile_id: new tile id as an integer + - workspace: workspace number as an integer + - output: name of the output as a string ``` focus @@ -271,11 +274,17 @@ cg-ipc{"event_name":"fullscreen","tile_id":"3","workspace":"1","output":"eDP-1"} *move_view_cycle_output* - Trigger: *movetonextscreen* and similar commands + - JSON + - event_name: "move_view_cycle_output" + - view_id: view id as an integer + - old_output: name of the old output as a string + - new_output: name of the new output as a string + - TODO tile id? ``` movetonextscreen cg-ipc{"event_name":"cycle_outputs","old_output":"eDP-1","new_output":"HDMI-A-1","reverse":"0"} -g-ipc{"event_name":"move_view_cycle_output","view_id":"11","old_output":"eDP-1","new_output":"HDMI-A-1"} +cg-ipc{"event_name":"move_view_cycle_output","view_id":"11","old_output":"eDP-1","new_output":"HDMI-A-1"} ``` *move_view_to_output* @@ -298,8 +307,32 @@ cg-ipc{"event_name":"move_view_to_output","view_id":"113","old_output":"eDP-1"," *new_output* *resize_tile* + - Trigger: the *resize* family of commands + - JSON + - event_name: "resize_tile" + - tile_id: tile id as an integer + - old_dims: TODO + - new_dimes: TODO + - workspace: workspace number as an integer + - output: name of the output as a string + +``` +resizeleft +cg-ipc{"event_name":"resize_tile","tile_id":"14","old_dims":"[1280;0;1440;1280]","new_dims":"[1270;0;1440;1290]","workspace":"1","output":"eDP-1"} +cg-ipc{"event_name":"resize_tile","tile_id":"13","old_dims":"[0;0;1440;1280]","new_dims":"[0;0;1440;1270]","workspace":"1","output":"eDP-1"} +``` *set_nws* + - Trigger: *workspaces* command + - JSON + - event_name: "set_nws" + - old_nws: old number of workspaces as an integer + - new_nws: new number of workspaces as an integer + +``` +workspaces 2 +cg-ipc{"event_name":"set_nws","old_nws":"1","new_nws":"2"} +``` *split* - Trigger: *split* command @@ -322,8 +355,29 @@ cg-ipc{"event_name":"split","tile_id":"11","new_tile_id":"12","workspace":"1","o switch_default_mode switch_output + - Trigger. *screen* command + - JSON + - event_name: "switch_output" + - old_output: name of the old output as a string + - new_output: name of the new output as a string + +``` +screen 2 +cg-ipc{"event_name":"switch_output","old_output":"eDP-1","new_output":"HDMI-A-1"} +``` switch_ws + - Trigger: *workspace* command + - JSON + - event_name: "switch_ws" + - old_workspace: old workspace number as an integer + - new_workspace: new workspace number as an integer + - output: name of the output as a string + +``` +workspace 2 +cg-ipc{"event_name":"switch_ws","old_workspace":"1","new_workspace":"2","output":"eDP-1"} +``` *view_map* - Trigger: view is opened by a process @@ -357,9 +411,11 @@ cg-ipc{"event_name":"view_unmap","view_id":"24","tile_id":"13","workspace":"1"," ## SECURITY +The socket has to be explicitly enabled using the `-e` flag. + The socket is restricted to the user for reading, writing and execution (700). -All user software can execute arbitrary code while cagebreak is running. +All user software can execute arbitrary code while the cagebreak socket is running. ## EXAMPLES From e644c7f8b774be430f249f3a8f36e65236304130 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 31 Dec 2022 10:42:14 +0100 Subject: [PATCH 502/689] Modify SECURITY.md to explicitely enabled socket. --- SECURITY.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/SECURITY.md b/SECURITY.md index e1e04d8..b5a7b44 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -5,6 +5,9 @@ escalation through the socket. Any program with access to the socket immediately gains arbitrary code execution rights. The socket is restricted to the user of the cagebreak process (700). +The socket has to be explicitely enabled by invoking Cagebreak with +the `-e` flag. + If you disagree with this threat model, you may contact us via email (See section Email Contact below.) or [open an issue on github](https://github.com/project-repo/cagebreak/issues/new). @@ -76,7 +79,7 @@ Not applicable - Cagebreak must allow system manipulation for user software. Not applicable - There are no prohibited operations (See Tampering above.). While cagebreak does send events over documented channels there is no logging activated by default, though, of course, this can be changed by the user -by logging socket output for example. +by logging socket output (if enabled) for example. #### Information Disclosure @@ -86,7 +89,7 @@ and any software run by the user may exfiltrate any data the user has access to. #### Denial of Service Not applicable - Cagebreak offers functionality to terminate itself, which is -available to all user software over the socket. +available to all user software over the socket if the socket is enabled. #### Elevation of Privilege From c806e4f0fe258298984cce9eb6410cf129841917 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 31 Dec 2022 11:20:52 +0100 Subject: [PATCH 503/689] Add tile_ids to output move_view_to_cycle_tile --- keybinding.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/keybinding.c b/keybinding.c index 94b0ca4..cac4412 100644 --- a/keybinding.c +++ b/keybinding.c @@ -1206,10 +1206,12 @@ keybinding_move_view_to_cycle_output(struct cg_server *server, bool reverse) { id = view->id; } ipc_send_event(server, - "{\"event_name\":\"move_view_cycle_output\",\"view_id\":\"%" - "d\",\"old_output\":\"%s\",\"new_output\":\"%s\"}", - id, old_outp->wlr_output->name, - server->curr_output->wlr_output->name); + "{\"event_name\":\"move_view_cycle_output\",\"view_id\":%d,\"old_output\":\"%s\",\"new_output\":\"%s\",\"old_tile_id\":%d,\"new_tile_id\":%d}", + id, old_outp->wlr_output->name, + old_outp->wlr_output->name,server->curr_output + ->workspaces[old_outp->curr_workspace]->focused_tile->id, + server->curr_output->wlr_output->name,server->curr_output + ->workspaces[server->curr_output->curr_workspace]->focused_tile->id); } void From 22eb4853c2710c49e09051099282a25d56a7daa5 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 31 Dec 2022 11:54:39 +0100 Subject: [PATCH 504/689] Add socket documentation --- man/cagebreak-socket.7.md | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/man/cagebreak-socket.7.md b/man/cagebreak-socket.7.md index 870d2cf..f9e861b 100644 --- a/man/cagebreak-socket.7.md +++ b/man/cagebreak-socket.7.md @@ -350,9 +350,30 @@ cg-ipc{"event_name":"split","tile_id":"11","new_tile_id":"12","workspace":"1","o ``` *swap_tile* - - Trigger + - Trigger: the *exchange* family of commands + - JSON + - event_name: "swap_tile" + - tile_id: previous tile id as an integer + - swap_tile_id: swap tile id as an integer + - workspace: workspace number as an integer + - output: name of the output as a string -switch_default_mode +``` +exchangeright +cg-ipc{"event_name":"swap_tile","tile_id":"1","swap_tile_id":"3","workspace":"1","output":"eDP-1"} +``` + +*switch_default_mode* + - Trigger: *setmode* command + - JSON + - event_name: "switch_default_mode" + - old_mode: old mode number + - mode: new mode numer + +``` +setmode top +cg-ipc{"event_name":"switch_default_mode","old_mode":"0","mode":"0"} +``` switch_output - Trigger. *screen* command From c2ea3a51330fc87445e746766038e8950339b942 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 31 Dec 2022 12:18:40 +0100 Subject: [PATCH 505/689] Add input keyboard documentation --- man/cagebreak-config.5.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index 6d2ff7a..111a789 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -208,6 +208,12 @@ definekey top mode root *scroll_method none|two_finger|edge|on_button_down* Change scroll method for specified input device + *repeat_delay * + Repeat delay in ms for keyboards only + + *repeat_rate * + Repeat rate in 1/s for keyboards only + *tap enabled|disabled* Enable or disable tap for specified input device From 6572260432b30d09e06b1953a1c52553878a17f6 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 1 Jan 2023 10:43:25 +0100 Subject: [PATCH 506/689] Add socket documentation --- man/cagebreak-socket.7.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/man/cagebreak-socket.7.md b/man/cagebreak-socket.7.md index f9e861b..96fedf1 100644 --- a/man/cagebreak-socket.7.md +++ b/man/cagebreak-socket.7.md @@ -303,8 +303,31 @@ cg-ipc{"event_name":"move_view_to_output","view_id":"113","old_output":"eDP-1"," ``` *move_view_to_ws* + - Trigger: *movetoworkspace* command + - JSON + - event_name: "move_view_to_ws" + - view_id: view id as an integer + - old_workspace: old workspace number as an integer + - output: name of the output as a string + - view_pid: pid of the process + +``` +movetoworkspace 1 +cg-ipc{"event_name":"switch_ws","old_workspace":"1","new_workspace":"1","output":"eDP-1"} +cg-ipc{"event_name":"move_view_to_ws","view_id":"43","old_workspace":"0","new_workspace":"0","output":"eDP-1","view_pid":"64908"} +``` *new_output* + - Trigger: a new output is physically attached + - JSON + - event_name: "new_output" + - output: new output name as a string + - priority: priority as per *output* prio in *cagebreak-config(5)* or default + +``` +# a new output is attached +cg-ipc{"event_name":"new_output","output":"HDMI-A-1","priority":"-1"} +``` *resize_tile* - Trigger: the *resize* family of commands From f640d75ba51a070488f3bab5320952f244b844aa Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 1 Jan 2023 10:50:24 +0100 Subject: [PATCH 507/689] Remove quotes around integers in ipc output --- keybinding.c | 62 +++++++++++++++++++++++++--------------------------- seat.c | 2 +- view.c | 8 +++---- 3 files changed, 35 insertions(+), 37 deletions(-) diff --git a/keybinding.c b/keybinding.c index cac4412..c2f3366 100644 --- a/keybinding.c +++ b/keybinding.c @@ -230,8 +230,8 @@ swap_tile(struct cg_tile *tile, swap_tile); seat_set_focus(server->seat, swap_tile->view); ipc_send_event(tile->workspace->output->server, - "{\"event_name\":\"swap_tile\",\"tile_id\":\"%d\",\"swap_" - "tile_id\":\"%d\",\"workspace\":\"%d\",\"output\":\"%s\"}", + "{\"event_name\":\"swap_tile\",\"tile_id\":%d,\"swap_" + "tile_id\":%d,\"workspace\":%d,\"output\":\"%s\"}", tile->id, swap_tile->id, tile->workspace->num + 1, tile->workspace->output->wlr_output->name); } @@ -378,9 +378,9 @@ resize(struct cg_tile *tile, const struct cg_tile *parent, int coord_offset, view_maximize(tile->view, tile); } ipc_send_event(tile->workspace->output->server, - "{\"event_name\":\"resize_tile\",\"tile_id\":\"%d\",\"old_" - "dims\":\"[%d;%d;%d;%d]\",\"new_dims\":\"[%d;%d;%d;%d]\"," - "\"workspace\":\"%d\",\"output\":\"%s\"}", + "{\"event_name\":\"resize_tile\",\"tile_id\":%d,\"old_" + "dims\":\"[%d,%d,%d,%d]\",\"new_dims\":\"[%d,%d,%d,%d]\"," + "\"workspace\":%d,\"output\":\"%s\"}", tile->id, old_x, old_y, old_height, old_width, tile->tile.x, tile->tile.y, tile->tile.height, tile->tile.width, tile->workspace->num + 1, @@ -478,8 +478,8 @@ keybinding_workspace_fullscreen(struct cg_server *server) { server->curr_output->curr_workspace); struct cg_output *output = server->curr_output; ipc_send_event(server, - "{\"event_name\":\"fullscreen\",\"tile_id\":\"%d\"," - "\"workspace\":\"%d\",\"output\":\"%s\"}", + "{\"event_name\":\"fullscreen\",\"tile_id\":%d," + "\"workspace\":%d,\"output\":\"%s\"}", output->workspaces[output->curr_workspace]->focused_tile->id, output->workspaces[output->curr_workspace]->num + 1, output->wlr_output->name); @@ -573,8 +573,8 @@ keybinding_split_output(struct cg_output *output, bool vertical) { } ipc_send_event( output->server, - "{\"event_name\":\"split\",\"tile_id\":\"%d\",\"new_tile_id\":\"%d\"," - "\"workspace\":\"%d\",\"output\":\"%s\",\"vertical\":\"%d\"}", + "{\"event_name\":\"split\",\"tile_id\":%d,\"new_tile_id\":%d," + "\"workspace\":%d,\"output\":\"%s\",\"vertical\":%d}", curr_workspace->focused_tile->id, new_tile->id, curr_workspace->num + 1, curr_workspace->output->wlr_output->name, vertical); } @@ -590,8 +590,8 @@ keybinding_close_view(struct cg_view *view) { uint32_t ws = view->workspace->num; view->impl->close(view); ipc_send_event(outp->server, - "{\"event_name\":\"close\",\"view_id\":\"%d\",\"tile_id\":" - "\"%d\",\"workspace\":\"%d\",\"output\":\"%s\"}", + "{\"event_name\":\"close\",\"view_id\":%d,\"tile_id\":" + "%d,\"workspace\":%d,\"output\":\"%s\"}", view_id, tile_id, ws + 1, outp->wlr_output->name); } @@ -642,7 +642,7 @@ keybinding_cycle_outputs(struct cg_server *server, bool reverse) { set_output(server, output); ipc_send_event(output->server, "{\"event_name\":\"cycle_outputs\",\"old_output\":\"%s\"," - "\"new_output\":\"%s\",\"reverse\":\"%d\"}", + "\"new_output\":\"%s\",\"reverse\":%d}", old_output->wlr_output->name, output->wlr_output->name, reverse); } @@ -678,9 +678,9 @@ keybinding_cycle_views(struct cg_server *server, bool reverse, bool ipc) { seat_set_focus(server->seat, next_view); if(ipc) { ipc_send_event(curr_workspace->output->server, - "{\"event_name\":\"cycle_views\",\"old_view_id\":\"%d\"," - "\"new_view_id\":\"%d\",\"tile_id\":\"%d\"," - "\"workspace\":\"%d\",\"output\":\"%s\"}", + "{\"event_name\":\"cycle_views\",\"old_view_id\":%d," + "\"new_view_id\":%d,\"tile_id\":%d," + "\"workspace\":%d,\"output\":\"%s\"}", current_view->link.next == curr_workspace->views.next ? -1 : (int)current_view->id, @@ -705,8 +705,8 @@ keybinding_focus_tile(struct cg_server *server, uint32_t tile_id) { seat_set_focus(server->seat, next_view); ipc_send_event( output->server, - "{\"event_name\":\"focus_tile\",\"old_tile_id\":\"%d\",\"new_tile_" - "id\":\"%d\",\"workspace\":\"%d\",\"output\":\"%s\"}", + "{\"event_name\":\"focus_tile\",\"old_tile_id\":%d,\"new_tile_" + "id\":%d,\"workspace\":%d,\"output\":\"%s\"}", old_tile->id, workspace->focused_tile->id, workspace->num + 1, output->wlr_output->name); break; @@ -740,8 +740,8 @@ keybinding_switch_ws(struct cg_server *server, uint32_t ws) { server->curr_output->workspaces[ws]->focused_tile->view); message_printf(server->curr_output, "Workspace %d", ws + 1); ipc_send_event(output->server, - "{\"event_name\":\"switch_ws\",\"old_workspace\":\"%d\"," - "\"new_workspace\":\"%d\",\"output\":\"%s\"}", + "{\"event_name\":\"switch_ws\",\"old_workspace\":%d," + "\"new_workspace\":%d,\"output\":\"%s\"}", old_ws + 1, ws + 1, output->wlr_output->name); return 0; } @@ -838,7 +838,7 @@ print_view(struct cg_view *view) { uint32_t nmemb = 4; outp_str.str_arr = calloc(nmemb, sizeof(char *)); print_str(&outp_str, "\"id\": %d,\n", view->id); - print_str(&outp_str, "\"pid\": \"%d\",\n", view->impl->get_pid(view)); + print_str(&outp_str, "\"pid\": %d,\n", view->impl->get_pid(view)); print_str(&outp_str, "\"coords\": {\"x\":%d,\"y\":%d},\n", view->ox, view->oy); #if CG_HAS_XWAYLAND @@ -1206,7 +1206,7 @@ keybinding_move_view_to_cycle_output(struct cg_server *server, bool reverse) { id = view->id; } ipc_send_event(server, - "{\"event_name\":\"move_view_cycle_output\",\"view_id\":%d,\"old_output\":\"%s\",\"new_output\":\"%s\",\"old_tile_id\":%d,\"new_tile_id\":%d}", + "{\"event_name\":\"move_view_to_cycle_output\",\"view_id\":%d,\"old_output\":\"%s\",\"new_output\":\"%s\",\"old_tile_id\":%d,\"new_tile_id\":%d}", id, old_outp->wlr_output->name, old_outp->wlr_output->name,server->curr_output ->workspaces[old_outp->curr_workspace]->focused_tile->id, @@ -1267,7 +1267,7 @@ keybinding_set_nws(struct cg_server *server, int nws) { ->focused_tile->view); ipc_send_event( server, - "{\"event_name\":\"set_nws\",\"old_nws\":\"%d\",\"new_nws\":\"%d\"}", + "{\"event_name\":\"set_nws\",\"old_nws\":%d,\"new_nws\":%d}", old_nws, server->nws); } @@ -1293,16 +1293,16 @@ void keybinding_definekey(struct cg_server *server, struct keybinding *kb) { keybinding_list_push(server->keybindings, kb); ipc_send_event(server, - "{\"event_name\":\"definekey\",\"modifiers\":\"%d\",\"key\":" - "\"%d\",\"command\":\"%d\"}", + "{\"event_name\":\"definekey\",\"modifiers\":%d,\"key\":" + "%d,\"command\":%d}", kb->modifiers, kb->key, kb->action); } void keybinding_set_background(struct cg_server *server, float *bg) { ipc_send_event(server, - "{\"event_name\":\"background\",\"old_bg\":\"[%f,%f,%f]\"," - "\"new_bg\":\"[%f,%f,%f]\"}", + "{\"event_name\":\"background\",\"old_bg\":[%f,%f,%f]," + "\"new_bg\":[%f,%f,%f]}", server->bg_color[0], server->bg_color[1], server->bg_color[2], bg[0], bg[1], bg[2]); server->bg_color[0] = bg[0]; @@ -1364,18 +1364,16 @@ keybinding_move_view_to_output(struct cg_server *server, int output_num) { workspace_tile_update_view(ws->focused_tile,view); seat_set_focus(server->seat, view); } - pid_t view_pid = -1; int view_id = -1; if(view != NULL) { - view_pid = view->impl->get_pid(view); view_id = view->id; } ipc_send_event( server, - "{\"event_name\":\"move_view_to_output\",\"view_id\":\"%d\",\"old_" - "output\":\"%s\",\"new_output\":\"%s\",\"view_pid\":\"%d\"}", + "{\"event_name\":\"move_view_to_output\",\"view_id\":%d,\"old_" + "output\":\"%s\",\"new_output\":\"%s\"}", view_id, old_outp->wlr_output->name, - server->curr_output->wlr_output->name, view_pid); + server->curr_output->wlr_output->name); } void @@ -1598,7 +1596,7 @@ run_action(enum keybinding_action action, struct cg_server *server, case KEYBINDING_SWITCH_DEFAULT_MODE: ipc_send_event(server, "{\"event_name\":\"switch_default_mode\",\"old_mode\":" - "\"%d\",\"mode\":\"%d\"}", + "%d,\"mode\":%d}", server->seat->default_mode, data.u); server->seat->mode = data.u; server->seat->default_mode = data.u; diff --git a/seat.c b/seat.c index ad60682..6d79aad 100644 --- a/seat.c +++ b/seat.c @@ -729,7 +729,7 @@ process_cursor_motion(struct cg_seat *seat, uint32_t time) { ipc_send_event( seat->server, "{\"event_name\":\"cursor_switch_tile\",\"old_output\":\"%s\"," - "\"old_tile\":\"%d\",\"new_output\":\"%s\",\"new_tile\":\"%d\"}", + "\"old_tile\":%d,\"new_output\":\"%s\",\"new_tile\":%d}", seat->cursor_tile->workspace->output->wlr_output->name, seat->cursor_tile->id, c_outp->name, c_tile->id); } diff --git a/view.c b/view.c index 8afb697..8c504e0 100644 --- a/view.c +++ b/view.c @@ -152,8 +152,8 @@ view_unmap(struct cg_view *view) { view->wlr_surface = NULL; ipc_send_event( view->workspace->server, - "{\"event_name\":\"view_unmap\",\"view_id\":\"%d\",\"tile_id\":\"%d\"," - "\"workspace\":\"%d\",\"output\":\"%s\",\"view_pid\":\"%d\"}", + "{\"event_name\":\"view_unmap\",\"view_id\":%d,\"tile_id\":%d," + "\"workspace\":%d,\"output\":\"%s\",\"view_pid\":%d}", id, tile_id, ws + 1, output_name, pid); } @@ -195,8 +195,8 @@ view_map(struct cg_view *view, struct wlr_surface *surface, } ipc_send_event( output->server, - "{\"event_name\":\"view_map\",\"view_id\":\"%d\",\"tile_id\":\"%d\"," - "\"workspace\":\"%d\",\"output\":\"%s\",\"view_pid\":\"%d\"}", + "{\"event_name\":\"view_map\",\"view_id\":%d,\"tile_id\":%d," + "\"workspace\":%d,\"output\":\"%s\",\"view_pid\":%d}", view->id, tile_id, view->workspace->num + 1, view->workspace->output->wlr_output->name, view->impl->get_pid(view)); } From d5774d321d8c4bb93db67173ac6ed4ffad643d69 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 1 Jan 2023 10:50:44 +0100 Subject: [PATCH 508/689] Adjust documentation --- man/cagebreak-socket.7.md | 51 +++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/man/cagebreak-socket.7.md b/man/cagebreak-socket.7.md index f9e861b..74c7d8d 100644 --- a/man/cagebreak-socket.7.md +++ b/man/cagebreak-socket.7.md @@ -30,7 +30,7 @@ Here is an example of how this works using only as a command over the socket ``` only -cg-ipc{"event_name":"fullscreen","tile_id":"2","workspace":"1","output":"eDP-1"} +cg-ipc{"event_name":"fullscreen","tile_id":2,"workspace":1,"output":"eDP-1"} ``` This documentation includes the trigger for the event, the keys and the data @@ -45,7 +45,7 @@ type of the values of each event. ``` background 0 1.0 0 -cg-ipc{"event_name":"background","old_bg":"[0.000000,1.000000,1.000000]","new_bg":"[0.000000,1.000000,0.000000]"} +cg-ipc{"event_name":"background","old_bg":[0.000000,1.000000,1.000000],"new_bg":[0.000000,1.000000,0.000000]} ``` *close* @@ -59,7 +59,7 @@ cg-ipc{"event_name":"background","old_bg":"[0.000000,1.000000,1.000000]","new_bg ``` close -cg-ipc{"event_name":"close","view_id":"47","tile_id":"47","workspace":"1","output":"eDP-1"} +cg-ipc{"event_name":"close","view_id":47,"tile_id":47,"workspace":1,"output":"eDP-1"} ``` *configure_input* @@ -80,7 +80,7 @@ cg-ipc{"event_name":"configure_input","input":"*"} ``` configure_message fg_color 1.0 1.0 0 0 -[cg ipc](cg-ipc){"event_name":"configure_message"} +cg-ipc{"event_name":"configure_message"} ``` *configure_output* @@ -105,7 +105,7 @@ cg-ipc{"event_name":"configure_output","output":"eDP-1"} ``` # Cursor switches tile -cg-ipc{"event_name":"cursor_switch_tile","old_output":"eDP-1","old_tile":"2","new_output":"eDP-1","new_tile":"3"} +cg-ipc{"event_name":"cursor_switch_tile","old_output":"eDP-1","old_tile":2,"new_output":"eDP-1","new_tile":3} ``` *cycle_outputs* @@ -118,7 +118,7 @@ cg-ipc{"event_name":"cursor_switch_tile","old_output":"eDP-1","old_tile":"2","ne ``` nextscreen -cg-ipc{"event_name":"cycle_outputs","old_output":"eDP-1","new_output":"HDMI-A-1","reverse":"0"} +cg-ipc{"event_name":"cycle_outputs","old_output":"eDP-1","new_output":"HDMI-A-1","reverse":0} ``` *cycle_views* @@ -133,7 +133,7 @@ cg-ipc{"event_name":"cycle_outputs","old_output":"eDP-1","new_output":"HDMI-A-1" ``` next -cg-ipc{"event_name":"cycle_views","old_view_id":"11","new_view_id":"4","tile_id":"13","workspace":"1","output":"eDP-1"} +cg-ipc{"event_name":"cycle_views","old_view_id":11,"new_view_id":4,"tile_id":13,"workspace":1,"output":"eDP-1"} ``` *definekey* @@ -148,7 +148,7 @@ cg-ipc{"event_name":"cycle_views","old_view_id":"11","new_view_id":"4","tile_id" definemode foo cg-ipc{"event_name":"definemode","mode":"foo"} definekey foo e only -cg-ipc{"event_name":"definekey","modifiers":"0","key":"101","command":"5"} +cg-ipc{"event_name":"definekey","modifiers":0,"key":101,"command":5} ``` *definemode* @@ -213,7 +213,7 @@ cg-ipc{"event_name":"dump","nws":1, "curr_workspace": 0, "workspaces": [{"views": [{ "id": 4, -"pid": "37878", +"pid": 37878, "coords": {"x":0,"y":0}, "type": "xwayland" @@ -256,7 +256,7 @@ cg-ipc{"event_name":"dump","nws":1, ``` focus -cg-ipc{"event_name":"focus_tile","old_tile_id":"14","new_tile_id":"13","workspace":"1","output":"eDP-1"} +cg-ipc{"event_name":"focus_tile","old_tile_id":14,"new_tile_id":13,"workspace":1,"output":"eDP-1"} ``` *fullscreen* @@ -269,13 +269,13 @@ cg-ipc{"event_name":"focus_tile","old_tile_id":"14","new_tile_id":"13","workspac ``` only -cg-ipc{"event_name":"fullscreen","tile_id":"3","workspace":"1","output":"eDP-1"} +cg-ipc{"event_name":"fullscreen","tile_id":3,"workspace":1,"output":"eDP-1"} ``` -*move_view_cycle_output* +*move_view_to_cycle_output* - Trigger: *movetonextscreen* and similar commands - JSON - - event_name: "move_view_cycle_output" + - event_name: "move_view_to_cycle_output" - view_id: view id as an integer - old_output: name of the old output as a string - new_output: name of the new output as a string @@ -283,8 +283,8 @@ cg-ipc{"event_name":"fullscreen","tile_id":"3","workspace":"1","output":"eDP-1"} ``` movetonextscreen -cg-ipc{"event_name":"cycle_outputs","old_output":"eDP-1","new_output":"HDMI-A-1","reverse":"0"} -cg-ipc{"event_name":"move_view_cycle_output","view_id":"11","old_output":"eDP-1","new_output":"HDMI-A-1"} +cg-ipc{"event_name":"cycle_outputs","old_output":"eDP-1","new_output":"HDMI-A-1","reverse":0} +cg-ipc{"event_name":"move_view_to_cycle_output","view_id":11,"old_output":"eDP-1","new_output":"HDMI-A-1"} ``` *move_view_to_output* @@ -294,12 +294,11 @@ cg-ipc{"event_name":"move_view_cycle_output","view_id":"11","old_output":"eDP-1" - view_id: view id as an integer - old_output: old output name as string - new_output: new output name as string - - view_pid: pid of the process ``` movetoscreen 2 cg-ipc{"event_name":"switch_output","old_output":"eDP-1","new_output":"HDMI-A-1"} -cg-ipc{"event_name":"move_view_to_output","view_id":"113","old_output":"eDP-1","new_output":"HDMI-A-1","view_pid":"50526"} +cg-ipc{"event_name":"move_view_to_output","view_id":113,"old_output":"eDP-1","new_output":"HDMI-A-1"} ``` *move_view_to_ws* @@ -318,8 +317,8 @@ cg-ipc{"event_name":"move_view_to_output","view_id":"113","old_output":"eDP-1"," ``` resizeleft -cg-ipc{"event_name":"resize_tile","tile_id":"14","old_dims":"[1280;0;1440;1280]","new_dims":"[1270;0;1440;1290]","workspace":"1","output":"eDP-1"} -cg-ipc{"event_name":"resize_tile","tile_id":"13","old_dims":"[0;0;1440;1280]","new_dims":"[0;0;1440;1270]","workspace":"1","output":"eDP-1"} +cg-ipc{"event_name":"resize_tile","tile_id":14,"old_dims":"[1280,0,1440,1280]","new_dims":"[1270,0,1440,1290]","workspace":1,"output":"eDP-1"} +cg-ipc{"event_name":"resize_tile","tile_id":13,"old_dims":"[0,0,1440,1280]","new_dims":"[0,0,1440,1270]","workspace":1,"output":"eDP-1"} ``` *set_nws* @@ -331,7 +330,7 @@ cg-ipc{"event_name":"resize_tile","tile_id":"13","old_dims":"[0;0;1440;1280]","n ``` workspaces 2 -cg-ipc{"event_name":"set_nws","old_nws":"1","new_nws":"2"} +cg-ipc{"event_name":"set_nws","old_nws":1,"new_nws":2} ``` *split* @@ -346,7 +345,7 @@ cg-ipc{"event_name":"set_nws","old_nws":"1","new_nws":"2"} ``` hsplit -cg-ipc{"event_name":"split","tile_id":"11","new_tile_id":"12","workspace":"1","output":"eDP-1","vertical":"0"} +cg-ipc{"event_name":"split","tile_id":11,"new_tile_id":12,"workspace":1,"output":"eDP-1","vertical":0} ``` *swap_tile* @@ -360,7 +359,7 @@ cg-ipc{"event_name":"split","tile_id":"11","new_tile_id":"12","workspace":"1","o ``` exchangeright -cg-ipc{"event_name":"swap_tile","tile_id":"1","swap_tile_id":"3","workspace":"1","output":"eDP-1"} +cg-ipc{"event_name":"swap_tile","tile_id":1,"swap_tile_id":3,"workspace":1,"output":"eDP-1"} ``` *switch_default_mode* @@ -372,7 +371,7 @@ cg-ipc{"event_name":"swap_tile","tile_id":"1","swap_tile_id":"3","workspace":"1" ``` setmode top -cg-ipc{"event_name":"switch_default_mode","old_mode":"0","mode":"0"} +cg-ipc{"event_name":"switch_default_mode","old_mode":0,"mode":0} ``` switch_output @@ -397,7 +396,7 @@ switch_ws ``` workspace 2 -cg-ipc{"event_name":"switch_ws","old_workspace":"1","new_workspace":"2","output":"eDP-1"} +cg-ipc{"event_name":"switch_ws","old_workspace":1,"new_workspace":2,"output":"eDP-1"} ``` *view_map* @@ -412,7 +411,7 @@ cg-ipc{"event_name":"switch_ws","old_workspace":"1","new_workspace":"2","output" ``` # process opens a view -cg-ipc{"event_name":"view_map","view_id":"28","tile_id":"14","workspace":"1","output":"eDP-1","view_pid":"39827"} +cg-ipc{"event_name":"view_map","view_id":28,"tile_id":14,"workspace":1,"output":"eDP-1","view_pid":39827} ``` *view_unmap* @@ -427,7 +426,7 @@ cg-ipc{"event_name":"view_map","view_id":"28","tile_id":"14","workspace":"1","ou ``` # view is closed by the process -cg-ipc{"event_name":"view_unmap","view_id":"24","tile_id":"13","workspace":"1","output":"eDP-1","view_pid":"39544"} +cg-ipc{"event_name":"view_unmap","view_id":24,"tile_id":13,"workspace":1,"output":"eDP-1","view_pid":39544} ``` ## SECURITY From 989f3bb35aa5bb04c01e4807d0729e4a86dff252 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 1 Jan 2023 10:58:59 +0100 Subject: [PATCH 509/689] Update ipc output and documention - Remove quotes - Fix event name --- keybinding.c | 6 +++--- man/cagebreak-socket.7.md | 6 +++--- output.c | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/keybinding.c b/keybinding.c index c2f3366..b1131aa 100644 --- a/keybinding.c +++ b/keybinding.c @@ -1404,9 +1404,9 @@ keybinding_move_view_to_workspace(struct cg_server *server, uint32_t ws) { seat_set_focus(server->seat, view); } ipc_send_event(server, - "{\"event_name\":\"move_view_to_ws\",\"view_id\":\"%d\"," - "\"old_workspace\":\"%d\",\"new_workspace\":\"%d\"," - "\"output\":\"%s\",\"view_pid\":\"%d\"}", + "{\"event_name\":\"move_view_to_ws\",\"view_id\":%d," + "\"old_workspace\":%d,\"new_workspace\":%d," + "\"output\":\"%s\",\"view_pid\":%d}", view == NULL ? -1 : (int)view->id, old_ws, ws, server->curr_output->wlr_output->name, view == NULL ? 0 : view->impl->get_pid(view)); diff --git a/man/cagebreak-socket.7.md b/man/cagebreak-socket.7.md index 4baed48..0ca9179 100644 --- a/man/cagebreak-socket.7.md +++ b/man/cagebreak-socket.7.md @@ -312,8 +312,8 @@ cg-ipc{"event_name":"move_view_to_output","view_id":113,"old_output":"eDP-1","ne ``` movetoworkspace 1 -cg-ipc{"event_name":"switch_ws","old_workspace":"1","new_workspace":"1","output":"eDP-1"} -cg-ipc{"event_name":"move_view_to_ws","view_id":"43","old_workspace":"0","new_workspace":"0","output":"eDP-1","view_pid":"64908"} +cg-ipc{"event_name":"switch_ws","old_workspace":1,"new_workspace":1,"output":"eDP-1"} +cg-ipc{"event_name":"move_view_to_ws","view_id":43,"old_workspace":0,"new_workspace":0,"output":"eDP-1","view_pid":64908} ``` *new_output* @@ -325,7 +325,7 @@ cg-ipc{"event_name":"move_view_to_ws","view_id":"43","old_workspace":"0","new_wo ``` # a new output is attached -cg-ipc{"event_name":"new_output","output":"HDMI-A-1","priority":"-1"} +cg-ipc{"event_name":"new_output","output":"HDMI-A-1","priority":-1} ``` *resize_tile* diff --git a/output.c b/output.c index ed7855f..ac8384e 100644 --- a/output.c +++ b/output.c @@ -129,7 +129,7 @@ output_destroy(struct cg_output *output) { if(outp_name != NULL) { ipc_send_event(server, - "{\"event_name\":\"new_output\",\"output\":\"%s\"}", + "{\"event_name\":\"destroy_output\",\"output\":\"%s\"}", outp_name); free(outp_name); } else { @@ -570,7 +570,7 @@ handle_new_output(struct wl_listener *listener, void *data) { wl_signal_add(&wlr_output->events.mode, &output->mode); ipc_send_event( server, - "{\"event_name\":\"new_output\",\"output\":\"%s\",\"priority\":\"%d\"}", + "{\"event_name\":\"new_output\",\"output\":\"%s\",\"priority\":%d}", output->wlr_output->name, output->priority); } #if CG_HAS_FANALYZE From 5b2a9e84ce4ed081e42b13dc0492fec9bda8a6ae Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 1 Jan 2023 12:30:56 +0100 Subject: [PATCH 510/689] Add Issues to Bugs.md --- Bugs.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/Bugs.md b/Bugs.md index fcb97b2..e3f8807 100644 --- a/Bugs.md +++ b/Bugs.md @@ -1039,3 +1039,28 @@ and `server_show_info` were fixed. This bug was found using the scan-build utility. +## Issue 46 + + * github issue number: #33 + * Fixed: 2.0.0 + +Cagebrak did not state in its FAQ how to use letters not found +on the current keyboards alphabet. + +## Issue 47 + + * github issue number: #32 + * Fixed: 2.0.0 + +Cagebreak did not state in its FAQ how programs can be launched. + +## Issue 48 + + * github issue number: #16 + * Fixed: 2.0.0 + +Cagebreak cursor sizes varied under some environmental circumstances. +Investigations showed that the cursor is set by the respective application +but environment variables are usually respected. This is now documented in +the FAQ. + From fbd33e8fa648a692b3e21503c73e7c1a5ab78929 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 1 Jan 2023 12:31:17 +0100 Subject: [PATCH 511/689] Add todo to socket doc --- man/cagebreak-socket.7.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/man/cagebreak-socket.7.md b/man/cagebreak-socket.7.md index 0ca9179..6b4aa1c 100644 --- a/man/cagebreak-socket.7.md +++ b/man/cagebreak-socket.7.md @@ -162,6 +162,8 @@ definemode foo cg-ipc{"event_name":"definemode","mode":"foo"} ``` +destroy_output TODO + *dump* - Trigger: *dump* command - JSON From 424266ec03965dc458a244cdd0f0d8db3d8e62a4 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 1 Jan 2023 14:04:48 +0100 Subject: [PATCH 512/689] Add #3 (49) to Bugs.md --- Bugs.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Bugs.md b/Bugs.md index e3f8807..004dac2 100644 --- a/Bugs.md +++ b/Bugs.md @@ -1064,3 +1064,12 @@ Investigations showed that the cursor is set by the respective application but environment variables are usually respected. This is now documented in the FAQ. +## Issue 49 + + * github issue number: #3 + * Fixed: 2.0.0 + +Cagebreak used to have no way to disable the interpretation of keybindings +for a specific keyboard, which was cumbersome for some applications. This +feature is now available + From cf53f8a97076a64501d9ed753ef1bd30a3a8c234 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 1 Jan 2023 14:42:56 +0100 Subject: [PATCH 513/689] Add Issue 50 (#26) to Bugs.md --- Bugs.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Bugs.md b/Bugs.md index 004dac2..41be864 100644 --- a/Bugs.md +++ b/Bugs.md @@ -1073,3 +1073,10 @@ Cagebreak used to have no way to disable the interpretation of keybindings for a specific keyboard, which was cumbersome for some applications. This feature is now available +## Issue 50 + + * github issue number: #26 + * Fixed: 2.0.0 + +Cagebreak used to have no way to hide the cursor. This is now possible. + From 4853f24390ce54850cf3b6a7520780e56076eb3b Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 1 Jan 2023 15:19:34 +0100 Subject: [PATCH 514/689] Add Issue 51 (#7) in Bugs.md --- Bugs.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Bugs.md b/Bugs.md index 41be864..39141c2 100644 --- a/Bugs.md +++ b/Bugs.md @@ -1080,3 +1080,11 @@ feature is now available Cagebreak used to have no way to hide the cursor. This is now possible. +## Issue 51 + + * github issue number: #7 + * Fixed: 2.0.0 + +Cagebreak used to not change the cursor while waiting for a key. The cursor +is now a square in this state. + From 6b480ebf0717c08f8a211c719e014377f6e1ef47 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 1 Jan 2023 15:58:22 +0100 Subject: [PATCH 515/689] Document keybinding enable/disable - Issue 51 in Bugs.md --- man/cagebreak-config.5.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index 111a789..6bc8510 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -182,6 +182,9 @@ definekey top mode root Enable or disable send_events for specified input device - Disabling send_events disables the input device. + *keybindings [enable|disable]* + Enable or disable keybinding interpretation for a specific keyboard. + *left_handed enabled|disabled* Enable or disable left handed mode for specified input device From 41a6ee2fc1d5fd9708c571ccddf2bce0a0ffb4a3 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 1 Jan 2023 16:30:55 +0100 Subject: [PATCH 516/689] Fix meson command in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bd29720..28e82fc 100644 --- a/README.md +++ b/README.md @@ -231,7 +231,7 @@ Here is an example workflow: ``` rm -rf build -CC=clang meson build -Dfuzz=true -Db_sanitize=address,undefined -Db_lundef=false +CC=clang meson setup build -Dfuzz=true -Db_sanitize=address,undefined -Db_lundef=false ninja -C build/ mkdir build/fuzz_corpus cp examples/config build/fuzz_corpus/ From 450d8128557a79fd1f4bd8b3c826325c077bef66 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 1 Jan 2023 17:35:11 +0100 Subject: [PATCH 517/689] Add destroy_output doc to socket man --- man/cagebreak-socket.7.md | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/man/cagebreak-socket.7.md b/man/cagebreak-socket.7.md index 6b4aa1c..4244e85 100644 --- a/man/cagebreak-socket.7.md +++ b/man/cagebreak-socket.7.md @@ -142,7 +142,7 @@ cg-ipc{"event_name":"cycle_views","old_view_id":11,"new_view_id":4,"tile_id":13, - event_name: "definekey" - modifiers: TODO - key: key as a number - - command: command as a number TODO + - command: command as a number TODO maybe will be changed to string, remove otherwise ``` definemode foo @@ -162,7 +162,16 @@ definemode foo cg-ipc{"event_name":"definemode","mode":"foo"} ``` -destroy_output TODO +*destroy_output* + - Trigger: removal of an output + - JSON + - event_name: "destroy_output" + - output: name of the output as a string + +``` +# remove output from the device +cg-ipc{"event_name":"destroy_output","output":"HDMI-A-1"} +``` *dump* - Trigger: *dump* command @@ -194,10 +203,11 @@ destroy_output TODO - view: view id as an integer - keyboards: object of objects for each keyboard - name_of_keyboard: object for a keyboard + - commands_enabled: 0 if keybindings are disabled for the keyboard, 1 otherwise - repeat_delay: repeat delay in milliseconds as an integer - repeat_rate: repeat rate in 1/sec as an integer + - input_devices: TODO - cursor_coords: object of x and y coordinates - - TODO ``` dump @@ -240,6 +250,7 @@ cg-ipc{"event_name":"dump","nws":1, }]}] }} ,"keyboards": {"0:1:Power_Button": { +"commands_enabled": 1, "repeat_delay": 600, "repeat_rate": 25 }} From 3cdc6ec36960a31e8cb54b3dfbb00dc4f17db921 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 1 Jan 2023 21:35:27 +0100 Subject: [PATCH 518/689] Adjust ipc syntax --- keybinding.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keybinding.c b/keybinding.c index b1131aa..cca943e 100644 --- a/keybinding.c +++ b/keybinding.c @@ -862,7 +862,7 @@ print_tile(struct cg_tile *tile) { tile->tile.y); print_str(&outp_str, "\"size\": {\"width\":%d,\"height\":%d},\n", tile->tile.width, tile->tile.height); - print_str(&outp_str, "\"view\": \"%d\"\n", + print_str(&outp_str, "\"view\": %d\n", tile->view == NULL ? -1 : (int)tile->view->id); return dyn_str_to_str(&outp_str); } @@ -1079,7 +1079,7 @@ print_input_device(struct cg_input_device *dev) { print_str(&outp_str, "\"NULL\": {\n"); } print_str(&outp_str, "\"is_virtual\": %d,\n", dev->is_virtual); - print_str(&outp_str, "\"type\": \"%s\",\n", dev->wlr_device->type==WLR_INPUT_DEVICE_POINTER?"pointer":dev->wlr_device->type==WLR_INPUT_DEVICE_SWITCH?"switch":dev->wlr_device->type==WLR_INPUT_DEVICE_TABLET_PAD?"tablet pad":dev->wlr_device->type==WLR_INPUT_DEVICE_TABLET_TOOL?"tablet tool":dev->wlr_device->type==WLR_INPUT_DEVICE_TOUCH?"touch":dev->wlr_device->type==WLR_INPUT_DEVICE_KEYBOARD?"keyboard":"unknown"); + print_str(&outp_str, "\"type\": \"%s\"\n", dev->wlr_device->type==WLR_INPUT_DEVICE_POINTER?"pointer":dev->wlr_device->type==WLR_INPUT_DEVICE_SWITCH?"switch":dev->wlr_device->type==WLR_INPUT_DEVICE_TABLET_PAD?"tablet pad":dev->wlr_device->type==WLR_INPUT_DEVICE_TABLET_TOOL?"tablet tool":dev->wlr_device->type==WLR_INPUT_DEVICE_TOUCH?"touch":dev->wlr_device->type==WLR_INPUT_DEVICE_KEYBOARD?"keyboard":"unknown"); print_str(&outp_str, "}"); return dyn_str_to_str(&outp_str); } From afe4a8385bfa2345059c01af14d339b695bdae4e Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 1 Jan 2023 21:35:36 +0100 Subject: [PATCH 519/689] Fix scan-build warnings --- cagebreak.c | 88 ++++++++++++++++++++++++++++++----------------------- server.c | 1 - 2 files changed, 50 insertions(+), 39 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index ccb4aaf..26864b5 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -153,7 +153,10 @@ parse_args(struct cg_server *server, int argc, char *argv[], char **config_path) show_info = true; break; case 'c': - *config_path=strdup(optarg); + if(optarg != NULL) { + *config_path=strdup(optarg); + optarg=NULL; + } break; case 'e': server->enable_socket=true; @@ -254,6 +257,7 @@ main(int argc, char *argv[]) { struct wl_event_source *sigint_source = NULL; struct wl_event_source *sigterm_source = NULL; struct wl_event_source *sigalrm_source = NULL; + struct wl_event_source *sigpipe_source = NULL; struct wlr_backend *backend = NULL; struct wlr_compositor *compositor = NULL; struct wlr_data_device_manager *data_device_manager = NULL; @@ -270,11 +274,15 @@ main(int argc, char *argv[]) { #if CG_HAS_XWAYLAND struct wlr_xwayland *xwayland = NULL; #endif + wl_list_init(&server.input_config); + wl_list_init(&server.output_config); + wl_list_init(&server.output_priorities); + int ret = 0; char *config_path = NULL; if(!parse_args(&server, argc, argv,&config_path)) { - return 1; + goto end; } #ifdef DEBUG @@ -283,14 +291,10 @@ main(int argc, char *argv[]) { wlr_log_init(WLR_ERROR, NULL); #endif - wl_list_init(&server.input_config); - wl_list_init(&server.output_config); - wl_list_init(&server.output_priorities); - server.modes = malloc(4 * sizeof(char *)); if(!server.modes) { wlr_log(WLR_ERROR, "Error allocating mode array"); - return -1; + goto end; } /* Wayland requires XDG_RUNTIME_DIR to be set. */ @@ -302,7 +306,8 @@ main(int argc, char *argv[]) { if(!server.wl_display) { wlr_log(WLR_ERROR, "Cannot allocate a Wayland display"); free(server.modes); - return 1; + server.modes=NULL; + goto end; } server.xcursor_size=XCURSOR_SIZE; @@ -325,8 +330,7 @@ main(int argc, char *argv[]) { if(server.modes[0] == NULL || server.modes[1] == NULL || server.modes[2] == NULL) { wlr_log(WLR_ERROR, "Error allocating default modes"); - free(server.modes); - return 1; + goto end; } server.nws = 1; @@ -352,7 +356,7 @@ main(int argc, char *argv[]) { wl_event_loop_add_signal(event_loop, SIGTERM, handle_signal, &server); sigalrm_source = wl_event_loop_add_signal(event_loop, SIGALRM, handle_signal, &server); - sigalrm_source = + sigpipe_source = wl_event_loop_add_signal(event_loop, SIGPIPE, handle_signal, &server); server.event_loop = event_loop; @@ -671,29 +675,24 @@ main(int argc, char *argv[]) { wl_display_destroy_clients(server.wl_display); end: + if(server.modes != NULL) { #if CG_HAS_FANALYZE #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wanalyzer-double-free" #endif - server.running=false; - for(unsigned int i = 0; server.modes[i] != NULL; ++i) { - free(server.modes[i]); + for(unsigned int i = 0; server.modes[i] != NULL; ++i) { + free(server.modes[i]); + } + free(server.modes); } - free(server.modes); if(config_path != NULL) { free(config_path); } -#if CG_HAS_XWAYLAND - if(xwayland!=NULL) { - wlr_xwayland_destroy(xwayland); - } -#endif - struct cg_output_config *output_config, *output_config_tmp; wl_list_for_each_safe(output_config, output_config_tmp, - &server.output_config, link) { + &server.output_config, link) { wl_list_remove(&output_config->link); free(output_config->output_name); free(output_config); @@ -701,7 +700,7 @@ end: struct cg_input_config *input_config, *input_config_tmp; wl_list_for_each_safe(input_config, input_config_tmp, - &server.input_config, link) { + &server.input_config, link) { wl_list_remove(&input_config->link); if(input_config->identifier != NULL) { free(input_config->identifier); @@ -709,24 +708,37 @@ end: free(input_config); } - keybinding_list_free(server.keybindings); - wl_event_source_remove(sigint_source); - wl_event_source_remove(sigterm_source); - wl_event_source_remove(sigalrm_source); + if(server.keybindings != NULL) { + keybinding_list_free(server.keybindings); + } - seat_destroy(server.seat); - /* This function is not null-safe, but we only ever get here - with a proper wl_display. */ - wl_display_destroy(server.wl_display); - wlr_output_layout_destroy(server.output_layout); + if(server.running == true) { + server.running=false; +#if CG_HAS_XWAYLAND + if(xwayland!=NULL) { + wlr_xwayland_destroy(xwayland); + } +#endif - free(server.input); - free(server.message_config.font); - pango_cairo_font_map_set_default(NULL); - cairo_debug_reset_static_data(); - FcFini(); + wl_event_source_remove(sigint_source); + wl_event_source_remove(sigterm_source); + wl_event_source_remove(sigalrm_source); + wl_event_source_remove(sigpipe_source); - return ret; + seat_destroy(server.seat); + /* This function is not null-safe, but we only ever get here + with a proper wl_display. */ + wl_display_destroy(server.wl_display); + wlr_output_layout_destroy(server.output_layout); + + free(server.input); + free(server.message_config.font); + pango_cairo_font_map_set_default(NULL); + cairo_debug_reset_static_data(); + FcFini(); + + return ret; + } } #if CG_HAS_FANALYZE #pragma GCC diagnostic pop diff --git a/server.c b/server.c index 16253d8..292d0b0 100644 --- a/server.c +++ b/server.c @@ -25,7 +25,6 @@ display_terminate(struct cg_server *server) { if(server == NULL) { return; } - server->running = false; wl_display_terminate(server->wl_display); } From 70664c428dd013e96a2f4b9cd13476b7ae0d1004 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 1 Jan 2023 23:13:59 +0100 Subject: [PATCH 520/689] Adjust documentation to changed socket --- man/cagebreak-socket.7.md | 120 +++++++++++++++++++++++++++++++------- 1 file changed, 100 insertions(+), 20 deletions(-) diff --git a/man/cagebreak-socket.7.md b/man/cagebreak-socket.7.md index 4244e85..66e84c9 100644 --- a/man/cagebreak-socket.7.md +++ b/man/cagebreak-socket.7.md @@ -140,7 +140,15 @@ cg-ipc{"event_name":"cycle_views","old_view_id":11,"new_view_id":4,"tile_id":13, - Trigger: *definekey* command - JSON - event_name: "definekey" - - modifiers: TODO + - modifiers: number denoting the modifier as described below + - 0: no modifier + - 1: shift + - 2: alt + - 3: ctrl + - 4: logo key + - 5: modifier 2 + - 6: modifier 3 + - 7: modifier 5 - key: key as a number - command: command as a number TODO maybe will be changed to string, remove otherwise @@ -201,20 +209,23 @@ cg-ipc{"event_name":"destroy_output","output":"HDMI-A-1"} - coords: object of x and y coordinates - size: object of width and height - view: view id as an integer - - keyboards: object of objects for each keyboard + - keyboards: object of objects for each keyboard group - name_of_keyboard: object for a keyboard - commands_enabled: 0 if keybindings are disabled for the keyboard, 1 otherwise - repeat_delay: repeat delay in milliseconds as an integer - repeat_rate: repeat rate in 1/sec as an integer - - input_devices: TODO + - input_devices: object of objects for each keyboard + - identifier for a keyboard: object + - is_virtual: 0 if physical, 1 otherwise + - type: [keyboard|pointer|switch] - cursor_coords: object of x and y coordinates ``` dump cg-ipc{"event_name":"dump","nws":1, "bg_color":[0.000000,0.000000,0.000000,1.000000], -"views_curr_id":9, -"tiles_curr_id":3, +"views_curr_id":80, +"tiles_curr_id":8, "curr_output":"eDP-1", "modes":["top","root","resize"], "outputs": {"eDP-1": { @@ -224,28 +235,64 @@ cg-ipc{"event_name":"dump","nws":1, "refresh_rate": 60.012000, "curr_workspace": 0, "workspaces": [{"views": [{ -"id": 4, -"pid": 37878, +"id": 16, +"pid": 2505, "coords": {"x":0,"y":0}, "type": "xwayland" },{ -"id": 8, -"pid": "38279", +"id": 51, +"pid": 6667, +"coords": {"x":0,"y":0}, +"type": "xdg" + +},{ +"id": 72, +"pid": 11243, +"coords": {"x":0,"y":0}, +"type": "xdg" + +},{ +"id": 56, +"pid": 6700, "coords": {"x":1280,"y":0}, "type": "xdg" -}],"tiles": [{ -"id": 2, +},{ +"id": 20, +"pid": 3044, "coords": {"x":1280,"y":0}, -"size": {"width":1280,"height":1440}, -"view": "8" +"type": "xdg" },{ -"id": 1, +"id": 42, +"pid": 6397, +"coords": {"x":1280,"y":0}, +"type": "xdg" + +},{ +"id": 65, +"pid": 8453, +"coords": {"x":0,"y":0}, +"type": "xdg" + +},{ +"id": 78, +"pid": 12631, +"coords": {"x":0,"y":0}, +"type": "xdg" + +}],"tiles": [{ +"id": 6, "coords": {"x":0,"y":0}, "size": {"width":1280,"height":1440}, -"view": "4" +"view": "78" + +},{ +"id": 7, +"coords": {"x":1280,"y":0}, +"size": {"width":1280,"height":1440}, +"view": "42" }]}] }} @@ -254,7 +301,41 @@ cg-ipc{"event_name":"dump","nws":1, "repeat_delay": 600, "repeat_rate": 25 }} -,"cursor_coords":{"x":1737.440431,"y":677.906813} +,"input_devices": {"6058:20564:ThinkPad_Extra_Buttons": { +"is_virtual": 0, +"type": "switch", +},"6058:20564:ThinkPad_Extra_Buttons": { +"is_virtual": 0, +"type": "keyboard", +},"2:10:TPPS/2_Elan_TrackPoint": { +"is_virtual": 0, +"type": "pointer", +},"1:1:AT_Translated_Set_2_keyboard": { +"is_virtual": 0, +"type": "keyboard", +},"0:0:sof-hda-dsp_Headphone": { +"is_virtual": 0, +"type": "keyboard", +},"1739:52619:SYNA8004:00_06CB:CD8B_Touchpad": { +"is_virtual": 0, +"type": "pointer", +},"1739:52619:SYNA8004:00_06CB:CD8B_Mouse": { +"is_virtual": 0, +"type": "pointer", +},"0:3:Sleep_Button": { +"is_virtual": 0, +"type": "keyboard", +},"0:5:Lid_Switch": { +"is_virtual": 0, +"type": "switch", +},"0:6:Video_Bus": { +"is_virtual": 0, +"type": "keyboard", +},"0:1:Power_Button": { +"is_virtual": 0, +"type": "keyboard", +}} +,"cursor_coords":{"x":972.821761,"y":670.836215} } ``` @@ -292,7 +373,6 @@ cg-ipc{"event_name":"fullscreen","tile_id":3,"workspace":1,"output":"eDP-1"} - view_id: view id as an integer - old_output: name of the old output as a string - new_output: name of the new output as a string - - TODO tile id? ``` movetonextscreen @@ -311,7 +391,7 @@ cg-ipc{"event_name":"move_view_to_cycle_output","view_id":11,"old_output":"eDP-1 ``` movetoscreen 2 cg-ipc{"event_name":"switch_output","old_output":"eDP-1","new_output":"HDMI-A-1"} -cg-ipc{"event_name":"move_view_to_output","view_id":113,"old_output":"eDP-1","new_output":"HDMI-A-1"} +cg-ipc{"event_name":"move_view_to_output","view_id":78,"old_output":"eDP-1","new_output":"HDMI-A-1"} ``` *move_view_to_ws* @@ -346,8 +426,8 @@ cg-ipc{"event_name":"new_output","output":"HDMI-A-1","priority":-1} - JSON - event_name: "resize_tile" - tile_id: tile id as an integer - - old_dims: TODO - - new_dimes: TODO + - old_dims: list of pixels [x pixels of lower left corner, y pixels of lower left corner, x pixels of upper right corner, y pixels of upper right corner + - new_dims: list of pixels [x pixels of lower left corner, y pixels of lower left corner, x pixels of upper right corner, y pixels of upper right corner - workspace: workspace number as an integer - output: name of the output as a string From 9d1cafa2f66c67c4101445631628208574f7f92f Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 2 Jan 2023 07:51:51 +0100 Subject: [PATCH 521/689] Support printing commands as string over ipc --- keybinding.c | 4 +- keybinding.h | 107 ++++++++++++++++++++++++++++----------------------- 2 files changed, 61 insertions(+), 50 deletions(-) diff --git a/keybinding.c b/keybinding.c index cca943e..416ecac 100644 --- a/keybinding.c +++ b/keybinding.c @@ -1294,8 +1294,8 @@ keybinding_definekey(struct cg_server *server, struct keybinding *kb) { keybinding_list_push(server->keybindings, kb); ipc_send_event(server, "{\"event_name\":\"definekey\",\"modifiers\":%d,\"key\":" - "%d,\"command\":%d}", - kb->modifiers, kb->key, kb->action); + "%d,\"command\":\"%s\"}", + kb->modifiers, kb->key, keybinding_action_string[kb->action]); } void diff --git a/keybinding.h b/keybinding.h index 45784b5..a70709f 100644 --- a/keybinding.h +++ b/keybinding.h @@ -10,59 +10,70 @@ struct cg_server; +#define FOREACH_KEYBINDING(KEYBINDING) \ + KEYBINDING(KEYBINDING_RUN_COMMAND) /* data.c is the string to execute */ \ + KEYBINDING(KEYBINDING_CLOSE_VIEW) \ + KEYBINDING(KEYBINDING_SPLIT_VERTICAL) \ + KEYBINDING(KEYBINDING_SPLIT_HORIZONTAL) \ + KEYBINDING(KEYBINDING_CHANGE_TTY) /*data.u is the desired tty*/\ + KEYBINDING(KEYBINDING_LAYOUT_FULLSCREEN)\ + KEYBINDING(KEYBINDING_CYCLE_VIEWS) /* data.b is 0 if forward, 1 if reverse */\ + KEYBINDING(KEYBINDING_CYCLE_TILES) /* data.b is 0 if forward, 1 if reverse */\ + KEYBINDING(KEYBINDING_CYCLE_OUTPUT) /* data.b is 0 if forward, 1 if reverse */\ + KEYBINDING(KEYBINDING_CONFIGURE_OUTPUT) /* data.o_cfg is the desired output */\ +\ + KEYBINDING(KEYBINDING_CONFIGURE_MESSAGE) /* data.m_cfg is the desired config */\ + KEYBINDING(KEYBINDING_CONFIGURE_INPUT) /* data.i_cfg is the desired input configuration */\ +\ + KEYBINDING(KEYBINDING_QUIT)\ + KEYBINDING(KEYBINDING_NOOP)\ + KEYBINDING(KEYBINDING_SWITCH_OUTPUT) /* data.u is the desired output */\ + KEYBINDING(KEYBINDING_SWITCH_WORKSPACE) /* data.u is the desired workspace */\ + KEYBINDING(KEYBINDING_SWITCH_MODE) /* data.u is the desired mode */\ + KEYBINDING(KEYBINDING_SWITCH_DEFAULT_MODE) /* data.u is the desired mode */\ + KEYBINDING(KEYBINDING_RESIZE_TILE_HORIZONTAL) /* data.i is the number of pixels to add */\ +\ + KEYBINDING(KEYBINDING_RESIZE_TILE_VERTICAL) /* data.i is the number of pixels to add to */\ +\ + KEYBINDING(KEYBINDING_MOVE_VIEW_TO_WORKSPACE) /* data.u is the desired workspace */\ + KEYBINDING(KEYBINDING_MOVE_VIEW_TO_OUTPUT) /* data.u is the desired output */\ + KEYBINDING(KEYBINDING_MOVE_VIEW_TO_CYCLE_OUTPUT) /* data.b is 0 if forward, 1 if */\ +\ + KEYBINDING(KEYBINDING_DUMP)\ + KEYBINDING(KEYBINDING_SHOW_TIME)\ + KEYBINDING(KEYBINDING_SHOW_INFO)\ + KEYBINDING(KEYBINDING_DISPLAY_MESSAGE)\ + KEYBINDING(KEYBINDING_CURSOR)\ +\ + KEYBINDING(KEYBINDING_SWAP_LEFT)\ + KEYBINDING(KEYBINDING_SWAP_RIGHT)\ + KEYBINDING(KEYBINDING_SWAP_TOP)\ + KEYBINDING(KEYBINDING_SWAP_BOTTOM)\ +\ + KEYBINDING(KEYBINDING_FOCUS_LEFT)\ + KEYBINDING(KEYBINDING_FOCUS_RIGHT)\ + KEYBINDING(KEYBINDING_FOCUS_TOP)\ + KEYBINDING(KEYBINDING_FOCUS_BOTTOM)\ + KEYBINDING(KEYBINDING_FOCUS_TILE)\ +\ + KEYBINDING(KEYBINDING_DEFINEKEY) /* data.kb is the keybinding definition */\ + KEYBINDING(KEYBINDING_BACKGROUND) /* data.color is the background color */\ + KEYBINDING(KEYBINDING_DEFINEMODE) /* data.c is the mode name */\ + KEYBINDING(KEYBINDING_WORKSPACES) /* data.i is the number of workspaces */\ + + +#define GENERATE_ENUM(ENUM) ENUM, +#define GENERATE_STRING(STRING) #STRING, + /* Important: if you add a keybinding which uses data.c or requires "free" * to be called, don't forget to add it to the function "keybinding_list_free" * in keybinding.c */ enum keybinding_action { - KEYBINDING_RUN_COMMAND, // data.c is the string to execute - KEYBINDING_CLOSE_VIEW, - KEYBINDING_SPLIT_VERTICAL, - KEYBINDING_SPLIT_HORIZONTAL, - KEYBINDING_CHANGE_TTY, // data.u is the desired tty - KEYBINDING_LAYOUT_FULLSCREEN, - KEYBINDING_CYCLE_VIEWS, // data.b is 0 if forward, 1 if reverse - KEYBINDING_CYCLE_TILES, // data.b is 0 if forward, 1 if reverse - KEYBINDING_CYCLE_OUTPUT, // data.b is 0 if forward, 1 if reverse - KEYBINDING_CONFIGURE_OUTPUT, // data.o_cfg is the desired output - // configuration - KEYBINDING_CONFIGURE_MESSAGE, // data.m_cfg is the desired config - KEYBINDING_CONFIGURE_INPUT, // data.i_cfg is the desired input - // configuration - KEYBINDING_QUIT, - KEYBINDING_NOOP, - KEYBINDING_SWITCH_OUTPUT, // data.u is the desired output - KEYBINDING_SWITCH_WORKSPACE, // data.u is the desired workspace - KEYBINDING_SWITCH_MODE, // data.u is the desired mode - KEYBINDING_SWITCH_DEFAULT_MODE, // data.u is the desired mode - KEYBINDING_RESIZE_TILE_HORIZONTAL, // data.i is the number of pixels to add - // to the current width - KEYBINDING_RESIZE_TILE_VERTICAL, // data.i is the number of pixels to add to - // the current height - KEYBINDING_MOVE_VIEW_TO_WORKSPACE, // data.u is the desired workspace - KEYBINDING_MOVE_VIEW_TO_OUTPUT, // data.u is the desired output - KEYBINDING_MOVE_VIEW_TO_CYCLE_OUTPUT, // data.b is 0 if forward, 1 if - // reverse - KEYBINDING_DUMP, - KEYBINDING_SHOW_TIME, - KEYBINDING_SHOW_INFO, - KEYBINDING_DISPLAY_MESSAGE, - KEYBINDING_CURSOR, + FOREACH_KEYBINDING(GENERATE_ENUM) +}; - KEYBINDING_SWAP_LEFT, - KEYBINDING_SWAP_RIGHT, - KEYBINDING_SWAP_TOP, - KEYBINDING_SWAP_BOTTOM, - - KEYBINDING_FOCUS_LEFT, - KEYBINDING_FOCUS_RIGHT, - KEYBINDING_FOCUS_TOP, - KEYBINDING_FOCUS_BOTTOM, - KEYBINDING_FOCUS_TILE, - - KEYBINDING_DEFINEKEY, // data.kb is the keybinding definition - KEYBINDING_BACKGROUND, // data.color is the background color - KEYBINDING_DEFINEMODE, // data.c is the mode name - KEYBINDING_WORKSPACES, // data.i is the number of workspaces +static const char *keybinding_action_string[] = { + FOREACH_KEYBINDING(GENERATE_STRING) }; union keybinding_params { From 02b73fb2b20ab9ebcc8923ebfd462a3976da37f3 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 2 Jan 2023 08:35:09 +0100 Subject: [PATCH 522/689] Fix fuzzing - Fix fuzzing build - Fix bugs found by fuzzer --- fuzz/fuzz-lib.c | 178 ++++++++++++++++++++++++++++++---------------- fuzz/fuzz-parse.c | 9 ++- fuzz/meson.build | 2 +- keybinding.c | 17 +++-- output.c | 2 +- workspace.c | 4 ++ 6 files changed, 138 insertions(+), 74 deletions(-) diff --git a/fuzz/fuzz-lib.c b/fuzz/fuzz-lib.c index c94dd8b..e46bf5d 100644 --- a/fuzz/fuzz-lib.c +++ b/fuzz/fuzz-lib.c @@ -20,8 +20,12 @@ #include #include +#include +#include +#include #include #include +#include #include #include #include @@ -88,15 +92,6 @@ drop_permissions(void) { return true; } -static bool -parse_args(struct cg_server *server, int argc, char *argv[]) { - server->output_transform = WL_OUTPUT_TRANSFORM_NORMAL; -#ifdef DEBUG - server->debug_damage_tracking = false; -#endif - return true; -} - void cleanup() { server.running = false; @@ -120,13 +115,11 @@ cleanup() { seat_destroy(server.seat); /* This function is not null-safe, but we only ever get here with a proper wl_display. */ - wl_display_destroy(server.wl_display); wlr_output_layout_destroy(server.output_layout); } int LLVMFuzzerInitialize(int *argc, char ***argv) { - struct wl_event_loop *event_loop = NULL; struct wlr_backend *backend = NULL; struct wlr_compositor *compositor = NULL; struct wlr_data_device_manager *data_device_manager = NULL; @@ -135,13 +128,22 @@ LLVMFuzzerInitialize(int *argc, char ***argv) { struct wlr_export_dmabuf_manager_v1 *export_dmabuf_manager = NULL; struct wlr_screencopy_manager_v1 *screencopy_manager = NULL; struct wlr_data_control_manager_v1 *data_control_manager = NULL; + struct wlr_viewporter *viewporter = NULL; + struct wlr_presentation *presentation = NULL; struct wlr_xdg_output_manager_v1 *output_manager = NULL; struct wlr_gamma_control_manager_v1 *gamma_control_manager = NULL; - int ret = 0; + struct wlr_xdg_shell *xdg_shell = NULL; +#if CG_HAS_XWAYLAND + struct wlr_xwayland *xwayland = NULL; +#endif + wl_list_init(&server.input_config); + wl_list_init(&server.output_config); + wl_list_init(&server.output_priorities); + wl_list_init(&server.outputs); + wl_list_init(&server.disabled_outputs); - if(!parse_args(&server, *argc, *argv)) { - return 1; - } + + int ret = 0; #ifdef DEBUG wlr_log_init(WLR_DEBUG, NULL); @@ -149,33 +151,63 @@ LLVMFuzzerInitialize(int *argc, char ***argv) { wlr_log_init(WLR_ERROR, NULL); #endif - wl_list_init(&server.input_config); + server.modes = malloc(4 * sizeof(char *)); + if(!server.modes) { + wlr_log(WLR_ERROR, "Error allocating mode array"); + goto end; + } /* Wayland requires XDG_RUNTIME_DIR to be set. */ if(!getenv("XDG_RUNTIME_DIR")) { - wlr_log(WLR_ERROR, "XDG_RUNTIME_DIR is not set in the environment"); - return 1; + wlr_log(WLR_INFO, "XDG_RUNTIME_DIR is not set in the environment"); } server.wl_display = wl_display_create(); if(!server.wl_display) { wlr_log(WLR_ERROR, "Cannot allocate a Wayland display"); - return 1; + free(server.modes); + server.modes=NULL; + goto end; + } + + server.xcursor_size=XCURSOR_SIZE; + const char *env_cursor_size = getenv("XCURSOR_SIZE"); + if (env_cursor_size && strlen(env_cursor_size) > 0) { + errno = 0; + char *end; + unsigned size = strtoul(env_cursor_size, &end, 10); + if (!*end && errno == 0) { + server.xcursor_size = size; + } } server.running = true; - server.modes = malloc(4 * sizeof(char *)); server.modes[0] = strdup("top"); server.modes[1] = strdup("root"); server.modes[2] = strdup("resize"); server.modes[3] = NULL; + if(server.modes[0] == NULL || server.modes[1] == NULL || + server.modes[2] == NULL) { + wlr_log(WLR_ERROR, "Error allocating default modes"); + goto end; + } server.nws = 1; - server.message_timeout = 2; + server.views_curr_id = 1; + server.tiles_curr_id = 1; + server.message_config.fg_color[0] = 0.0; + server.message_config.fg_color[1] = 0.0; + server.message_config.fg_color[2] = 0.0; + server.message_config.fg_color[3] = 1.0; - event_loop = wl_display_get_event_loop(server.wl_display); - server.event_loop = event_loop; + server.message_config.bg_color[0] = 0.9; + server.message_config.bg_color[1] = 0.85; + server.message_config.bg_color[2] = 0.85; + server.message_config.bg_color[3] = 1.0; + + server.message_config.display_time = 2; + server.message_config.font = strdup("pango:Monospace 10"); backend = wlr_multi_backend_create(server.wl_display); if(!backend) { @@ -201,10 +233,6 @@ LLVMFuzzerInitialize(int *argc, char ***argv) { goto end; }; - if(!drop_permissions()) { - ret = 1; - goto end; - } server.keybindings = keybinding_list_init(); if(server.keybindings == NULL || server.keybindings->keybindings == NULL) { @@ -213,14 +241,13 @@ LLVMFuzzerInitialize(int *argc, char ***argv) { goto end; } - wl_list_init(&server.output_config); - server.renderer = wlr_renderer_autocreate(backend); if(!server.renderer) { wlr_log(WLR_ERROR, "Unable to create the wlroots renderer"); ret = 1; goto end; } + server.allocator = wlr_allocator_autocreate(server.backend, server.renderer); if(!server.allocator) { @@ -228,16 +255,10 @@ LLVMFuzzerInitialize(int *argc, char ***argv) { ret = 1; goto end; } + wlr_renderer_init_wl_display(server.renderer, server.wl_display); - server.bg_color = malloc(4 * sizeof(float)); - server.bg_color[0] = 0; - server.bg_color[1] = 0; - server.bg_color[2] = 0; - server.bg_color[3] = 1; - wl_list_init(&server.outputs); - wl_list_init(&server.disabled_outputs); - + server.bg_color = (float[4]){0, 0, 0, 1}; server.output_layout = wlr_output_layout_create(); if(!server.output_layout) { wlr_log(WLR_ERROR, "Unable to create output layout"); @@ -245,6 +266,27 @@ LLVMFuzzerInitialize(int *argc, char ***argv) { goto end; } + if(ipc_init(&server) != 0) { + wlr_log(WLR_ERROR, "Failed to initialize IPC"); + ret = 1; + goto end; + } + + server.scene = wlr_scene_create(); + if(!server.scene) { + wlr_log(WLR_ERROR, "Unable to create scene"); + ret = 1; + goto end; + } + wlr_scene_attach_output_layout(server.scene, server.output_layout); + + compositor = wlr_compositor_create(server.wl_display, server.renderer); + if(!compositor) { + wlr_log(WLR_ERROR, "Unable to create the wlroots compositor"); + ret = 1; + goto end; + } + data_device_manager = wlr_data_device_manager_create(server.wl_display); if(!data_device_manager) { wlr_log(WLR_ERROR, "Unable to create the data device manager"); @@ -324,6 +366,21 @@ LLVMFuzzerInitialize(int *argc, char ***argv) { wlr_server_decoration_manager_set_default_mode( server_decoration_manager, WLR_SERVER_DECORATION_MANAGER_MODE_SERVER); + viewporter = wlr_viewporter_create(server.wl_display); + if(!viewporter) { + wlr_log(WLR_ERROR, "Unable to create the viewporter interface"); + ret = 1; + goto end; + } + + presentation = wlr_presentation_create(server.wl_display, server.backend); + if(!presentation) { + wlr_log(WLR_ERROR, "Unable to create the presentation interface"); + ret = 1; + goto end; + } + wlr_scene_set_presentation(server.scene, presentation); + export_dmabuf_manager = wlr_export_dmabuf_manager_v1_create(server.wl_display); if(!export_dmabuf_manager) { @@ -347,17 +404,17 @@ LLVMFuzzerInitialize(int *argc, char ***argv) { goto end; } - gamma_control_manager = - wlr_gamma_control_manager_v1_create(server.wl_display); - if(!gamma_control_manager) { - wlr_log(WLR_ERROR, "Unable to create the gamma control manager"); + if(!wlr_primary_selection_v1_device_manager_create(server.wl_display)) { + wlr_log(WLR_ERROR, + "Unable to create the primary selection device manager"); ret = 1; goto end; } - compositor = wlr_compositor_create(server.wl_display, server.renderer); - if(!compositor) { - wlr_log(WLR_ERROR, "Unable to create the wlroots compositor"); + gamma_control_manager = + wlr_gamma_control_manager_v1_create(server.wl_display); + if(!gamma_control_manager) { + wlr_log(WLR_ERROR, "Unable to create the gamma control manager"); ret = 1; goto end; } @@ -372,13 +429,6 @@ LLVMFuzzerInitialize(int *argc, char ***argv) { server.new_xwayland_surface.notify = handle_xwayland_surface_new; wl_signal_add(&xwayland->events.new_surface, &server.new_xwayland_surface); - xcursor_manager = wlr_xcursor_manager_create(DEFAULT_XCURSOR, XCURSOR_SIZE); - if(!xcursor_manager) { - wlr_log(WLR_ERROR, "Cannot create XWayland XCursor manager"); - ret = 1; - goto end; - } - if(setenv("DISPLAY", xwayland->display_name, true) < 0) { wlr_log_errno(WLR_ERROR, "Unable to set DISPLAY for XWayland.", "Clients may not be able to connect"); @@ -387,18 +437,15 @@ LLVMFuzzerInitialize(int *argc, char ***argv) { xwayland->display_name); } - if(wlr_xcursor_manager_load(xcursor_manager, 1)) { - wlr_log(WLR_ERROR, "Cannot load XWayland XCursor theme"); - } struct wlr_xcursor *xcursor = - wlr_xcursor_manager_get_xcursor(xcursor_manager, DEFAULT_XCURSOR, 1); + wlr_xcursor_manager_get_xcursor(server.seat->xcursor_manager, DEFAULT_XCURSOR, 1); + if(xcursor) { struct wlr_xcursor_image *image = xcursor->images[0]; wlr_xwayland_set_cursor(xwayland, image->buffer, image->width * 4, image->width, image->height, image->hotspot_x, image->hotspot_y); } - #endif const char *socket = wl_display_add_socket_auto(server.wl_display); @@ -418,15 +465,25 @@ LLVMFuzzerInitialize(int *argc, char ***argv) { wlr_log_errno(WLR_ERROR, "Unable to set WAYLAND_DISPLAY.", "Clients may not be able to connect"); } else { - wlr_log(WLR_DEBUG, - "Cagebreak " CG_VERSION " is running on Wayland display %s", - socket); + fprintf(stderr, "Cagebreak " CG_VERSION " is running on Wayland display %s\n", socket); + } + +#if CG_HAS_XWAYLAND + wlr_xwayland_set_seat(xwayland, server.seat->seat); +#endif + + /* Place the cursor to the top left of the output layout. */ + wlr_cursor_warp(server.seat->cursor, NULL, 0, 0); + + + if(!drop_permissions()) { + ret = 1; + goto end; } /* Place the cursor to the topl left of the output layout. */ wlr_cursor_warp(server.seat->cursor, NULL, 0, 0); atexit(cleanup); - // server.wl_display->run = 1; return 0; end: cleanup(); @@ -571,5 +628,4 @@ destroy_output(char *line, struct cg_server *server) { --outpn; } } - it->damage_destroy.notify(&it->damage_destroy, NULL); } diff --git a/fuzz/fuzz-parse.c b/fuzz/fuzz-parse.c index 8aded78..d152f07 100644 --- a/fuzz/fuzz-parse.c +++ b/fuzz/fuzz-parse.c @@ -38,7 +38,7 @@ set_configuration(struct cg_server *server, char *content) { (line = strtok_r(NULL, "\n", &content)) != NULL; ++line_num) { line[strcspn(line, "\n")] = '\0'; if(*line != '\0' && *line != '#') { - char *errstr; + char *errstr=NULL; server->running = true; if(parse_rc_line(server, line, &errstr) != 0) { if(errstr != NULL) { @@ -56,10 +56,9 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { if(size == 0) { return 0; } - int max_line_size = 256 > size ? size : 256; - char *str = malloc(sizeof(char) * max_line_size); - strncpy(str, (char *)data, max_line_size); - str[max_line_size - 1] = 0; + char *str = malloc(sizeof(char) * size); + strncpy(str, (char *)data, size); + str[size - 1] = 0; set_configuration(&server, str); free(str); keybinding_list_free(server.keybindings); diff --git a/fuzz/meson.build b/fuzz/meson.build index b5ba1be..b8448bc 100644 --- a/fuzz/meson.build +++ b/fuzz/meson.build @@ -19,7 +19,7 @@ endif override_lib = shared_library('execl_override', [ 'execl_override.c' ], - dependencies: [ pixman,cairo,pango,pangocairo ], + dependencies: [ cairo,pango,pangocairo ], install: false ) diff --git a/keybinding.c b/keybinding.c index 416ecac..f809b34 100644 --- a/keybinding.c +++ b/keybinding.c @@ -87,6 +87,10 @@ keybinding_free(struct keybinding *keybinding, bool recursive) { free(keybinding->data.m_cfg->font); } break; + case KEYBINDING_DISPLAY_MESSAGE: + if(keybinding->data.c != NULL) { + free(keybinding->data.c); + } default: break; } @@ -1046,7 +1050,7 @@ print_keyboard_groups(struct cg_server *server) { struct dyn_str outp_str; outp_str.len = 0; outp_str.cur_pos = 0; - outp_str.str_arr = calloc((2 * ninps - 1) + 2, sizeof(char *)); + outp_str.str_arr = calloc((2 * ninps - 1) + 3, sizeof(char *)); print_str(&outp_str, "\"keyboards\": {"); struct cg_keyboard_group *it; uint32_t count = 0; @@ -1090,7 +1094,7 @@ print_input_devices(struct cg_server *server) { struct dyn_str outp_str; outp_str.len = 0; outp_str.cur_pos = 0; - outp_str.str_arr = calloc((2 * ninps - 1) + 2, sizeof(char *)); + outp_str.str_arr = calloc((2 * ninps - 1) + 3, sizeof(char *)); print_str(&outp_str, "\"input_devices\": {"); struct cg_input_device *it; uint32_t count = 0; @@ -1217,9 +1221,10 @@ keybinding_move_view_to_cycle_output(struct cg_server *server, bool reverse) { void keybinding_set_nws(struct cg_server *server, int nws) { struct cg_output *output; - int old_nws = server->nws; + unsigned int old_nws = server->nws; + server->nws = nws; wl_list_for_each(output, &server->outputs, link) { - for(unsigned int i = nws; i < server->nws; ++i) { + for(unsigned int i = nws; i < old_nws; ++i) { struct cg_view *view, *tmp; wl_list_for_each_safe(view, tmp, &output->workspaces[i]->views, link) { @@ -1244,7 +1249,7 @@ keybinding_set_nws(struct cg_server *server, int nws) { return; } output->workspaces = new_workspaces; - for(int i = server->nws; i < nws; ++i) { + for(int i = old_nws; i < nws; ++i) { output->workspaces[i] = full_screen_workspace(output); output->workspaces[i]->num = i; if(!output->workspaces[i]) { @@ -1257,10 +1262,10 @@ keybinding_set_nws(struct cg_server *server, int nws) { } if(output->curr_workspace >= nws) { + output->curr_workspace=0; workspace_focus(output, nws - 1); } } - server->nws = nws; seat_set_focus( server->seat, server->curr_output->workspaces[server->curr_output->curr_workspace] diff --git a/output.c b/output.c index ac8384e..379e9d1 100644 --- a/output.c +++ b/output.c @@ -540,11 +540,11 @@ handle_new_output(struct wl_listener *listener, void *data) { output->workspaces = malloc(server->nws * sizeof(struct cg_workspace *)); for(unsigned int i = 0; i < server->nws; ++i) { output->workspaces[i] = full_screen_workspace(output); - output->workspaces[i]->num = i; if(!output->workspaces[i]) { wlr_log(WLR_ERROR, "Failed to allocate workspaces for output"); return; } + output->workspaces[i]->num = i; wl_list_init(&output->workspaces[i]->views); wl_list_init(&output->workspaces[i]->unmanaged_views); } diff --git a/workspace.c b/workspace.c index 3b2b8e9..a9b9734 100644 --- a/workspace.c +++ b/workspace.c @@ -126,6 +126,10 @@ workspace_free(struct cg_workspace *workspace) { void workspace_focus(struct cg_output *outp, int ws) { + if(ws>=outp->server->nws) { + wlr_log(WLR_ERROR,"Attempt to focus workspace %d, but only %d workspaces are available.",ws,outp->server->nws); + return; + } wlr_scene_node_place_above( &outp->bg->node, &outp->workspaces[outp->curr_workspace]->scene->node); wlr_scene_node_place_above(&outp->workspaces[ws]->scene->node, From 3773a5f167ccf672949b8cec247aa218db2105f6 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 2 Jan 2023 10:18:14 +0100 Subject: [PATCH 523/689] Fix compiler warnings --- keybinding.c | 4 ++++ keybinding.h | 4 +--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/keybinding.c b/keybinding.c index f809b34..d3b3e61 100644 --- a/keybinding.c +++ b/keybinding.c @@ -25,6 +25,10 @@ #include "view.h" #include "workspace.h" +char *keybinding_action_string[] = { + FOREACH_KEYBINDING(GENERATE_STRING) +}; + int keybinding_resize(struct keybinding_list *list) { if(list->length == list->capacity) { diff --git a/keybinding.h b/keybinding.h index a70709f..2ecf4b0 100644 --- a/keybinding.h +++ b/keybinding.h @@ -72,9 +72,7 @@ enum keybinding_action { FOREACH_KEYBINDING(GENERATE_ENUM) }; -static const char *keybinding_action_string[] = { - FOREACH_KEYBINDING(GENERATE_STRING) -}; +extern char *keybinding_action_string[]; union keybinding_params { char *c; From 0772817055a2976870bd28ddd5c2d543bccd6f4f Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 2 Jan 2023 12:15:06 +0100 Subject: [PATCH 524/689] Print modes as string --- keybinding.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/keybinding.c b/keybinding.c index d3b3e61..063ebba 100644 --- a/keybinding.c +++ b/keybinding.c @@ -1118,12 +1118,23 @@ print_input_devices(struct cg_server *server) { return dyn_str_to_str(&outp_str); } +char * +get_mode_name(char **modes,unsigned int mode_nr) { + unsigned int i; + for(i=0;itiles_curr_id); print_str(&str, "\"curr_output\":\"%s\",\n", server->curr_output->wlr_output->name); + print_str(&str, "\"default_mode\":\"%s\",\n", + get_mode_name(server->modes,server->seat->default_mode)); print_modes(&str, server->modes); char *outps_str = print_outputs(server); if(outps_str!=NULL) { @@ -1605,8 +1618,8 @@ run_action(enum keybinding_action action, struct cg_server *server, case KEYBINDING_SWITCH_DEFAULT_MODE: ipc_send_event(server, "{\"event_name\":\"switch_default_mode\",\"old_mode\":" - "%d,\"mode\":%d}", - server->seat->default_mode, data.u); + "\"%s\",\"mode\":\"%s\"}", + get_mode_name(server->modes,server->seat->default_mode), get_mode_name(server->modes,data.u)); server->seat->mode = data.u; server->seat->default_mode = data.u; break; From 432291f7e2ccf7d90da83935b523b24ab8e64b40 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 2 Jan 2023 13:34:21 +0100 Subject: [PATCH 525/689] Adjust printed names of commands --- keybinding.h | 86 ++++++++++++++++++++++++++-------------------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/keybinding.h b/keybinding.h index 2ecf4b0..cf06e2a 100644 --- a/keybinding.h +++ b/keybinding.h @@ -11,59 +11,59 @@ struct cg_server; #define FOREACH_KEYBINDING(KEYBINDING) \ - KEYBINDING(KEYBINDING_RUN_COMMAND) /* data.c is the string to execute */ \ - KEYBINDING(KEYBINDING_CLOSE_VIEW) \ - KEYBINDING(KEYBINDING_SPLIT_VERTICAL) \ - KEYBINDING(KEYBINDING_SPLIT_HORIZONTAL) \ - KEYBINDING(KEYBINDING_CHANGE_TTY) /*data.u is the desired tty*/\ - KEYBINDING(KEYBINDING_LAYOUT_FULLSCREEN)\ - KEYBINDING(KEYBINDING_CYCLE_VIEWS) /* data.b is 0 if forward, 1 if reverse */\ - KEYBINDING(KEYBINDING_CYCLE_TILES) /* data.b is 0 if forward, 1 if reverse */\ - KEYBINDING(KEYBINDING_CYCLE_OUTPUT) /* data.b is 0 if forward, 1 if reverse */\ - KEYBINDING(KEYBINDING_CONFIGURE_OUTPUT) /* data.o_cfg is the desired output */\ + KEYBINDING(KEYBINDING_RUN_COMMAND,exec) /* data.c is the string to execute */ \ + KEYBINDING(KEYBINDING_CLOSE_VIEW,close) \ + KEYBINDING(KEYBINDING_SPLIT_VERTICAL,vsplit) \ + KEYBINDING(KEYBINDING_SPLIT_HORIZONTAL,hsplit) \ + KEYBINDING(KEYBINDING_CHANGE_TTY,switchvt) /*data.u is the desired tty*/\ + KEYBINDING(KEYBINDING_LAYOUT_FULLSCREEN,only)\ + KEYBINDING(KEYBINDING_CYCLE_VIEWS,cycle_views) /* data.b is 0 if forward, 1 if reverse */\ + KEYBINDING(KEYBINDING_CYCLE_TILES,cycle_tiles) /* data.b is 0 if forward, 1 if reverse */\ + KEYBINDING(KEYBINDING_CYCLE_OUTPUT,cycle_outputs) /* data.b is 0 if forward, 1 if reverse */\ + KEYBINDING(KEYBINDING_CONFIGURE_OUTPUT,output) /* data.o_cfg is the desired output */\ \ - KEYBINDING(KEYBINDING_CONFIGURE_MESSAGE) /* data.m_cfg is the desired config */\ - KEYBINDING(KEYBINDING_CONFIGURE_INPUT) /* data.i_cfg is the desired input configuration */\ + KEYBINDING(KEYBINDING_CONFIGURE_MESSAGE,configure_message) /* data.m_cfg is the desired config */\ + KEYBINDING(KEYBINDING_CONFIGURE_INPUT,input) /* data.i_cfg is the desired input configuration */\ \ - KEYBINDING(KEYBINDING_QUIT)\ - KEYBINDING(KEYBINDING_NOOP)\ - KEYBINDING(KEYBINDING_SWITCH_OUTPUT) /* data.u is the desired output */\ - KEYBINDING(KEYBINDING_SWITCH_WORKSPACE) /* data.u is the desired workspace */\ - KEYBINDING(KEYBINDING_SWITCH_MODE) /* data.u is the desired mode */\ - KEYBINDING(KEYBINDING_SWITCH_DEFAULT_MODE) /* data.u is the desired mode */\ - KEYBINDING(KEYBINDING_RESIZE_TILE_HORIZONTAL) /* data.i is the number of pixels to add */\ + KEYBINDING(KEYBINDING_QUIT,quit)\ + KEYBINDING(KEYBINDING_NOOP,abort)\ + KEYBINDING(KEYBINDING_SWITCH_OUTPUT,screen) /* data.u is the desired output */\ + KEYBINDING(KEYBINDING_SWITCH_WORKSPACE,workspace) /* data.u is the desired workspace */\ + KEYBINDING(KEYBINDING_SWITCH_MODE,mode) /* data.u is the desired mode */\ + KEYBINDING(KEYBINDING_SWITCH_DEFAULT_MODE,setmode) /* data.u is the desired mode */\ + KEYBINDING(KEYBINDING_RESIZE_TILE_HORIZONTAL,resize_tile_horizontal) /* data.i is the number of pixels to add */\ \ - KEYBINDING(KEYBINDING_RESIZE_TILE_VERTICAL) /* data.i is the number of pixels to add to */\ + KEYBINDING(KEYBINDING_RESIZE_TILE_VERTICAL,resize_tile_vertical) /* data.i is the number of pixels to add to */\ \ - KEYBINDING(KEYBINDING_MOVE_VIEW_TO_WORKSPACE) /* data.u is the desired workspace */\ - KEYBINDING(KEYBINDING_MOVE_VIEW_TO_OUTPUT) /* data.u is the desired output */\ - KEYBINDING(KEYBINDING_MOVE_VIEW_TO_CYCLE_OUTPUT) /* data.b is 0 if forward, 1 if */\ + KEYBINDING(KEYBINDING_MOVE_VIEW_TO_WORKSPACE,movetoworkspace) /* data.u is the desired workspace */\ + KEYBINDING(KEYBINDING_MOVE_VIEW_TO_OUTPUT,movetoscreen) /* data.u is the desired output */\ + KEYBINDING(KEYBINDING_MOVE_VIEW_TO_CYCLE_OUTPUT,move_view_to_cycle_output) /* data.b is 0 if forward, 1 if */\ \ - KEYBINDING(KEYBINDING_DUMP)\ - KEYBINDING(KEYBINDING_SHOW_TIME)\ - KEYBINDING(KEYBINDING_SHOW_INFO)\ - KEYBINDING(KEYBINDING_DISPLAY_MESSAGE)\ - KEYBINDING(KEYBINDING_CURSOR)\ + KEYBINDING(KEYBINDING_DUMP,dump)\ + KEYBINDING(KEYBINDING_SHOW_TIME,time)\ + KEYBINDING(KEYBINDING_SHOW_INFO,show_info)\ + KEYBINDING(KEYBINDING_DISPLAY_MESSAGE,message)\ + KEYBINDING(KEYBINDING_CURSOR,cursor)\ \ - KEYBINDING(KEYBINDING_SWAP_LEFT)\ - KEYBINDING(KEYBINDING_SWAP_RIGHT)\ - KEYBINDING(KEYBINDING_SWAP_TOP)\ - KEYBINDING(KEYBINDING_SWAP_BOTTOM)\ + KEYBINDING(KEYBINDING_SWAP_LEFT,exchangeleft)\ + KEYBINDING(KEYBINDING_SWAP_RIGHT,exchangeright)\ + KEYBINDING(KEYBINDING_SWAP_TOP,exchangeup)\ + KEYBINDING(KEYBINDING_SWAP_BOTTOM,exchangedown)\ \ - KEYBINDING(KEYBINDING_FOCUS_LEFT)\ - KEYBINDING(KEYBINDING_FOCUS_RIGHT)\ - KEYBINDING(KEYBINDING_FOCUS_TOP)\ - KEYBINDING(KEYBINDING_FOCUS_BOTTOM)\ - KEYBINDING(KEYBINDING_FOCUS_TILE)\ + KEYBINDING(KEYBINDING_FOCUS_LEFT,focusleft)\ + KEYBINDING(KEYBINDING_FOCUS_RIGHT,focusright)\ + KEYBINDING(KEYBINDING_FOCUS_TOP,focusup)\ + KEYBINDING(KEYBINDING_FOCUS_BOTTOM,focusdown)\ + KEYBINDING(KEYBINDING_FOCUS_TILE,focus_tile)\ \ - KEYBINDING(KEYBINDING_DEFINEKEY) /* data.kb is the keybinding definition */\ - KEYBINDING(KEYBINDING_BACKGROUND) /* data.color is the background color */\ - KEYBINDING(KEYBINDING_DEFINEMODE) /* data.c is the mode name */\ - KEYBINDING(KEYBINDING_WORKSPACES) /* data.i is the number of workspaces */\ + KEYBINDING(KEYBINDING_DEFINEKEY,definekey) /* data.kb is the keybinding definition */\ + KEYBINDING(KEYBINDING_BACKGROUND,background) /* data.color is the background color */\ + KEYBINDING(KEYBINDING_DEFINEMODE,definemode) /* data.c is the mode name */\ + KEYBINDING(KEYBINDING_WORKSPACES,workspaces) /* data.i is the number of workspaces */\ -#define GENERATE_ENUM(ENUM) ENUM, -#define GENERATE_STRING(STRING) #STRING, +#define GENERATE_ENUM(ENUM,NAME) ENUM, +#define GENERATE_STRING(STRING,NAME) #NAME, /* Important: if you add a keybinding which uses data.c or requires "free" * to be called, don't forget to add it to the function "keybinding_list_free" From 0de9c50a70568b043bafe50bc514d9f220aaad83 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 2 Jan 2023 15:12:11 +0100 Subject: [PATCH 526/689] Document default_mode in dump --- man/cagebreak-socket.7.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/man/cagebreak-socket.7.md b/man/cagebreak-socket.7.md index 66e84c9..e49fb23 100644 --- a/man/cagebreak-socket.7.md +++ b/man/cagebreak-socket.7.md @@ -190,6 +190,7 @@ cg-ipc{"event_name":"destroy_output","output":"HDMI-A-1"} - views_curr_id: id of the currently focussed view as an integer - tiles_curr_id: id of the currently focussed tile as in integer - curr_output: current output as a string + - default_mode: name of the default mode as a string - modes: list of names of modes as strings - outputs: object of objects for each output - output name as string @@ -227,6 +228,7 @@ cg-ipc{"event_name":"dump","nws":1, "views_curr_id":80, "tiles_curr_id":8, "curr_output":"eDP-1", +"default_mode":"top", "modes":["top","root","resize"], "outputs": {"eDP-1": { "priority": -1, From 8e97b7c69736958dac891762de386e0cef9c8534 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 2 Jan 2023 16:26:36 +0100 Subject: [PATCH 527/689] Add definemode socket doc --- man/cagebreak-socket.7.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/man/cagebreak-socket.7.md b/man/cagebreak-socket.7.md index e49fb23..3ae1e96 100644 --- a/man/cagebreak-socket.7.md +++ b/man/cagebreak-socket.7.md @@ -150,13 +150,20 @@ cg-ipc{"event_name":"cycle_views","old_view_id":11,"new_view_id":4,"tile_id":13, - 6: modifier 3 - 7: modifier 5 - key: key as a number - - command: command as a number TODO maybe will be changed to string, remove otherwise + - command: command as a string - CAVEAT: This is an internal representation of + commands without arguments some commands are not isomorphically represented, + they are listed below: + - "cycle_tiles": represents *exchange* commands + - "cycle_views": represents *next* and *prev* commands + - "cycle_outputs": represents *nextscreen", *movetoprevscreen* and *prevscreen* commands + - "resize_tile_vertical": represents *resizedown* and *resizeup* commands + - "resize_tile_horizontal": represents *resizeleft* and *resizeright* commands ``` definemode foo cg-ipc{"event_name":"definemode","mode":"foo"} definekey foo e only -cg-ipc{"event_name":"definekey","modifiers":0,"key":101,"command":5} +cg-ipc{"event_name":"definekey","modifiers":0,"key":101,"command":"only"} ``` *definemode* From 9f4be786a73d1ef077d96308c45160ea643f6365 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 2 Jan 2023 16:58:28 +0100 Subject: [PATCH 528/689] Add config nesting restriction to doc --- man/cagebreak-config.5.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index 6bc8510..a084cd0 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -17,6 +17,10 @@ are parsed sequentially but independently from the rest of the file. Each line starting with a "#" is a comment. +Note that nesting of commands is limited to 50 times, though lines +are arbitrarily long in practice, though a reasonable limit of 4Mb has +been set. + See *KEY DEFINITIONS* for details on modifier keys and *MODES* for details on modes. From 40c73b8f416726ef2b35e08474605457f85f0924 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 2 Jan 2023 17:22:50 +0100 Subject: [PATCH 529/689] Add nesting level restriction --- config.h.in | 2 ++ parse.c | 26 +++++++++++++++----------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/config.h.in b/config.h.in index 8495284..53a167a 100644 --- a/config.h.in +++ b/config.h.in @@ -6,4 +6,6 @@ #mesondefine CG_VERSION +#define MAX_NESTING_LEVEL 50 + #endif diff --git a/parse.c b/parse.c index bd8ebae..21f3f56 100644 --- a/parse.c +++ b/parse.c @@ -76,12 +76,12 @@ parse_key(struct keybinding *keybinding, const char *key_def, char **errstr) { int parse_command(struct cg_server *server, struct keybinding *keybinding, - char *saveptr, char **errstr); + char *saveptr, char **errstr, int nesting_level); /* Parse a keybinding definition and return it if successful, else return NULL */ struct keybinding * -parse_keybinding(struct cg_server *server, char **saveptr, char **errstr) { +parse_keybinding(struct cg_server *server, char **saveptr, char **errstr,int nesting_level) { struct keybinding *keybinding = malloc(sizeof(struct keybinding)); if(keybinding == NULL) { *errstr = log_error( @@ -94,7 +94,7 @@ parse_keybinding(struct cg_server *server, char **saveptr, char **errstr) { free(keybinding); return NULL; } - if(parse_command(server, keybinding, *saveptr, errstr) != 0) { + if(parse_command(server, keybinding, *saveptr, errstr,nesting_level+1) != 0) { free(keybinding); return NULL; } @@ -389,8 +389,8 @@ error: } struct keybinding * -parse_bind(struct cg_server *server, char **saveptr, char **errstr) { - struct keybinding *keybinding = parse_keybinding(server, saveptr, errstr); +parse_bind(struct cg_server *server, char **saveptr, char **errstr, int nesting_level) { + struct keybinding *keybinding = parse_keybinding(server, saveptr, errstr,nesting_level); if(keybinding == NULL) { wlr_log(WLR_ERROR, "Could not parse keybinding for \"bind\"."); return NULL; @@ -400,7 +400,7 @@ parse_bind(struct cg_server *server, char **saveptr, char **errstr) { } struct keybinding * -parse_definekey(struct cg_server *server, char **saveptr, char **errstr) { +parse_definekey(struct cg_server *server, char **saveptr, char **errstr, int nesting_level) { char *mode = strtok_r(NULL, " ", saveptr); if(mode == NULL) { *errstr = @@ -412,7 +412,7 @@ parse_definekey(struct cg_server *server, char **saveptr, char **errstr) { *errstr = log_error("Unknown mode \"%s\"", mode); return NULL; } - struct keybinding *keybinding = parse_keybinding(server, saveptr, errstr); + struct keybinding *keybinding = parse_keybinding(server, saveptr, errstr, nesting_level); if(keybinding == NULL) { wlr_log(WLR_ERROR, "Could not parse keybinding for \"definekey\""); return NULL; @@ -753,8 +753,12 @@ error: int parse_command(struct cg_server *server, struct keybinding *keybinding, - char *saveptr, char **errstr) { + char *saveptr, char **errstr,int nesting_level) { char *action = strtok_r(NULL, " ", &saveptr); + if(nesting_level>=MAX_NESTING_LEVEL) { + *errstr = log_error("Nesting level of commands is too deep. Giving up."); + return -1; + } if(action == NULL) { *errstr = log_error("Expexted an action to parse, got none."); return -1; @@ -970,13 +974,13 @@ parse_command(struct cg_server *server, struct keybinding *keybinding, keybinding->data.u = (unsigned int)mode_idx; } else if(strcmp(action, "bind") == 0) { keybinding->action = KEYBINDING_DEFINEKEY; - keybinding->data.kb = parse_bind(server, &saveptr, errstr); + keybinding->data.kb = parse_bind(server, &saveptr, errstr,nesting_level); if(keybinding->data.kb == NULL) { return -1; } } else if(strcmp(action, "definekey") == 0) { keybinding->action = KEYBINDING_DEFINEKEY; - keybinding->data.kb = parse_definekey(server, &saveptr, errstr); + keybinding->data.kb = parse_definekey(server, &saveptr, errstr,nesting_level); if(keybinding->data.kb == NULL) { return -1; } @@ -1047,7 +1051,7 @@ parse_rc_line(struct cg_server *server, char *line, char **errstr) { free(saveptr); return -1; } - if(parse_command(server, keybinding, saveptr, errstr) != 0) { + if(parse_command(server, keybinding, saveptr, errstr,1) != 0) { wlr_log(WLR_ERROR, "Error parsing command."); free(keybinding); free(saveptr); From 3cbf59a348c84364cf475898fe36618cd755ee13 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 2 Jan 2023 17:59:24 +0100 Subject: [PATCH 530/689] Fix typo in man page --- man/cagebreak-socket.7.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/cagebreak-socket.7.md b/man/cagebreak-socket.7.md index 3ae1e96..af856c4 100644 --- a/man/cagebreak-socket.7.md +++ b/man/cagebreak-socket.7.md @@ -155,7 +155,7 @@ cg-ipc{"event_name":"cycle_views","old_view_id":11,"new_view_id":4,"tile_id":13, they are listed below: - "cycle_tiles": represents *exchange* commands - "cycle_views": represents *next* and *prev* commands - - "cycle_outputs": represents *nextscreen", *movetoprevscreen* and *prevscreen* commands + - "cycle_outputs": represents *nextscreen*, *movetoprevscreen* and *prevscreen* commands - "resize_tile_vertical": represents *resizedown* and *resizeup* commands - "resize_tile_horizontal": represents *resizeleft* and *resizeright* commands From 1813245e216ea55096441c41abf673d5b45e12ff Mon Sep 17 00:00:00 2001 From: project-repo Date: Tue, 3 Jan 2023 08:39:23 +0100 Subject: [PATCH 531/689] Do not emit two events on single command --- keybinding.c | 18 ++++++++++-------- keybinding.h | 2 +- output.c | 2 +- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/keybinding.c b/keybinding.c index 063ebba..77e2e24 100644 --- a/keybinding.c +++ b/keybinding.c @@ -630,7 +630,7 @@ set_output(struct cg_server *server, struct cg_output *output) { } void -keybinding_cycle_outputs(struct cg_server *server, bool reverse) { +keybinding_cycle_outputs(struct cg_server *server, bool reverse, bool trigger_event) { struct cg_output *output = NULL; struct cg_output *old_output = server->curr_output; if(reverse) { @@ -648,11 +648,13 @@ keybinding_cycle_outputs(struct cg_server *server, bool reverse) { } } set_output(server, output); - ipc_send_event(output->server, - "{\"event_name\":\"cycle_outputs\",\"old_output\":\"%s\"," - "\"new_output\":\"%s\",\"reverse\":%d}", - old_output->wlr_output->name, output->wlr_output->name, - reverse); + if(trigger_event) { + ipc_send_event(output->server, + "{\"event_name\":\"cycle_outputs\",\"old_output\":\"%s\"," + "\"new_output\":\"%s\",\"reverse\":%d}", + old_output->wlr_output->name, output->wlr_output->name, + reverse); + } } /* Cycle through views, whereby the workspace does not change */ @@ -1211,7 +1213,7 @@ keybinding_move_view_to_cycle_output(struct cg_server *server, bool reverse) { seat_set_focus(server->seat, NULL); } } - keybinding_cycle_outputs(server, reverse); + keybinding_cycle_outputs(server, reverse,false); if(view != NULL) { struct cg_workspace *ws = server->curr_output @@ -1597,7 +1599,7 @@ run_action(enum keybinding_action action, struct cg_server *server, keybinding_cycle_tiles(server, data.b); break; case KEYBINDING_CYCLE_OUTPUT: - keybinding_cycle_outputs(server, data.b); + keybinding_cycle_outputs(server, data.b, true); break; case KEYBINDING_SWITCH_WORKSPACE: keybinding_switch_ws(server, data.u); diff --git a/keybinding.h b/keybinding.h index cf06e2a..479cecf 100644 --- a/keybinding.h +++ b/keybinding.h @@ -106,7 +106,7 @@ keybinding_list_push(struct keybinding_list *list, void keybinding_list_free(struct keybinding_list *list); void -keybinding_cycle_outputs(struct cg_server *server, bool reverse); +keybinding_cycle_outputs(struct cg_server *server, bool reverse, bool trigger_event); struct keybinding ** find_keybinding(const struct keybinding_list *list, const struct keybinding *keybinding); diff --git a/output.c b/output.c index 379e9d1..7381279 100644 --- a/output.c +++ b/output.c @@ -53,7 +53,7 @@ output_clear(struct cg_output *output) { if(server->running && server->curr_output == output && wl_list_length(&server->outputs) > 1) { - keybinding_cycle_outputs(server, false); + keybinding_cycle_outputs(server, false, true); } wl_list_remove(&output->link); From 7c673ae20e2f63a3c19ba124d6c70116e13b8828 Mon Sep 17 00:00:00 2001 From: project-repo Date: Wed, 4 Jan 2023 18:01:06 +0100 Subject: [PATCH 532/689] Review cagebreak-socket documenation --- man/cagebreak-socket.7.md | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/man/cagebreak-socket.7.md b/man/cagebreak-socket.7.md index 3ae1e96..d4d353f 100644 --- a/man/cagebreak-socket.7.md +++ b/man/cagebreak-socket.7.md @@ -26,14 +26,14 @@ Events have a general structure as follows: "cg-ipc"json object depending on the eventNULL ``` -Here is an example of how this works using only as a command over the socket +Here is an example of how this works using *only* as a command sent over the socket. ``` only cg-ipc{"event_name":"fullscreen","tile_id":2,"workspace":1,"output":"eDP-1"} ``` -This documentation includes the trigger for the event, the keys and the data +This documentation describes the trigger for the events, the keys and the data type of the values of each event. *background* @@ -53,7 +53,7 @@ cg-ipc{"event_name":"background","old_bg":[0.000000,1.000000,1.000000],"new_bg": - JSON - event_name: "close" - view_id: view id as an integer - - title_id: title id as an integer + - tile_id: tile id as an integer - workspace: workspace number as an integer - output: name of the output as a string @@ -66,7 +66,7 @@ cg-ipc{"event_name":"close","view_id":47,"tile_id":47,"workspace":1,"output":"eD - Trigger: *input* command - JSON - event_name: "configure_input" - - input: the input as a string as per cagebreak-config(5) + - input: the input as a string, as per cagebreak-config(5) ``` input * accel_profile flat @@ -127,7 +127,7 @@ cg-ipc{"event_name":"cycle_outputs","old_output":"eDP-1","new_output":"HDMI-A-1" - event_name: "cycle_views" - old_view_id: old view id as an integer - new_view_id: new view id as an interger - - tile_id: new tile is as an integer + - tile_id: tile id as an integer - workspace: workspace number as an integer - output: name of the output as a string @@ -151,11 +151,10 @@ cg-ipc{"event_name":"cycle_views","old_view_id":11,"new_view_id":4,"tile_id":13, - 7: modifier 5 - key: key as a number - command: command as a string - CAVEAT: This is an internal representation of - commands without arguments some commands are not isomorphically represented, - they are listed below: - - "cycle_tiles": represents *exchange* commands - - "cycle_views": represents *next* and *prev* commands - - "cycle_outputs": represents *nextscreen", *movetoprevscreen* and *prevscreen* commands + commands which is not in one-to-one correspondance with the commands available in the config file. The differences are as follows: + - "cycle_tiles": represents any *exchange* command (e.g. *exchangeright*) + - "cycle_views": represents both the *next* and the *prev* command + - "cycle_outputs": represents *nextscreen*, *movetoprevscreen* and *prevscreen* commands - "resize_tile_vertical": represents *resizedown* and *resizeup* commands - "resize_tile_horizontal": represents *resizeleft* and *resizeright* commands From 2baa1f614ec5939e95ef131b15bea5374ed002dc Mon Sep 17 00:00:00 2001 From: project-repo Date: Wed, 4 Jan 2023 19:18:58 +0100 Subject: [PATCH 533/689] Review cagebreak-socket documentation - Fix typos - Fix output in keybinding.c --- keybinding.c | 4 +-- man/cagebreak-socket.7.md | 57 ++++++++++----------------------------- 2 files changed, 16 insertions(+), 45 deletions(-) diff --git a/keybinding.c b/keybinding.c index 77e2e24..f019a89 100644 --- a/keybinding.c +++ b/keybinding.c @@ -1141,8 +1141,8 @@ keybinding_dump(struct cg_server *server) { print_str(&str, "{\"event_name\":\"dump\","); print_str(&str, "\"nws\":%d,\n", server->nws); - print_str(&str, "\"bg_color\":[%f,%f,%f,%f],\n", server->bg_color[0], - server->bg_color[1], server->bg_color[2], server->bg_color[3]); + print_str(&str, "\"bg_color\":[%f,%f,%f],\n", server->bg_color[0], + server->bg_color[1], server->bg_color[2]); print_str(&str, "\"views_curr_id\":%d,\n", server->views_curr_id); print_str(&str, "\"tiles_curr_id\":%d,\n", server->tiles_curr_id); print_str(&str, "\"curr_output\":\"%s\",\n", diff --git a/man/cagebreak-socket.7.md b/man/cagebreak-socket.7.md index d4d353f..3723308 100644 --- a/man/cagebreak-socket.7.md +++ b/man/cagebreak-socket.7.md @@ -192,7 +192,7 @@ cg-ipc{"event_name":"destroy_output","output":"HDMI-A-1"} - JSON - event_name: "dump" - nws: number of workspaces as an integer - - bg_color: list of three floating point numbers denoting the new background in rgba + - bg_color: list of three floating point numbers denoting the new background in rgb - views_curr_id: id of the currently focussed view as an integer - tiles_curr_id: id of the currently focussed tile as in integer - curr_output: current output as a string @@ -217,20 +217,20 @@ cg-ipc{"event_name":"destroy_output","output":"HDMI-A-1"} - size: object of width and height - view: view id as an integer - keyboards: object of objects for each keyboard group - - name_of_keyboard: object for a keyboard + - keyboard name as a string - commands_enabled: 0 if keybindings are disabled for the keyboard, 1 otherwise - repeat_delay: repeat delay in milliseconds as an integer - repeat_rate: repeat rate in 1/sec as an integer - input_devices: object of objects for each keyboard - - identifier for a keyboard: object - - is_virtual: 0 if physical, 1 otherwise + - identifier for a keyboard as a string + - is_virtual: 1 if virtual, 0 otherwise - type: [keyboard|pointer|switch] - cursor_coords: object of x and y coordinates ``` dump cg-ipc{"event_name":"dump","nws":1, -"bg_color":[0.000000,0.000000,0.000000,1.000000], +"bg_color":[0.000000,0.000000,0.000000], "views_curr_id":80, "tiles_curr_id":8, "curr_output":"eDP-1", @@ -248,12 +248,6 @@ cg-ipc{"event_name":"dump","nws":1, "coords": {"x":0,"y":0}, "type": "xwayland" -},{ -"id": 51, -"pid": 6667, -"coords": {"x":0,"y":0}, -"type": "xdg" - },{ "id": 72, "pid": 11243, @@ -266,41 +260,17 @@ cg-ipc{"event_name":"dump","nws":1, "coords": {"x":1280,"y":0}, "type": "xdg" -},{ -"id": 20, -"pid": 3044, -"coords": {"x":1280,"y":0}, -"type": "xdg" - -},{ -"id": 42, -"pid": 6397, -"coords": {"x":1280,"y":0}, -"type": "xdg" - -},{ -"id": 65, -"pid": 8453, -"coords": {"x":0,"y":0}, -"type": "xdg" - -},{ -"id": 78, -"pid": 12631, -"coords": {"x":0,"y":0}, -"type": "xdg" - }],"tiles": [{ "id": 6, "coords": {"x":0,"y":0}, "size": {"width":1280,"height":1440}, -"view": "78" +"view": 78 },{ "id": 7, "coords": {"x":1280,"y":0}, "size": {"width":1280,"height":1440}, -"view": "42" +"view": 42 }]}] }} @@ -408,6 +378,7 @@ cg-ipc{"event_name":"move_view_to_output","view_id":78,"old_output":"eDP-1","new - event_name: "move_view_to_ws" - view_id: view id as an integer - old_workspace: old workspace number as an integer + - new_workspace: new workspace number as an integer - output: name of the output as a string - view_pid: pid of the process @@ -434,8 +405,8 @@ cg-ipc{"event_name":"new_output","output":"HDMI-A-1","priority":-1} - JSON - event_name: "resize_tile" - tile_id: tile id as an integer - - old_dims: list of pixels [x pixels of lower left corner, y pixels of lower left corner, x pixels of upper right corner, y pixels of upper right corner - - new_dims: list of pixels [x pixels of lower left corner, y pixels of lower left corner, x pixels of upper right corner, y pixels of upper right corner + - old_dims: list of coordinates [x coordinate of lower left corner, y coordinate of lower left corner, x coordinate of upper right corner, y coordinate of upper right corner] + - new_dims: list of coordinate [x coordinate of lower left corner, y coordinate of lower left corner, x coordinate of upper right corner, y coordinate of upper right corner] - workspace: workspace number as an integer - output: name of the output as a string @@ -465,7 +436,7 @@ cg-ipc{"event_name":"set_nws","old_nws":1,"new_nws":2} - new_tile_id: new tile id as an integer - workspace: workspace number as an integer - output: output as a string - - vertical: "0" if horizontal split, "1" if not + - vertical: 0 if horizontal split, 1 if not ``` hsplit @@ -490,12 +461,12 @@ cg-ipc{"event_name":"swap_tile","tile_id":1,"swap_tile_id":3,"workspace":1,"outp - Trigger: *setmode* command - JSON - event_name: "switch_default_mode" - - old_mode: old mode number - - mode: new mode numer + - old_mode: old mode name + - mode: new mode name ``` setmode top -cg-ipc{"event_name":"switch_default_mode","old_mode":0,"mode":0} +cg-ipc{"event_name":"switch_default_mode","old_mode":"top","mode":"root"} ``` switch_output From 4e1c08556880a0b5570c26d8d4f3706563aa124a Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 5 Jan 2023 18:42:23 +0100 Subject: [PATCH 534/689] Make compatible with wlroots 0.16 --- cagebreak.c | 11 ++++- fuzz/fuzz-lib.c | 90 +---------------------------------- input_manager.c | 4 +- keybinding.c | 29 ++++++------ meson.build | 2 +- message.c | 17 +++---- output.c | 14 +++--- seat.c | 121 +++++++++++++++++++++++++----------------------- seat.h | 2 +- view.c | 31 +++++++------ view.h | 4 +- workspace.c | 13 +++--- xdg_shell.c | 65 ++++++++++++++------------ xwayland.c | 18 +++---- 14 files changed, 177 insertions(+), 244 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index 26864b5..eafdb08 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -260,6 +261,7 @@ main(int argc, char *argv[]) { struct wl_event_source *sigpipe_source = NULL; struct wlr_backend *backend = NULL; struct wlr_compositor *compositor = NULL; + struct wlr_subcompositor *subcompositor = NULL; struct wlr_data_device_manager *data_device_manager = NULL; struct wlr_server_decoration_manager *server_decoration_manager = NULL; struct wlr_xdg_decoration_manager_v1 *xdg_decoration_manager = NULL; @@ -429,6 +431,13 @@ main(int argc, char *argv[]) { goto end; } + subcompositor = wlr_subcompositor_create(server.wl_display); + if (!subcompositor) { + wlr_log(WLR_ERROR, "Unable to create the wlroots subcompositor"); + ret = 1; + goto end; + } + data_device_manager = wlr_data_device_manager_create(server.wl_display); if(!data_device_manager) { wlr_log(WLR_ERROR, "Unable to create the data device manager"); @@ -477,7 +486,7 @@ main(int argc, char *argv[]) { &server.new_idle_inhibitor_v1); wl_list_init(&server.inhibitors); - xdg_shell = wlr_xdg_shell_create(server.wl_display); + xdg_shell = wlr_xdg_shell_create(server.wl_display,3); if(!xdg_shell) { wlr_log(WLR_ERROR, "Unable to create the XDG shell interface"); ret = 1; diff --git a/fuzz/fuzz-lib.c b/fuzz/fuzz-lib.c index e46bf5d..eaf8fb6 100644 --- a/fuzz/fuzz-lib.c +++ b/fuzz/fuzz-lib.c @@ -335,7 +335,7 @@ LLVMFuzzerInitialize(int *argc, char ***argv) { &server.new_idle_inhibitor_v1); wl_list_init(&server.inhibitors); - xdg_shell = wlr_xdg_shell_create(server.wl_display); + xdg_shell = wlr_xdg_shell_create(server.wl_display,3); if(!xdg_shell) { wlr_log(WLR_ERROR, "Unable to create the XDG shell interface"); ret = 1; @@ -490,27 +490,6 @@ end: return ret; } -void -move_cursor(char *line, struct cg_server *server) { - return; // TODO - long del = 0; - char *delstr = strtok_r(NULL, ";", &line); - enum wlr_axis_orientation orientation = - (*(line++) == '0') ? WLR_AXIS_ORIENTATION_VERTICAL - : WLR_AXIS_ORIENTATION_HORIZONTAL; - if(delstr == NULL) { - return; - } - del = strtol(delstr, NULL, 10); - struct wlr_event_pointer_axis event = {.device = NULL, - .time_msec = 0, - .source = WLR_AXIS_SOURCE_WHEEL, - .orientation = orientation, - .delta = del * 15, - .delta_discrete = del}; - // TODO dispatch_cursor_axis(server->seat->cursor, &event); -} - void add_output_callback(struct wlr_backend *backend, void *data) { long *dims = data; @@ -542,73 +521,6 @@ create_output(char *line, struct cg_server *server) { wlr_multi_for_each_backend(server->backend, add_output_callback, dims); } -void -add_input_device_callback(struct wlr_backend *backend, void *data) { - enum wlr_input_device_type *type = data; - wlr_headless_add_input_device(backend, *type); -} - -void -create_input_device(char *line, struct cg_server *server) { - enum wlr_input_device_type type; - if(*line != '\0') { - if(strncmp(line, "kbd", 3) == 0) { - type = WLR_INPUT_DEVICE_KEYBOARD; - wlr_multi_for_each_backend(server->backend, - add_input_device_callback, &type); - } else if(strncmp(line, "ptr", 3) == 0) { - type = WLR_INPUT_DEVICE_POINTER; - wlr_multi_for_each_backend(server->backend, - add_input_device_callback, &type); - } else if(strncmp(line, "tch", 3) == 0) { - type = WLR_INPUT_DEVICE_TOUCH; - wlr_multi_for_each_backend(server->backend, - add_input_device_callback, &type); - } - } -} - -void -destroy_input_device(char *line, struct cg_server *server) { - long devn = 0; - if(line[0] != '\0') { - devn = strtol(line + 1, NULL, 10); - } - if(line != NULL) { - if(strncmp(line, "k", 1) == 0) { - if(wl_list_empty(&server->seat->keyboard_groups)) { - return; - } - devn = devn % wl_list_length(&server->seat->keyboard_groups); - struct cg_keyboard_group *group, *group_tmp; - wl_list_for_each_safe(group, group_tmp, - &server->seat->keyboard_groups, link) { - if(devn == 0) { - wl_list_remove(&group->link); - wlr_keyboard_group_destroy(group->wlr_group); - wl_event_source_remove(group->key_repeat_timer); - free(group); - break; - } - --devn; - } - } else if(strncmp(line, "p", 1) == 0) { - if(wl_list_empty(&server->input->devices)) { - return; - } - devn = devn % wl_list_length(&server->input->devices); - struct cg_input_device *dev, *dev_tmp; - wl_list_for_each_safe(dev, dev_tmp, &server->input->devices, link) { - if(devn == 0) { - dev->device_destroy.notify(&dev->device_destroy, NULL); - break; - } - --devn; - } - } - } -} - void destroy_output(char *line, struct cg_server *server) { if(wl_list_length(&server->outputs) < 2) { diff --git a/input_manager.c b/input_manager.c index 8e65e4d..915384e 100644 --- a/input_manager.c +++ b/input_manager.c @@ -341,7 +341,7 @@ handle_virtual_keyboard(struct wl_listener *listener, void *data) { struct cg_input_manager *input = wl_container_of(listener, input, virtual_keyboard_new); struct wlr_virtual_keyboard_v1 *keyboard = data; - struct wlr_input_device *device = &keyboard->input_device; + struct wlr_input_device *device = &keyboard->keyboard.base; new_input(input,device,true); } @@ -352,7 +352,7 @@ handle_virtual_pointer(struct wl_listener *listener, void *data) { wl_container_of(listener, input_manager, virtual_pointer_new); struct wlr_virtual_pointer_v1_new_pointer_event *event = data; struct wlr_virtual_pointer_v1 *pointer = event->new_pointer; - struct wlr_input_device *device = &pointer->input_device; + struct wlr_input_device *device = &pointer->pointer.base; new_input(input_manager,device,true); diff --git a/keybinding.c b/keybinding.c index f019a89..6e1c219 100644 --- a/keybinding.c +++ b/keybinding.c @@ -446,17 +446,17 @@ resize_vertical(struct cg_tile *tile, struct cg_tile *parent, int y_offset, void resize_tile(struct cg_server *server, int hpixs, int vpixs) { struct cg_output *output = server->curr_output; - struct wlr_box *output_box = wlr_output_layout_get_box( - output->server->output_layout, output->wlr_output); + struct wlr_box output_box; + wlr_output_layout_get_box(output->server->output_layout, output->wlr_output,&output_box); struct cg_tile *focused = output->workspaces[output->curr_workspace]->focused_tile; /* First do the horizontal adjustment */ - if(hpixs != 0 && focused->tile.width < output_box->width && - is_between_strict(0, output_box->width, focused->tile.width + hpixs)) { + if(hpixs != 0 && focused->tile.width < output_box.width && + is_between_strict(0, output_box.width, focused->tile.width + hpixs)) { int x_offset = 0; /* In case we are on the total right, move the left edge of the tile */ - if(focused->tile.x + focused->tile.width == output_box->width) { + if(focused->tile.x + focused->tile.width == output_box.width) { x_offset = -hpixs; } bool resize_allowed = @@ -466,10 +466,10 @@ resize_tile(struct cg_server *server, int hpixs, int vpixs) { } } /* Repeat for vertical */ - if(vpixs != 0 && focused->tile.height < output_box->height && - is_between_strict(0, output_box->height, focused->tile.height + vpixs)) { + if(vpixs != 0 && focused->tile.height < output_box.height && + is_between_strict(0, output_box.height, focused->tile.height + vpixs)) { int y_offset = 0; - if(focused->tile.y + focused->tile.height == output_box->height) { + if(focused->tile.y + focused->tile.height == output_box.height) { y_offset = -vpixs; } bool resize_allowed = @@ -986,13 +986,12 @@ print_output(struct cg_output *outp) { outp_str.len = 0; outp_str.cur_pos = 0; uint32_t nmemb = 8; - struct wlr_box *outp_box=wlr_output_layout_get_box(outp->server->output_layout,outp->wlr_output); + struct wlr_box outp_box; + wlr_output_layout_get_box(outp->server->output_layout,outp->wlr_output,&outp_box); outp_str.str_arr = calloc(nmemb, sizeof(char *)); print_str(&outp_str, "\"%s\": {\n", outp->wlr_output->name); print_str(&outp_str, "\"priority\": %d,\n", outp->priority); - if(outp_box!=NULL) { - print_str(&outp_str, "\"coords\": {\"x\":%d,\"y\":%d},\n", outp_box->x,outp_box->y); - } + print_str(&outp_str, "\"coords\": {\"x\":%d,\"y\":%d},\n", outp_box.x,outp_box.y); print_str(&outp_str, "\"size\": {\"width\":%d,\"height\":%d},\n", 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, "\"curr_workspace\": %d,\n", outp->curr_workspace); @@ -1219,7 +1218,7 @@ keybinding_move_view_to_cycle_output(struct cg_server *server, bool reverse) { server->curr_output ->workspaces[server->curr_output->curr_workspace]; wl_list_insert(&ws->views, &view->link); - wlr_scene_node_reparent(view->scene_node, &ws->scene->node); + wlr_scene_node_reparent(&view->scene_tree->node, ws->scene); workspace_tile_update_view(ws->focused_tile,view); view->workspace = ws; seat_set_focus(server->seat, view); @@ -1384,7 +1383,7 @@ keybinding_move_view_to_output(struct cg_server *server, int output_num) { ->workspaces[server->curr_output->curr_workspace]; view->workspace = ws; wl_list_insert(&ws->views, &view->link); - wlr_scene_node_reparent(view->scene_node, &ws->scene->node); + wlr_scene_node_reparent(&view->scene_tree->node, ws->scene); workspace_tile_update_view(ws->focused_tile,view); seat_set_focus(server->seat, view); } @@ -1423,7 +1422,7 @@ keybinding_move_view_to_workspace(struct cg_server *server, uint32_t ws) { ->workspaces[server->curr_output->curr_workspace]; view->workspace = ws; wl_list_insert(&ws->views, &view->link); - wlr_scene_node_reparent(view->scene_node, &ws->scene->node); + wlr_scene_node_reparent(&view->scene_tree->node, ws->scene); workspace_tile_update_view(ws->focused_tile,view); seat_set_focus(server->seat, view); } diff --git a/meson.build b/meson.build index cf7794b..07e6b43 100644 --- a/meson.build +++ b/meson.build @@ -52,7 +52,7 @@ if is_freebsd ) endif -wlroots = dependency('wlroots', version: ['>=0.14.1', '< 0.16.0']) +wlroots = dependency('wlroots', version: ['>=0.16.1', '< 0.17.0']) wayland_protos = dependency('wayland-protocols', version: '>=1.14') wayland_server = dependency('wayland-server') wayland_cursor = dependency('wayland-cursor') diff --git a/message.c b/message.c index 29d28da..e4cfe9a 100644 --- a/message.c +++ b/message.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include "message.h" @@ -229,15 +230,15 @@ message_set_output(struct cg_output *output, const char *string, return; } message->message = - wlr_scene_buffer_create(&scene_output->scene->node, &buf->base); + wlr_scene_buffer_create(&scene_output->scene->tree, &buf->base); wlr_scene_node_raise_to_top(&message->message->node); wlr_scene_node_set_enabled(&message->message->node, true); - struct wlr_box *outp_box = wlr_output_layout_get_box( - output->server->output_layout, output->wlr_output); + struct wlr_box outp_box; + wlr_output_layout_get_box(output->server->output_layout, output->wlr_output,&outp_box); wlr_scene_buffer_set_dest_size(message->message, width, height); wlr_scene_node_set_position(&message->message->node, - message->position->x + outp_box->x, - message->position->y + outp_box->y); + message->position->x + outp_box.x, + message->position->y + outp_box.y); } void @@ -257,10 +258,10 @@ message_printf(struct cg_output *output, const char *fmt, ...) { free(buffer); return; } - struct wlr_box *output_box = wlr_output_layout_get_box( - output->server->output_layout, output->wlr_output); + struct wlr_box output_box; + wlr_output_layout_get_box(output->server->output_layout, output->wlr_output,&output_box); - box->x = output_box->width; + box->x = output_box.width; box->y = 0; box->width = 0; box->height = 0; diff --git a/output.c b/output.c index 7381279..24f6279 100644 --- a/output.c +++ b/output.c @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include @@ -81,7 +81,7 @@ output_clear(struct cg_output *output) { view->impl->destroy(view); } else { wl_list_insert(&ws->views, &view->link); - wlr_scene_node_reparent(view->scene_node, &ws->scene->node); + wlr_scene_node_reparent(&view->scene_tree->node, ws->scene); view->workspace = ws; view->tile = ws->focused_tile; if(server->seat->focused_view == NULL) { @@ -96,7 +96,7 @@ output_clear(struct cg_output *output) { view->impl->destroy(view); } else { wl_list_insert(&ws->unmanaged_views, &view->link); - wlr_scene_node_reparent(view->scene_node, &ws->scene->node); + wlr_scene_node_reparent(&view->scene_tree->node, ws->scene); view->workspace = ws; view->tile = ws->focused_tile; } @@ -314,11 +314,11 @@ output_apply_config(struct cg_server *server, struct cg_output *output, struct c return; } output->bg = wlr_scene_rect_create( - &scene_output->scene->node, output->wlr_output->width, + &scene_output->scene->tree, output->wlr_output->width, output->wlr_output->height, server->bg_color); - struct wlr_box *box = - wlr_output_layout_get_box(server->output_layout, output->wlr_output); - wlr_scene_node_set_position(&output->bg->node, box->x, box->y); + struct wlr_box box; + wlr_output_layout_get_box(server->output_layout, output->wlr_output,&box); + wlr_scene_node_set_position(&output->bg->node, box.x, box.y); wlr_scene_node_lower_to_bottom(&output->bg->node); } diff --git a/seat.c b/seat.c index 6d79aad..fcd4864 100644 --- a/seat.c +++ b/seat.c @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include @@ -84,6 +84,7 @@ remove_touch(struct cg_seat *seat, struct cg_touch *touch) { static void new_touch(struct cg_seat *seat, struct cg_input_device *input_device) { struct wlr_input_device *device = input_device->wlr_device; + struct wlr_touch *wlr_touch = wlr_touch_from_input_device(device); struct cg_touch *touch = calloc(1, sizeof(struct cg_touch)); if(!touch) { wlr_log(WLR_ERROR, "Cannot allocate touch"); @@ -96,10 +97,10 @@ new_touch(struct cg_seat *seat, struct cg_input_device *input_device) { input_device->touch = touch; ++seat->num_touch; - if(device->output_name != NULL) { + if(wlr_touch->output_name != NULL) { struct cg_output *output; wl_list_for_each(output, &seat->server->outputs, link) { - if(strcmp(device->output_name, output->wlr_output->name) == 0) { + if(strcmp(wlr_touch->output_name, output->wlr_output->name) == 0) { wlr_cursor_map_input_to_output(seat->cursor, device, output->wlr_output); break; @@ -121,6 +122,7 @@ remove_pointer(struct cg_seat *seat, struct cg_pointer *pointer) { static void new_pointer(struct cg_seat *seat, struct cg_input_device *input_device) { struct wlr_input_device *device = input_device->wlr_device; + struct wlr_pointer *wlr_pointer = wlr_pointer_from_input_device(device); struct cg_pointer *pointer = calloc(1, sizeof(struct cg_pointer)); if(!pointer) { wlr_log(WLR_ERROR, "Cannot allocate pointer"); @@ -133,10 +135,10 @@ new_pointer(struct cg_seat *seat, struct cg_input_device *input_device) { input_device->pointer = pointer; ++seat->num_pointers; - if(device->output_name != NULL) { + if(wlr_pointer->output_name != NULL) { struct cg_output *output; wl_list_for_each(output, &seat->server->outputs, link) { - if(strcmp(device->output_name, output->wlr_output->name) == 0) { + if(strcmp(wlr_pointer->output_name, output->wlr_output->name) == 0) { wlr_cursor_map_input_to_output(seat->cursor, device, output->wlr_output); break; @@ -149,7 +151,7 @@ static int handle_keyboard_repeat(void *data) { struct cg_keyboard_group *cg_group = data; struct wlr_keyboard *wlr_device = - cg_group->wlr_group->input_device->keyboard; + &cg_group->wlr_group->keyboard; if(cg_group->repeat_keybinding != NULL) { if(wlr_device->repeat_info.rate > 0) { if(wl_event_source_timer_update( @@ -168,9 +170,10 @@ handle_keyboard_repeat(void *data) { static void handle_modifier_event(struct wlr_input_device *device, struct cg_seat *seat) { - wlr_seat_set_keyboard(seat->seat, device); + struct wlr_keyboard *keyboard=wlr_keyboard_from_input_device(device); + wlr_seat_set_keyboard(seat->seat, keyboard); wlr_seat_keyboard_notify_modifiers(seat->seat, - &device->keyboard->modifiers); + &keyboard->modifiers); wlr_idle_notify_activity(seat->server->idle, seat->seat); } @@ -205,10 +208,10 @@ handle_command_key_bindings(struct cg_server *server, xkb_keysym_t sym, struct wlr_surface *surface = NULL; struct wlr_scene_node *node = wlr_scene_node_at( - &server->scene->node, server->seat->cursor->x, server->seat->cursor->y, &sx, &sy); + &server->scene->tree.node, server->seat->cursor->x, server->seat->cursor->y, &sx, &sy); if(server->seat->enable_cursor) { - if(node && node->type == WLR_SCENE_NODE_SURFACE) { - surface = wlr_scene_surface_from_node(node)->surface; + if(node && node->type == WLR_SCENE_NODE_BUFFER) { + surface = wlr_scene_surface_from_buffer(wlr_scene_buffer_from_node(node))->surface; wlr_seat_pointer_notify_enter(wlr_seat, surface, sx, sy); } else { wlr_xcursor_manager_set_cursor_image(server->seat->xcursor_manager, @@ -224,11 +227,10 @@ handle_command_key_bindings(struct cg_server *server, xkb_keysym_t sym, "Recognized keybinding pressed (key: %d, mode: %d, modifiers: %d)", sym, mode, modifiers); - if(group->wlr_group->input_device->keyboard->repeat_info.delay > 0) { + if(group->wlr_group->keyboard.repeat_info.delay > 0) { group->repeat_keybinding = keybinding; if(wl_event_source_timer_update(group->key_repeat_timer, - group->wlr_group->input_device - ->keyboard->repeat_info.delay) < + group->wlr_group->keyboard.repeat_info.delay) < 0) { wlr_log(WLR_DEBUG, "failed to set key repeat timer"); } @@ -271,26 +273,26 @@ key_is_modifier(const xkb_keysym_t key) { static void handle_key_event(struct cg_keyboard_group *group, struct cg_seat *seat, void *data) { - struct wlr_event_keyboard_key *event = data; - struct wlr_input_device *device = group->wlr_group->input_device; + struct wlr_keyboard_key_event *event = data; + struct wlr_keyboard *keyboard = &group->wlr_group->keyboard; /* Translate from libinput keycode to an xkbcommon keycode. */ xkb_keycode_t keycode = event->keycode + 8; const xkb_keysym_t *syms; int nsyms = - xkb_state_key_get_syms(device->keyboard->xkb_state, keycode, &syms); + xkb_state_key_get_syms(keyboard->xkb_state, keycode, &syms); bool handled = false; for(int i = 0; i < nsyms; ++i) { if(event->state == WL_KEYBOARD_KEY_STATE_PRESSED && !key_is_modifier(syms[i])) { - uint32_t modifiers = wlr_keyboard_get_modifiers(device->keyboard); + uint32_t modifiers = wlr_keyboard_get_modifiers(keyboard); /* Get the consumed_modifiers and remove them from the modifier list */ xkb_mod_mask_t consumed_modifiers = - xkb_state_key_get_consumed_mods2(device->keyboard->xkb_state, + xkb_state_key_get_consumed_mods2(keyboard->xkb_state, keycode, XKB_CONSUMED_MODE_GTK); if(handle_command_key_bindings(seat->server, syms[i], @@ -305,7 +307,7 @@ handle_key_event(struct cg_keyboard_group *group, struct cg_seat *seat, if(!handled) { /* Otherwise, we pass it along to the client. */ - wlr_seat_set_keyboard(seat->seat, device); + wlr_seat_set_keyboard(seat->seat, keyboard); wlr_seat_keyboard_notify_key(seat->seat, event->time_msec, event->keycode, event->state); } @@ -324,7 +326,7 @@ static void handle_keyboard_group_modifiers(struct wl_listener *listener, void *_data) { struct cg_keyboard_group *group = wl_container_of(listener, group, modifiers); - handle_modifier_event(group->wlr_group->input_device, group->seat); + handle_modifier_event(&group->wlr_group->keyboard.base, group->seat); } static bool repeat_info_match(struct wlr_keyboard *a, struct wlr_keyboard *b) { @@ -335,7 +337,7 @@ static bool repeat_info_match(struct wlr_keyboard *a, struct wlr_keyboard *b) { static void cg_keyboard_group_add(struct cg_input_device *input_device, struct cg_seat *seat) { struct wlr_input_device *device=input_device->wlr_device; - struct wlr_keyboard *wlr_keyboard = device->keyboard; + struct wlr_keyboard *wlr_keyboard = wlr_keyboard_from_input_device(device); // Virtual devices should not be grouped if(!input_device->is_virtual) { struct cg_keyboard_group *group; @@ -364,10 +366,10 @@ cg_keyboard_group_add(struct cg_input_device *input_device, struct cg_seat *seat cg_group->wlr_group->data = cg_group; wlr_keyboard_set_keymap(&cg_group->wlr_group->keyboard, - device->keyboard->keymap); + wlr_keyboard->keymap); wlr_keyboard_set_repeat_info(&cg_group->wlr_group->keyboard, - device->keyboard->repeat_info.rate, - device->keyboard->repeat_info.delay); + wlr_keyboard->repeat_info.rate, + wlr_keyboard->repeat_info.delay); if(input_device->identifier != NULL) { cg_group->identifier=strdup(input_device->identifier); } else { @@ -420,7 +422,7 @@ new_keyboard(struct cg_seat *seat, struct cg_input_device *input_device) { return; } - wlr_keyboard_set_keymap(device->keyboard, keymap); + wlr_keyboard_set_keymap(wlr_keyboard_from_input_device(device), keymap); xkb_keymap_unref(keymap); xkb_context_unref(context); @@ -428,7 +430,7 @@ new_keyboard(struct cg_seat *seat, struct cg_input_device *input_device) { cg_keyboard_group_add(input_device, seat); ++seat->num_keyboards; - wlr_seat_set_keyboard(seat->seat, device); + wlr_seat_set_keyboard(seat->seat, wlr_keyboard_from_input_device(device)); } void @@ -465,14 +467,14 @@ remove_keyboard(struct cg_seat *seat, struct cg_input_device *keyboard) { return; } struct wlr_seat *wlr_seat = seat->seat; - struct wlr_keyboard *wlr_keyboard = keyboard->wlr_device->keyboard; + struct wlr_keyboard *wlr_keyboard = wlr_keyboard_from_input_device(keyboard->wlr_device); struct wlr_keyboard_group *wlr_group = wlr_keyboard->group; if(wlr_group) { wlr_keyboard_group_remove_keyboard(wlr_group, wlr_keyboard); if (wl_list_empty(&wlr_group->devices)) { wlr_log(WLR_DEBUG, "Destroying empty keyboard group %p", - wlr_group); + (void *)wlr_group); struct cg_keyboard_group *group = wlr_group->data; if(wlr_seat_get_keyboard(wlr_seat) == &wlr_group->keyboard) { wlr_seat_set_keyboard(wlr_seat, NULL); @@ -568,20 +570,20 @@ handle_request_set_cursor(struct wl_listener *listener, void *data) { static void handle_touch_down(struct wl_listener *listener, void *data) { struct cg_seat *seat = wl_container_of(listener, seat, touch_down); - struct wlr_event_touch_down *event = data; + struct wlr_touch_down_event *event = data; double lx, ly; - wlr_cursor_absolute_to_layout_coords(seat->cursor, event->device, event->x, + wlr_cursor_absolute_to_layout_coords(seat->cursor, &event->touch->base, event->x, event->y, &lx, &ly); double sx, sy; struct wlr_scene_node *node = - wlr_scene_node_at(&seat->server->scene->node, lx, ly, &sx, &sy); + wlr_scene_node_at(&seat->server->scene->tree.node, lx, ly, &sx, &sy); uint32_t serial = 0; - if(node && node->type == WLR_SCENE_NODE_SURFACE) { + if(node && node->type == WLR_SCENE_NODE_BUFFER) { serial = wlr_seat_touch_notify_down( - seat->seat, wlr_scene_surface_from_node(node)->surface, + seat->seat, wlr_scene_surface_from_buffer(wlr_scene_buffer_from_node(node))->surface, event->time_msec, event->touch_id, sx, sy); } @@ -597,7 +599,7 @@ handle_touch_down(struct wl_listener *listener, void *data) { static void handle_touch_up(struct wl_listener *listener, void *data) { struct cg_seat *seat = wl_container_of(listener, seat, touch_up); - struct wlr_event_touch_up *event = data; + struct wlr_touch_up_event *event = data; if(!wlr_seat_touch_get_point(seat->seat, event->touch_id)) { return; @@ -610,23 +612,23 @@ handle_touch_up(struct wl_listener *listener, void *data) { static void handle_touch_motion(struct wl_listener *listener, void *data) { struct cg_seat *seat = wl_container_of(listener, seat, touch_motion); - struct wlr_event_touch_motion *event = data; + struct wlr_touch_motion_event *event = data; if(!wlr_seat_touch_get_point(seat->seat, event->touch_id)) { return; } double lx, ly; - wlr_cursor_absolute_to_layout_coords(seat->cursor, event->device, event->x, + wlr_cursor_absolute_to_layout_coords(seat->cursor, &event->touch->base, event->x, event->y, &lx, &ly); double sx, sy; struct wlr_scene_node *node = - wlr_scene_node_at(&seat->server->scene->node, lx, ly, &sx, &sy); + wlr_scene_node_at(&seat->server->scene->tree.node, lx, ly, &sx, &sy); - if(node && node->type == WLR_SCENE_NODE_SURFACE) { + if(node && node->type == WLR_SCENE_NODE_BUFFER) { wlr_seat_touch_point_focus(seat->seat, - wlr_scene_surface_from_node(node)->surface, + wlr_scene_surface_from_buffer(wlr_scene_buffer_from_node(node))->surface, event->time_msec, event->touch_id, sx, sy); wlr_seat_touch_notify_motion(seat->seat, event->time_msec, event->touch_id, sx, sy); @@ -654,7 +656,7 @@ handle_cursor_frame(struct wl_listener *listener, void *_data) { static void handle_cursor_axis(struct wl_listener *listener, void *data) { struct cg_seat *seat = wl_container_of(listener, seat, cursor_axis); - struct wlr_event_pointer_axis *event = data; + struct wlr_pointer_axis_event *event = data; wlr_seat_pointer_notify_axis(seat->seat, event->time_msec, event->orientation, event->delta, @@ -665,7 +667,7 @@ handle_cursor_axis(struct wl_listener *listener, void *data) { static void handle_cursor_button(struct wl_listener *listener, void *data) { struct cg_seat *seat = wl_container_of(listener, seat, cursor_button); - struct wlr_event_pointer_button *event = data; + struct wlr_pointer_button_event *event = data; wlr_seat_pointer_notify_button(seat->seat, event->time_msec, event->button, event->state); @@ -679,10 +681,10 @@ process_cursor_motion(struct cg_seat *seat, uint32_t time) { struct wlr_surface *surface = NULL; struct wlr_scene_node *node = wlr_scene_node_at( - &seat->server->scene->node, seat->cursor->x, seat->cursor->y, &sx, &sy); + &seat->server->scene->tree.node, seat->cursor->x, seat->cursor->y, &sx, &sy); - if(node && node->type == WLR_SCENE_NODE_SURFACE) { - surface = wlr_scene_surface_from_node(node)->surface; + if(node && node->type == WLR_SCENE_NODE_BUFFER) { + surface = wlr_scene_surface_from_buffer(wlr_scene_buffer_from_node(node))->surface; wlr_seat_pointer_notify_enter(wlr_seat, surface, sx, sy); bool focus_changed = wlr_seat->pointer_state.focused_surface != surface; @@ -740,9 +742,9 @@ static void handle_cursor_motion_absolute(struct wl_listener *listener, void *data) { struct cg_seat *seat = wl_container_of(listener, seat, cursor_motion_absolute); - struct wlr_event_pointer_motion_absolute *event = data; + struct wlr_pointer_motion_absolute_event *event = data; - wlr_cursor_warp_absolute(seat->cursor, event->device, event->x, event->y); + wlr_cursor_warp_absolute(seat->cursor, &event->pointer->base, event->x, event->y); process_cursor_motion(seat, event->time_msec); wlr_idle_notify_activity(seat->server->idle, seat->seat); } @@ -750,9 +752,9 @@ handle_cursor_motion_absolute(struct wl_listener *listener, void *data) { static void handle_cursor_motion(struct wl_listener *listener, void *data) { struct cg_seat *seat = wl_container_of(listener, seat, cursor_motion); - struct wlr_event_pointer_motion *event = data; + struct wlr_pointer_motion_event *event = data; - wlr_cursor_move(seat->cursor, event->device, event->delta_x, + wlr_cursor_move(seat->cursor, &event->pointer->base, event->delta_x, event->delta_y); process_cursor_motion(seat, event->time_msec); wlr_idle_notify_activity(seat->server->idle, seat->seat); @@ -780,7 +782,7 @@ drag_icon_update_position(struct cg_drag_icon *drag_icon) { drag_icon->ly = seat->touch_ly; break; } - wlr_scene_node_set_position(drag_icon->scene_node, drag_icon->lx, + wlr_scene_node_set_position(&drag_icon->scene_tree->node, drag_icon->lx, drag_icon->ly); } @@ -791,7 +793,7 @@ handle_drag_icon_destroy(struct wl_listener *listener, void *_data) { wl_list_remove(&drag_icon->link); wl_list_remove(&drag_icon->destroy.link); - wlr_scene_node_destroy(drag_icon->scene_node); + wlr_scene_node_destroy(&drag_icon->scene_tree->node); free(drag_icon); } @@ -837,9 +839,9 @@ handle_start_drag(struct wl_listener *listener, void *data) { } drag_icon->seat = seat; drag_icon->wlr_drag_icon = wlr_drag_icon; - drag_icon->scene_node = wlr_scene_subsurface_tree_create( - &seat->server->scene->node, wlr_drag_icon->surface); - if(!drag_icon->scene_node) { + drag_icon->scene_tree = wlr_scene_subsurface_tree_create( + &seat->server->scene->tree, wlr_drag_icon->surface); + if(!drag_icon->scene_tree) { free(drag_icon); return; } @@ -1057,10 +1059,11 @@ seat_set_focus(struct cg_seat *seat, struct cg_view *view) { NULL); } - wlr_scene_node_raise_to_top(view->scene_node); + wlr_scene_node_raise_to_top(&view->scene_tree->node); process_cursor_motion(seat, -1); - struct wlr_box *box = wlr_output_layout_get_box( - server->output_layout, view->workspace->output->wlr_output); - wlr_scene_node_set_position(&view->workspace->output->bg->node, box->x, - box->y); + struct wlr_box box; + wlr_output_layout_get_box( + server->output_layout, view->workspace->output->wlr_output,&box); + wlr_scene_node_set_position(&view->workspace->output->bg->node, box.x, + box.y); } diff --git a/seat.h b/seat.h index cfbc869..8c11866 100644 --- a/seat.h +++ b/seat.h @@ -91,7 +91,7 @@ struct cg_drag_icon { struct wl_list link; // seat::drag_icons struct cg_seat *seat; struct wlr_drag_icon *wlr_drag_icon; - struct wlr_scene_node *scene_node; + struct wlr_scene_tree *scene_tree; /* The drag icon has a position in layout coordinates. */ double lx, ly; diff --git a/view.c b/view.c index 8c504e0..33259f0 100644 --- a/view.c +++ b/view.c @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include "ipc_server.h" @@ -88,13 +88,14 @@ void view_maximize(struct cg_view *view, struct cg_tile *tile) { view->ox = tile->tile.x; view->oy = tile->tile.y; - struct wlr_box *box = wlr_output_layout_get_box( - view->server->output_layout, view->workspace->output->wlr_output); - wlr_scene_node_set_position(view->scene_node, view->ox + box->x, - view->oy + box->y); + struct wlr_box box; + wlr_output_layout_get_box( + view->server->output_layout, view->workspace->output->wlr_output,&box); + wlr_scene_node_set_position(&view->scene_tree->node, view->ox + box.x, + view->oy + box.y); view->impl->maximize(view, tile->tile.width, tile->tile.height); view->tile = tile; - wlr_scene_node_raise_to_top(view->scene_node); + wlr_scene_node_raise_to_top(&view->scene_tree->node); } void @@ -116,7 +117,7 @@ view_unmap(struct cg_view *view) { tile_id = view->tile->id; } - wlr_scene_node_destroy(view->scene_node); + wlr_scene_node_destroy(&view->scene_tree->node); #if CG_HAS_XWAYLAND if((view->type != CG_XWAYLAND_VIEW || xwayland_view_should_manage(view))) @@ -163,13 +164,13 @@ view_map(struct cg_view *view, struct wlr_surface *surface, struct cg_output *output = ws->output; view->wlr_surface = surface; - view->scene_node = - wlr_scene_subsurface_tree_create(&ws->scene->node, surface); - if(!view->scene_node) { + view->scene_tree = + wlr_scene_subsurface_tree_create(ws->scene, surface); + if(!view->scene_tree) { wl_resource_post_no_memory(surface->resource); return; } - view->scene_node->data = view; + view->scene_tree->node.data = view; view->workspace = ws; #if CG_HAS_XWAYLAND @@ -177,10 +178,10 @@ view_map(struct cg_view *view, struct wlr_surface *surface, their own (x,y) coordinates in handle_wayland_surface_map. */ if(view->type == CG_XWAYLAND_VIEW && !xwayland_view_should_manage(view)) { wl_list_insert(&ws->unmanaged_views, &view->link); - struct wlr_box *box = wlr_output_layout_get_box( - view->server->output_layout, view->workspace->output->wlr_output); - wlr_scene_node_set_position(view->scene_node, view->ox + box->x, - view->oy + box->y); + struct wlr_box box; + wlr_output_layout_get_box(view->server->output_layout, view->workspace->output->wlr_output,&box); + wlr_scene_node_set_position(&view->scene_tree->node, view->ox + box.x, + view->oy + box.y); } else #endif { diff --git a/view.h b/view.h index df41547..6c56d70 100644 --- a/view.h +++ b/view.h @@ -5,7 +5,7 @@ #include #include -#include +#include struct cg_server; struct wlr_box; @@ -23,7 +23,7 @@ struct cg_view { struct wl_list link; // server::views struct wlr_surface *wlr_surface; struct cg_tile *tile; - struct wlr_scene_node *scene_node; + struct wlr_scene_tree *scene_tree; /* The view has a position in output coordinates. */ int ox, oy; diff --git a/workspace.c b/workspace.c index a9b9734..2c6db46 100644 --- a/workspace.c +++ b/workspace.c @@ -25,13 +25,13 @@ void workspace_tile_update_view(struct cg_tile *tile, struct cg_view *view) { if(tile->view!=NULL) { - wlr_scene_node_set_enabled(tile->view->scene_node,false); + wlr_scene_node_set_enabled(&tile->view->scene_tree->node,false); tile->view->tile=NULL; } tile->view=view; if(view!=NULL) { view_maximize(view,tile); - wlr_scene_node_set_enabled(view->scene_node,true); + wlr_scene_node_set_enabled(&view->scene_tree->node,true); } } @@ -53,9 +53,10 @@ full_screen_workspace_tiles(struct wlr_output_layout *layout, workspace->focused_tile->prev = workspace->focused_tile; workspace->focused_tile->tile.x = 0; workspace->focused_tile->tile.y = 0; - struct wlr_box *output_box = wlr_output_layout_get_box(layout, output); - workspace->focused_tile->tile.width = output_box->width; - workspace->focused_tile->tile.height = output_box->height; + struct wlr_box output_box; + wlr_output_layout_get_box(layout, output,&output_box); + workspace->focused_tile->tile.width = output_box.width; + workspace->focused_tile->tile.height = output_box.height; workspace_tile_update_view(workspace->focused_tile,NULL); workspace->focused_tile->id = *tiles_curr_id; ++(*tiles_curr_id); @@ -79,7 +80,7 @@ full_screen_workspace(struct cg_output *output) { } workspace->server = output->server; workspace->num = -1; - workspace->scene = wlr_scene_tree_create(&scene_output->scene->node); + workspace->scene = wlr_scene_tree_create(&scene_output->scene->tree); if(full_screen_workspace_tiles(output->server->output_layout, output->wlr_output, workspace, &output->server->tiles_curr_id) != 0) { diff --git a/xdg_shell.c b/xdg_shell.c index 4c32142..1567b65 100644 --- a/xdg_shell.c +++ b/xdg_shell.c @@ -77,21 +77,22 @@ xdg_decoration_handle_request_mode(struct wl_listener *listener, void *_data) { static void popup_unconstrain(struct cg_view *view, struct wlr_xdg_popup *popup) { - struct wlr_box *popup_box = &popup->geometry; + struct wlr_box *popup_box = &popup->current.geometry; struct wlr_output_layout *output_layout = view->server->output_layout; - struct wlr_box *view_output_box = wlr_output_layout_get_box( - output_layout, view->workspace->output->wlr_output); + struct wlr_box view_output_box; + wlr_output_layout_get_box( + output_layout, view->workspace->output->wlr_output,&view_output_box); struct wlr_output *wlr_output = wlr_output_layout_output_at( - output_layout, view_output_box->x + view->ox + popup_box->x, - view_output_box->y + view->oy + popup_box->y); - struct wlr_box *output_box = - wlr_output_layout_get_box(output_layout, wlr_output); + output_layout, view_output_box.x + view->ox + popup_box->x, + view_output_box.y + view->oy + popup_box->y); + struct wlr_box output_box; + wlr_output_layout_get_box(output_layout, wlr_output,&output_box); struct wlr_box output_toplevel_box = {.x = -view->ox, .y = -view->oy, - .width = output_box->width, - .height = output_box->height}; + .width = output_box.width, + .height = output_box.height}; wlr_xdg_popup_unconstrain_from_box(popup, &output_toplevel_box); } @@ -119,16 +120,15 @@ static bool is_primary(const struct cg_view *view) { const struct cg_xdg_shell_view *xdg_shell_view = xdg_shell_view_from_const_view(view); - struct wlr_xdg_surface *parent = + struct wlr_xdg_toplevel *parent = xdg_shell_view->xdg_surface->toplevel->parent; - /* FIXME: role is 0? */ - return parent == NULL; /*&& role == WLR_XDG_SURFACE_ROLE_TOPLEVEL */ + return parent == NULL; } static void activate(struct cg_view *view, bool activate) { struct cg_xdg_shell_view *xdg_shell_view = xdg_shell_view_from_view(view); - wlr_xdg_toplevel_set_activated(xdg_shell_view->xdg_surface, activate); + wlr_xdg_toplevel_set_activated(xdg_shell_view->xdg_surface->toplevel, activate); } static void @@ -136,17 +136,17 @@ close(struct cg_view *view) { struct cg_xdg_shell_view *xdg_shell_view = xdg_shell_view_from_view(view); struct wlr_xdg_surface *surface = xdg_shell_view->xdg_surface; if(surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL) { - wlr_xdg_toplevel_send_close(surface); + wlr_xdg_toplevel_send_close(surface->toplevel); } } static void maximize(struct cg_view *view, int width, int height) { struct cg_xdg_shell_view *xdg_shell_view = xdg_shell_view_from_view(view); - wlr_xdg_toplevel_set_size(xdg_shell_view->xdg_surface, width, height); + wlr_xdg_toplevel_set_size(xdg_shell_view->xdg_surface->toplevel, width, height); enum wlr_edges edges = WLR_EDGE_LEFT | WLR_EDGE_RIGHT | WLR_EDGE_TOP | WLR_EDGE_BOTTOM; - wlr_xdg_toplevel_set_tiled(xdg_shell_view->xdg_surface, edges); + wlr_xdg_toplevel_set_tiled(xdg_shell_view->xdg_surface->toplevel, edges); } static void @@ -158,11 +158,18 @@ destroy(struct cg_view *view) { static void handle_xdg_shell_surface_request_fullscreen(struct wl_listener *listener, void *data) { - struct cg_xdg_shell_view *xdg_shell_view = - wl_container_of(listener, xdg_shell_view, request_fullscreen); - struct wlr_xdg_toplevel_set_fullscreen_event *event = data; - wlr_xdg_toplevel_set_fullscreen(xdg_shell_view->xdg_surface, - event->fullscreen); + struct cg_xdg_shell_view *xdg_shell_view = wl_container_of(listener, xdg_shell_view, request_fullscreen); + + /** + * Certain clients do not like figuring out their own window geometry if they + * display in fullscreen mode, so we set it here. + */ + struct wlr_box layout_box; + wlr_output_layout_get_box(xdg_shell_view->view.server->output_layout, NULL, &layout_box); + wlr_xdg_toplevel_set_size(xdg_shell_view->xdg_surface->toplevel, layout_box.width, layout_box.height); + + wlr_xdg_toplevel_set_fullscreen(xdg_shell_view->xdg_surface->toplevel, + xdg_shell_view->xdg_surface->toplevel->requested.fullscreen); } static void @@ -248,26 +255,26 @@ handle_xdg_shell_surface_new(struct wl_listener *listener, void *data) { return; } - struct wlr_scene_node *parent_scene_node = NULL; + struct wlr_scene_tree *parent_scene_tree = NULL; struct wlr_xdg_surface *parent = wlr_xdg_surface_from_wlr_surface(popup->parent); switch(parent->role) { case WLR_XDG_SURFACE_ROLE_TOPLEVEL:; - parent_scene_node = view->scene_node; + parent_scene_tree = view->scene_tree; break; case WLR_XDG_SURFACE_ROLE_POPUP: - parent_scene_node = parent->data; + parent_scene_tree = parent->data; break; case WLR_XDG_SURFACE_ROLE_NONE: break; } - if(parent_scene_node == NULL) { + if(parent_scene_tree == NULL) { return; } - struct wlr_scene_node *popup_scene_node = - wlr_scene_xdg_surface_create(parent_scene_node, xdg_surface); - if(popup_scene_node == NULL) { + struct wlr_scene_tree *popup_scene_tree = + wlr_scene_xdg_surface_create(parent_scene_tree, xdg_surface); + if(popup_scene_tree == NULL) { wlr_log(WLR_ERROR, "Failed to allocate scene-graph node for XDG popup"); return; @@ -275,7 +282,7 @@ handle_xdg_shell_surface_new(struct wl_listener *listener, void *data) { popup_unconstrain(view, popup); - xdg_surface->data = popup_scene_node; + xdg_surface->data = popup_scene_tree; break; case WLR_XDG_SURFACE_ROLE_NONE: assert(false); // unreachable diff --git a/xwayland.c b/xwayland.c index 42344a0..4817aeb 100644 --- a/xwayland.c +++ b/xwayland.c @@ -79,7 +79,7 @@ close(struct cg_view *view) { static void maximize(struct cg_view *view, int width, int height) { struct cg_xwayland_view *xwayland_view = xwayland_view_from_view(view); - struct wlr_xwayland_surface_size_hints *hints = + xcb_size_hints_t *hints = xwayland_view->xwayland_surface->size_hints; if(hints != NULL && hints->flags & PMaxSize) { @@ -92,11 +92,11 @@ maximize(struct cg_view *view, int width, int height) { } } - struct wlr_box *output_box = wlr_output_layout_get_box( - view->server->output_layout, view->server->curr_output->wlr_output); + struct wlr_box output_box; + wlr_output_layout_get_box(view->server->output_layout, view->server->curr_output->wlr_output,&output_box); wlr_xwayland_surface_configure(xwayland_view->xwayland_surface, - view->ox + output_box->x, - view->oy + output_box->y, width, height); + view->ox + output_box.x, + view->oy + output_box.y, width, height); wlr_xwayland_surface_set_maximized(xwayland_view->xwayland_surface, true); } @@ -133,10 +133,10 @@ handle_xwayland_surface_map(struct wl_listener *listener, void *_data) { struct cg_view *view = &xwayland_view->view; if(!xwayland_view_should_manage(view)) { struct wlr_output_layout *output_layout = view->server->output_layout; - struct wlr_box *output_box = wlr_output_layout_get_box( - output_layout, view->server->curr_output->wlr_output); - view->ox = xwayland_view->xwayland_surface->x - output_box->x; - view->oy = xwayland_view->xwayland_surface->y - output_box->y; + struct wlr_box output_box; + wlr_output_layout_get_box(output_layout, view->server->curr_output->wlr_output,&output_box); + view->ox = xwayland_view->xwayland_surface->x - output_box.x; + view->oy = xwayland_view->xwayland_surface->y - output_box.y; } view_map(view, xwayland_view->xwayland_surface->surface, From 6ee98a32c7f48c1aaf8a083a66d8ce46caf7a5ab Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 5 Jan 2023 18:54:13 +0100 Subject: [PATCH 535/689] Fix naming convention --- workspace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workspace.c b/workspace.c index 2c6db46..d6ffe25 100644 --- a/workspace.c +++ b/workspace.c @@ -101,7 +101,7 @@ workspace_focus_tile(struct cg_workspace *ws, struct cg_tile *tile) { } box->x = tile->tile.x + tile->tile.width / 2; box->y = tile->tile.y + tile->tile.height / 2; - message_printf_pos(ws->output, box, CG_MESSAGE_CENTER, "Current frame"); + message_printf_pos(ws->output, box, CG_MESSAGE_CENTER, "Current tile"); } void From 74bc47d3a58f6faa0b2b85f478f7961425ba0a25 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 6 Jan 2023 07:52:54 +0100 Subject: [PATCH 536/689] Fix off by one --- keybinding.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keybinding.c b/keybinding.c index 6e1c219..1903858 100644 --- a/keybinding.c +++ b/keybinding.c @@ -994,7 +994,7 @@ print_output(struct cg_output *outp) { print_str(&outp_str, "\"coords\": {\"x\":%d,\"y\":%d},\n", outp_box.x,outp_box.y); print_str(&outp_str, "\"size\": {\"width\":%d,\"height\":%d},\n", 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, "\"curr_workspace\": %d,\n", outp->curr_workspace); + print_str(&outp_str, "\"curr_workspace\": %d,\n", outp->curr_workspace+1); char *workspaces_str = print_workspaces(outp); if(workspaces_str != NULL) { print_str(&outp_str, "%s", workspaces_str); @@ -1430,7 +1430,7 @@ keybinding_move_view_to_workspace(struct cg_server *server, uint32_t ws) { "{\"event_name\":\"move_view_to_ws\",\"view_id\":%d," "\"old_workspace\":%d,\"new_workspace\":%d," "\"output\":\"%s\",\"view_pid\":%d}", - view == NULL ? -1 : (int)view->id, old_ws, ws, + view == NULL ? -1 : (int)view->id, old_ws+1, ws+1, server->curr_output->wlr_output->name, view == NULL ? 0 : view->impl->get_pid(view)); } From 7002b00b2800934f91207a31ef929725496a2a84 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 6 Jan 2023 08:46:08 +0100 Subject: [PATCH 537/689] Add missing fields to ipc output --- keybinding.c | 74 +++++++++++++++++++++++++++++----------------------- output.c | 22 +++++++++++++--- output.h | 2 ++ seat.c | 7 ++--- view.c | 9 ++++--- 5 files changed, 70 insertions(+), 44 deletions(-) diff --git a/keybinding.c b/keybinding.c index 1903858..b33df09 100644 --- a/keybinding.c +++ b/keybinding.c @@ -239,9 +239,9 @@ swap_tile(struct cg_tile *tile, seat_set_focus(server->seat, swap_tile->view); ipc_send_event(tile->workspace->output->server, "{\"event_name\":\"swap_tile\",\"tile_id\":%d,\"swap_" - "tile_id\":%d,\"workspace\":%d,\"output\":\"%s\"}", + "tile_id\":%d,\"workspace\":%d,\"output\":\"%s\",\"output_id\":%d}", tile->id, swap_tile->id, tile->workspace->num + 1, - tile->workspace->output->wlr_output->name); + tile->workspace->output->wlr_output->name,output_get_num(tile->workspace->output)); } void @@ -388,11 +388,11 @@ resize(struct cg_tile *tile, const struct cg_tile *parent, int coord_offset, ipc_send_event(tile->workspace->output->server, "{\"event_name\":\"resize_tile\",\"tile_id\":%d,\"old_" "dims\":\"[%d,%d,%d,%d]\",\"new_dims\":\"[%d,%d,%d,%d]\"," - "\"workspace\":%d,\"output\":\"%s\"}", + "\"workspace\":%d,\"output\":\"%s\",\"output_id\":%d}", tile->id, old_x, old_y, old_height, old_width, tile->tile.x, tile->tile.y, tile->tile.height, tile->tile.width, tile->workspace->num + 1, - tile->workspace->output->wlr_output->name); + tile->workspace->output->wlr_output->name,output_get_num(tile->workspace->output)); } int * @@ -487,10 +487,10 @@ keybinding_workspace_fullscreen(struct cg_server *server) { struct cg_output *output = server->curr_output; ipc_send_event(server, "{\"event_name\":\"fullscreen\",\"tile_id\":%d," - "\"workspace\":%d,\"output\":\"%s\"}", + "\"workspace\":%d,\"output\":\"%s\",\"output_id\":%d}", output->workspaces[output->curr_workspace]->focused_tile->id, output->workspaces[output->curr_workspace]->num + 1, - output->wlr_output->name); + output->wlr_output->name,output_get_num(output)); } // Switch to a differerent virtual terminal @@ -582,9 +582,9 @@ keybinding_split_output(struct cg_output *output, bool vertical) { ipc_send_event( output->server, "{\"event_name\":\"split\",\"tile_id\":%d,\"new_tile_id\":%d," - "\"workspace\":%d,\"output\":\"%s\",\"vertical\":%d}", + "\"workspace\":%d,\"output\":\"%s\",\"output_id\":%d,\"vertical\":%d}", curr_workspace->focused_tile->id, new_tile->id, curr_workspace->num + 1, - curr_workspace->output->wlr_output->name, vertical); + curr_workspace->output->wlr_output->name, output_get_num(curr_workspace->output),vertical); } static void @@ -594,13 +594,14 @@ keybinding_close_view(struct cg_view *view) { } struct cg_output *outp = view->workspace->output; uint32_t view_id = view->id; + uint32_t view_pid = view->impl->get_pid(view); uint32_t tile_id = view->id; uint32_t ws = view->workspace->num; view->impl->close(view); ipc_send_event(outp->server, - "{\"event_name\":\"close\",\"view_id\":%d,\"tile_id\":" - "%d,\"workspace\":%d,\"output\":\"%s\"}", - view_id, tile_id, ws + 1, outp->wlr_output->name); + "{\"event_name\":\"close\",\"view_id\":%d,\"view_pid\":%d,\"tile_id\":" + "%d,\"workspace\":%d,\"output\":\"%s\",\"output_id\":%d}", + view_id, view_pid, tile_id, ws + 1, outp->wlr_output->name,output_get_num(outp)); } static void @@ -650,9 +651,9 @@ keybinding_cycle_outputs(struct cg_server *server, bool reverse, bool trigger_ev set_output(server, output); if(trigger_event) { ipc_send_event(output->server, - "{\"event_name\":\"cycle_outputs\",\"old_output\":\"%s\"," - "\"new_output\":\"%s\",\"reverse\":%d}", - old_output->wlr_output->name, output->wlr_output->name, + "{\"event_name\":\"cycle_outputs\",\"old_output\":\"%s\",\"old_output_id\":%d," + "\"new_output\":\"%s\",\"new_output_id\":%d,\"reverse\":%d}", + old_output->wlr_output->name, output_get_num(old_output),output->wlr_output->name, output_get_num(output), reverse); } } @@ -688,15 +689,19 @@ keybinding_cycle_views(struct cg_server *server, bool reverse, bool ipc) { seat_set_focus(server->seat, next_view); if(ipc) { ipc_send_event(curr_workspace->output->server, - "{\"event_name\":\"cycle_views\",\"old_view_id\":%d," - "\"new_view_id\":%d,\"tile_id\":%d," - "\"workspace\":%d,\"output\":\"%s\"}", + "{\"event_name\":\"cycle_views\",\"old_view_id\":%d,\"old_view_pid\":%d," + "\"new_view_id\":%d,\"new_view_pid\":%d,\"tile_id\":%d," + "\"workspace\":%d,\"output\":\"%s\",\"output_id\":%d}", current_view->link.next == curr_workspace->views.next ? -1 : (int)current_view->id, + current_view->link.next == curr_workspace->views.next + ? -1 + : (int)current_view->impl->get_pid(current_view), next_view == NULL ? -1 : (int)next_view->id, + next_view == NULL ? -1 : (int)next_view->impl->get_pid(next_view), next_view->tile->id, curr_workspace->num + 1, - curr_workspace->output->wlr_output->name); + curr_workspace->output->wlr_output->name,output_get_num(curr_workspace->output)); } } @@ -716,9 +721,9 @@ keybinding_focus_tile(struct cg_server *server, uint32_t tile_id) { ipc_send_event( output->server, "{\"event_name\":\"focus_tile\",\"old_tile_id\":%d,\"new_tile_" - "id\":%d,\"workspace\":%d,\"output\":\"%s\"}", + "id\":%d,\"workspace\":%d,\"output\":\"%s\",\"output_id\":%d}", old_tile->id, workspace->focused_tile->id, workspace->num + 1, - output->wlr_output->name); + output->wlr_output->name,output_get_num(output)); break; } } @@ -751,8 +756,8 @@ keybinding_switch_ws(struct cg_server *server, uint32_t ws) { message_printf(server->curr_output, "Workspace %d", ws + 1); ipc_send_event(output->server, "{\"event_name\":\"switch_ws\",\"old_workspace\":%d," - "\"new_workspace\":%d,\"output\":\"%s\"}", - old_ws + 1, ws + 1, output->wlr_output->name); + "\"new_workspace\":%d,\"output\":\"%s\",\"output_id\":%d}", + old_ws + 1, ws + 1, output->wlr_output->name,output_get_num(output)); return 0; } @@ -872,7 +877,7 @@ print_tile(struct cg_tile *tile) { tile->tile.y); print_str(&outp_str, "\"size\": {\"width\":%d,\"height\":%d},\n", tile->tile.width, tile->tile.height); - print_str(&outp_str, "\"view\": %d\n", + print_str(&outp_str, "\"view_id\": %d\n", tile->view == NULL ? -1 : (int)tile->view->id); return dyn_str_to_str(&outp_str); } @@ -1224,15 +1229,17 @@ keybinding_move_view_to_cycle_output(struct cg_server *server, bool reverse) { seat_set_focus(server->seat, view); } int id = -1; + int pid = -1; if(view != NULL) { id = view->id; + pid = view->impl->get_pid(view); } ipc_send_event(server, - "{\"event_name\":\"move_view_to_cycle_output\",\"view_id\":%d,\"old_output\":\"%s\",\"new_output\":\"%s\",\"old_tile_id\":%d,\"new_tile_id\":%d}", - id, old_outp->wlr_output->name, - old_outp->wlr_output->name,server->curr_output - ->workspaces[old_outp->curr_workspace]->focused_tile->id, - server->curr_output->wlr_output->name,server->curr_output + "{\"event_name\":\"move_view_to_cycle_output\",\"view_id\":%d,\"view_pid\":%d,\"old_output\":\"%s\",\"old_output_id\":%d,\"new_output\":\"%s\",\"new_output_id\":%d,\"old_tile_id\":%d,\"new_tile_id\":%d}", + id,pid,old_outp->wlr_output->name,output_get_num(old_outp), + server->curr_output->wlr_output->name,output_get_num(server->curr_output), + old_outp->workspaces[old_outp->curr_workspace]->focused_tile->id, + server->curr_output ->workspaces[server->curr_output->curr_workspace]->focused_tile->id); } @@ -1350,8 +1357,8 @@ keybinding_switch_output(struct cg_server *server, int output) { set_output(server, it); ipc_send_event(server, "{\"event_name\":\"switch_output\",\"old_output\":" - "\"%s\",\"new_output\":\"%s\"}", - old_outp->wlr_output->name, it->wlr_output->name); + "\"%s\",\"old_output_id\":%d,\"new_output\":\"%s\",\"new_output_id\":%d}", + old_outp->wlr_output->name,output_get_num(old_outp), it->wlr_output->name,output_get_num(it)); return; } ++count; @@ -1429,9 +1436,10 @@ keybinding_move_view_to_workspace(struct cg_server *server, uint32_t ws) { ipc_send_event(server, "{\"event_name\":\"move_view_to_ws\",\"view_id\":%d," "\"old_workspace\":%d,\"new_workspace\":%d," - "\"output\":\"%s\",\"view_pid\":%d}", + "\"output\":\"%s\",\"output_id\":%d,\"view_pid\":%d}", view == NULL ? -1 : (int)view->id, old_ws+1, ws+1, server->curr_output->wlr_output->name, + output_get_num(server->curr_output), view == NULL ? 0 : view->impl->get_pid(view)); } @@ -1483,8 +1491,8 @@ keybinding_configure_output(struct cg_server *server, output_configure(server, output); ipc_send_event( output->server, - "{\"event_name\":\"configure_output\",\"output\":\"%s\"}", - cfg->output_name); + "{\"event_name\":\"configure_output\",\"output\":\"%s\",\"output_id\":%d}", + cfg->output_name,output_get_num(output)); return; } } diff --git a/output.c b/output.c index 24f6279..92c6abe 100644 --- a/output.c +++ b/output.c @@ -105,10 +105,24 @@ output_clear(struct cg_output *output) { } } +int +output_get_num(const struct cg_output* output) { + struct cg_output *it; + int count = 1; + wl_list_for_each(it, &output->server->outputs, link) { + if(strcmp(output->wlr_output->name,it->wlr_output->name)==0) { + return count; + } + ++count; + } + return -1; +} + static void output_destroy(struct cg_output *output) { struct cg_server *server = output->server; char *outp_name = strdup(output->wlr_output->name); + int outp_num = output_get_num(output); wl_list_remove(&output->destroy.link); wl_list_remove(&output->mode.link); @@ -129,8 +143,8 @@ output_destroy(struct cg_output *output) { if(outp_name != NULL) { ipc_send_event(server, - "{\"event_name\":\"destroy_output\",\"output\":\"%s\"}", - outp_name); + "{\"event_name\":\"destroy_output\",\"output\":\"%s\",\"output_id\":%d}", + outp_name,outp_num); free(outp_name); } else { wlr_log(WLR_ERROR, @@ -570,8 +584,8 @@ handle_new_output(struct wl_listener *listener, void *data) { wl_signal_add(&wlr_output->events.mode, &output->mode); ipc_send_event( server, - "{\"event_name\":\"new_output\",\"output\":\"%s\",\"priority\":%d}", - output->wlr_output->name, output->priority); + "{\"event_name\":\"new_output\",\"output\":\"%s\",\"output_id\":%d,\"priority\":%d}", + output->wlr_output->name, output_get_num(output),output->priority); } #if CG_HAS_FANALYZE #pragma GCC diagnostic pop diff --git a/output.h b/output.h index 5f75805..ed7556f 100644 --- a/output.h +++ b/output.h @@ -59,4 +59,6 @@ void output_set_window_title(struct cg_output *output, const char *title); void output_make_workspace_fullscreen(struct cg_output *output, int ws); +int +output_get_num(const struct cg_output* output); #endif diff --git a/seat.c b/seat.c index fcd4864..41ae39f 100644 --- a/seat.c +++ b/seat.c @@ -730,10 +730,11 @@ process_cursor_motion(struct cg_seat *seat, uint32_t time) { if(seat->cursor_tile != NULL && seat->cursor_tile != c_tile) { ipc_send_event( seat->server, - "{\"event_name\":\"cursor_switch_tile\",\"old_output\":\"%s\"," - "\"old_tile\":%d,\"new_output\":\"%s\",\"new_tile\":%d}", + "{\"event_name\":\"cursor_switch_tile\",\"old_output\":\"%s\",\"old_output_id\":%d," + "\"old_tile\":%d,\"new_output\":\"%s\",\"new_output_id\":%d,\"new_tile\":%d}", seat->cursor_tile->workspace->output->wlr_output->name, - seat->cursor_tile->id, c_outp->name, c_tile->id); + output_get_num(seat->cursor_tile->workspace->output), + seat->cursor_tile->id, c_outp->name, output_get_num(cg_outp),c_tile->id); } seat->cursor_tile = c_tile; } diff --git a/view.c b/view.c index 33259f0..eafbe7d 100644 --- a/view.c +++ b/view.c @@ -105,6 +105,7 @@ view_unmap(struct cg_view *view) { uint32_t tile_id = 0; uint32_t ws = view->workspace->num; char *output_name = view->workspace->output->wlr_output->name; + int output_id = output_get_num(view->workspace->output); pid_t pid = view->impl->get_pid(view); /* If the view is not mapped, do nothing */ if(view->wlr_surface == NULL) { @@ -154,8 +155,8 @@ view_unmap(struct cg_view *view) { ipc_send_event( view->workspace->server, "{\"event_name\":\"view_unmap\",\"view_id\":%d,\"tile_id\":%d," - "\"workspace\":%d,\"output\":\"%s\",\"view_pid\":%d}", - id, tile_id, ws + 1, output_name, pid); + "\"workspace\":%d,\"output\":\"%s\",\"output_id\":%d,\"view_pid\":%d}", + id, tile_id, ws + 1, output_name, output_id,pid); } void @@ -197,9 +198,9 @@ view_map(struct cg_view *view, struct wlr_surface *surface, ipc_send_event( output->server, "{\"event_name\":\"view_map\",\"view_id\":%d,\"tile_id\":%d," - "\"workspace\":%d,\"output\":\"%s\",\"view_pid\":%d}", + "\"workspace\":%d,\"output\":\"%s\",\"output_id\":%d,\"view_pid\":%d}", view->id, tile_id, view->workspace->num + 1, - view->workspace->output->wlr_output->name, view->impl->get_pid(view)); + view->workspace->output->wlr_output->name, output_get_num(view->workspace->output),view->impl->get_pid(view)); } void From 57ee9a06b65e692740d8aa80d13804a360dc8104 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 6 Jan 2023 09:10:12 +0100 Subject: [PATCH 538/689] Disable resetting cursor image --- seat.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/seat.c b/seat.c index 41ae39f..13c420b 100644 --- a/seat.c +++ b/seat.c @@ -210,13 +210,11 @@ handle_command_key_bindings(struct cg_server *server, xkb_keysym_t sym, struct wlr_scene_node *node = wlr_scene_node_at( &server->scene->tree.node, server->seat->cursor->x, server->seat->cursor->y, &sx, &sy); if(server->seat->enable_cursor) { + wlr_xcursor_manager_set_cursor_image(server->seat->xcursor_manager, + "left_ptr", server->seat->cursor); if(node && node->type == WLR_SCENE_NODE_BUFFER) { surface = wlr_scene_surface_from_buffer(wlr_scene_buffer_from_node(node))->surface; wlr_seat_pointer_notify_enter(wlr_seat, surface, sx, sy); - } else { - wlr_xcursor_manager_set_cursor_image(server->seat->xcursor_manager, - "left_ptr", server->seat->cursor); - } } } @@ -546,7 +544,7 @@ handle_request_set_selection(struct wl_listener *listener, void *data) { static void handle_request_set_cursor(struct wl_listener *listener, void *data) { struct cg_seat *seat = wl_container_of(listener, seat, request_set_cursor); - if(seat->enable_cursor==false) { + if(seat->enable_cursor==false||seat->mode!=seat->default_mode) { return; } struct wlr_seat_pointer_request_set_cursor_event *event = data; From d7a21aacb162f134e2ffe6a324878b39f62f4aff Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 6 Jan 2023 14:20:36 +0100 Subject: [PATCH 539/689] Fix potential npd --- seat.c | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/seat.c b/seat.c index 13c420b..a446314 100644 --- a/seat.c +++ b/seat.c @@ -213,7 +213,10 @@ handle_command_key_bindings(struct cg_server *server, xkb_keysym_t sym, wlr_xcursor_manager_set_cursor_image(server->seat->xcursor_manager, "left_ptr", server->seat->cursor); if(node && node->type == WLR_SCENE_NODE_BUFFER) { - surface = wlr_scene_surface_from_buffer(wlr_scene_buffer_from_node(node))->surface; + struct wlr_scene_surface *scene_surface=wlr_scene_surface_from_buffer(wlr_scene_buffer_from_node(node)); + if(scene_surface != NULL) { + surface = scene_surface->surface; + } wlr_seat_pointer_notify_enter(wlr_seat, surface, sx, sy); } } @@ -580,9 +583,12 @@ handle_touch_down(struct wl_listener *listener, void *data) { uint32_t serial = 0; if(node && node->type == WLR_SCENE_NODE_BUFFER) { - serial = wlr_seat_touch_notify_down( - seat->seat, wlr_scene_surface_from_buffer(wlr_scene_buffer_from_node(node))->surface, - event->time_msec, event->touch_id, sx, sy); + struct wlr_scene_surface *scene_surface=wlr_scene_surface_from_buffer(wlr_scene_buffer_from_node(node)); + if(scene_surface != NULL) { + serial = wlr_seat_touch_notify_down( + seat->seat, scene_surface->surface, + event->time_msec, event->touch_id, sx, sy); + } } if(serial && wlr_seat_touch_num_points(seat->seat) == 1) { @@ -625,9 +631,13 @@ handle_touch_motion(struct wl_listener *listener, void *data) { wlr_scene_node_at(&seat->server->scene->tree.node, lx, ly, &sx, &sy); if(node && node->type == WLR_SCENE_NODE_BUFFER) { - wlr_seat_touch_point_focus(seat->seat, - wlr_scene_surface_from_buffer(wlr_scene_buffer_from_node(node))->surface, - event->time_msec, event->touch_id, sx, sy); + struct wlr_scene_surface *scene_surface=wlr_scene_surface_from_buffer(wlr_scene_buffer_from_node(node)); + if(scene_surface != NULL) { + + wlr_seat_touch_point_focus(seat->seat, + scene_surface->surface, + event->time_msec, event->touch_id, sx, sy); + } wlr_seat_touch_notify_motion(seat->seat, event->time_msec, event->touch_id, sx, sy); } else { @@ -682,7 +692,10 @@ process_cursor_motion(struct cg_seat *seat, uint32_t time) { &seat->server->scene->tree.node, seat->cursor->x, seat->cursor->y, &sx, &sy); if(node && node->type == WLR_SCENE_NODE_BUFFER) { - surface = wlr_scene_surface_from_buffer(wlr_scene_buffer_from_node(node))->surface; + struct wlr_scene_surface *scene_surface=wlr_scene_surface_from_buffer(wlr_scene_buffer_from_node(node)); + if(scene_surface != NULL) { + surface = scene_surface->surface; + } wlr_seat_pointer_notify_enter(wlr_seat, surface, sx, sy); bool focus_changed = wlr_seat->pointer_state.focused_surface != surface; From 226d471794caf57245cb44d2fe501b431e46d290 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 6 Jan 2023 15:13:24 +0100 Subject: [PATCH 540/689] Update xwayland seat on focus --- cagebreak.c | 21 +++++++++------------ seat.c | 3 +++ server.h | 1 + 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index eafdb08..5372ee2 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -273,9 +273,6 @@ main(int argc, char *argv[]) { struct wlr_xdg_output_manager_v1 *output_manager = NULL; struct wlr_gamma_control_manager_v1 *gamma_control_manager = NULL; struct wlr_xdg_shell *xdg_shell = NULL; -#if CG_HAS_XWAYLAND - struct wlr_xwayland *xwayland = NULL; -#endif wl_list_init(&server.input_config); wl_list_init(&server.output_config); wl_list_init(&server.output_priorities); @@ -571,21 +568,21 @@ main(int argc, char *argv[]) { } #if CG_HAS_XWAYLAND - xwayland = wlr_xwayland_create(server.wl_display, compositor, true); - if(!xwayland) { + server.xwayland = wlr_xwayland_create(server.wl_display, compositor, true); + if(!server.xwayland) { wlr_log(WLR_ERROR, "Cannot create XWayland server"); ret = 1; goto end; } server.new_xwayland_surface.notify = handle_xwayland_surface_new; - wl_signal_add(&xwayland->events.new_surface, &server.new_xwayland_surface); + wl_signal_add(&server.xwayland->events.new_surface, &server.new_xwayland_surface); - if(setenv("DISPLAY", xwayland->display_name, true) < 0) { + if(setenv("DISPLAY", server.xwayland->display_name, true) < 0) { wlr_log_errno(WLR_ERROR, "Unable to set DISPLAY for XWayland.", "Clients may not be able to connect"); } else { wlr_log(WLR_DEBUG, "XWayland is running on display %s", - xwayland->display_name); + server.xwayland->display_name); } struct wlr_xcursor *xcursor = @@ -593,7 +590,7 @@ main(int argc, char *argv[]) { if(xcursor) { struct wlr_xcursor_image *image = xcursor->images[0]; - wlr_xwayland_set_cursor(xwayland, image->buffer, image->width * 4, + wlr_xwayland_set_cursor(server.xwayland, image->buffer, image->width * 4, image->width, image->height, image->hotspot_x, image->hotspot_y); } @@ -620,7 +617,7 @@ main(int argc, char *argv[]) { } #if CG_HAS_XWAYLAND - wlr_xwayland_set_seat(xwayland, server.seat->seat); + wlr_xwayland_set_seat(server.xwayland, server.seat->seat); #endif if(show_info) { @@ -724,8 +721,8 @@ end: if(server.running == true) { server.running=false; #if CG_HAS_XWAYLAND - if(xwayland!=NULL) { - wlr_xwayland_destroy(xwayland); + if(server.xwayland!=NULL) { + wlr_xwayland_destroy(server.xwayland); } #endif diff --git a/seat.c b/seat.c index a446314..e3d0067 100644 --- a/seat.c +++ b/seat.c @@ -1041,6 +1041,9 @@ seat_set_focus(struct cg_seat *seat, struct cg_view *view) { } #if CG_HAS_XWAYLAND + if(view->type == CG_XWAYLAND_VIEW) { + wlr_xwayland_set_seat(server->xwayland, seat->seat); + } if(view->type == CG_XWAYLAND_VIEW && !xwayland_view_should_manage(view)) { const struct cg_xwayland_view *xwayland_view = xwayland_view_from_view(view); diff --git a/server.h b/server.h index a15048c..39d26f4 100644 --- a/server.h +++ b/server.h @@ -43,6 +43,7 @@ struct cg_server { struct wl_listener new_xdg_shell_surface; #if CG_HAS_XWAYLAND struct wl_listener new_xwayland_surface; + struct wlr_xwayland *xwayland; #endif struct keybinding_list *keybindings; From b3e238e44287b50636aca1f17c6693a3590eda12 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 6 Jan 2023 16:37:07 +0100 Subject: [PATCH 541/689] Fix quitting on startup --- cagebreak.c | 53 ++++++++++++++++++++++++++++++---------------------- keybinding.c | 1 + 2 files changed, 32 insertions(+), 22 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index 5372ee2..fa0336e 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -652,12 +652,11 @@ main(int argc, char *argv[]) { } } - if(conf_ret != 0) { - free(config_file); + free(config_file); + if(conf_ret != 0||!server.running) { ret = 1; goto end; } - free(config_file); } { @@ -718,33 +717,43 @@ end: keybinding_list_free(server.keybindings); } - if(server.running == true) { - server.running=false; + if(server.message_config.font!=NULL) { + free(server.message_config.font); + } + server.running=false; + if(server.seat!=NULL) { + seat_destroy(server.seat); + } #if CG_HAS_XWAYLAND - if(server.xwayland!=NULL) { - wlr_xwayland_destroy(server.xwayland); - } + if(server.xwayland!=NULL) { + wlr_xwayland_destroy(server.xwayland); + } #endif + if(sigint_source!=NULL) { wl_event_source_remove(sigint_source); wl_event_source_remove(sigterm_source); wl_event_source_remove(sigalrm_source); wl_event_source_remove(sigpipe_source); - - seat_destroy(server.seat); - /* This function is not null-safe, but we only ever get here - with a proper wl_display. */ - wl_display_destroy(server.wl_display); - wlr_output_layout_destroy(server.output_layout); - - free(server.input); - free(server.message_config.font); - pango_cairo_font_map_set_default(NULL); - cairo_debug_reset_static_data(); - FcFini(); - - return ret; } + + /* This function is not null-safe, but we only ever get here + with a proper wl_display. */ + if(server.wl_display!=NULL) { + wl_display_destroy(server.wl_display); + } + if(server.output_layout!=NULL) { + wlr_output_layout_destroy(server.output_layout); + } + + if(server.input!=NULL) { + free(server.input); + } + pango_cairo_font_map_set_default(NULL); + cairo_debug_reset_static_data(); + FcFini(); + + return ret; } #if CG_HAS_FANALYZE #pragma GCC diagnostic pop diff --git a/keybinding.c b/keybinding.c index b33df09..4718f6b 100644 --- a/keybinding.c +++ b/keybinding.c @@ -1573,6 +1573,7 @@ run_action(enum keybinding_action action, struct cg_server *server, switch(action) { case KEYBINDING_QUIT: display_terminate(server); + server->running=false; break; case KEYBINDING_CHANGE_TTY: return keybinding_switch_vt(server->backend, data.u); From a6fdd0a27b4356c1dd58265bdca51b3881f4c618 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 6 Jan 2023 16:42:07 +0100 Subject: [PATCH 542/689] Fix man typo --- man/cagebreak-config.5.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index a084cd0..b8fd58a 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -182,7 +182,7 @@ definekey top mode root Enable or disable disable-while-typing for specified input device - *event enabled|disabled|disabled_on_external_mouse* + *events enabled|disabled|disabled_on_external_mouse* Enable or disable send_events for specified input device - Disabling send_events disables the input device. From c07a734262595238c3d3781eedb835348e72ea3c Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 6 Jan 2023 16:52:04 +0100 Subject: [PATCH 543/689] Add Bug doc for config bug --- Bugs.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Bugs.md b/Bugs.md index 39141c2..a56a25f 100644 --- a/Bugs.md +++ b/Bugs.md @@ -1088,3 +1088,18 @@ Cagebreak used to have no way to hide the cursor. This is now possible. Cagebreak used to not change the cursor while waiting for a key. The cursor is now a square in this state. +## Issue 52 + + * github issue number: N/A + * Fixed 2.0.0 + +Cagebreak did not correctly apply some simple commands if they were simply +written in the configuration file. + +Consider the example config file: + +``` +quit +``` + +Under these circumstances Cagebreak did not quit right after startup. From 9e5c1814bed057f7b015b98bd73cfff2cec5b26d Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 6 Jan 2023 16:52:56 +0100 Subject: [PATCH 544/689] Update dependency versions --- meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 07e6b43..a2c5f50 100644 --- a/meson.build +++ b/meson.build @@ -201,8 +201,8 @@ reproducible_build_versions = { 'wayland_server': '1.19.0', 'wayland_client': '1.21.0', 'wayland_cursor': '1.21.0', - 'wlroots': '0.15.1', - 'xkbcommon': '1.4.1', + 'wlroots': '0.16.1', + 'xkbcommon': '1.5.0', 'fontconfig': '2.14.1', 'libinput': '1.22.0', 'libevdev': '1.13.0', From fc20ab4aed7002345e4ffdbfb0791b67ccad6c99 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 6 Jan 2023 17:16:45 +0100 Subject: [PATCH 545/689] Update release checklist --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 28e82fc..66f3470 100644 --- a/README.md +++ b/README.md @@ -354,6 +354,7 @@ occur. * [ ] cagebreak * [ ] cagebreak-config * [ ] cagebreak-socket + * [ ] example config * [ ] Set EPOCH to release day in man generation in meson.build * [ ] FAQ.md * [ ] Changelog.md for major and minor releases but not patches @@ -367,6 +368,7 @@ occur. * [ ] Libfuzzer testing * [ ] Build version without xwayland support * [ ] meson.build reproducible build versions are current archlinux libraries and gcc + * [ ] wlr_xdg_shell version check * [ ] `ninja -C build clang-format` makes no changes * [ ] `ninja -C build scan-build` shows no issues * [ ] Cagebreak is reproducible on multiple machines From d017f53a254ed611b2c0d27385f8b0b68a03f870 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 6 Jan 2023 19:10:48 +0100 Subject: [PATCH 546/689] Apply clang-format --- cagebreak.c | 94 ++++++++-------- fuzz/fuzz-lib.c | 29 +++-- fuzz/fuzz-parse.c | 2 +- input_manager.c | 157 +++++++++++++------------- input_manager.h | 10 +- ipc_server.c | 22 ++-- keybinding.c | 282 ++++++++++++++++++++++++++-------------------- keybinding.h | 133 ++++++++++++---------- libinput.c | 24 ++-- message.c | 8 +- output.c | 82 +++++++------- output.h | 4 +- parse.c | 69 +++++++----- seat.c | 160 ++++++++++++++------------ view.c | 18 +-- workspace.c | 27 +++-- xdg_shell.c | 30 +++-- xwayland.c | 12 +- 18 files changed, 645 insertions(+), 518 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index fa0336e..df96831 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -139,9 +139,10 @@ usage(FILE *file, const char *const cage) { } static bool -parse_args(struct cg_server *server, int argc, char *argv[], char **config_path) { +parse_args(struct cg_server *server, int argc, char *argv[], + char **config_path) { int c; - server->enable_socket=false; + server->enable_socket = false; while((c = getopt(argc, argv, "c:hvse")) != -1) { switch(c) { case 'h': @@ -155,12 +156,12 @@ parse_args(struct cg_server *server, int argc, char *argv[], char **config_path) break; case 'c': if(optarg != NULL) { - *config_path=strdup(optarg); - optarg=NULL; + *config_path = strdup(optarg); + optarg = NULL; } break; case 'e': - server->enable_socket=true; + server->enable_socket = true; break; default: usage(stderr, argv[0]); @@ -179,31 +180,33 @@ parse_args(struct cg_server *server, int argc, char *argv[], char **config_path) /* Parse config file. Lines longer than "max_line_size" are ignored */ int set_configuration(struct cg_server *server, - const char *const config_file_path) { + const char *const config_file_path) { FILE *config_file = fopen(config_file_path, "r"); if(config_file == NULL) { wlr_log(WLR_ERROR, "Could not open config file \"%s\"", - config_file_path); + config_file_path); return 1; } - uint32_t line_length=64; - char *line=calloc(line_length,sizeof(char)); + uint32_t line_length = 64; + char *line = calloc(line_length, sizeof(char)); for(unsigned int line_num = 1;; ++line_num) { while(true) { - if(fgets(line+strlen(line), line_length-strlen(line), config_file) == NULL) { + if(fgets(line + strlen(line), line_length - strlen(line), + config_file) == NULL) { break; } - if(strcspn(line,"\n")!=line_length-1) { + if(strcspn(line, "\n") != line_length - 1) { break; } - line_length*=2; - line=reallocarray(line,line_length,sizeof(char)); + line_length *= 2; + line = reallocarray(line, line_length, sizeof(char)); if(line == NULL) { - wlr_log(WLR_ERROR, "Could not allocate buffer for reading configuration file."); + wlr_log(WLR_ERROR, "Could not allocate buffer for reading " + "configuration file."); return 1; } } - if(strlen(line)==0) { + if(strlen(line) == 0) { break; } line[strcspn(line, "\n")] = '\0'; @@ -211,7 +214,7 @@ set_configuration(struct cg_server *server, char *errstr; if(parse_rc_line(server, line, &errstr) != 0) { wlr_log(WLR_ERROR, "Error in config file \"%s\", line %d\n", - config_file_path, line_num); + config_file_path, line_num); fclose(config_file); if(errstr != NULL) { free(errstr); @@ -220,7 +223,7 @@ set_configuration(struct cg_server *server, return -1; } } - memset(line,0,line_length*sizeof(char)); + memset(line, 0, line_length * sizeof(char)); } free(line); fclose(config_file); @@ -280,7 +283,7 @@ main(int argc, char *argv[]) { int ret = 0; char *config_path = NULL; - if(!parse_args(&server, argc, argv,&config_path)) { + if(!parse_args(&server, argc, argv, &config_path)) { goto end; } @@ -305,17 +308,17 @@ main(int argc, char *argv[]) { if(!server.wl_display) { wlr_log(WLR_ERROR, "Cannot allocate a Wayland display"); free(server.modes); - server.modes=NULL; + server.modes = NULL; goto end; } - server.xcursor_size=XCURSOR_SIZE; + server.xcursor_size = XCURSOR_SIZE; const char *env_cursor_size = getenv("XCURSOR_SIZE"); - if (env_cursor_size && strlen(env_cursor_size) > 0) { + if(env_cursor_size && strlen(env_cursor_size) > 0) { errno = 0; char *end; unsigned size = strtoul(env_cursor_size, &end, 10); - if (!*end && errno == 0) { + if(!*end && errno == 0) { server.xcursor_size = size; } } @@ -429,7 +432,7 @@ main(int argc, char *argv[]) { } subcompositor = wlr_subcompositor_create(server.wl_display); - if (!subcompositor) { + if(!subcompositor) { wlr_log(WLR_ERROR, "Unable to create the wlroots subcompositor"); ret = 1; goto end; @@ -483,7 +486,7 @@ main(int argc, char *argv[]) { &server.new_idle_inhibitor_v1); wl_list_init(&server.inhibitors); - xdg_shell = wlr_xdg_shell_create(server.wl_display,3); + xdg_shell = wlr_xdg_shell_create(server.wl_display, 3); if(!xdg_shell) { wlr_log(WLR_ERROR, "Unable to create the XDG shell interface"); ret = 1; @@ -575,7 +578,8 @@ main(int argc, char *argv[]) { goto end; } server.new_xwayland_surface.notify = handle_xwayland_surface_new; - wl_signal_add(&server.xwayland->events.new_surface, &server.new_xwayland_surface); + wl_signal_add(&server.xwayland->events.new_surface, + &server.new_xwayland_surface); if(setenv("DISPLAY", server.xwayland->display_name, true) < 0) { wlr_log_errno(WLR_ERROR, "Unable to set DISPLAY for XWayland.", @@ -585,14 +589,14 @@ main(int argc, char *argv[]) { server.xwayland->display_name); } - struct wlr_xcursor *xcursor = - wlr_xcursor_manager_get_xcursor(server.seat->xcursor_manager, DEFAULT_XCURSOR, 1); + struct wlr_xcursor *xcursor = wlr_xcursor_manager_get_xcursor( + server.seat->xcursor_manager, DEFAULT_XCURSOR, 1); if(xcursor) { struct wlr_xcursor_image *image = xcursor->images[0]; - wlr_xwayland_set_cursor(server.xwayland, image->buffer, image->width * 4, - image->width, image->height, image->hotspot_x, - image->hotspot_y); + wlr_xwayland_set_cursor(server.xwayland, image->buffer, + image->width * 4, image->width, image->height, + image->hotspot_x, image->hotspot_y); } #endif @@ -613,7 +617,9 @@ main(int argc, char *argv[]) { wlr_log_errno(WLR_ERROR, "Unable to set WAYLAND_DISPLAY.", "Clients may not be able to connect"); } else { - fprintf(stderr, "Cagebreak " CG_VERSION " is running on Wayland display %s\n", socket); + fprintf(stderr, + "Cagebreak " CG_VERSION " is running on Wayland display %s\n", + socket); } #if CG_HAS_XWAYLAND @@ -645,7 +651,7 @@ main(int argc, char *argv[]) { if(config_file == NULL) { char *default_conf = "/etc/xdg/cagebreak/config"; wlr_log(WLR_INFO, "Loading default configuration file: \"%s\"", - default_conf); + default_conf); conf_ret = set_configuration(&server, default_conf); } else { conf_ret = 1; @@ -653,7 +659,7 @@ main(int argc, char *argv[]) { } free(config_file); - if(conf_ret != 0||!server.running) { + if(conf_ret != 0 || !server.running) { ret = 1; goto end; } @@ -697,15 +703,15 @@ end: struct cg_output_config *output_config, *output_config_tmp; wl_list_for_each_safe(output_config, output_config_tmp, - &server.output_config, link) { + &server.output_config, link) { wl_list_remove(&output_config->link); free(output_config->output_name); free(output_config); } struct cg_input_config *input_config, *input_config_tmp; - wl_list_for_each_safe(input_config, input_config_tmp, - &server.input_config, link) { + wl_list_for_each_safe(input_config, input_config_tmp, &server.input_config, + link) { wl_list_remove(&input_config->link); if(input_config->identifier != NULL) { free(input_config->identifier); @@ -717,20 +723,20 @@ end: keybinding_list_free(server.keybindings); } - if(server.message_config.font!=NULL) { + if(server.message_config.font != NULL) { free(server.message_config.font); } - server.running=false; - if(server.seat!=NULL) { + server.running = false; + if(server.seat != NULL) { seat_destroy(server.seat); } #if CG_HAS_XWAYLAND - if(server.xwayland!=NULL) { + if(server.xwayland != NULL) { wlr_xwayland_destroy(server.xwayland); } #endif - if(sigint_source!=NULL) { + if(sigint_source != NULL) { wl_event_source_remove(sigint_source); wl_event_source_remove(sigterm_source); wl_event_source_remove(sigalrm_source); @@ -739,14 +745,14 @@ end: /* This function is not null-safe, but we only ever get here with a proper wl_display. */ - if(server.wl_display!=NULL) { + if(server.wl_display != NULL) { wl_display_destroy(server.wl_display); } - if(server.output_layout!=NULL) { + if(server.output_layout != NULL) { wlr_output_layout_destroy(server.output_layout); } - if(server.input!=NULL) { + if(server.input != NULL) { free(server.input); } pango_cairo_font_map_set_default(NULL); diff --git a/fuzz/fuzz-lib.c b/fuzz/fuzz-lib.c index eaf8fb6..4628187 100644 --- a/fuzz/fuzz-lib.c +++ b/fuzz/fuzz-lib.c @@ -20,12 +20,8 @@ #include #include -#include -#include -#include #include #include -#include #include #include #include @@ -39,8 +35,12 @@ #include #include #include +#include +#include +#include #include #include +#include #if CG_HAS_XWAYLAND #include #endif @@ -142,7 +142,6 @@ LLVMFuzzerInitialize(int *argc, char ***argv) { wl_list_init(&server.outputs); wl_list_init(&server.disabled_outputs); - int ret = 0; #ifdef DEBUG @@ -166,17 +165,17 @@ LLVMFuzzerInitialize(int *argc, char ***argv) { if(!server.wl_display) { wlr_log(WLR_ERROR, "Cannot allocate a Wayland display"); free(server.modes); - server.modes=NULL; + server.modes = NULL; goto end; } - server.xcursor_size=XCURSOR_SIZE; + server.xcursor_size = XCURSOR_SIZE; const char *env_cursor_size = getenv("XCURSOR_SIZE"); - if (env_cursor_size && strlen(env_cursor_size) > 0) { + if(env_cursor_size && strlen(env_cursor_size) > 0) { errno = 0; char *end; unsigned size = strtoul(env_cursor_size, &end, 10); - if (!*end && errno == 0) { + if(!*end && errno == 0) { server.xcursor_size = size; } } @@ -233,7 +232,6 @@ LLVMFuzzerInitialize(int *argc, char ***argv) { goto end; }; - server.keybindings = keybinding_list_init(); if(server.keybindings == NULL || server.keybindings->keybindings == NULL) { wlr_log(WLR_ERROR, "Unable to allocate keybindings"); @@ -335,7 +333,7 @@ LLVMFuzzerInitialize(int *argc, char ***argv) { &server.new_idle_inhibitor_v1); wl_list_init(&server.inhibitors); - xdg_shell = wlr_xdg_shell_create(server.wl_display,3); + xdg_shell = wlr_xdg_shell_create(server.wl_display, 3); if(!xdg_shell) { wlr_log(WLR_ERROR, "Unable to create the XDG shell interface"); ret = 1; @@ -437,8 +435,8 @@ LLVMFuzzerInitialize(int *argc, char ***argv) { xwayland->display_name); } - struct wlr_xcursor *xcursor = - wlr_xcursor_manager_get_xcursor(server.seat->xcursor_manager, DEFAULT_XCURSOR, 1); + struct wlr_xcursor *xcursor = wlr_xcursor_manager_get_xcursor( + server.seat->xcursor_manager, DEFAULT_XCURSOR, 1); if(xcursor) { struct wlr_xcursor_image *image = xcursor->images[0]; @@ -465,7 +463,9 @@ LLVMFuzzerInitialize(int *argc, char ***argv) { wlr_log_errno(WLR_ERROR, "Unable to set WAYLAND_DISPLAY.", "Clients may not be able to connect"); } else { - fprintf(stderr, "Cagebreak " CG_VERSION " is running on Wayland display %s\n", socket); + fprintf(stderr, + "Cagebreak " CG_VERSION " is running on Wayland display %s\n", + socket); } #if CG_HAS_XWAYLAND @@ -475,7 +475,6 @@ LLVMFuzzerInitialize(int *argc, char ***argv) { /* Place the cursor to the top left of the output layout. */ wlr_cursor_warp(server.seat->cursor, NULL, 0, 0); - if(!drop_permissions()) { ret = 1; goto end; diff --git a/fuzz/fuzz-parse.c b/fuzz/fuzz-parse.c index d152f07..ebc6535 100644 --- a/fuzz/fuzz-parse.c +++ b/fuzz/fuzz-parse.c @@ -38,7 +38,7 @@ set_configuration(struct cg_server *server, char *content) { (line = strtok_r(NULL, "\n", &content)) != NULL; ++line_num) { line[strcspn(line, "\n")] = '\0'; if(*line != '\0' && *line != '#') { - char *errstr=NULL; + char *errstr = NULL; server->running = true; if(parse_rc_line(server, line, &errstr) != 0) { if(errstr != NULL) { diff --git a/input_manager.c b/input_manager.c index 915384e..0d927e0 100644 --- a/input_manager.c +++ b/input_manager.c @@ -16,10 +16,10 @@ #include "server.h" #include -#include -#include -#include #include +#include +#include +#include #include #include #include @@ -27,9 +27,9 @@ #include #include #include +#include #include #include -#include #include void @@ -94,7 +94,7 @@ input_manager_handle_device_destroy(struct wl_listener *listener, void *data) { free(input_device); } -struct cg_input_config* +struct cg_input_config * input_manager_create_empty_input_config() { struct cg_input_config *cfg = calloc(1, sizeof(struct cg_input_config)); if(cfg == NULL) { @@ -124,168 +124,172 @@ input_manager_create_empty_input_config() { wl_list_init(&cfg->tools);*/ /* Keyboards */ - cfg->enable_keybindings=-1; - cfg->repeat_delay=-1; - cfg->repeat_rate=-1; + cfg->enable_keybindings = -1; + cfg->repeat_delay = -1; + cfg->repeat_rate = -1; return cfg; } /* cfg1 has precedence */ -struct cg_input_config* -input_manager_merge_input_configs(struct cg_input_config* cfg1, struct cg_input_config* cfg2) { +struct cg_input_config * +input_manager_merge_input_configs(struct cg_input_config *cfg1, + struct cg_input_config *cfg2) { struct cg_input_config *out_cfg = calloc(1, sizeof(struct cg_input_config)); - if(cfg1->identifier==NULL) { - if(cfg2->identifier!=NULL) { - out_cfg->identifier=strdup(cfg2->identifier); + if(cfg1->identifier == NULL) { + if(cfg2->identifier != NULL) { + out_cfg->identifier = strdup(cfg2->identifier); } } else { - out_cfg->identifier=strdup(cfg1->identifier); + out_cfg->identifier = strdup(cfg1->identifier); } if(out_cfg == NULL) { return NULL; } if(cfg1->tap == INT_MIN) { - out_cfg->tap=cfg2->tap; + out_cfg->tap = cfg2->tap; } else { - out_cfg->tap=cfg1->tap; + out_cfg->tap = cfg1->tap; } if(cfg1->send_events == INT_MIN) { - out_cfg->send_events=cfg2->send_events; + out_cfg->send_events = cfg2->send_events; } else { - out_cfg->send_events=cfg1->send_events; + out_cfg->send_events = cfg1->send_events; } if(cfg1->dwt == INT_MIN) { - out_cfg->dwt=cfg2->dwt; + out_cfg->dwt = cfg2->dwt; } else { - out_cfg->dwt=cfg1->dwt; + out_cfg->dwt = cfg1->dwt; } if(cfg1->drag_lock == INT_MIN) { - out_cfg->drag_lock=cfg2->drag_lock; + out_cfg->drag_lock = cfg2->drag_lock; } else { - out_cfg->drag_lock=cfg1->drag_lock; + out_cfg->drag_lock = cfg1->drag_lock; } if(cfg1->drag == INT_MIN) { - out_cfg->drag=cfg2->drag; + out_cfg->drag = cfg2->drag; } else { - out_cfg->drag=cfg1->drag; + out_cfg->drag = cfg1->drag; } if(cfg1->tap_button_map == INT_MIN) { - out_cfg->tap_button_map=cfg2->tap_button_map; + out_cfg->tap_button_map = cfg2->tap_button_map; } else { - out_cfg->tap_button_map=cfg1->tap_button_map; + out_cfg->tap_button_map = cfg1->tap_button_map; } if(cfg1->left_handed == INT_MIN) { - out_cfg->left_handed=cfg2->left_handed; + out_cfg->left_handed = cfg2->left_handed; } else { - out_cfg->left_handed=cfg1->left_handed; + out_cfg->left_handed = cfg1->left_handed; } if(cfg1->scroll_method == INT_MIN) { - out_cfg->scroll_method=cfg2->scroll_method; + out_cfg->scroll_method = cfg2->scroll_method; } else { - out_cfg->scroll_method=cfg1->scroll_method; + out_cfg->scroll_method = cfg1->scroll_method; } if(cfg1->scroll_button == INT_MIN) { - out_cfg->scroll_button=cfg2->scroll_button; + out_cfg->scroll_button = cfg2->scroll_button; } else { - out_cfg->scroll_button=cfg1->scroll_button; + out_cfg->scroll_button = cfg1->scroll_button; } if(cfg1->scroll_factor == FLT_MIN) { - out_cfg->scroll_factor=cfg2->scroll_factor; + out_cfg->scroll_factor = cfg2->scroll_factor; } else { - out_cfg->scroll_factor=cfg1->scroll_factor; + out_cfg->scroll_factor = cfg1->scroll_factor; } if(cfg1->pointer_accel == FLT_MIN) { - out_cfg->pointer_accel=cfg2->pointer_accel; + out_cfg->pointer_accel = cfg2->pointer_accel; } else { - out_cfg->pointer_accel=cfg1->pointer_accel; + out_cfg->pointer_accel = cfg1->pointer_accel; } if(cfg1->accel_profile == INT_MIN) { - out_cfg->accel_profile=cfg2->accel_profile; + out_cfg->accel_profile = cfg2->accel_profile; } else { - out_cfg->accel_profile=cfg1->accel_profile; + out_cfg->accel_profile = cfg1->accel_profile; } if(cfg1->natural_scroll == INT_MIN) { - out_cfg->natural_scroll=cfg2->natural_scroll; + out_cfg->natural_scroll = cfg2->natural_scroll; } else { - out_cfg->natural_scroll=cfg1->natural_scroll; + out_cfg->natural_scroll = cfg1->natural_scroll; } if(cfg1->middle_emulation == INT_MIN) { - out_cfg->middle_emulation=cfg2->middle_emulation; + out_cfg->middle_emulation = cfg2->middle_emulation; } else { - out_cfg->middle_emulation=cfg1->middle_emulation; + out_cfg->middle_emulation = cfg1->middle_emulation; } if(cfg1->click_method == INT_MIN) { - out_cfg->click_method=cfg2->click_method; + out_cfg->click_method = cfg2->click_method; } else { - out_cfg->click_method=cfg1->click_method; + out_cfg->click_method = cfg1->click_method; } if(cfg1->enable_keybindings == -1) { - out_cfg->enable_keybindings=cfg2->enable_keybindings; + out_cfg->enable_keybindings = cfg2->enable_keybindings; } else { - out_cfg->enable_keybindings=cfg1->enable_keybindings; + out_cfg->enable_keybindings = cfg1->enable_keybindings; } if(cfg1->repeat_delay == -1) { - out_cfg->repeat_delay=cfg2->repeat_delay; + out_cfg->repeat_delay = cfg2->repeat_delay; } else { - out_cfg->repeat_delay=cfg1->repeat_delay; + out_cfg->repeat_delay = cfg1->repeat_delay; } if(cfg1->repeat_rate == -1) { - out_cfg->repeat_rate=cfg2->repeat_rate; + out_cfg->repeat_rate = cfg2->repeat_rate; } else { - out_cfg->repeat_rate=cfg1->repeat_rate; + out_cfg->repeat_rate = cfg1->repeat_rate; } return out_cfg; } void apply_keyboard_group_config(struct cg_input_config *config, - struct cg_keyboard_group *group) { - if(config->enable_keybindings!=-1) { - group->enable_keybindings=config->enable_keybindings; + struct cg_keyboard_group *group) { + if(config->enable_keybindings != -1) { + group->enable_keybindings = config->enable_keybindings; } - int repeat_delay=600,repeat_rate=25; + int repeat_delay = 600, repeat_rate = 25; if(config->repeat_delay != -1) { - repeat_delay=config->repeat_delay; + repeat_delay = config->repeat_delay; } if(config->repeat_rate != -1) { - repeat_rate=config->repeat_rate; + repeat_rate = config->repeat_rate; } - wlr_keyboard_set_repeat_info(&group->wlr_group->keyboard, repeat_rate, repeat_delay); + wlr_keyboard_set_repeat_info(&group->wlr_group->keyboard, repeat_rate, + repeat_delay); } void cg_input_manager_configure_keyboard_group(struct cg_keyboard_group *group) { struct cg_server *server = group->seat->server; - struct cg_input_config *tot_cfg=input_manager_create_empty_input_config(); - if(tot_cfg==NULL) { + struct cg_input_config *tot_cfg = input_manager_create_empty_input_config(); + if(tot_cfg == NULL) { return; } struct cg_input_config *tmp_cfg, *config = NULL; wl_list_for_each(config, &server->input_config, link) { - if(strcmp(config->identifier, group->identifier) == 0 || strcmp(config->identifier, "*")==0 - || (strncmp(config->identifier, "type:", 5) == 0 && - strcmp(config->identifier + 5, "keyboard") == 0)) { - tmp_cfg=tot_cfg; - if(tot_cfg->identifier==NULL || strcmp(tot_cfg->identifier,"*")==0 || strcmp(config->identifier,group->identifier)) { - tot_cfg=input_manager_merge_input_configs(config,tot_cfg); + if(strcmp(config->identifier, group->identifier) == 0 || + strcmp(config->identifier, "*") == 0 || + (strncmp(config->identifier, "type:", 5) == 0 && + strcmp(config->identifier + 5, "keyboard") == 0)) { + tmp_cfg = tot_cfg; + if(tot_cfg->identifier == NULL || + strcmp(tot_cfg->identifier, "*") == 0 || + strcmp(config->identifier, group->identifier)) { + tot_cfg = input_manager_merge_input_configs(config, tot_cfg); } else { - tot_cfg=input_manager_merge_input_configs(tot_cfg,config); + tot_cfg = input_manager_merge_input_configs(tot_cfg, config); } - if(tmp_cfg->identifier!=NULL) { + if(tmp_cfg->identifier != NULL) { free(tmp_cfg->identifier); } free(tmp_cfg); } } apply_keyboard_group_config(tot_cfg, group); - if(tot_cfg->identifier!=NULL) { + if(tot_cfg->identifier != NULL) { free(tot_cfg->identifier); } free(tot_cfg); } - void cg_input_manager_configure(struct cg_server *server) { struct cg_input_device *device = NULL; @@ -299,7 +303,8 @@ cg_input_manager_configure(struct cg_server *server) { } static void -new_input(struct cg_input_manager *input, struct wlr_input_device *device, bool virtual) { +new_input(struct cg_input_manager *input, struct wlr_input_device *device, + bool virtual) { struct cg_input_device *input_device = calloc(1, sizeof(struct cg_input_device)); if(!input_device) { @@ -308,7 +313,7 @@ new_input(struct cg_input_manager *input, struct wlr_input_device *device, bool } device->data = input_device; - input_device->is_virtual=virtual; + input_device->is_virtual = virtual; input_device->wlr_device = device; input_device->identifier = input_device_get_identifier(device); input_device->server = input->server; @@ -332,7 +337,7 @@ handle_new_input(struct wl_listener *listener, void *data) { wl_container_of(listener, input, new_input); struct wlr_input_device *device = data; - new_input(input,device,false); + new_input(input, device, false); } void @@ -343,7 +348,7 @@ handle_virtual_keyboard(struct wl_listener *listener, void *data) { struct wlr_virtual_keyboard_v1 *keyboard = data; struct wlr_input_device *device = &keyboard->keyboard.base; - new_input(input,device,true); + new_input(input, device, true); } void @@ -354,11 +359,11 @@ handle_virtual_pointer(struct wl_listener *listener, void *data) { struct wlr_virtual_pointer_v1 *pointer = event->new_pointer; struct wlr_input_device *device = &pointer->pointer.base; - new_input(input_manager,device,true); + new_input(input_manager, device, true); if(event->suggested_output) { - wlr_cursor_map_input_to_output(input_manager->server->seat->cursor, device, - event->suggested_output); + wlr_cursor_map_input_to_output(input_manager->server->seat->cursor, + device, event->suggested_output); } } diff --git a/input_manager.h b/input_manager.h index 9a82ce3..0dbbaad 100644 --- a/input_manager.h +++ b/input_manager.h @@ -12,16 +12,16 @@ void input_manager_handle_device_destroy(struct wl_listener *listener, void *data); uint32_t input_manager_get_mouse_button(const char *name, char **error); -struct cg_input_config* +struct cg_input_config * input_manager_create_empty_input_config(); -struct cg_input_config* -input_manager_merge_input_configs(struct cg_input_config* cfg1, struct cg_input_config* cfg2); +struct cg_input_config * +input_manager_merge_input_configs(struct cg_input_config *cfg1, + struct cg_input_config *cfg2); void cg_input_manager_configure(struct cg_server *server); void cg_input_manager_configure_keyboard_group(struct cg_keyboard_group *group); - struct cg_input_manager { struct wl_list devices; struct cg_server *server; @@ -111,7 +111,7 @@ struct cg_input_device { char *identifier; struct cg_server *server; struct wlr_input_device *wlr_device; - struct wl_list link;//input_manager::devices + struct wl_list link; // input_manager::devices struct wl_listener device_destroy; bool is_virtual; diff --git a/ipc_server.c b/ipc_server.c index 55ddfad..825ddf2 100644 --- a/ipc_server.c +++ b/ipc_server.c @@ -200,8 +200,8 @@ ipc_handle_connection(int fd, uint32_t mask, void *data) { close(client_fd); return 0; } - client->read_buf_cap=64; - client->read_buffer = calloc(client->read_buf_cap,sizeof(char)); + client->read_buf_cap = 64; + client->read_buffer = calloc(client->read_buf_cap, sizeof(char)); client->read_buf_len = 0; client->read_discard = 0; client->server = server; @@ -248,18 +248,22 @@ ipc_client_handle_readable(int client_fd, uint32_t mask, void *data) { return 0; } - while(read_available+client->read_buf_len>(int32_t) client->read_buf_cap-1) { - client->read_buf_cap*=2; - client->read_buffer=reallocarray(client->read_buffer,client->read_buf_cap,sizeof(char)); + while(read_available + client->read_buf_len > + (int32_t)client->read_buf_cap - 1) { + client->read_buf_cap *= 2; + client->read_buffer = reallocarray(client->read_buffer, + client->read_buf_cap, sizeof(char)); if(client->read_buffer == NULL) { - wlr_log(WLR_ERROR, "Unable to allocate buffer large enough to hold client read data"); + wlr_log(WLR_ERROR, "Unable to allocate buffer large enough to hold " + "client read data"); ipc_client_disconnect(client); return 0; } } // Append to buffer - ssize_t received = recv( - client_fd, client->read_buffer + client->read_buf_len, read_available, 0); + ssize_t received = + recv(client_fd, client->read_buffer + client->read_buf_len, + read_available, 0); if(received == -1) { wlr_log(WLR_ERROR, "Unable to receive data from IPC client"); ipc_client_disconnect(client); @@ -344,7 +348,7 @@ ipc_send_event_client(struct cg_ipc_client *client, const char *payload, memcpy(data, ipc_magic, sizeof(ipc_magic)); // +1 for terminating null character - while(client->write_buffer_len + IPC_HEADER_SIZE + payload_length +1 >= + while(client->write_buffer_len + IPC_HEADER_SIZE + payload_length + 1 >= client->write_buffer_size) { client->write_buffer_size *= 2; } diff --git a/keybinding.c b/keybinding.c index 4718f6b..b1b8085 100644 --- a/keybinding.c +++ b/keybinding.c @@ -7,12 +7,12 @@ #include #include #include +#include #include #include -#include #include -#include #include +#include #include "input.h" #include "input_manager.h" @@ -25,9 +25,7 @@ #include "view.h" #include "workspace.h" -char *keybinding_action_string[] = { - FOREACH_KEYBINDING(GENERATE_STRING) -}; +char *keybinding_action_string[] = {FOREACH_KEYBINDING(GENERATE_STRING)}; int keybinding_resize(struct keybinding_list *list) { @@ -230,18 +228,20 @@ swap_tile(struct cg_tile *tile, } struct cg_view *tmp_view = tile->view; struct cg_view *tmp_swap_view = swap_tile->view; - workspace_tile_update_view(tile,NULL); - workspace_tile_update_view(swap_tile,tmp_view); - workspace_tile_update_view(tile,tmp_swap_view); + workspace_tile_update_view(tile, NULL); + workspace_tile_update_view(swap_tile, tmp_view); + workspace_tile_update_view(tile, tmp_swap_view); workspace_focus_tile( server->curr_output->workspaces[server->curr_output->curr_workspace], swap_tile); seat_set_focus(server->seat, swap_tile->view); - ipc_send_event(tile->workspace->output->server, - "{\"event_name\":\"swap_tile\",\"tile_id\":%d,\"swap_" - "tile_id\":%d,\"workspace\":%d,\"output\":\"%s\",\"output_id\":%d}", - tile->id, swap_tile->id, tile->workspace->num + 1, - tile->workspace->output->wlr_output->name,output_get_num(tile->workspace->output)); + ipc_send_event( + tile->workspace->output->server, + "{\"event_name\":\"swap_tile\",\"tile_id\":%d,\"swap_" + "tile_id\":%d,\"workspace\":%d,\"output\":\"%s\",\"output_id\":%d}", + tile->id, swap_tile->id, tile->workspace->num + 1, + tile->workspace->output->wlr_output->name, + output_get_num(tile->workspace->output)); } void @@ -392,7 +392,8 @@ resize(struct cg_tile *tile, const struct cg_tile *parent, int coord_offset, tile->id, old_x, old_y, old_height, old_width, tile->tile.x, tile->tile.y, tile->tile.height, tile->tile.width, tile->workspace->num + 1, - tile->workspace->output->wlr_output->name,output_get_num(tile->workspace->output)); + tile->workspace->output->wlr_output->name, + output_get_num(tile->workspace->output)); } int * @@ -447,7 +448,8 @@ void resize_tile(struct cg_server *server, int hpixs, int vpixs) { struct cg_output *output = server->curr_output; struct wlr_box output_box; - wlr_output_layout_get_box(output->server->output_layout, output->wlr_output,&output_box); + wlr_output_layout_get_box(output->server->output_layout, output->wlr_output, + &output_box); struct cg_tile *focused = output->workspaces[output->curr_workspace]->focused_tile; @@ -490,7 +492,7 @@ keybinding_workspace_fullscreen(struct cg_server *server) { "\"workspace\":%d,\"output\":\"%s\",\"output_id\":%d}", output->workspaces[output->curr_workspace]->focused_tile->id, output->workspaces[output->curr_workspace]->num + 1, - output->wlr_output->name,output_get_num(output)); + output->wlr_output->name, output_get_num(output)); } // Switch to a differerent virtual terminal @@ -563,7 +565,7 @@ keybinding_split_output(struct cg_output *output, bool vertical) { new_tile->tile.height = y + height - new_y; new_tile->prev = curr_workspace->focused_tile; new_tile->next = curr_workspace->focused_tile->next; - workspace_tile_update_view(new_tile,next_view); + workspace_tile_update_view(new_tile, next_view); new_tile->workspace = curr_workspace; curr_workspace->focused_tile->next->prev = new_tile; curr_workspace->focused_tile->next = new_tile; @@ -584,7 +586,8 @@ keybinding_split_output(struct cg_output *output, bool vertical) { "{\"event_name\":\"split\",\"tile_id\":%d,\"new_tile_id\":%d," "\"workspace\":%d,\"output\":\"%s\",\"output_id\":%d,\"vertical\":%d}", curr_workspace->focused_tile->id, new_tile->id, curr_workspace->num + 1, - curr_workspace->output->wlr_output->name, output_get_num(curr_workspace->output),vertical); + curr_workspace->output->wlr_output->name, + output_get_num(curr_workspace->output), vertical); } static void @@ -598,10 +601,12 @@ keybinding_close_view(struct cg_view *view) { uint32_t tile_id = view->id; uint32_t ws = view->workspace->num; view->impl->close(view); - ipc_send_event(outp->server, - "{\"event_name\":\"close\",\"view_id\":%d,\"view_pid\":%d,\"tile_id\":" - "%d,\"workspace\":%d,\"output\":\"%s\",\"output_id\":%d}", - view_id, view_pid, tile_id, ws + 1, outp->wlr_output->name,output_get_num(outp)); + ipc_send_event( + outp->server, + "{\"event_name\":\"close\",\"view_id\":%d,\"view_pid\":%d,\"tile_id\":" + "%d,\"workspace\":%d,\"output\":\"%s\",\"output_id\":%d}", + view_id, view_pid, tile_id, ws + 1, outp->wlr_output->name, + output_get_num(outp)); } static void @@ -631,7 +636,8 @@ set_output(struct cg_server *server, struct cg_output *output) { } void -keybinding_cycle_outputs(struct cg_server *server, bool reverse, bool trigger_event) { +keybinding_cycle_outputs(struct cg_server *server, bool reverse, + bool trigger_event) { struct cg_output *output = NULL; struct cg_output *old_output = server->curr_output; if(reverse) { @@ -650,11 +656,13 @@ keybinding_cycle_outputs(struct cg_server *server, bool reverse, bool trigger_ev } set_output(server, output); if(trigger_event) { - ipc_send_event(output->server, - "{\"event_name\":\"cycle_outputs\",\"old_output\":\"%s\",\"old_output_id\":%d," - "\"new_output\":\"%s\",\"new_output_id\":%d,\"reverse\":%d}", - old_output->wlr_output->name, output_get_num(old_output),output->wlr_output->name, output_get_num(output), - reverse); + ipc_send_event( + output->server, + "{\"event_name\":\"cycle_outputs\",\"old_output\":\"%s\",\"old_" + "output_id\":%d," + "\"new_output\":\"%s\",\"new_output_id\":%d,\"reverse\":%d}", + old_output->wlr_output->name, output_get_num(old_output), + output->wlr_output->name, output_get_num(output), reverse); } } @@ -667,16 +675,16 @@ keybinding_cycle_views(struct cg_server *server, bool reverse, bool ipc) { struct cg_view *it_view, *next_view = NULL; if(reverse) { - wl_list_for_each(it_view,&curr_workspace->views,link) { + wl_list_for_each(it_view, &curr_workspace->views, link) { if(!view_is_visible(it_view)) { - next_view=it_view; + next_view = it_view; break; } } } else { - wl_list_for_each_reverse(it_view,&curr_workspace->views,link) { + wl_list_for_each_reverse(it_view, &curr_workspace->views, link) { if(!view_is_visible(it_view)) { - next_view=it_view; + next_view = it_view; break; } } @@ -688,20 +696,23 @@ keybinding_cycle_views(struct cg_server *server, bool reverse, bool ipc) { seat_set_focus(server->seat, next_view); if(ipc) { - ipc_send_event(curr_workspace->output->server, - "{\"event_name\":\"cycle_views\",\"old_view_id\":%d,\"old_view_pid\":%d," - "\"new_view_id\":%d,\"new_view_pid\":%d,\"tile_id\":%d," - "\"workspace\":%d,\"output\":\"%s\",\"output_id\":%d}", - current_view->link.next == curr_workspace->views.next - ? -1 - : (int)current_view->id, - current_view->link.next == curr_workspace->views.next - ? -1 - : (int)current_view->impl->get_pid(current_view), - next_view == NULL ? -1 : (int)next_view->id, - next_view == NULL ? -1 : (int)next_view->impl->get_pid(next_view), - next_view->tile->id, curr_workspace->num + 1, - curr_workspace->output->wlr_output->name,output_get_num(curr_workspace->output)); + ipc_send_event( + curr_workspace->output->server, + "{\"event_name\":\"cycle_views\",\"old_view_id\":%d,\"old_view_" + "pid\":%d," + "\"new_view_id\":%d,\"new_view_pid\":%d,\"tile_id\":%d," + "\"workspace\":%d,\"output\":\"%s\",\"output_id\":%d}", + current_view->link.next == curr_workspace->views.next + ? -1 + : (int)current_view->id, + current_view->link.next == curr_workspace->views.next + ? -1 + : (int)current_view->impl->get_pid(current_view), + next_view == NULL ? -1 : (int)next_view->id, + next_view == NULL ? -1 : (int)next_view->impl->get_pid(next_view), + next_view->tile->id, curr_workspace->num + 1, + curr_workspace->output->wlr_output->name, + output_get_num(curr_workspace->output)); } } @@ -712,18 +723,18 @@ keybinding_focus_tile(struct cg_server *server, uint32_t tile_id) { struct cg_tile *old_tile = workspace->focused_tile; bool first = true; for(struct cg_tile *tile = workspace->focused_tile; - first || tile != workspace->focused_tile; tile = tile->next) { + first || tile != workspace->focused_tile; tile = tile->next) { first = false; - if(tile->id==tile_id) { + if(tile->id == tile_id) { workspace_focus_tile(workspace, tile); struct cg_view *next_view = workspace->focused_tile->view; seat_set_focus(server->seat, next_view); ipc_send_event( - output->server, - "{\"event_name\":\"focus_tile\",\"old_tile_id\":%d,\"new_tile_" - "id\":%d,\"workspace\":%d,\"output\":\"%s\",\"output_id\":%d}", - old_tile->id, workspace->focused_tile->id, workspace->num + 1, - output->wlr_output->name,output_get_num(output)); + output->server, + "{\"event_name\":\"focus_tile\",\"old_tile_id\":%d,\"new_tile_" + "id\":%d,\"workspace\":%d,\"output\":\"%s\",\"output_id\":%d}", + old_tile->id, workspace->focused_tile->id, workspace->num + 1, + output->wlr_output->name, output_get_num(output)); break; } } @@ -757,7 +768,8 @@ keybinding_switch_ws(struct cg_server *server, uint32_t ws) { ipc_send_event(output->server, "{\"event_name\":\"switch_ws\",\"old_workspace\":%d," "\"new_workspace\":%d,\"output\":\"%s\",\"output_id\":%d}", - old_ws + 1, ws + 1, output->wlr_output->name,output_get_num(output)); + old_ws + 1, ws + 1, output->wlr_output->name, + output_get_num(output)); return 0; } @@ -824,8 +836,10 @@ print_modes(struct dyn_str *str, char **modes) { ++nmemb; ++tmp; } - if(nmemb==0) { - wlr_log(WLR_ERROR,"This is a bug: Cagebreak has no valid modes. This should not occur, since default modes are defined on startup."); + if(nmemb == 0) { + wlr_log(WLR_ERROR, + "This is a bug: Cagebreak has no valid modes. This should not " + "occur, since default modes are defined on startup."); return; } /* We are assuming here that we have at least one mode, which is given by @@ -992,14 +1006,18 @@ print_output(struct cg_output *outp) { outp_str.cur_pos = 0; uint32_t nmemb = 8; struct wlr_box outp_box; - wlr_output_layout_get_box(outp->server->output_layout,outp->wlr_output,&outp_box); + wlr_output_layout_get_box(outp->server->output_layout, outp->wlr_output, + &outp_box); outp_str.str_arr = calloc(nmemb, sizeof(char *)); print_str(&outp_str, "\"%s\": {\n", outp->wlr_output->name); print_str(&outp_str, "\"priority\": %d,\n", outp->priority); - print_str(&outp_str, "\"coords\": {\"x\":%d,\"y\":%d},\n", outp_box.x,outp_box.y); - print_str(&outp_str, "\"size\": {\"width\":%d,\"height\":%d},\n", 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, "\"curr_workspace\": %d,\n", outp->curr_workspace+1); + print_str(&outp_str, "\"coords\": {\"x\":%d,\"y\":%d},\n", outp_box.x, + outp_box.y); + print_str(&outp_str, "\"size\": {\"width\":%d,\"height\":%d},\n", + 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, "\"curr_workspace\": %d,\n", outp->curr_workspace + 1); char *workspaces_str = print_workspaces(outp); if(workspaces_str != NULL) { print_str(&outp_str, "%s", workspaces_str); @@ -1042,14 +1060,17 @@ print_keyboard_group(struct cg_keyboard_group *grp) { outp_str.cur_pos = 0; uint32_t nmemb = 5; outp_str.str_arr = calloc(nmemb, sizeof(char *)); - if(grp->identifier!=NULL) { + if(grp->identifier != NULL) { print_str(&outp_str, "\"%s\": {\n", grp->identifier); } else { print_str(&outp_str, "\"NULL\": {\n"); } - print_str(&outp_str, "\"commands_enabled\": %d,\n", grp->enable_keybindings); - print_str(&outp_str, "\"repeat_delay\": %d,\n", grp->wlr_group->keyboard.repeat_info.delay); - print_str(&outp_str, "\"repeat_rate\": %d\n", grp->wlr_group->keyboard.repeat_info.rate); + print_str(&outp_str, "\"commands_enabled\": %d,\n", + grp->enable_keybindings); + print_str(&outp_str, "\"repeat_delay\": %d,\n", + grp->wlr_group->keyboard.repeat_info.delay); + print_str(&outp_str, "\"repeat_rate\": %d\n", + grp->wlr_group->keyboard.repeat_info.rate); print_str(&outp_str, "}"); return dyn_str_to_str(&outp_str); } @@ -1087,13 +1108,21 @@ print_input_device(struct cg_input_device *dev) { outp_str.cur_pos = 0; uint32_t nmemb = 4; outp_str.str_arr = calloc(nmemb, sizeof(char *)); - if(dev->identifier!=NULL) { + if(dev->identifier != NULL) { print_str(&outp_str, "\"%s\": {\n", dev->identifier); } else { print_str(&outp_str, "\"NULL\": {\n"); } print_str(&outp_str, "\"is_virtual\": %d,\n", dev->is_virtual); - print_str(&outp_str, "\"type\": \"%s\"\n", dev->wlr_device->type==WLR_INPUT_DEVICE_POINTER?"pointer":dev->wlr_device->type==WLR_INPUT_DEVICE_SWITCH?"switch":dev->wlr_device->type==WLR_INPUT_DEVICE_TABLET_PAD?"tablet pad":dev->wlr_device->type==WLR_INPUT_DEVICE_TABLET_TOOL?"tablet tool":dev->wlr_device->type==WLR_INPUT_DEVICE_TOUCH?"touch":dev->wlr_device->type==WLR_INPUT_DEVICE_KEYBOARD?"keyboard":"unknown"); + print_str( + &outp_str, "\"type\": \"%s\"\n", + dev->wlr_device->type == WLR_INPUT_DEVICE_POINTER ? "pointer" + : dev->wlr_device->type == WLR_INPUT_DEVICE_SWITCH ? "switch" + : dev->wlr_device->type == WLR_INPUT_DEVICE_TABLET_PAD ? "tablet pad" + : dev->wlr_device->type == WLR_INPUT_DEVICE_TABLET_TOOL ? "tablet tool" + : dev->wlr_device->type == WLR_INPUT_DEVICE_TOUCH ? "touch" + : dev->wlr_device->type == WLR_INPUT_DEVICE_KEYBOARD ? "keyboard" + : "unknown"); print_str(&outp_str, "}"); return dyn_str_to_str(&outp_str); } @@ -1125,10 +1154,11 @@ print_input_devices(struct cg_server *server) { } char * -get_mode_name(char **modes,unsigned int mode_nr) { +get_mode_name(char **modes, unsigned int mode_nr) { unsigned int i; - for(i=0;icurr_output->wlr_output->name); print_str(&str, "\"default_mode\":\"%s\",\n", - get_mode_name(server->modes,server->seat->default_mode)); + get_mode_name(server->modes, server->seat->default_mode)); print_modes(&str, server->modes); char *outps_str = print_outputs(server); - if(outps_str!=NULL) { + if(outps_str != NULL) { print_str(&str, "%s,", outps_str); free(outps_str); } char *keyboards_str = print_keyboard_groups(server); - if(keyboards_str!=NULL) { + if(keyboards_str != NULL) { print_str(&str, "%s,", keyboards_str); free(keyboards_str); } char *input_dev_str = print_input_devices(server); - if(input_dev_str!=NULL) { + if(input_dev_str != NULL) { print_str(&str, "%s,", input_dev_str); free(input_dev_str); } @@ -1217,14 +1247,14 @@ keybinding_move_view_to_cycle_output(struct cg_server *server, bool reverse) { seat_set_focus(server->seat, NULL); } } - keybinding_cycle_outputs(server, reverse,false); + keybinding_cycle_outputs(server, reverse, false); if(view != NULL) { struct cg_workspace *ws = server->curr_output ->workspaces[server->curr_output->curr_workspace]; wl_list_insert(&ws->views, &view->link); wlr_scene_node_reparent(&view->scene_tree->node, ws->scene); - workspace_tile_update_view(ws->focused_tile,view); + workspace_tile_update_view(ws->focused_tile, view); view->workspace = ws; seat_set_focus(server->seat, view); } @@ -1234,13 +1264,17 @@ keybinding_move_view_to_cycle_output(struct cg_server *server, bool reverse) { id = view->id; pid = view->impl->get_pid(view); } - ipc_send_event(server, - "{\"event_name\":\"move_view_to_cycle_output\",\"view_id\":%d,\"view_pid\":%d,\"old_output\":\"%s\",\"old_output_id\":%d,\"new_output\":\"%s\",\"new_output_id\":%d,\"old_tile_id\":%d,\"new_tile_id\":%d}", - id,pid,old_outp->wlr_output->name,output_get_num(old_outp), - server->curr_output->wlr_output->name,output_get_num(server->curr_output), - old_outp->workspaces[old_outp->curr_workspace]->focused_tile->id, - server->curr_output - ->workspaces[server->curr_output->curr_workspace]->focused_tile->id); + ipc_send_event( + server, + "{\"event_name\":\"move_view_to_cycle_output\",\"view_id\":%d,\"view_" + "pid\":%d,\"old_output\":\"%s\",\"old_output_id\":%d,\"new_output\":\"%" + "s\",\"new_output_id\":%d,\"old_tile_id\":%d,\"new_tile_id\":%d}", + id, pid, old_outp->wlr_output->name, output_get_num(old_outp), + server->curr_output->wlr_output->name, + output_get_num(server->curr_output), + old_outp->workspaces[old_outp->curr_workspace]->focused_tile->id, + server->curr_output->workspaces[server->curr_output->curr_workspace] + ->focused_tile->id); } void @@ -1287,7 +1321,7 @@ keybinding_set_nws(struct cg_server *server, int nws) { } if(output->curr_workspace >= nws) { - output->curr_workspace=0; + output->curr_workspace = 0; workspace_focus(output, nws - 1); } } @@ -1295,10 +1329,9 @@ keybinding_set_nws(struct cg_server *server, int nws) { server->seat, server->curr_output->workspaces[server->curr_output->curr_workspace] ->focused_tile->view); - ipc_send_event( - server, - "{\"event_name\":\"set_nws\",\"old_nws\":%d,\"new_nws\":%d}", - old_nws, server->nws); + ipc_send_event(server, + "{\"event_name\":\"set_nws\",\"old_nws\":%d,\"new_nws\":%d}", + old_nws, server->nws); } void @@ -1325,7 +1358,8 @@ keybinding_definekey(struct cg_server *server, struct keybinding *kb) { ipc_send_event(server, "{\"event_name\":\"definekey\",\"modifiers\":%d,\"key\":" "%d,\"command\":\"%s\"}", - kb->modifiers, kb->key, keybinding_action_string[kb->action]); + kb->modifiers, kb->key, + keybinding_action_string[kb->action]); } void @@ -1357,8 +1391,10 @@ keybinding_switch_output(struct cg_server *server, int output) { set_output(server, it); ipc_send_event(server, "{\"event_name\":\"switch_output\",\"old_output\":" - "\"%s\",\"old_output_id\":%d,\"new_output\":\"%s\",\"new_output_id\":%d}", - old_outp->wlr_output->name,output_get_num(old_outp), it->wlr_output->name,output_get_num(it)); + "\"%s\",\"old_output_id\":%d,\"new_output\":\"%s\"," + "\"new_output_id\":%d}", + old_outp->wlr_output->name, output_get_num(old_outp), + it->wlr_output->name, output_get_num(it)); return; } ++count; @@ -1374,8 +1410,10 @@ keybinding_move_view_to_output(struct cg_server *server, int output_num) { server->curr_output->workspaces[server->curr_output->curr_workspace] ->focused_tile->view; if(view != NULL) { - workspace_tile_update_view(server->curr_output->workspaces[server->curr_output->curr_workspace] - ->focused_tile,NULL); + workspace_tile_update_view( + server->curr_output->workspaces[server->curr_output->curr_workspace] + ->focused_tile, + NULL); wl_list_remove(&view->link); keybinding_cycle_views(server, false, false); if(server->curr_output->workspaces[server->curr_output->curr_workspace] @@ -1391,7 +1429,7 @@ keybinding_move_view_to_output(struct cg_server *server, int output_num) { view->workspace = ws; wl_list_insert(&ws->views, &view->link); wlr_scene_node_reparent(&view->scene_tree->node, ws->scene); - workspace_tile_update_view(ws->focused_tile,view); + workspace_tile_update_view(ws->focused_tile, view); seat_set_focus(server->seat, view); } int view_id = -1; @@ -1430,16 +1468,16 @@ keybinding_move_view_to_workspace(struct cg_server *server, uint32_t ws) { view->workspace = ws; wl_list_insert(&ws->views, &view->link); wlr_scene_node_reparent(&view->scene_tree->node, ws->scene); - workspace_tile_update_view(ws->focused_tile,view); + workspace_tile_update_view(ws->focused_tile, view); seat_set_focus(server->seat, view); } ipc_send_event(server, "{\"event_name\":\"move_view_to_ws\",\"view_id\":%d," "\"old_workspace\":%d,\"new_workspace\":%d," "\"output\":\"%s\",\"output_id\":%d,\"view_pid\":%d}", - view == NULL ? -1 : (int)view->id, old_ws+1, ws+1, + view == NULL ? -1 : (int)view->id, old_ws + 1, ws + 1, server->curr_output->wlr_output->name, - output_get_num(server->curr_output), + output_get_num(server->curr_output), view == NULL ? 0 : view->impl->get_pid(view)); } @@ -1489,10 +1527,10 @@ keybinding_configure_output(struct cg_server *server, wl_list_for_each_safe(output, tmp_output, &server->outputs, link) { if(strcmp(config->output_name, output->wlr_output->name) == 0) { output_configure(server, output); - ipc_send_event( - output->server, - "{\"event_name\":\"configure_output\",\"output\":\"%s\",\"output_id\":%d}", - cfg->output_name,output_get_num(output)); + ipc_send_event(output->server, + "{\"event_name\":\"configure_output\",\"output\":\"%" + "s\",\"output_id\":%d}", + cfg->output_name, output_get_num(output)); return; } } @@ -1511,18 +1549,20 @@ keybinding_configure_output(struct cg_server *server, void keybinding_configure_input(struct cg_server *server, struct cg_input_config *cfg) { - struct cg_input_config *tcfg=input_manager_create_empty_input_config(); - if(tcfg==NULL) { - wlr_log(WLR_ERROR,"Could not allocate temporary empty input configuration."); + struct cg_input_config *tcfg = input_manager_create_empty_input_config(); + if(tcfg == NULL) { + wlr_log(WLR_ERROR, + "Could not allocate temporary empty input configuration."); return; } - struct cg_input_config *ocfg=input_manager_merge_input_configs(cfg,tcfg); + struct cg_input_config *ocfg = input_manager_merge_input_configs(cfg, tcfg); free(tcfg); - if(ocfg==NULL) { - wlr_log(WLR_ERROR,"Could not allocate input configuration for merging."); + if(ocfg == NULL) { + wlr_log(WLR_ERROR, + "Could not allocate input configuration for merging."); return; } - wl_list_insert(&server->input_config,&ocfg->link); + wl_list_insert(&server->input_config, &ocfg->link); cg_input_manager_configure(server); ipc_send_event(server, "{\"event_name\":\"configure_input\",\"input\":\"%s\"}", @@ -1555,13 +1595,13 @@ keybinding_configure_message(struct cg_server *server, } void -set_cursor(bool enabled,struct cg_seat* seat) { - if(enabled==true) { - seat->enable_cursor=true; +set_cursor(bool enabled, struct cg_seat *seat) { + if(enabled == true) { + seat->enable_cursor = true; wlr_xcursor_manager_set_cursor_image(seat->xcursor_manager, DEFAULT_XCURSOR, seat->cursor); } else { - seat->enable_cursor=false; + seat->enable_cursor = false; wlr_cursor_set_image(seat->cursor, NULL, 0, 0, 0, 0, 0, 0); } } @@ -1573,12 +1613,12 @@ run_action(enum keybinding_action action, struct cg_server *server, switch(action) { case KEYBINDING_QUIT: display_terminate(server); - server->running=false; + server->running = false; break; case KEYBINDING_CHANGE_TTY: return keybinding_switch_vt(server->backend, data.u); case KEYBINDING_CURSOR: - set_cursor(data.i,server->seat); + set_cursor(data.i, server->seat); break; case KEYBINDING_LAYOUT_FULLSCREEN: keybinding_workspace_fullscreen(server); @@ -1616,11 +1656,12 @@ run_action(enum keybinding_action action, struct cg_server *server, keybinding_switch_output(server, data.u); break; case KEYBINDING_SWITCH_MODE: - if(data.u!=server->seat->default_mode) { + if(data.u != server->seat->default_mode) { wlr_seat_pointer_notify_clear_focus(server->seat->seat); - if(server->seat->enable_cursor==true) { - wlr_xcursor_manager_set_cursor_image(server->seat->xcursor_manager, - "dot_box_mask", server->seat->cursor); + if(server->seat->enable_cursor == true) { + wlr_xcursor_manager_set_cursor_image( + server->seat->xcursor_manager, "dot_box_mask", + server->seat->cursor); } } server->seat->mode = data.u; @@ -1629,7 +1670,8 @@ run_action(enum keybinding_action action, struct cg_server *server, ipc_send_event(server, "{\"event_name\":\"switch_default_mode\",\"old_mode\":" "\"%s\",\"mode\":\"%s\"}", - get_mode_name(server->modes,server->seat->default_mode), get_mode_name(server->modes,data.u)); + get_mode_name(server->modes, server->seat->default_mode), + get_mode_name(server->modes, data.u)); server->seat->mode = data.u; server->seat->default_mode = data.u; break; @@ -1740,7 +1782,7 @@ run_action(enum keybinding_action action, struct cg_server *server, ->focused_tile->view); break; case KEYBINDING_FOCUS_TILE: - keybinding_focus_tile(server,data.u); + keybinding_focus_tile(server, data.u); break; default: { wlr_log(WLR_ERROR, diff --git a/keybinding.h b/keybinding.h index 479cecf..3c632c3 100644 --- a/keybinding.h +++ b/keybinding.h @@ -10,67 +10,85 @@ struct cg_server; -#define FOREACH_KEYBINDING(KEYBINDING) \ - KEYBINDING(KEYBINDING_RUN_COMMAND,exec) /* data.c is the string to execute */ \ - KEYBINDING(KEYBINDING_CLOSE_VIEW,close) \ - KEYBINDING(KEYBINDING_SPLIT_VERTICAL,vsplit) \ - KEYBINDING(KEYBINDING_SPLIT_HORIZONTAL,hsplit) \ - KEYBINDING(KEYBINDING_CHANGE_TTY,switchvt) /*data.u is the desired tty*/\ - KEYBINDING(KEYBINDING_LAYOUT_FULLSCREEN,only)\ - KEYBINDING(KEYBINDING_CYCLE_VIEWS,cycle_views) /* data.b is 0 if forward, 1 if reverse */\ - KEYBINDING(KEYBINDING_CYCLE_TILES,cycle_tiles) /* data.b is 0 if forward, 1 if reverse */\ - KEYBINDING(KEYBINDING_CYCLE_OUTPUT,cycle_outputs) /* data.b is 0 if forward, 1 if reverse */\ - KEYBINDING(KEYBINDING_CONFIGURE_OUTPUT,output) /* data.o_cfg is the desired output */\ -\ - KEYBINDING(KEYBINDING_CONFIGURE_MESSAGE,configure_message) /* data.m_cfg is the desired config */\ - KEYBINDING(KEYBINDING_CONFIGURE_INPUT,input) /* data.i_cfg is the desired input configuration */\ -\ - KEYBINDING(KEYBINDING_QUIT,quit)\ - KEYBINDING(KEYBINDING_NOOP,abort)\ - KEYBINDING(KEYBINDING_SWITCH_OUTPUT,screen) /* data.u is the desired output */\ - KEYBINDING(KEYBINDING_SWITCH_WORKSPACE,workspace) /* data.u is the desired workspace */\ - KEYBINDING(KEYBINDING_SWITCH_MODE,mode) /* data.u is the desired mode */\ - KEYBINDING(KEYBINDING_SWITCH_DEFAULT_MODE,setmode) /* data.u is the desired mode */\ - KEYBINDING(KEYBINDING_RESIZE_TILE_HORIZONTAL,resize_tile_horizontal) /* data.i is the number of pixels to add */\ -\ - KEYBINDING(KEYBINDING_RESIZE_TILE_VERTICAL,resize_tile_vertical) /* data.i is the number of pixels to add to */\ -\ - KEYBINDING(KEYBINDING_MOVE_VIEW_TO_WORKSPACE,movetoworkspace) /* data.u is the desired workspace */\ - KEYBINDING(KEYBINDING_MOVE_VIEW_TO_OUTPUT,movetoscreen) /* data.u is the desired output */\ - KEYBINDING(KEYBINDING_MOVE_VIEW_TO_CYCLE_OUTPUT,move_view_to_cycle_output) /* data.b is 0 if forward, 1 if */\ -\ - KEYBINDING(KEYBINDING_DUMP,dump)\ - KEYBINDING(KEYBINDING_SHOW_TIME,time)\ - KEYBINDING(KEYBINDING_SHOW_INFO,show_info)\ - KEYBINDING(KEYBINDING_DISPLAY_MESSAGE,message)\ - KEYBINDING(KEYBINDING_CURSOR,cursor)\ -\ - KEYBINDING(KEYBINDING_SWAP_LEFT,exchangeleft)\ - KEYBINDING(KEYBINDING_SWAP_RIGHT,exchangeright)\ - KEYBINDING(KEYBINDING_SWAP_TOP,exchangeup)\ - KEYBINDING(KEYBINDING_SWAP_BOTTOM,exchangedown)\ -\ - KEYBINDING(KEYBINDING_FOCUS_LEFT,focusleft)\ - KEYBINDING(KEYBINDING_FOCUS_RIGHT,focusright)\ - KEYBINDING(KEYBINDING_FOCUS_TOP,focusup)\ - KEYBINDING(KEYBINDING_FOCUS_BOTTOM,focusdown)\ - KEYBINDING(KEYBINDING_FOCUS_TILE,focus_tile)\ -\ - KEYBINDING(KEYBINDING_DEFINEKEY,definekey) /* data.kb is the keybinding definition */\ - KEYBINDING(KEYBINDING_BACKGROUND,background) /* data.color is the background color */\ - KEYBINDING(KEYBINDING_DEFINEMODE,definemode) /* data.c is the mode name */\ - KEYBINDING(KEYBINDING_WORKSPACES,workspaces) /* data.i is the number of workspaces */\ +#define FOREACH_KEYBINDING(KEYBINDING) \ + KEYBINDING(KEYBINDING_RUN_COMMAND, \ + exec) /* data.c is the string to execute */ \ + KEYBINDING(KEYBINDING_CLOSE_VIEW, close) \ + KEYBINDING(KEYBINDING_SPLIT_VERTICAL, vsplit) \ + KEYBINDING(KEYBINDING_SPLIT_HORIZONTAL, hsplit) \ + KEYBINDING(KEYBINDING_CHANGE_TTY, switchvt) /*data.u is the desired tty*/ \ + KEYBINDING(KEYBINDING_LAYOUT_FULLSCREEN, only) \ + KEYBINDING(KEYBINDING_CYCLE_VIEWS, \ + cycle_views) /* data.b is 0 if forward, 1 if reverse */ \ + KEYBINDING(KEYBINDING_CYCLE_TILES, \ + cycle_tiles) /* data.b is 0 if forward, 1 if reverse */ \ + KEYBINDING(KEYBINDING_CYCLE_OUTPUT, \ + cycle_outputs) /* data.b is 0 if forward, 1 if reverse */ \ + KEYBINDING(KEYBINDING_CONFIGURE_OUTPUT, \ + output) /* data.o_cfg is the desired output */ \ + \ + KEYBINDING(KEYBINDING_CONFIGURE_MESSAGE, \ + configure_message) /* data.m_cfg is the desired config */ \ + KEYBINDING(KEYBINDING_CONFIGURE_INPUT, \ + input) /* data.i_cfg is the desired input configuration */ \ + \ + KEYBINDING(KEYBINDING_QUIT, quit) \ + KEYBINDING(KEYBINDING_NOOP, abort) \ + KEYBINDING(KEYBINDING_SWITCH_OUTPUT, \ + screen) /* data.u is the desired output */ \ + KEYBINDING(KEYBINDING_SWITCH_WORKSPACE, \ + workspace) /* data.u is the desired workspace */ \ + KEYBINDING(KEYBINDING_SWITCH_MODE, mode) /* data.u is the desired mode */ \ + KEYBINDING(KEYBINDING_SWITCH_DEFAULT_MODE, \ + setmode) /* data.u is the desired mode */ \ + KEYBINDING( \ + KEYBINDING_RESIZE_TILE_HORIZONTAL, \ + resize_tile_horizontal) /* data.i is the number of pixels to add */ \ + \ + KEYBINDING( \ + KEYBINDING_RESIZE_TILE_VERTICAL, \ + resize_tile_vertical) /* data.i is the number of pixels to add to */ \ + \ + KEYBINDING(KEYBINDING_MOVE_VIEW_TO_WORKSPACE, \ + movetoworkspace) /* data.u is the desired workspace */ \ + KEYBINDING(KEYBINDING_MOVE_VIEW_TO_OUTPUT, \ + movetoscreen) /* data.u is the desired output */ \ + KEYBINDING(KEYBINDING_MOVE_VIEW_TO_CYCLE_OUTPUT, \ + move_view_to_cycle_output) /* data.b is 0 if forward, 1 if */ \ + \ + KEYBINDING(KEYBINDING_DUMP, dump) \ + KEYBINDING(KEYBINDING_SHOW_TIME, time) \ + KEYBINDING(KEYBINDING_SHOW_INFO, show_info) \ + KEYBINDING(KEYBINDING_DISPLAY_MESSAGE, message) \ + KEYBINDING(KEYBINDING_CURSOR, cursor) \ + \ + KEYBINDING(KEYBINDING_SWAP_LEFT, exchangeleft) \ + KEYBINDING(KEYBINDING_SWAP_RIGHT, exchangeright) \ + KEYBINDING(KEYBINDING_SWAP_TOP, exchangeup) \ + KEYBINDING(KEYBINDING_SWAP_BOTTOM, exchangedown) \ + \ + KEYBINDING(KEYBINDING_FOCUS_LEFT, focusleft) \ + KEYBINDING(KEYBINDING_FOCUS_RIGHT, focusright) \ + KEYBINDING(KEYBINDING_FOCUS_TOP, focusup) \ + KEYBINDING(KEYBINDING_FOCUS_BOTTOM, focusdown) \ + KEYBINDING(KEYBINDING_FOCUS_TILE, focus_tile) \ + \ + KEYBINDING(KEYBINDING_DEFINEKEY, \ + definekey) /* data.kb is the keybinding definition */ \ + KEYBINDING(KEYBINDING_BACKGROUND, \ + background) /* data.color is the background color */ \ + KEYBINDING(KEYBINDING_DEFINEMODE, \ + definemode) /* data.c is the mode name */ \ + KEYBINDING(KEYBINDING_WORKSPACES, \ + workspaces) /* data.i is the number of workspaces */ - -#define GENERATE_ENUM(ENUM,NAME) ENUM, -#define GENERATE_STRING(STRING,NAME) #NAME, +#define GENERATE_ENUM(ENUM, NAME) ENUM, +#define GENERATE_STRING(STRING, NAME) #NAME, /* Important: if you add a keybinding which uses data.c or requires "free" * to be called, don't forget to add it to the function "keybinding_list_free" * in keybinding.c */ -enum keybinding_action { - FOREACH_KEYBINDING(GENERATE_ENUM) -}; +enum keybinding_action { FOREACH_KEYBINDING(GENERATE_ENUM) }; extern char *keybinding_action_string[]; @@ -106,7 +124,8 @@ keybinding_list_push(struct keybinding_list *list, void keybinding_list_free(struct keybinding_list *list); void -keybinding_cycle_outputs(struct cg_server *server, bool reverse, bool trigger_event); +keybinding_cycle_outputs(struct cg_server *server, bool reverse, + bool trigger_event); struct keybinding ** find_keybinding(const struct keybinding_list *list, const struct keybinding *keybinding); diff --git a/libinput.c b/libinput.c index fbc37e1..ffaaada 100644 --- a/libinput.c +++ b/libinput.c @@ -265,22 +265,23 @@ apply_config_to_device(struct cg_input_config *config, if(wlr_input_device_is_libinput(input_device->wlr_device)) { struct libinput_device *device = - wlr_libinput_get_device_handle(input_device->wlr_device); + wlr_libinput_get_device_handle(input_device->wlr_device); if(config->mapped_to_output && - !output_by_name_or_id(config->mapped_to_output, input_device->server)) { + !output_by_name_or_id(config->mapped_to_output, + input_device->server)) { wlr_log(WLR_DEBUG, - "'%s' is mapped to offline output '%s'; disabling input", - config->identifier, config->mapped_to_output); + "'%s' is mapped to offline output '%s'; disabling input", + config->identifier, config->mapped_to_output); set_send_events(device, LIBINPUT_CONFIG_SEND_EVENTS_DISABLED); } else if(config->send_events != INT_MIN) { set_send_events(device, config->send_events); } else { - // Have to reset to the default mode here, otherwise if ic->send_events - // is unset and a mapped output just came online after being disabled, - // we'd remain stuck sending no events. + // Have to reset to the default mode here, otherwise if + // ic->send_events is unset and a mapped output just came online + // after being disabled, we'd remain stuck sending no events. set_send_events( - device, - libinput_device_config_send_events_get_default_mode(device)); + device, + libinput_device_config_send_events_get_default_mode(device)); } if(config->tap != INT_MIN) { @@ -336,8 +337,9 @@ cg_input_configure_libinput_device(struct cg_input_device *input_device) { wl_list_for_each(config, &server->input_config, link) { const char *device_type = input_device_get_type(input_device); if(strcmp(config->identifier, input_device->identifier) == 0 || - strcmp(config->identifier, "*") == 0||(strncmp(config->identifier, "type:", 5) == 0&& - strcmp(config->identifier + 5, device_type) == 0)) { + strcmp(config->identifier, "*") == 0 || + (strncmp(config->identifier, "type:", 5) == 0 && + strcmp(config->identifier + 5, device_type) == 0)) { apply_config_to_device(config, input_device); } } diff --git a/message.c b/message.c index e4cfe9a..9441ae5 100644 --- a/message.c +++ b/message.c @@ -5,13 +5,13 @@ #include #include #include +#include #include #include #include #include #include #include -#include #include #include "message.h" @@ -234,7 +234,8 @@ message_set_output(struct cg_output *output, const char *string, wlr_scene_node_raise_to_top(&message->message->node); wlr_scene_node_set_enabled(&message->message->node, true); struct wlr_box outp_box; - wlr_output_layout_get_box(output->server->output_layout, output->wlr_output,&outp_box); + wlr_output_layout_get_box(output->server->output_layout, output->wlr_output, + &outp_box); wlr_scene_buffer_set_dest_size(message->message, width, height); wlr_scene_node_set_position(&message->message->node, message->position->x + outp_box.x, @@ -259,7 +260,8 @@ message_printf(struct cg_output *output, const char *fmt, ...) { return; } struct wlr_box output_box; - wlr_output_layout_get_box(output->server->output_layout, output->wlr_output,&output_box); + wlr_output_layout_get_box(output->server->output_layout, output->wlr_output, + &output_box); box->x = output_box.width; box->y = 0; diff --git a/output.c b/output.c index 92c6abe..b31a4eb 100644 --- a/output.c +++ b/output.c @@ -21,12 +21,12 @@ #if WLR_HAS_X11_BACKEND #include #endif +#include #include #include #include #include #include -#include #include #include #include @@ -69,7 +69,7 @@ output_clear(struct cg_output *output) { first || output->workspaces[i]->focused_tile != tile; tile = tile->next) { first = false; - workspace_tile_update_view(tile,NULL); + workspace_tile_update_view(tile, NULL); } struct cg_workspace *ws = server->curr_output @@ -106,11 +106,11 @@ output_clear(struct cg_output *output) { } int -output_get_num(const struct cg_output* output) { +output_get_num(const struct cg_output *output) { struct cg_output *it; int count = 1; wl_list_for_each(it, &output->server->outputs, link) { - if(strcmp(output->wlr_output->name,it->wlr_output->name)==0) { + if(strcmp(output->wlr_output->name, it->wlr_output->name) == 0) { return count; } ++count; @@ -143,8 +143,9 @@ output_destroy(struct cg_output *output) { if(outp_name != NULL) { ipc_send_event(server, - "{\"event_name\":\"destroy_output\",\"output\":\"%s\",\"output_id\":%d}", - outp_name,outp_num); + "{\"event_name\":\"destroy_output\",\"output\":\"%s\"," + "\"output_id\":%d}", + outp_name, outp_num); free(outp_name); } else { wlr_log(WLR_ERROR, @@ -260,7 +261,8 @@ output_insert(struct cg_server *server, struct cg_output *output) { } void -output_apply_config(struct cg_server *server, struct cg_output *output, struct cg_output_config *config) { +output_apply_config(struct cg_server *server, struct cg_output *output, + struct cg_output_config *config) { struct wlr_output *wlr_output = output->wlr_output; if(output->wlr_output->enabled) { @@ -279,18 +281,17 @@ output_apply_config(struct cg_server *server, struct cg_output *output, struct c wlr_output_set_scale(wlr_output, config->scale); } if(config->pos.x != -1) { - if(output_set_mode(wlr_output, config->pos.width, - config->pos.height, config->refresh_rate) != 0) { - wlr_log(WLR_ERROR, - "Setting output mode failed, disabling output."); + if(output_set_mode(wlr_output, config->pos.width, config->pos.height, + config->refresh_rate) != 0) { + wlr_log(WLR_ERROR, "Setting output mode failed, disabling output."); output_clear(output); wl_list_insert(&server->disabled_outputs, &output->link); wlr_output_enable(wlr_output, false); wlr_output_commit(wlr_output); return; } - wlr_output_layout_add(server->output_layout, wlr_output, - config->pos.x, config->pos.y); + wlr_output_layout_add(server->output_layout, wlr_output, config->pos.x, + config->pos.y); /* Since the size of the output may have changed, we * reinitialize all workspaces with a fullscreen layout */ for(unsigned int i = 0; i < output->server->nws; ++i) { @@ -306,7 +307,8 @@ output_apply_config(struct cg_server *server, struct cg_output *output, struct c } } /* Refuse to disable the only output */ - if(config->status == OUTPUT_DISABLE&&wl_list_length(&server->outputs)>1) { + if(config->status == OUTPUT_DISABLE && + wl_list_length(&server->outputs) > 1) { output_clear(output); wl_list_insert(&server->disabled_outputs, &output->link); wlr_output_enable(wlr_output, false); @@ -331,15 +333,16 @@ output_apply_config(struct cg_server *server, struct cg_output *output, struct c &scene_output->scene->tree, output->wlr_output->width, output->wlr_output->height, server->bg_color); struct wlr_box box; - wlr_output_layout_get_box(server->output_layout, output->wlr_output,&box); + wlr_output_layout_get_box(server->output_layout, output->wlr_output, &box); wlr_scene_node_set_position(&output->bg->node, box.x, box.y); wlr_scene_node_lower_to_bottom(&output->bg->node); } -struct cg_output_config *empty_output_config() { +struct cg_output_config * +empty_output_config() { struct cg_output_config *cfg = calloc(1, sizeof(struct cg_output_config)); - if(cfg==NULL) { - wlr_log(WLR_ERROR,"Could not allocate output configuration."); + if(cfg == NULL) { + wlr_log(WLR_ERROR, "Could not allocate output configuration."); return NULL; } @@ -358,14 +361,16 @@ struct cg_output_config *empty_output_config() { } /* cfg1 has precedence over cfg2 */ -struct cg_output_config *merge_output_configs(struct cg_output_config *cfg1, struct cg_output_config *cfg2) { - struct cg_output_config *out_cfg=empty_output_config(); - if(cfg1->status==out_cfg->status) { +struct cg_output_config * +merge_output_configs(struct cg_output_config *cfg1, + struct cg_output_config *cfg2) { + struct cg_output_config *out_cfg = empty_output_config(); + if(cfg1->status == out_cfg->status) { out_cfg->status = cfg2->status; } else { out_cfg->status = cfg1->status; } - if(cfg1->pos.x==out_cfg->pos.x) { + if(cfg1->pos.x == out_cfg->pos.x) { out_cfg->pos.x = cfg2->pos.x; out_cfg->pos.y = cfg2->pos.y; out_cfg->pos.width = cfg2->pos.width; @@ -377,30 +382,30 @@ struct cg_output_config *merge_output_configs(struct cg_output_config *cfg1, str out_cfg->pos.height = cfg1->pos.height; } if(cfg1->output_name == NULL) { - if(cfg2->output_name == NULL) { - out_cfg->output_name = NULL; - } else { + if(cfg2->output_name == NULL) { + out_cfg->output_name = NULL; + } else { out_cfg->output_name = strdup(cfg2->output_name); - } + } } else { out_cfg->output_name = strdup(cfg1->output_name); } - if(cfg1->refresh_rate==out_cfg->refresh_rate) { + if(cfg1->refresh_rate == out_cfg->refresh_rate) { out_cfg->refresh_rate = cfg2->refresh_rate; } else { out_cfg->refresh_rate = cfg1->refresh_rate; } - if(cfg1->priority==out_cfg->priority) { + if(cfg1->priority == out_cfg->priority) { out_cfg->priority = cfg2->priority; } else { out_cfg->priority = cfg1->priority; } - if(cfg1->scale==out_cfg->scale) { + if(cfg1->scale == out_cfg->scale) { out_cfg->scale = cfg2->scale; } else { out_cfg->scale = cfg1->scale; } - if(cfg1->angle==out_cfg->angle) { + if(cfg1->angle == out_cfg->angle) { out_cfg->status = cfg2->angle; } else { out_cfg->angle = cfg1->angle; @@ -410,15 +415,15 @@ struct cg_output_config *merge_output_configs(struct cg_output_config *cfg1, str void output_configure(struct cg_server *server, struct cg_output *output) { - struct cg_output_config *tot_config=empty_output_config(); + struct cg_output_config *tot_config = empty_output_config(); struct cg_output_config *config; wl_list_for_each(config, &server->output_config, link) { if(strcmp(config->output_name, output->wlr_output->name) == 0) { if(tot_config == NULL) { return; } - struct cg_output_config *prev_config=tot_config; - tot_config=merge_output_configs(config,tot_config); + struct cg_output_config *prev_config = tot_config; + tot_config = merge_output_configs(config, tot_config); if(prev_config->output_name != NULL) { free(prev_config->output_name); } @@ -426,7 +431,7 @@ output_configure(struct cg_server *server, struct cg_output *output) { } } if(tot_config != NULL) { - output_apply_config(server,output,tot_config); + output_apply_config(server, output, tot_config); } free(tot_config->output_name); free(tot_config); @@ -582,10 +587,11 @@ handle_new_output(struct wl_listener *listener, void *data) { wl_signal_add(&wlr_output->events.commit, &output->commit); output->mode.notify = handle_output_mode; wl_signal_add(&wlr_output->events.mode, &output->mode); - ipc_send_event( - server, - "{\"event_name\":\"new_output\",\"output\":\"%s\",\"output_id\":%d,\"priority\":%d}", - output->wlr_output->name, output_get_num(output),output->priority); + ipc_send_event(server, + "{\"event_name\":\"new_output\",\"output\":\"%s\",\"output_" + "id\":%d,\"priority\":%d}", + output->wlr_output->name, output_get_num(output), + output->priority); } #if CG_HAS_FANALYZE #pragma GCC diagnostic pop diff --git a/output.h b/output.h index ed7556f..859c682 100644 --- a/output.h +++ b/output.h @@ -42,7 +42,7 @@ struct cg_output_config { float refresh_rate; float scale; int priority; - int angle;//enum wl_output_transform, -1 signifies "unspecified" + int angle; // enum wl_output_transform, -1 signifies "unspecified" struct wl_list link; // cg_server::output_config }; @@ -60,5 +60,5 @@ output_set_window_title(struct cg_output *output, const char *title); void output_make_workspace_fullscreen(struct cg_output *output, int ws); int -output_get_num(const struct cg_output* output); +output_get_num(const struct cg_output *output); #endif diff --git a/parse.c b/parse.c index 21f3f56..c097096 100644 --- a/parse.c +++ b/parse.c @@ -13,7 +13,6 @@ #include "parse.h" #include "server.h" #include "util.h" -#include "input_manager.h" char * log_error(const char *fmt, ...) { @@ -81,7 +80,8 @@ parse_command(struct cg_server *server, struct keybinding *keybinding, /* Parse a keybinding definition and return it if successful, else return NULL */ struct keybinding * -parse_keybinding(struct cg_server *server, char **saveptr, char **errstr,int nesting_level) { +parse_keybinding(struct cg_server *server, char **saveptr, char **errstr, + int nesting_level) { struct keybinding *keybinding = malloc(sizeof(struct keybinding)); if(keybinding == NULL) { *errstr = log_error( @@ -94,7 +94,8 @@ parse_keybinding(struct cg_server *server, char **saveptr, char **errstr,int nes free(keybinding); return NULL; } - if(parse_command(server, keybinding, *saveptr, errstr,nesting_level+1) != 0) { + if(parse_command(server, keybinding, *saveptr, errstr, nesting_level + 1) != + 0) { free(keybinding); return NULL; } @@ -138,7 +139,7 @@ parse_uint(char **saveptr, const char *delim) { struct cg_input_config * parse_input_config(char **saveptr, char **errstr) { - struct cg_input_config *cfg=input_manager_create_empty_input_config(); + struct cg_input_config *cfg = input_manager_create_empty_input_config(); char *value = NULL; char *ident = NULL; if(cfg == NULL) { @@ -351,7 +352,7 @@ parse_input_config(char **saveptr, char **errstr) { } } else if(strcmp(setting, "repeat_delay") == 0) { cfg->repeat_delay = parse_uint(saveptr, " "); - if(cfg->repeat_delay < 0 ) { + if(cfg->repeat_delay < 0) { *errstr = log_error("Invalid option \"%s\" to setting " "\"repeat_delay\", expected positive integer", value); @@ -359,7 +360,7 @@ parse_input_config(char **saveptr, char **errstr) { } } else if(strcmp(setting, "repeat_rate") == 0) { cfg->repeat_rate = parse_uint(saveptr, " "); - if(cfg->repeat_rate < 0 ) { + if(cfg->repeat_rate < 0) { *errstr = log_error("Invalid option \"%s\" to setting " "\"repeat_rate\", expected positive integer", value); @@ -389,8 +390,10 @@ error: } struct keybinding * -parse_bind(struct cg_server *server, char **saveptr, char **errstr, int nesting_level) { - struct keybinding *keybinding = parse_keybinding(server, saveptr, errstr,nesting_level); +parse_bind(struct cg_server *server, char **saveptr, char **errstr, + int nesting_level) { + struct keybinding *keybinding = + parse_keybinding(server, saveptr, errstr, nesting_level); if(keybinding == NULL) { wlr_log(WLR_ERROR, "Could not parse keybinding for \"bind\"."); return NULL; @@ -400,7 +403,8 @@ parse_bind(struct cg_server *server, char **saveptr, char **errstr, int nesting_ } struct keybinding * -parse_definekey(struct cg_server *server, char **saveptr, char **errstr, int nesting_level) { +parse_definekey(struct cg_server *server, char **saveptr, char **errstr, + int nesting_level) { char *mode = strtok_r(NULL, " ", saveptr); if(mode == NULL) { *errstr = @@ -412,7 +416,8 @@ parse_definekey(struct cg_server *server, char **saveptr, char **errstr, int nes *errstr = log_error("Unknown mode \"%s\"", mode); return NULL; } - struct keybinding *keybinding = parse_keybinding(server, saveptr, errstr, nesting_level); + struct keybinding *keybinding = + parse_keybinding(server, saveptr, errstr, nesting_level); if(keybinding == NULL) { wlr_log(WLR_ERROR, "Could not parse keybinding for \"definekey\""); return NULL; @@ -480,13 +485,15 @@ parse_escape(char **saveptr, char **errstr) { int parse_cursor(char **saveptr, char **errstr) { - if(strcmp(*saveptr,"enable")==0) { + if(strcmp(*saveptr, "enable") == 0) { return 1; - } else if(strcmp(*saveptr,"disable")==0) { + } else if(strcmp(*saveptr, "disable") == 0) { return 0; } else { wlr_log(WLR_ERROR, - "Invalid option \"%s\" for \"cursor\". Expected \"enable\" or \"disable\".", *saveptr); + "Invalid option \"%s\" for \"cursor\". Expected \"enable\" or " + "\"disable\".", + *saveptr); return -1; } } @@ -576,15 +583,14 @@ parse_output_config(char **saveptr, char **errstr) { if(strcmp(key_str, "rotate") == 0) { uint32_t angle = parse_uint(saveptr, " "); - //360 degrees is equivalent to 0 degrees - cfg->angle = angle%4; + // 360 degrees is equivalent to 0 degrees + cfg->angle = angle % 4; if(cfg->angle < 0) { - *errstr = log_error( - "Error parsing option rotate for output %s", - name); + *errstr = + log_error("Error parsing option rotate for output %s", name); goto error; } - cfg->output_name=strdup(name); + cfg->output_name = strdup(name); return cfg; } @@ -604,9 +610,9 @@ parse_output_config(char **saveptr, char **errstr) { cfg->scale = parse_float(saveptr, " "); if(cfg->scale <= 0.0) { *errstr = - log_error("Error parsing scale of output configuration for " - "output %s, expected positive float", - name); + log_error("Error parsing scale of output configuration for " + "output %s, expected positive float", + name); goto error; } cfg->output_name = strdup(name); @@ -753,10 +759,11 @@ error: int parse_command(struct cg_server *server, struct keybinding *keybinding, - char *saveptr, char **errstr,int nesting_level) { + char *saveptr, char **errstr, int nesting_level) { char *action = strtok_r(NULL, " ", &saveptr); - if(nesting_level>=MAX_NESTING_LEVEL) { - *errstr = log_error("Nesting level of commands is too deep. Giving up."); + if(nesting_level >= MAX_NESTING_LEVEL) { + *errstr = + log_error("Nesting level of commands is too deep. Giving up."); return -1; } if(action == NULL) { @@ -787,7 +794,9 @@ parse_command(struct cg_server *server, struct keybinding *keybinding, long tile_id = strtol(nws_str, NULL, 10); if(tile_id < 1) { - *errstr = log_error("Tile id for focus_tile must be a positive integer. Got %l\n", tile_id); + *errstr = log_error( + "Tile id for focus_tile must be a positive integer. Got %l\n", + tile_id); return -1; } keybinding->data.u = tile_id; @@ -974,13 +983,15 @@ parse_command(struct cg_server *server, struct keybinding *keybinding, keybinding->data.u = (unsigned int)mode_idx; } else if(strcmp(action, "bind") == 0) { keybinding->action = KEYBINDING_DEFINEKEY; - keybinding->data.kb = parse_bind(server, &saveptr, errstr,nesting_level); + keybinding->data.kb = + parse_bind(server, &saveptr, errstr, nesting_level); if(keybinding->data.kb == NULL) { return -1; } } else if(strcmp(action, "definekey") == 0) { keybinding->action = KEYBINDING_DEFINEKEY; - keybinding->data.kb = parse_definekey(server, &saveptr, errstr,nesting_level); + keybinding->data.kb = + parse_definekey(server, &saveptr, errstr, nesting_level); if(keybinding->data.kb == NULL) { return -1; } @@ -1051,7 +1062,7 @@ parse_rc_line(struct cg_server *server, char *line, char **errstr) { free(saveptr); return -1; } - if(parse_command(server, keybinding, saveptr, errstr,1) != 0) { + if(parse_command(server, keybinding, saveptr, errstr, 1) != 0) { wlr_log(WLR_ERROR, "Error parsing command."); free(keybinding); free(saveptr); diff --git a/seat.c b/seat.c index e3d0067..a1996c3 100644 --- a/seat.c +++ b/seat.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -24,7 +25,6 @@ #include #include #include -#include #include #include #include @@ -63,7 +63,8 @@ update_capabilities(const struct cg_seat *seat) { wlr_seat_set_capabilities(seat->seat, caps); /* Hide cursor if the seat doesn't have pointer capability. */ - if(((caps & WL_SEAT_CAPABILITY_POINTER) == 0) || seat->enable_cursor == false) { + if(((caps & WL_SEAT_CAPABILITY_POINTER) == 0) || + seat->enable_cursor == false) { wlr_cursor_set_image(seat->cursor, NULL, 0, 0, 0, 0, 0, 0); } else { wlr_xcursor_manager_set_cursor_image(seat->xcursor_manager, @@ -138,7 +139,8 @@ new_pointer(struct cg_seat *seat, struct cg_input_device *input_device) { if(wlr_pointer->output_name != NULL) { struct cg_output *output; wl_list_for_each(output, &seat->server->outputs, link) { - if(strcmp(wlr_pointer->output_name, output->wlr_output->name) == 0) { + if(strcmp(wlr_pointer->output_name, output->wlr_output->name) == + 0) { wlr_cursor_map_input_to_output(seat->cursor, device, output->wlr_output); break; @@ -150,8 +152,7 @@ new_pointer(struct cg_seat *seat, struct cg_input_device *input_device) { static int handle_keyboard_repeat(void *data) { struct cg_keyboard_group *cg_group = data; - struct wlr_keyboard *wlr_device = - &cg_group->wlr_group->keyboard; + struct wlr_keyboard *wlr_device = &cg_group->wlr_group->keyboard; if(cg_group->repeat_keybinding != NULL) { if(wlr_device->repeat_info.rate > 0) { if(wl_event_source_timer_update( @@ -170,10 +171,9 @@ handle_keyboard_repeat(void *data) { static void handle_modifier_event(struct wlr_input_device *device, struct cg_seat *seat) { - struct wlr_keyboard *keyboard=wlr_keyboard_from_input_device(device); + struct wlr_keyboard *keyboard = wlr_keyboard_from_input_device(device); wlr_seat_set_keyboard(seat->seat, keyboard); - wlr_seat_keyboard_notify_modifiers(seat->seat, - &keyboard->modifiers); + wlr_seat_keyboard_notify_modifiers(seat->seat, &keyboard->modifiers); wlr_idle_notify_activity(seat->server->idle, seat->seat); } @@ -193,7 +193,7 @@ static bool handle_command_key_bindings(struct cg_server *server, xkb_keysym_t sym, uint32_t modifiers, uint32_t mode, struct cg_keyboard_group *group) { - if(group->enable_keybindings==false) { + if(group->enable_keybindings == false) { return false; } struct keybinding **keybinding = find_keybinding( @@ -201,19 +201,23 @@ handle_command_key_bindings(struct cg_server *server, xkb_keysym_t sym, &(struct keybinding){.key = sym, .mode = mode, .modifiers = modifiers}); if(server->seat->mode != server->seat->default_mode) { server->seat->mode = - server->seat - ->default_mode; // Return to mode we are currently in by default + server->seat + ->default_mode; // Return to mode we are currently in by default double sx, sy; struct wlr_seat *wlr_seat = server->seat->seat; struct wlr_surface *surface = NULL; struct wlr_scene_node *node = wlr_scene_node_at( - &server->scene->tree.node, server->seat->cursor->x, server->seat->cursor->y, &sx, &sy); + &server->scene->tree.node, server->seat->cursor->x, + server->seat->cursor->y, &sx, &sy); if(server->seat->enable_cursor) { wlr_xcursor_manager_set_cursor_image(server->seat->xcursor_manager, - "left_ptr", server->seat->cursor); + "left_ptr", + server->seat->cursor); if(node && node->type == WLR_SCENE_NODE_BUFFER) { - struct wlr_scene_surface *scene_surface=wlr_scene_surface_from_buffer(wlr_scene_buffer_from_node(node)); + struct wlr_scene_surface *scene_surface = + wlr_scene_surface_from_buffer( + wlr_scene_buffer_from_node(node)); if(scene_surface != NULL) { surface = scene_surface->surface; } @@ -230,9 +234,9 @@ handle_command_key_bindings(struct cg_server *server, xkb_keysym_t sym, if(group->wlr_group->keyboard.repeat_info.delay > 0) { group->repeat_keybinding = keybinding; - if(wl_event_source_timer_update(group->key_repeat_timer, - group->wlr_group->keyboard.repeat_info.delay) < - 0) { + if(wl_event_source_timer_update( + group->key_repeat_timer, + group->wlr_group->keyboard.repeat_info.delay) < 0) { wlr_log(WLR_DEBUG, "failed to set key repeat timer"); } } @@ -281,8 +285,7 @@ handle_key_event(struct cg_keyboard_group *group, struct cg_seat *seat, xkb_keycode_t keycode = event->keycode + 8; const xkb_keysym_t *syms; - int nsyms = - xkb_state_key_get_syms(keyboard->xkb_state, keycode, &syms); + int nsyms = xkb_state_key_get_syms(keyboard->xkb_state, keycode, &syms); bool handled = false; @@ -293,8 +296,7 @@ handle_key_event(struct cg_keyboard_group *group, struct cg_seat *seat, /* Get the consumed_modifiers and remove them from the modifier list */ xkb_mod_mask_t consumed_modifiers = - xkb_state_key_get_consumed_mods2(keyboard->xkb_state, - keycode, + xkb_state_key_get_consumed_mods2(keyboard->xkb_state, keycode, XKB_CONSUMED_MODE_GTK); if(handle_command_key_bindings(seat->server, syms[i], modifiers & ~consumed_modifiers, @@ -330,21 +332,26 @@ handle_keyboard_group_modifiers(struct wl_listener *listener, void *_data) { handle_modifier_event(&group->wlr_group->keyboard.base, group->seat); } -static bool repeat_info_match(struct wlr_keyboard *a, struct wlr_keyboard *b) { +static bool +repeat_info_match(struct wlr_keyboard *a, struct wlr_keyboard *b) { return a->repeat_info.rate == b->repeat_info.rate && - a->repeat_info.delay == b->repeat_info.delay; + a->repeat_info.delay == b->repeat_info.delay; } static void -cg_keyboard_group_add(struct cg_input_device *input_device, struct cg_seat *seat) { - struct wlr_input_device *device=input_device->wlr_device; +cg_keyboard_group_add(struct cg_input_device *input_device, + struct cg_seat *seat) { + struct wlr_input_device *device = input_device->wlr_device; struct wlr_keyboard *wlr_keyboard = wlr_keyboard_from_input_device(device); // Virtual devices should not be grouped if(!input_device->is_virtual) { struct cg_keyboard_group *group; wl_list_for_each(group, &seat->keyboard_groups, link) { struct wlr_keyboard_group *wlr_group = group->wlr_group; - if(wlr_keyboard_keymaps_match(wlr_keyboard->keymap,wlr_group->keyboard.keymap) && repeat_info_match(wlr_keyboard,&wlr_group->keyboard) && wlr_keyboard_group_add_keyboard(wlr_group, wlr_keyboard)) { + if(wlr_keyboard_keymaps_match(wlr_keyboard->keymap, + wlr_group->keyboard.keymap) && + repeat_info_match(wlr_keyboard, &wlr_group->keyboard) && + wlr_keyboard_group_add_keyboard(wlr_group, wlr_keyboard)) { wlr_log(WLR_DEBUG, "Adding keyboard to existing group."); return; } @@ -372,9 +379,9 @@ cg_keyboard_group_add(struct cg_input_device *input_device, struct cg_seat *seat wlr_keyboard->repeat_info.rate, wlr_keyboard->repeat_info.delay); if(input_device->identifier != NULL) { - cg_group->identifier=strdup(input_device->identifier); + cg_group->identifier = strdup(input_device->identifier); } else { - cg_group->identifier=NULL; + cg_group->identifier = NULL; } wlr_log(WLR_DEBUG, "Created keyboard group."); @@ -391,7 +398,7 @@ cg_keyboard_group_add(struct cg_input_device *input_device, struct cg_seat *seat seat->server->event_loop, handle_keyboard_repeat, cg_group); cg_group->modifiers.notify = handle_keyboard_group_modifiers; - cg_group->enable_keybindings=true; + cg_group->enable_keybindings = true; cg_input_manager_configure_keyboard_group(cg_group); return; @@ -399,7 +406,7 @@ cleanup: if(cg_group && cg_group->wlr_group) { wlr_keyboard_group_destroy(cg_group->wlr_group); } - if(cg_group&&cg_group->identifier) { + if(cg_group && cg_group->identifier) { free(cg_group->identifier); } free(cg_group); @@ -458,7 +465,8 @@ seat_add_device(struct cg_seat *seat, struct cg_input_device *device) { update_capabilities(seat); } -static void destroy_empty_wlr_keyboard_group(void *data) { +static void +destroy_empty_wlr_keyboard_group(void *data) { wlr_keyboard_group_destroy(data); } @@ -468,14 +476,15 @@ remove_keyboard(struct cg_seat *seat, struct cg_input_device *keyboard) { return; } struct wlr_seat *wlr_seat = seat->seat; - struct wlr_keyboard *wlr_keyboard = wlr_keyboard_from_input_device(keyboard->wlr_device); + struct wlr_keyboard *wlr_keyboard = + wlr_keyboard_from_input_device(keyboard->wlr_device); struct wlr_keyboard_group *wlr_group = wlr_keyboard->group; if(wlr_group) { wlr_keyboard_group_remove_keyboard(wlr_group, wlr_keyboard); - if (wl_list_empty(&wlr_group->devices)) { + if(wl_list_empty(&wlr_group->devices)) { wlr_log(WLR_DEBUG, "Destroying empty keyboard group %p", - (void *)wlr_group); + (void *)wlr_group); struct cg_keyboard_group *group = wlr_group->data; if(wlr_seat_get_keyboard(wlr_seat) == &wlr_group->keyboard) { wlr_seat_set_keyboard(wlr_seat, NULL); @@ -484,16 +493,15 @@ remove_keyboard(struct cg_seat *seat, struct cg_input_device *keyboard) { wl_list_remove(&group->link); wl_list_remove(&group->key.link); wl_list_remove(&group->modifiers.link); - if(group->identifier!=NULL) { + if(group->identifier != NULL) { free(group->identifier); } free(group); - // To prevent use-after-free conditions when handling key events, defer - // freeing the wlr_keyboard_group until idle + // To prevent use-after-free conditions when handling key events, + // defer freeing the wlr_keyboard_group until idle wl_event_loop_add_idle(seat->server->event_loop, - destroy_empty_wlr_keyboard_group, wlr_group); - + destroy_empty_wlr_keyboard_group, wlr_group); } } @@ -547,7 +555,7 @@ handle_request_set_selection(struct wl_listener *listener, void *data) { static void handle_request_set_cursor(struct wl_listener *listener, void *data) { struct cg_seat *seat = wl_container_of(listener, seat, request_set_cursor); - if(seat->enable_cursor==false||seat->mode!=seat->default_mode) { + if(seat->enable_cursor == false || seat->mode != seat->default_mode) { return; } struct wlr_seat_pointer_request_set_cursor_event *event = data; @@ -574,8 +582,8 @@ handle_touch_down(struct wl_listener *listener, void *data) { struct wlr_touch_down_event *event = data; double lx, ly; - wlr_cursor_absolute_to_layout_coords(seat->cursor, &event->touch->base, event->x, - event->y, &lx, &ly); + wlr_cursor_absolute_to_layout_coords(seat->cursor, &event->touch->base, + event->x, event->y, &lx, &ly); double sx, sy; struct wlr_scene_node *node = @@ -583,11 +591,12 @@ handle_touch_down(struct wl_listener *listener, void *data) { uint32_t serial = 0; if(node && node->type == WLR_SCENE_NODE_BUFFER) { - struct wlr_scene_surface *scene_surface=wlr_scene_surface_from_buffer(wlr_scene_buffer_from_node(node)); + struct wlr_scene_surface *scene_surface = + wlr_scene_surface_from_buffer(wlr_scene_buffer_from_node(node)); if(scene_surface != NULL) { serial = wlr_seat_touch_notify_down( - seat->seat, scene_surface->surface, - event->time_msec, event->touch_id, sx, sy); + seat->seat, scene_surface->surface, event->time_msec, + event->touch_id, sx, sy); } } @@ -623,20 +632,21 @@ handle_touch_motion(struct wl_listener *listener, void *data) { } double lx, ly; - wlr_cursor_absolute_to_layout_coords(seat->cursor, &event->touch->base, event->x, - event->y, &lx, &ly); + wlr_cursor_absolute_to_layout_coords(seat->cursor, &event->touch->base, + event->x, event->y, &lx, &ly); double sx, sy; struct wlr_scene_node *node = wlr_scene_node_at(&seat->server->scene->tree.node, lx, ly, &sx, &sy); if(node && node->type == WLR_SCENE_NODE_BUFFER) { - struct wlr_scene_surface *scene_surface=wlr_scene_surface_from_buffer(wlr_scene_buffer_from_node(node)); + struct wlr_scene_surface *scene_surface = + wlr_scene_surface_from_buffer(wlr_scene_buffer_from_node(node)); if(scene_surface != NULL) { - wlr_seat_touch_point_focus(seat->seat, - scene_surface->surface, - event->time_msec, event->touch_id, sx, sy); + wlr_seat_touch_point_focus(seat->seat, scene_surface->surface, + event->time_msec, event->touch_id, sx, + sy); } wlr_seat_touch_notify_motion(seat->seat, event->time_msec, event->touch_id, sx, sy); @@ -688,11 +698,13 @@ process_cursor_motion(struct cg_seat *seat, uint32_t time) { struct wlr_seat *wlr_seat = seat->seat; struct wlr_surface *surface = NULL; - struct wlr_scene_node *node = wlr_scene_node_at( - &seat->server->scene->tree.node, seat->cursor->x, seat->cursor->y, &sx, &sy); + struct wlr_scene_node *node = + wlr_scene_node_at(&seat->server->scene->tree.node, seat->cursor->x, + seat->cursor->y, &sx, &sy); if(node && node->type == WLR_SCENE_NODE_BUFFER) { - struct wlr_scene_surface *scene_surface=wlr_scene_surface_from_buffer(wlr_scene_buffer_from_node(node)); + struct wlr_scene_surface *scene_surface = + wlr_scene_surface_from_buffer(wlr_scene_buffer_from_node(node)); if(scene_surface != NULL) { surface = scene_surface->surface; } @@ -739,13 +751,15 @@ process_cursor_motion(struct cg_seat *seat, uint32_t time) { } } if(seat->cursor_tile != NULL && seat->cursor_tile != c_tile) { - ipc_send_event( - seat->server, - "{\"event_name\":\"cursor_switch_tile\",\"old_output\":\"%s\",\"old_output_id\":%d," - "\"old_tile\":%d,\"new_output\":\"%s\",\"new_output_id\":%d,\"new_tile\":%d}", - seat->cursor_tile->workspace->output->wlr_output->name, - output_get_num(seat->cursor_tile->workspace->output), - seat->cursor_tile->id, c_outp->name, output_get_num(cg_outp),c_tile->id); + ipc_send_event(seat->server, + "{\"event_name\":\"cursor_switch_tile\",\"old_output\":" + "\"%s\",\"old_output_id\":%d," + "\"old_tile\":%d,\"new_output\":\"%s\",\"new_output_" + "id\":%d,\"new_tile\":%d}", + seat->cursor_tile->workspace->output->wlr_output->name, + output_get_num(seat->cursor_tile->workspace->output), + seat->cursor_tile->id, c_outp->name, + output_get_num(cg_outp), c_tile->id); } seat->cursor_tile = c_tile; } @@ -756,7 +770,8 @@ handle_cursor_motion_absolute(struct wl_listener *listener, void *data) { wl_container_of(listener, seat, cursor_motion_absolute); struct wlr_pointer_motion_absolute_event *event = data; - wlr_cursor_warp_absolute(seat->cursor, &event->pointer->base, event->x, event->y); + wlr_cursor_warp_absolute(seat->cursor, &event->pointer->base, event->x, + event->y); process_cursor_motion(seat, event->time_msec); wlr_idle_notify_activity(seat->server->idle, seat->seat); } @@ -913,7 +928,7 @@ seat_create(struct cg_server *server, struct wlr_backend *backend) { return NULL; } - seat->enable_cursor=true; + seat->enable_cursor = true; seat->seat = wlr_seat_create(server->wl_display, "seat0"); if(!seat->seat) { wlr_log(WLR_ERROR, "Cannot allocate seat0"); @@ -934,7 +949,8 @@ seat_create(struct cg_server *server, struct wlr_backend *backend) { wlr_cursor_attach_output_layout(seat->cursor, server->output_layout); if(!seat->xcursor_manager) { - seat->xcursor_manager = wlr_xcursor_manager_create(NULL, server->xcursor_size); + seat->xcursor_manager = + wlr_xcursor_manager_create(NULL, server->xcursor_size); if(!seat->xcursor_manager) { wlr_log(WLR_ERROR, "Cannot create XCursor manager"); wlr_cursor_destroy(seat->cursor); @@ -1020,7 +1036,10 @@ seat_set_focus(struct cg_seat *seat, struct cg_view *view) { /* Focusing the background */ if(view == NULL) { - workspace_tile_update_view(server->curr_output->workspaces[server->curr_output->curr_workspace]->focused_tile,NULL); + workspace_tile_update_view( + server->curr_output->workspaces[server->curr_output->curr_workspace] + ->focused_tile, + NULL); seat->focused_view = NULL; if(prev_view != NULL) { view_activate(prev_view, false); @@ -1033,11 +1052,12 @@ seat_set_focus(struct cg_seat *seat, struct cg_view *view) { if(view->type != CG_XWAYLAND_VIEW || xwayland_view_should_manage(view)) #endif { - struct cg_workspace *curr_workspace = server->curr_output + struct cg_workspace *curr_workspace = + server->curr_output ->workspaces[server->curr_output->curr_workspace]; - workspace_tile_update_view(curr_workspace->focused_tile,view); + workspace_tile_update_view(curr_workspace->focused_tile, view); wl_list_remove(&curr_workspace->views); - wl_list_insert(&view->link,&curr_workspace->views); + wl_list_insert(&view->link, &curr_workspace->views); } #if CG_HAS_XWAYLAND @@ -1077,8 +1097,8 @@ seat_set_focus(struct cg_seat *seat, struct cg_view *view) { wlr_scene_node_raise_to_top(&view->scene_tree->node); process_cursor_motion(seat, -1); struct wlr_box box; - wlr_output_layout_get_box( - server->output_layout, view->workspace->output->wlr_output,&box); + wlr_output_layout_get_box(server->output_layout, + view->workspace->output->wlr_output, &box); wlr_scene_node_set_position(&view->workspace->output->bg->node, box.x, box.y); } diff --git a/view.c b/view.c index eafbe7d..dee1ab8 100644 --- a/view.c +++ b/view.c @@ -17,7 +17,6 @@ #include #include #include -#include #include #include "ipc_server.h" @@ -89,8 +88,8 @@ view_maximize(struct cg_view *view, struct cg_tile *tile) { view->ox = tile->tile.x; view->oy = tile->tile.y; struct wlr_box box; - wlr_output_layout_get_box( - view->server->output_layout, view->workspace->output->wlr_output,&box); + wlr_output_layout_get_box(view->server->output_layout, + view->workspace->output->wlr_output, &box); wlr_scene_node_set_position(&view->scene_tree->node, view->ox + box.x, view->oy + box.y); view->impl->maximize(view, tile->tile.width, tile->tile.height); @@ -135,7 +134,7 @@ view_unmap(struct cg_view *view) { } struct cg_tile *view_tile = view_get_tile(view); if(view_tile != NULL) { - workspace_tile_update_view(view_tile,prev); + workspace_tile_update_view(view_tile, prev); } } #if CG_HAS_XWAYLAND @@ -156,7 +155,7 @@ view_unmap(struct cg_view *view) { view->workspace->server, "{\"event_name\":\"view_unmap\",\"view_id\":%d,\"tile_id\":%d," "\"workspace\":%d,\"output\":\"%s\",\"output_id\":%d,\"view_pid\":%d}", - id, tile_id, ws + 1, output_name, output_id,pid); + id, tile_id, ws + 1, output_name, output_id, pid); } void @@ -165,8 +164,7 @@ view_map(struct cg_view *view, struct wlr_surface *surface, struct cg_output *output = ws->output; view->wlr_surface = surface; - view->scene_tree = - wlr_scene_subsurface_tree_create(ws->scene, surface); + view->scene_tree = wlr_scene_subsurface_tree_create(ws->scene, surface); if(!view->scene_tree) { wl_resource_post_no_memory(surface->resource); return; @@ -180,7 +178,8 @@ view_map(struct cg_view *view, struct wlr_surface *surface, if(view->type == CG_XWAYLAND_VIEW && !xwayland_view_should_manage(view)) { wl_list_insert(&ws->unmanaged_views, &view->link); struct wlr_box box; - wlr_output_layout_get_box(view->server->output_layout, view->workspace->output->wlr_output,&box); + wlr_output_layout_get_box(view->server->output_layout, + view->workspace->output->wlr_output, &box); wlr_scene_node_set_position(&view->scene_tree->node, view->ox + box.x, view->oy + box.y); } else @@ -200,7 +199,8 @@ view_map(struct cg_view *view, struct wlr_surface *surface, "{\"event_name\":\"view_map\",\"view_id\":%d,\"tile_id\":%d," "\"workspace\":%d,\"output\":\"%s\",\"output_id\":%d,\"view_pid\":%d}", view->id, tile_id, view->workspace->num + 1, - view->workspace->output->wlr_output->name, output_get_num(view->workspace->output),view->impl->get_pid(view)); + view->workspace->output->wlr_output->name, + output_get_num(view->workspace->output), view->impl->get_pid(view)); } void diff --git a/workspace.c b/workspace.c index d6ffe25..d99d3a4 100644 --- a/workspace.c +++ b/workspace.c @@ -19,19 +19,19 @@ #include "output.h" #include "seat.h" #include "server.h" -#include "workspace.h" #include "view.h" +#include "workspace.h" void workspace_tile_update_view(struct cg_tile *tile, struct cg_view *view) { - if(tile->view!=NULL) { - wlr_scene_node_set_enabled(&tile->view->scene_tree->node,false); - tile->view->tile=NULL; + if(tile->view != NULL) { + wlr_scene_node_set_enabled(&tile->view->scene_tree->node, false); + tile->view->tile = NULL; } - tile->view=view; - if(view!=NULL) { - view_maximize(view,tile); - wlr_scene_node_set_enabled(&view->scene_tree->node,true); + tile->view = view; + if(view != NULL) { + view_maximize(view, tile); + wlr_scene_node_set_enabled(&view->scene_tree->node, true); } } @@ -54,10 +54,10 @@ full_screen_workspace_tiles(struct wlr_output_layout *layout, workspace->focused_tile->tile.x = 0; workspace->focused_tile->tile.y = 0; struct wlr_box output_box; - wlr_output_layout_get_box(layout, output,&output_box); + wlr_output_layout_get_box(layout, output, &output_box); workspace->focused_tile->tile.width = output_box.width; workspace->focused_tile->tile.height = output_box.height; - workspace_tile_update_view(workspace->focused_tile,NULL); + workspace_tile_update_view(workspace->focused_tile, NULL); workspace->focused_tile->id = *tiles_curr_id; ++(*tiles_curr_id); return 0; @@ -127,8 +127,11 @@ workspace_free(struct cg_workspace *workspace) { void workspace_focus(struct cg_output *outp, int ws) { - if(ws>=outp->server->nws) { - wlr_log(WLR_ERROR,"Attempt to focus workspace %d, but only %d workspaces are available.",ws,outp->server->nws); + if(ws >= outp->server->nws) { + wlr_log(WLR_ERROR, + "Attempt to focus workspace %d, but only %d workspaces are " + "available.", + ws, outp->server->nws); return; } wlr_scene_node_place_above( diff --git a/xdg_shell.c b/xdg_shell.c index 1567b65..7662996 100644 --- a/xdg_shell.c +++ b/xdg_shell.c @@ -82,12 +82,12 @@ popup_unconstrain(struct cg_view *view, struct wlr_xdg_popup *popup) { struct wlr_output_layout *output_layout = view->server->output_layout; struct wlr_box view_output_box; wlr_output_layout_get_box( - output_layout, view->workspace->output->wlr_output,&view_output_box); + output_layout, view->workspace->output->wlr_output, &view_output_box); struct wlr_output *wlr_output = wlr_output_layout_output_at( output_layout, view_output_box.x + view->ox + popup_box->x, view_output_box.y + view->oy + popup_box->y); struct wlr_box output_box; - wlr_output_layout_get_box(output_layout, wlr_output,&output_box); + wlr_output_layout_get_box(output_layout, wlr_output, &output_box); struct wlr_box output_toplevel_box = {.x = -view->ox, .y = -view->oy, @@ -111,7 +111,7 @@ static pid_t get_pid(const struct cg_view *view) { pid_t pid; struct wl_client *client = - wl_resource_get_client(view->wlr_surface->resource); + wl_resource_get_client(view->wlr_surface->resource); wl_client_get_credentials(client, &pid, NULL, NULL); return pid; } @@ -128,7 +128,8 @@ is_primary(const struct cg_view *view) { static void activate(struct cg_view *view, bool activate) { struct cg_xdg_shell_view *xdg_shell_view = xdg_shell_view_from_view(view); - wlr_xdg_toplevel_set_activated(xdg_shell_view->xdg_surface->toplevel, activate); + wlr_xdg_toplevel_set_activated(xdg_shell_view->xdg_surface->toplevel, + activate); } static void @@ -143,7 +144,8 @@ close(struct cg_view *view) { static void maximize(struct cg_view *view, int width, int height) { struct cg_xdg_shell_view *xdg_shell_view = xdg_shell_view_from_view(view); - wlr_xdg_toplevel_set_size(xdg_shell_view->xdg_surface->toplevel, width, height); + wlr_xdg_toplevel_set_size(xdg_shell_view->xdg_surface->toplevel, width, + height); enum wlr_edges edges = WLR_EDGE_LEFT | WLR_EDGE_RIGHT | WLR_EDGE_TOP | WLR_EDGE_BOTTOM; wlr_xdg_toplevel_set_tiled(xdg_shell_view->xdg_surface->toplevel, edges); @@ -158,18 +160,22 @@ destroy(struct cg_view *view) { static void handle_xdg_shell_surface_request_fullscreen(struct wl_listener *listener, void *data) { - struct cg_xdg_shell_view *xdg_shell_view = wl_container_of(listener, xdg_shell_view, request_fullscreen); + struct cg_xdg_shell_view *xdg_shell_view = + wl_container_of(listener, xdg_shell_view, request_fullscreen); /** - * Certain clients do not like figuring out their own window geometry if they - * display in fullscreen mode, so we set it here. + * Certain clients do not like figuring out their own window geometry if + * they display in fullscreen mode, so we set it here. */ struct wlr_box layout_box; - wlr_output_layout_get_box(xdg_shell_view->view.server->output_layout, NULL, &layout_box); - wlr_xdg_toplevel_set_size(xdg_shell_view->xdg_surface->toplevel, layout_box.width, layout_box.height); + wlr_output_layout_get_box(xdg_shell_view->view.server->output_layout, NULL, + &layout_box); + wlr_xdg_toplevel_set_size(xdg_shell_view->xdg_surface->toplevel, + layout_box.width, layout_box.height); - wlr_xdg_toplevel_set_fullscreen(xdg_shell_view->xdg_surface->toplevel, - xdg_shell_view->xdg_surface->toplevel->requested.fullscreen); + wlr_xdg_toplevel_set_fullscreen( + xdg_shell_view->xdg_surface->toplevel, + xdg_shell_view->xdg_surface->toplevel->requested.fullscreen); } static void diff --git a/xwayland.c b/xwayland.c index 4817aeb..d6ea9f7 100644 --- a/xwayland.c +++ b/xwayland.c @@ -47,7 +47,7 @@ xwayland_view_should_manage(const struct cg_view *view) { static pid_t get_pid(const struct cg_view *view) { struct wlr_xwayland_surface *surf = - wlr_xwayland_surface_from_wlr_surface(view->wlr_surface); + wlr_xwayland_surface_from_wlr_surface(view->wlr_surface); return surf->pid; } @@ -79,8 +79,7 @@ close(struct cg_view *view) { static void maximize(struct cg_view *view, int width, int height) { struct cg_xwayland_view *xwayland_view = xwayland_view_from_view(view); - xcb_size_hints_t *hints = - xwayland_view->xwayland_surface->size_hints; + xcb_size_hints_t *hints = xwayland_view->xwayland_surface->size_hints; if(hints != NULL && hints->flags & PMaxSize) { if(width > hints->max_width) { @@ -93,7 +92,9 @@ maximize(struct cg_view *view, int width, int height) { } struct wlr_box output_box; - wlr_output_layout_get_box(view->server->output_layout, view->server->curr_output->wlr_output,&output_box); + wlr_output_layout_get_box(view->server->output_layout, + view->server->curr_output->wlr_output, + &output_box); wlr_xwayland_surface_configure(xwayland_view->xwayland_surface, view->ox + output_box.x, view->oy + output_box.y, width, height); @@ -134,7 +135,8 @@ handle_xwayland_surface_map(struct wl_listener *listener, void *_data) { if(!xwayland_view_should_manage(view)) { struct wlr_output_layout *output_layout = view->server->output_layout; struct wlr_box output_box; - wlr_output_layout_get_box(output_layout, view->server->curr_output->wlr_output,&output_box); + wlr_output_layout_get_box( + output_layout, view->server->curr_output->wlr_output, &output_box); view->ox = xwayland_view->xwayland_surface->x - output_box.x; view->oy = xwayland_view->xwayland_surface->y - output_box.y; } From 8660346f760009bf09a560f70ae8c3147103cfcf Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 6 Jan 2023 19:50:36 +0100 Subject: [PATCH 547/689] Improve naming convention --- man/cagebreak-config.5.md | 2 +- parse.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index b8fd58a..14d2e00 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -186,7 +186,7 @@ definekey top mode root Enable or disable send_events for specified input device - Disabling send_events disables the input device. - *keybindings [enable|disable]* + *keybindings [enabled|disabled]* Enable or disable keybinding interpretation for a specific keyboard. *left_handed enabled|disabled* diff --git a/parse.c b/parse.c index c097096..fd8e083 100644 --- a/parse.c +++ b/parse.c @@ -341,9 +341,9 @@ parse_input_config(char **saveptr, char **errstr) { goto error; } } else if(strcmp(setting, "keybindings") == 0) { - if(strcmp(value, "enable") == 0) { + if(strcmp(value, "enabled") == 0) { cfg->enable_keybindings = true; - } else if(strcmp(value, "disable") == 0) { + } else if(strcmp(value, "disabled") == 0) { cfg->enable_keybindings = false; } else { *errstr = log_error( From e46a32ab43f1dc4bd7399e1dcfabb880c223ea27 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 6 Jan 2023 20:15:28 +0100 Subject: [PATCH 548/689] Add example scripts for socket interaction --- example_scripts/cb_script_header.sh | 16 ++++++++++++++++ example_scripts/focus_follows_cursor.sh | 21 +++++++++++++++++++++ example_scripts/show_workspace_views.sh | 23 +++++++++++++++++++++++ 3 files changed, 60 insertions(+) create mode 100644 example_scripts/cb_script_header.sh create mode 100644 example_scripts/focus_follows_cursor.sh create mode 100644 example_scripts/show_workspace_views.sh diff --git a/example_scripts/cb_script_header.sh b/example_scripts/cb_script_header.sh new file mode 100644 index 0000000..0e7bda6 --- /dev/null +++ b/example_scripts/cb_script_header.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +named_pipe_send="$(mktemp -u)" +named_pipe_recv="$(mktemp -u)" +mkfifo "${named_pipe_send}" +mkfifo "${named_pipe_recv}" +nc -U "${CAGEBREAK_SOCKET}" < "${named_pipe_send}" > "${named_pipe_recv}"& +# The file descriptor 3 is set up to send commands to cagebreak and file +# descriptor 4 can be used to read events. Notice that events will pile up in +# file descriptor 4, so it is a good idea to continuously read from it or to +# clear it before starting a new transaction. +exec 3>"${named_pipe_send}" +exec 4<"${named_pipe_recv}" +# When the script exits, the os will clean up the pipe +rm "${named_pipe_recv}" +rm "${named_pipe_send}" diff --git a/example_scripts/focus_follows_cursor.sh b/example_scripts/focus_follows_cursor.sh new file mode 100644 index 0000000..e193e28 --- /dev/null +++ b/example_scripts/focus_follows_cursor.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# This script uses the cagebreak socket to modify the compositor's behaviour in +# such a way that the currently focussed tile follows the cursor, i.e. that the +# currently focussed tile is always the one within which the cursor is located. + +# Start up the ipc link +source "$(dirname "${BASH_SOURCE[0]}")/cb_script_header.sh" + +while IFS= read -r -d $'\0' event +do + # Remove the cg-ipc header + event="${event:6}" + if [[ "$(echo "${event}" | jq ".event_name")" = "\"cursor_switch_tile\"" ]] + then + new_tile="$(echo "${event}"|jq -r ".new_tile")" + new_output_id="$(echo "${event}"|jq -r ".new_output_id")" + # Send the new tile to focus to cagebreak + echo -e "screen ${new_output_id}\nfocus_tile ${new_tile}" >&3 + fi +done <&4 diff --git a/example_scripts/show_workspace_views.sh b/example_scripts/show_workspace_views.sh new file mode 100644 index 0000000..0c86b56 --- /dev/null +++ b/example_scripts/show_workspace_views.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +# This script displays the process names of the views on the current workspace. + +# Start up the ipc link +source "$(dirname "${BASH_SOURCE[0]}")/cb_script_header.sh" + +echo "dump" >&3 + +while IFS= read -r -d $'\0' event +do + # Remove the cg-ipc header + event="${event:6}" + if [[ "$(echo "${event}" | jq ".event_name")" = "\"dump\"" ]] + then + curr_output="$(echo "${event}"|jq ".curr_output")" + curr_workspace="$(echo "${event}"|jq -r ".outputs.${curr_output}.curr_workspace")" + # Print the process names of the view on the current workspace. jq retrieves + # their PID and ps is then used to retrieve the process names. + (echo -n "message ";ps -o comm=Command -p $(echo "${event}"|jq -r ".outputs.${curr_output}.workspaces[$((curr_workspace-1))].views[].pid")|tail +2|sed ':a; N; $!ba; s/\n/||/g') >&3 + break + fi +done <&4 From eede8b79c46561e7dc6a9d1ce44e1903acbb7a7a Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 7 Jan 2023 17:41:51 +0100 Subject: [PATCH 549/689] Add cagebreak philosophy to README --- README.md | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 64 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 66f3470..03a92c7 100644 --- a/README.md +++ b/README.md @@ -136,7 +136,70 @@ installed. Then, add `-Dman-pages=true` to the `meson` command. You can start Cagebreak by running `./build/cagebreak`. If you run it from within an existing X11 or Wayland session, it will open in a virtual output as a window in your existing session. If you run it in a TTY, it'll run with the -KMS+DRM backend. For more configuration options, see the man pages. +KMS+DRM backend. Note that a configuration file is required. For more +configuration options, see the man pages. + +#### Usage Philosophy + +Cagebreak is built to suit the needs of its creators. This section outlines +how we intended some parts of cagebreak and might ease the learning curve a +little bit. Please note that this does not replace the man pages or the FAQ. +Also, cagebreak is a few bits that modify some other bits and pixels, +if it works for you in some different way that's ok too. + +1. Cagebreak is keyboard-based. Everything regarding cagebreak can be done + through the keyboard and it is our view that it should be. This does not mean + that pointers, touchpads and such are not available for the few applications + that do require them. + +2. Cagebreak is a tiling compositor. Every view takes up as much screen space + as possible. We believe this is useful as only very few programs are typically + necessary to complete a task. To manage multiple tasks concurrently, we use + workspaces. + +3. Each task deserves its own workspace. Any given task (the sort of thing you + might find in your calendar or on your todo list) probably requires very few + views and ideally those take up as much of the screen as possible. + +> Combining 2. and 3. might look like this in practice: + +> Task 1: Edit introduction section for paper on X +> Task 2: Coordinate event with person Y + +> * split screen vertically +> * open web browser or pdf viewer to read literature +> * focus next +> * open editor +> * change to a different workspace +> * split screen vertically +> * open calendar application +> * focus next +> * open chat application + +> Now each task has its own workspace and switching between tasks is possible +> by switching between workspaces. + +> Note that using the socket more advanced setups are possible. But the user +> is warned that excessive tweaking eats into the work to be done. + +4. Use keybindings and terminal emulators for the right purpose. Given the + philosophy outlined above you probably launch the same few programs very + often and others are very rarely used. We believe that commonly + used programs should have their own keybindings together with the most + important cagebreak commands. All the rarely used programs should be launched + from a terminal emulator as they probably require special flags, environment + variables and file paths anyway. + +> In practice this means thinking about the applications and cagebreak commands +> you use and take your keyboard layout into account when defining keybindings for +> your individual needs. + +5. Cagebreak can't do everything but with scripting you can do most things. + Through the socket and with a bit of scripting you can use the internal state + of cagebreak in combination with cagebreak commands and the full power of + a scripting language of your choice to do almost whatever you want. + +> Example scripts can be found in the repository. ## Contributing From 4e4d51178c77562e36fec7b39094b7e1aeee7983 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 7 Jan 2023 19:41:50 +0100 Subject: [PATCH 550/689] Adjust README formatting --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 03a92c7..91509b7 100644 --- a/README.md +++ b/README.md @@ -163,8 +163,8 @@ if it works for you in some different way that's ok too. > Combining 2. and 3. might look like this in practice: -> Task 1: Edit introduction section for paper on X -> Task 2: Coordinate event with person Y +> * Task 1: Edit introduction section for paper on X +> * Task 2: Coordinate event with person Y > * split screen vertically > * open web browser or pdf viewer to read literature From ffe580fb8eb4abff8aa1371d9acbee60d8b75406 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 7 Jan 2023 20:25:16 +0100 Subject: [PATCH 551/689] Add scripts as possible contribution --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 91509b7..47a1f9f 100644 --- a/README.md +++ b/README.md @@ -221,6 +221,9 @@ if it works for you in some different way that's ok too. * Compile the code. * Ideas on improving the testing and quality assurance are particularly welcome. + * If you want, you can share your cagebreak scripts and we might include them + in the repository provided you agree to release them under MIT and we agree + with the use case and coding style. * Iff you are happy with Cagebreak and use Arch Linux, you may vote for [Cagebreak in the AUR](https://aur.archlinux.org/packages/cagebreak). * The points above still apply. From d7f3c81f508e3fa8a3f3ca124ac41b388ae3e34b Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 7 Jan 2023 21:47:49 +0100 Subject: [PATCH 552/689] Edit README --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 47a1f9f..4cd811c 100644 --- a/README.md +++ b/README.md @@ -70,8 +70,8 @@ See the [Changelog](Changelog.md). ### Name Cagebreak is based on [Cage](https://github.com/Hjdskes/cage), a Wayland kiosk -compositor. Since it breaks the -kiosk into tiles the name Cagebreak seemed appropriate. +compositor. Since it breaks the kiosk into tiles the name +Cagebreak seemed appropriate. ## Installation @@ -139,6 +139,9 @@ a window in your existing session. If you run it in a TTY, it'll run with the KMS+DRM backend. Note that a configuration file is required. For more configuration options, see the man pages. +Please see `example_scripts/` for example scripts and a basis to customize +from. + #### Usage Philosophy Cagebreak is built to suit the needs of its creators. This section outlines @@ -199,7 +202,7 @@ if it works for you in some different way that's ok too. of cagebreak in combination with cagebreak commands and the full power of a scripting language of your choice to do almost whatever you want. -> Example scripts can be found in the repository. +> Example scripts can be found in the repository under `example_scripts/`. ## Contributing From 9a49821d25977aeb72c32b6f0588a5ba7f593b65 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 7 Jan 2023 21:51:59 +0100 Subject: [PATCH 553/689] Add Issue 53 (#35) in Bugs.md --- Bugs.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Bugs.md b/Bugs.md index a56a25f..1aeb7df 100644 --- a/Bugs.md +++ b/Bugs.md @@ -1091,7 +1091,7 @@ is now a square in this state. ## Issue 52 * github issue number: N/A - * Fixed 2.0.0 + * Fixed: 2.0.0 Cagebreak did not correctly apply some simple commands if they were simply written in the configuration file. @@ -1103,3 +1103,10 @@ quit ``` Under these circumstances Cagebreak did not quit right after startup. + +## Issue 53 + + * github issue number: #35 + * Fixed: 2.0.0 + +Cagebreak did not build with wlroots 0.16.1 and this was adjusted. From 0f7187b3f5d548364f4e3813a57514384275b2f3 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 7 Jan 2023 22:03:03 +0100 Subject: [PATCH 554/689] Adjust example config --- examples/config | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/config b/examples/config index 7eddad1..52cbecf 100644 --- a/examples/config +++ b/examples/config @@ -41,6 +41,9 @@ definekey resize j resizedown definekey resize k resizeup definekey resize Escape setmode top +#unhide cursor (default) +cursor enable + ###################### #Workspaces ###################### From c068ae57e857111e7955a904985319e19efc03d5 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 7 Jan 2023 22:22:56 +0100 Subject: [PATCH 555/689] Adjust README --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4cd811c..5375410 100644 --- a/README.md +++ b/README.md @@ -405,8 +405,7 @@ In the past, our git history did not perfectly reflect this scheme. ### Release Procedure -The release procedure outlines the process for a release to -occur. +The release procedure outlines the process for a release to occur. * [ ] `git checkout development` * [ ] `git pull origin development` @@ -564,7 +563,7 @@ see [SECURITY.md](SECURITY.md). in 1.6.0 with slight modifications * Oliver Friedmann * [Add output scaling](https://github.com/project-repo/cagebreak/pull/34), released - in 2.0.0 + in 2.0.0 with slight modifications ## License From 3b10ac8250a6bf35b270e688030d12f8a15cc6d4 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 7 Jan 2023 22:37:17 +0100 Subject: [PATCH 556/689] Adjust SECURITY.md --- SECURITY.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/SECURITY.md b/SECURITY.md index b5a7b44..bd7c388 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -3,10 +3,8 @@ The main possibility for security bugs in cagebreak is by privilege escalation through the socket. Any program with access to the socket immediately gains arbitrary code execution rights. The socket -is restricted to the user of the cagebreak process (700). - -The socket has to be explicitely enabled by invoking Cagebreak with -the `-e` flag. +is restricted to the user of the cagebreak process (700) and has to +be explicitely enabled using the `-e` flag on invocation. If you disagree with this threat model, you may contact us via email (See section Email Contact below.) or [open an issue on github](https://github.com/project-repo/cagebreak/issues/new). From 48f3a749aaed9c6ec7d8811495b9cb7377c1caa8 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 7 Jan 2023 23:37:06 +0100 Subject: [PATCH 557/689] Adjust copyright/licenso info to SPDX standard and 2023 --- cagebreak.c | 9 ++------- config.h.in | 3 +++ example_scripts/cb_script_header.sh | 2 ++ example_scripts/focus_follows_cursor.sh | 2 ++ example_scripts/show_workspace_views.sh | 2 ++ examples/config | 2 ++ fuzz/execl_override.c | 6 ++++-- fuzz/fuzz-lib.c | 9 ++------- fuzz/fuzz-lib.h | 9 ++------- fuzz/fuzz-parse.c | 9 ++------- fuzz/meson.build | 3 +++ idle_inhibit_v1.c | 10 ++-------- idle_inhibit_v1.h | 2 ++ input.h | 3 +++ input_manager.c | 10 ++-------- input_manager.h | 3 +++ ipc_server.c | 10 ++-------- ipc_server.h | 3 +++ keybinding.c | 3 +++ keybinding.h | 3 +++ libinput.c | 3 +++ man/cagebreak-config.5.md | 2 +- man/cagebreak-socket.7.md | 2 +- man/cagebreak.1.md | 2 +- meson.build | 2 ++ meson_options.txt | 2 ++ message.c | 3 +++ message.h | 3 +++ output.c | 11 ++--------- output.h | 3 +++ pango.c | 3 +++ pango.h | 3 +++ parse.c | 3 +++ parse.h | 3 +++ seat.c | 10 ++-------- seat.h | 3 +++ util.c | 10 ++-------- util.h | 3 +++ view.c | 10 ++-------- view.h | 3 +++ workspace.c | 10 ++-------- workspace.h | 3 +++ xdg_shell.c | 10 ++-------- xdg_shell.h | 3 +++ xwayland.c | 11 +++-------- xwayland.h | 3 +++ 46 files changed, 113 insertions(+), 114 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index df96831..0c5c247 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -1,10 +1,5 @@ -/* - * Cagebreak: A Wayland tiling compositor. - * - * Copyright (C) 2018-2020 Jente Hidskes - * - * See the LICENSE file accompanying this file. - */ +// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// SPDX -License-Identifier: MIT #define _POSIX_C_SOURCE 200812L #define _DEFAULT_SOURCE diff --git a/config.h.in b/config.h.in index 53a167a..a79a80c 100644 --- a/config.h.in +++ b/config.h.in @@ -1,3 +1,6 @@ +// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// SPDX -License-Identifier: MIT + #ifndef CG_CONFIG_H #define CG_CONFIG_H diff --git a/example_scripts/cb_script_header.sh b/example_scripts/cb_script_header.sh index 0e7bda6..9533beb 100644 --- a/example_scripts/cb_script_header.sh +++ b/example_scripts/cb_script_header.sh @@ -1,4 +1,6 @@ #!/bin/bash +# Copyright 2023, project-repo and the cagebreak contributors +# SPDX -License-Identifier: MIT named_pipe_send="$(mktemp -u)" named_pipe_recv="$(mktemp -u)" diff --git a/example_scripts/focus_follows_cursor.sh b/example_scripts/focus_follows_cursor.sh index e193e28..79e2889 100644 --- a/example_scripts/focus_follows_cursor.sh +++ b/example_scripts/focus_follows_cursor.sh @@ -1,4 +1,6 @@ #!/bin/bash +# Copyright 2023, project-repo and the cagebreak contributors +# SPDX -License-Identifier: MIT # This script uses the cagebreak socket to modify the compositor's behaviour in # such a way that the currently focussed tile follows the cursor, i.e. that the diff --git a/example_scripts/show_workspace_views.sh b/example_scripts/show_workspace_views.sh index 0c86b56..3be9cbb 100644 --- a/example_scripts/show_workspace_views.sh +++ b/example_scripts/show_workspace_views.sh @@ -1,4 +1,6 @@ #!/bin/bash +# Copyright 2020 - 2023, project-repo and the cagebreak contributors +# SPDX -License-Identifier: MIT # This script displays the process names of the views on the current workspace. diff --git a/examples/config b/examples/config index 52cbecf..d79a792 100644 --- a/examples/config +++ b/examples/config @@ -1,3 +1,5 @@ +# Copyright 2020 - 2023, project-repo and the cagebreak contributors +# SPDX -License-Identifier: MIT ###################### # General settings an key bindings ###################### diff --git a/fuzz/execl_override.c b/fuzz/execl_override.c index 316cf1e..9fc9e6e 100644 --- a/fuzz/execl_override.c +++ b/fuzz/execl_override.c @@ -1,5 +1,7 @@ -/* This file is used by the fuzzer in order to prevent executing shell commands. - */ +// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// SPDX -License-Identifier: MIT +// This file is used by the fuzzer in order to prevent executing shell commands. + #define _GNU_SOURCE #include "../output.h" #include diff --git a/fuzz/fuzz-lib.c b/fuzz/fuzz-lib.c index 4628187..c159538 100644 --- a/fuzz/fuzz-lib.c +++ b/fuzz/fuzz-lib.c @@ -1,10 +1,5 @@ -/* - * Cagebreak: A Wayland tiling compositor. - * - * Copyright (C) 2018-2020 Jente Hidskes - * - * See the LICENSE file accompanying this file. - */ +// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// SPDX -License-Identifier: MIT #define _POSIX_C_SOURCE 200812L diff --git a/fuzz/fuzz-lib.h b/fuzz/fuzz-lib.h index 7182a50..950f455 100644 --- a/fuzz/fuzz-lib.h +++ b/fuzz/fuzz-lib.h @@ -1,10 +1,5 @@ -/* - * Cagebreak: A Wayland tiling compositor. - * - * Copyright (C) 2018-2020 Jente Hidskes - * - * See the LICENSE file accompanying this file. - */ +// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// SPDX -License-Identifier: MIT #ifndef CG_FUZZ_LIB_H #define CG_FUZZ_LIB_H diff --git a/fuzz/fuzz-parse.c b/fuzz/fuzz-parse.c index ebc6535..0fc060c 100644 --- a/fuzz/fuzz-parse.c +++ b/fuzz/fuzz-parse.c @@ -1,10 +1,5 @@ -/* - * Cagebreak: A Wayland tiling compositor. - * - * Copyright (C) 2018-2020 Jente Hidskes - * - * See the LICENSE file accompanying this file. - */ +// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// SPDX -License-Identifier: MIT #define _POSIX_C_SOURCE 200812L diff --git a/fuzz/meson.build b/fuzz/meson.build index b8448bc..01fdd3e 100644 --- a/fuzz/meson.build +++ b/fuzz/meson.build @@ -1,3 +1,6 @@ +# Copyright 2020 - 2023, project-repo and the cagebreak contributors +# SPDX -License-Identifier: MIT + fuzz_sources = [ 'fuzz-parse.c', 'fuzz-lib.c', diff --git a/idle_inhibit_v1.c b/idle_inhibit_v1.c index 8ebc768..9bc3f7a 100644 --- a/idle_inhibit_v1.c +++ b/idle_inhibit_v1.c @@ -1,11 +1,5 @@ -/* - * Cagebreak: A Wayland tiling compositor. - * - * Copyright (C) 2020-2022 The Cagebreak Authors - * Copyright (C) 2018-2019 Jente Hidskes - * - * See the LICENSE file accompanying this file. - */ +// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// SPDX -License-Identifier: MIT #include #include diff --git a/idle_inhibit_v1.h b/idle_inhibit_v1.h index cd1a58d..f0dce64 100644 --- a/idle_inhibit_v1.h +++ b/idle_inhibit_v1.h @@ -1,3 +1,5 @@ +// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// SPDX -License-Identifier: MIT #ifndef CG_IDLE_INHIBIT_H #define CG_IDLE_INHIBIT_H diff --git a/input.h b/input.h index 22db599..f7877c5 100644 --- a/input.h +++ b/input.h @@ -1,3 +1,6 @@ +// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// SPDX -License-Identifier: MIT + #ifndef _CG_INPUT_H #define _CG_INPUT_H diff --git a/input_manager.c b/input_manager.c index 0d927e0..29e4d1d 100644 --- a/input_manager.c +++ b/input_manager.c @@ -1,11 +1,5 @@ -/* - * Cagebreak: A Wayland tiling compositor. - * - * Copyright (C) 2020-2022 The Cagebreak Authors - * Copyright (C) 2018-2020 Jente Hidskes - * - * See the LICENSE file accompanying this file. - */ +// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// SPDX -License-Identifier: MIT #define _POSIX_C_SOURCE 200812L diff --git a/input_manager.h b/input_manager.h index 0dbbaad..1def1df 100644 --- a/input_manager.h +++ b/input_manager.h @@ -1,3 +1,6 @@ +// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// SPDX -License-Identifier: MIT + #ifndef CG_INPUT_MANAGER_H #define CG_INPUT_MANAGER_H diff --git a/ipc_server.c b/ipc_server.c index 825ddf2..c5295e7 100644 --- a/ipc_server.c +++ b/ipc_server.c @@ -1,11 +1,5 @@ -/* - * Cagebreak: A Wayland tiling compositor. - * - * Copyright (C) 2020-2022 The Cagebreak Authors - * Copyright (C) 2018-2020 Jente Hidskes - * - * See the LICENSE file accompanying this file. - */ +// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// SPDX -License-Identifier: MIT #define _POSIX_C_SOURCE 200112L #define _DEFAULT_SOURCE diff --git a/ipc_server.h b/ipc_server.h index 7fc9d60..2c66b83 100644 --- a/ipc_server.h +++ b/ipc_server.h @@ -1,3 +1,6 @@ +// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// SPDX -License-Identifier: MIT + #ifndef CG_IPC_SERVER_H #define CG_IPC_SERVER_H diff --git a/keybinding.c b/keybinding.c index b1b8085..0c96d4b 100644 --- a/keybinding.c +++ b/keybinding.c @@ -1,3 +1,6 @@ +// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// SPDX -License-Identifier: MIT + #define _POSIX_C_SOURCE 200809L #include diff --git a/keybinding.h b/keybinding.h index 3c632c3..872f12d 100644 --- a/keybinding.h +++ b/keybinding.h @@ -1,3 +1,6 @@ +// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// SPDX -License-Identifier: MIT + #ifndef KEYBINDING_H #define KEYBINDING_H diff --git a/libinput.c b/libinput.c index ffaaada..dcb9d1f 100644 --- a/libinput.c +++ b/libinput.c @@ -1,3 +1,6 @@ +// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// SPDX -License-Identifier: MIT + #include "input.h" #include "input_manager.h" #include "output.h" diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index 14d2e00..a93734f 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -423,7 +423,7 @@ GPG Fingerprints: # LICENSE -Copyright (c) 2020-2022 The Cagebreak authors +Copyright (c) 2020-2023 The Cagebreak authors Copyright (c) 2018-2020 Jente Hidskes diff --git a/man/cagebreak-socket.7.md b/man/cagebreak-socket.7.md index 3723308..5d83f0b 100644 --- a/man/cagebreak-socket.7.md +++ b/man/cagebreak-socket.7.md @@ -557,7 +557,7 @@ GPG Fingerprints: # LICENSE -Copyright (c) 2022 The Cagebreak authors +Copyright (c) 2022 - 2023 The Cagebreak authors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index 0537367..7feccc1 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -87,7 +87,7 @@ GPG Fingerprints: # LICENSE -Copyright (c) 2020-2022 The Cagebreak authors +Copyright (c) 2020-2023 The Cagebreak authors Copyright (c) 2018-2020 Jente Hidskes diff --git a/meson.build b/meson.build index a2c5f50..61c6af1 100644 --- a/meson.build +++ b/meson.build @@ -1,3 +1,5 @@ +# Copyright 2020 - 2023, project-repo and the cagebreak contributors +# SPDX -License-Identifier: MIT project( 'cagebreak', 'c', diff --git a/meson_options.txt b/meson_options.txt index b6dcb79..6d4a787 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,3 +1,5 @@ +# Copyright 2020 - 2023, project-repo and the cagebreak contributors +# SPDX -License-Identifier: MIT option('xwayland', type: 'boolean', value: 'false', description: 'Enable support for X11 applications') option('man-pages', type: 'boolean', value: 'false', description: 'Build man pages (requires pandoc)') option('fuzz', type: 'boolean', value: 'false', description: 'Enable building fuzzer targets') diff --git a/message.c b/message.c index 9441ae5..f0c2c64 100644 --- a/message.c +++ b/message.c @@ -1,3 +1,6 @@ +// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// SPDX -License-Identifier: MIT + #include #include #include diff --git a/message.h b/message.h index e672f5d..25bf692 100644 --- a/message.h +++ b/message.h @@ -1,3 +1,6 @@ +// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// SPDX -License-Identifier: MIT + #ifndef MESSAGE_H #define MESSAGE_H diff --git a/output.c b/output.c index b31a4eb..b36d724 100644 --- a/output.c +++ b/output.c @@ -1,12 +1,5 @@ -/* - * Cagebreak: A Wayland tiling compositor. - * - * Copyright (C) 2020-2022 The Cagebreak Authors - * Copyright (C) 2018-2020 Jente Hidskes - * Copyright (C) 2019 The Sway authors - * - * See the LICENSE file accompanying this file. - */ +// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// SPDX -License-Identifier: MIT #define _POSIX_C_SOURCE 200809L diff --git a/output.h b/output.h index 859c682..0a255df 100644 --- a/output.h +++ b/output.h @@ -1,3 +1,6 @@ +// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// SPDX -License-Identifier: MIT + #ifndef CG_OUTPUT_H #define CG_OUTPUT_H diff --git a/pango.c b/pango.c index e9d04d3..c513f97 100644 --- a/pango.c +++ b/pango.c @@ -1,3 +1,6 @@ +// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// SPDX -License-Identifier: MIT + #include #include #include diff --git a/pango.h b/pango.h index fed8371..30f2865 100644 --- a/pango.h +++ b/pango.h @@ -1,3 +1,6 @@ +// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// SPDX -License-Identifier: MIT + #ifndef _SWAY_PANGO_H #define _SWAY_PANGO_H #include diff --git a/parse.c b/parse.c index fd8e083..d250439 100644 --- a/parse.c +++ b/parse.c @@ -1,3 +1,6 @@ +// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// SPDX -License-Identifier: MIT + #define _POSIX_C_SOURCE 200812L #include diff --git a/parse.h b/parse.h index b1e6c59..4e38ea9 100644 --- a/parse.h +++ b/parse.h @@ -1,3 +1,6 @@ +// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// SPDX -License-Identifier: MIT + #ifndef PARSE_H #define PARSE_H diff --git a/seat.c b/seat.c index a1996c3..3ffd06b 100644 --- a/seat.c +++ b/seat.c @@ -1,11 +1,5 @@ -/* - * Cagebreak: A Wayland tiling compositor. - * - * Copyright (C) 2020-2022 The Cagebreak Authors - * Copyright (C) 2018-2020 Jente Hidskes - * - * See the LICENSE file accompanying this file. - */ +// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// SPDX -License-Identifier: MIT #define _POSIX_C_SOURCE 200812L diff --git a/seat.h b/seat.h index 8c11866..e44d808 100644 --- a/seat.h +++ b/seat.h @@ -1,3 +1,6 @@ +// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// SPDX -License-Identifier: MIT + #ifndef CG_SEAT_H #define CG_SEAT_H diff --git a/util.c b/util.c index 95e1ea4..455f306 100644 --- a/util.c +++ b/util.c @@ -1,11 +1,5 @@ -/* - * Cagebreak: A Wayland tiling compositor. - * - * Copyright (C) 2020-2022 The Cagebreak Authors - * Copyright (C) 2019 The Sway authors - * - * See the LICENSE file accompanying this file. - */ +// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// SPDX -License-Identifier: MIT #include diff --git a/util.h b/util.h index 01e403e..ef3f532 100644 --- a/util.h +++ b/util.h @@ -1,3 +1,6 @@ +// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// SPDX -License-Identifier: MIT + #ifndef CG_UTIL_H #define CG_UTIL_H diff --git a/view.c b/view.c index dee1ab8..74c31b8 100644 --- a/view.c +++ b/view.c @@ -1,11 +1,5 @@ -/* - * Cagebreak: A Wayland tiling compositor. - * - * Copyright (C) 2020-2022 The Cagebreak Authors - * Copyright (C) 2018-2020 Jente Hidskes - * - * See the LICENSE file accompanying this file. - */ +// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// SPDX -License-Identifier: MIT #define _POSIX_C_SOURCE 200809L diff --git a/view.h b/view.h index 6c56d70..99e3e65 100644 --- a/view.h +++ b/view.h @@ -1,3 +1,6 @@ +// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// SPDX -License-Identifier: MIT + #ifndef CG_VIEW_H #define CG_VIEW_H diff --git a/workspace.c b/workspace.c index d99d3a4..1caff0d 100644 --- a/workspace.c +++ b/workspace.c @@ -1,11 +1,5 @@ -/* - * Cagebreak: A Wayland tiling compositor. - * - * Copyright (C) 2020-2022 The Cagebreak Authors - * Copyright (C) 2018-2019 Jente Hidskes - * - * See the LICENSE file accompanying this file. - */ +// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// SPDX -License-Identifier: MIT #define _POSIX_C_SOURCE 200809L diff --git a/workspace.h b/workspace.h index 94cc989..e0f2473 100644 --- a/workspace.h +++ b/workspace.h @@ -1,3 +1,6 @@ +// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// SPDX -License-Identifier: MIT + #ifndef CG_WORKSPACE_H #define CG_WORKSPACE_H diff --git a/xdg_shell.c b/xdg_shell.c index 7662996..fc251c7 100644 --- a/xdg_shell.c +++ b/xdg_shell.c @@ -1,11 +1,5 @@ -/* - * Cagebreak: A Wayland tiling compositor. - * - * Copyright (C) 2020-2022 The Cagebreak Authors - * Copyright (C) 2018-2019 Jente Hidskes - * - * See the LICENSE file accompanying this file. - */ +// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// SPDX -License-Identifier: MIT #define _POSIX_C_SOURCE 200809L diff --git a/xdg_shell.h b/xdg_shell.h index cb92b5a..e066208 100644 --- a/xdg_shell.h +++ b/xdg_shell.h @@ -1,3 +1,6 @@ +// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// SPDX -License-Identifier: MIT + #ifndef CG_XDG_SHELL_H #define CG_XDG_SHELL_H diff --git a/xwayland.c b/xwayland.c index d6ea9f7..f601a0f 100644 --- a/xwayland.c +++ b/xwayland.c @@ -1,11 +1,6 @@ -/* - * Cagebreak: A Wayland tiling compositor. - * - * Copyright (C) 2020-2022 The Cagebreak Authors - * Copyright (C) 2018-2020 Jente Hidskes - * - * See the LICENSE file accompanying this file. - */ +// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// SPDX -License-Identifier: MIT + #include "config.h" #include diff --git a/xwayland.h b/xwayland.h index 71db92f..cde30c5 100644 --- a/xwayland.h +++ b/xwayland.h @@ -1,3 +1,6 @@ +// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// SPDX -License-Identifier: MIT + #ifndef CG_XWAYLAND_H #define CG_XWAYLAND_H From 89c92c516635b164993a971d2b072c91b28671f3 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 8 Jan 2023 16:59:07 +0100 Subject: [PATCH 558/689] Adjust socket documentation --- man/cagebreak-socket.7.md | 66 ++++++++++++++++++++++++++++----------- 1 file changed, 47 insertions(+), 19 deletions(-) diff --git a/man/cagebreak-socket.7.md b/man/cagebreak-socket.7.md index 5d83f0b..d73d420 100644 --- a/man/cagebreak-socket.7.md +++ b/man/cagebreak-socket.7.md @@ -54,12 +54,14 @@ cg-ipc{"event_name":"background","old_bg":[0.000000,1.000000,1.000000],"new_bg": - event_name: "close" - view_id: view id as an integer - tile_id: tile id as an integer + - view_pid: pid of the process - workspace: workspace number as an integer - output: name of the output as a string + - output_id: id of the output as an integer ``` close -cg-ipc{"event_name":"close","view_id":47,"tile_id":47,"workspace":1,"output":"eDP-1"} +cg-ipc{"event_name":"close","view_id":47,"view_pid":30456,"tile_id":47,"workspace":1,"output":"eDP-1","output_id":1} ``` *configure_input* @@ -88,10 +90,11 @@ cg-ipc{"event_name":"configure_message"} - JSON - event_name: "configure_output" - output: name of the output as a string + - output_id: id of the output as an integer ``` output eDP-1 rotate 0 -cg-ipc{"event_name":"configure_output","output":"eDP-1"} +cg-ipc{"event_name":"configure_output","output":"eDP-1","output_id":1} ``` *cursor_switch_tile* @@ -99,13 +102,15 @@ cg-ipc{"event_name":"configure_output","output":"eDP-1"} - JSON - event_name: "cursor_switch_tile" - old_output: name of the old output as a string + - old_output_id: old output id as an integer - old_tile: number of the old tile as an integer - new_output: name of the new output as a string + - new_output_id: new output id as an integer - new_tile: number of the new tile as an integer ``` # Cursor switches tile -cg-ipc{"event_name":"cursor_switch_tile","old_output":"eDP-1","old_tile":2,"new_output":"eDP-1","new_tile":3} +cg-ipc{"event_name":"cursor_switch_tile","old_output":"eDP-1","old_output_id":1,"old_tile":2,"new_output":"eDP-1","new_output_id":1,"new_tile":3} ``` *cycle_outputs* @@ -113,12 +118,14 @@ cg-ipc{"event_name":"cursor_switch_tile","old_output":"eDP-1","old_tile":2,"new_ - JSON - event_name: "cycle_outputs" - old_output: old output name as string + - old_output_id: old output id as an integer - new_output: new output name as string + - new_output_id: new output id as an integer - reverse: "0" if *nextscreen* or "1" if *prevscreen* ``` nextscreen -cg-ipc{"event_name":"cycle_outputs","old_output":"eDP-1","new_output":"HDMI-A-1","reverse":0} +cg-ipc{"event_name":"cycle_outputs","old_output":"eDP-1","old_output_id":1,"new_output":"HDMI-A-1","new_output_id":2,"reverse":0} ``` *cycle_views* @@ -126,14 +133,17 @@ cg-ipc{"event_name":"cycle_outputs","old_output":"eDP-1","new_output":"HDMI-A-1" - JSON - event_name: "cycle_views" - old_view_id: old view id as an integer + - old_view_pid: pid of old view - new_view_id: new view id as an interger + - new_view_pid: pid of new view - tile_id: tile id as an integer - workspace: workspace number as an integer - output: name of the output as a string + - output_id: id of the output as an integer ``` next -cg-ipc{"event_name":"cycle_views","old_view_id":11,"new_view_id":4,"tile_id":13,"workspace":1,"output":"eDP-1"} +cg-ipc{"event_name":"cycle_views","old_view_id":11,"old_view_pid":32223,"new_view_id":4,"old_view_pid";53221,"tile_id":13,"workspace":1,"output":"eDP-1","output_id":1} ``` *definekey* @@ -181,10 +191,11 @@ cg-ipc{"event_name":"definemode","mode":"foo"} - JSON - event_name: "destroy_output" - output: name of the output as a string + - output_id: id of the output as an integer ``` # remove output from the device -cg-ipc{"event_name":"destroy_output","output":"HDMI-A-1"} +cg-ipc{"event_name":"destroy_output","output":"HDMI-A-1","output_id":2} ``` *dump* @@ -325,10 +336,11 @@ cg-ipc{"event_name":"dump","nws":1, - new_tile_id: new tile id as an integer - workspace: workspace number as an integer - output: name of the output as a string + - output_id: id of the output as an integer ``` focus -cg-ipc{"event_name":"focus_tile","old_tile_id":14,"new_tile_id":13,"workspace":1,"output":"eDP-1"} +cg-ipc{"event_name":"focus_tile","old_tile_id":14,"new_tile_id":13,"workspace":1,"output":"eDP-1","output_id":1} ``` *fullscreen* @@ -338,10 +350,11 @@ cg-ipc{"event_name":"focus_tile","old_tile_id":14,"new_tile_id":13,"workspace":1 - tile_id: tile id as an integer - workspace: workspace number as an integer - output: output as a string + - output_id: id of the output as an integer ``` only -cg-ipc{"event_name":"fullscreen","tile_id":3,"workspace":1,"output":"eDP-1"} +cg-ipc{"event_name":"fullscreen","tile_id":3,"workspace":1,"output":"eDP-1","output_id":1} ``` *move_view_to_cycle_output* @@ -349,13 +362,16 @@ cg-ipc{"event_name":"fullscreen","tile_id":3,"workspace":1,"output":"eDP-1"} - JSON - event_name: "move_view_to_cycle_output" - view_id: view id as an integer + - view_pid: pid of the process - old_output: name of the old output as a string + - old_output_id: old output id as an integer - new_output: name of the new output as a string + - old_output_id: old output id as an integer ``` movetonextscreen cg-ipc{"event_name":"cycle_outputs","old_output":"eDP-1","new_output":"HDMI-A-1","reverse":0} -cg-ipc{"event_name":"move_view_to_cycle_output","view_id":11,"old_output":"eDP-1","new_output":"HDMI-A-1"} +cg-ipc{"event_name":"move_view_to_cycle_output","view_id":11,"view_pid":43123,"old_output":"eDP-1","old_output_id":1,"new_output":"HDMI-A-1","new_output_id":2} ``` *move_view_to_output* @@ -380,12 +396,13 @@ cg-ipc{"event_name":"move_view_to_output","view_id":78,"old_output":"eDP-1","new - old_workspace: old workspace number as an integer - new_workspace: new workspace number as an integer - output: name of the output as a string + - output_id: id of the output as an integer - view_pid: pid of the process ``` movetoworkspace 1 cg-ipc{"event_name":"switch_ws","old_workspace":1,"new_workspace":1,"output":"eDP-1"} -cg-ipc{"event_name":"move_view_to_ws","view_id":43,"old_workspace":0,"new_workspace":0,"output":"eDP-1","view_pid":64908} +cg-ipc{"event_name":"move_view_to_ws","view_id":43,"old_workspace":0,"new_workspace":0,"output":"eDP-1","output_id":1,"view_pid":64908} ``` *new_output* @@ -393,11 +410,12 @@ cg-ipc{"event_name":"move_view_to_ws","view_id":43,"old_workspace":0,"new_worksp - JSON - event_name: "new_output" - output: new output name as a string + - output_id: id of the new output as an integer - priority: priority as per *output* prio in *cagebreak-config(5)* or default ``` # a new output is attached -cg-ipc{"event_name":"new_output","output":"HDMI-A-1","priority":-1} +cg-ipc{"event_name":"new_output","output":"HDMI-A-1","output_id":2,"priority":-1} ``` *resize_tile* @@ -409,11 +427,12 @@ cg-ipc{"event_name":"new_output","output":"HDMI-A-1","priority":-1} - new_dims: list of coordinate [x coordinate of lower left corner, y coordinate of lower left corner, x coordinate of upper right corner, y coordinate of upper right corner] - workspace: workspace number as an integer - output: name of the output as a string + - output_id: id of the output as an integer ``` resizeleft -cg-ipc{"event_name":"resize_tile","tile_id":14,"old_dims":"[1280,0,1440,1280]","new_dims":"[1270,0,1440,1290]","workspace":1,"output":"eDP-1"} -cg-ipc{"event_name":"resize_tile","tile_id":13,"old_dims":"[0,0,1440,1280]","new_dims":"[0,0,1440,1270]","workspace":1,"output":"eDP-1"} +cg-ipc{"event_name":"resize_tile","tile_id":14,"old_dims":"[1280,0,1440,1280]","new_dims":"[1270,0,1440,1290]","workspace":1,"output":"eDP-1","output_id":1} +cg-ipc{"event_name":"resize_tile","tile_id":13,"old_dims":"[0,0,1440,1280]","new_dims":"[0,0,1440,1270]","workspace":1,"output":"eDP-1","output_id":1} ``` *set_nws* @@ -436,11 +455,12 @@ cg-ipc{"event_name":"set_nws","old_nws":1,"new_nws":2} - new_tile_id: new tile id as an integer - workspace: workspace number as an integer - output: output as a string + - output_id: id of the output as an integer - vertical: 0 if horizontal split, 1 if not ``` hsplit -cg-ipc{"event_name":"split","tile_id":11,"new_tile_id":12,"workspace":1,"output":"eDP-1","vertical":0} +cg-ipc{"event_name":"split","tile_id":11,"new_tile_id":12,"workspace":1,"output":"eDP-1","output_id":1,"vertical":0} ``` *swap_tile* @@ -448,13 +468,16 @@ cg-ipc{"event_name":"split","tile_id":11,"new_tile_id":12,"workspace":1,"output" - JSON - event_name: "swap_tile" - tile_id: previous tile id as an integer + - tile_pid: pid of previous tile - swap_tile_id: swap tile id as an integer + - swap_tile_pid: pid of swap tile - workspace: workspace number as an integer - output: name of the output as a string + - output_id: id of the output as an integer ``` exchangeright -cg-ipc{"event_name":"swap_tile","tile_id":1,"swap_tile_id":3,"workspace":1,"output":"eDP-1"} +cg-ipc{"event_name":"swap_tile","tile_id":1,"tile_pid":53478,"swap_tile_id":3,"swap_tile_pid":98234,"workspace":1,"output":"eDP-1"} ``` *switch_default_mode* @@ -474,11 +497,13 @@ switch_output - JSON - event_name: "switch_output" - old_output: name of the old output as a string + - old_output_id: old output id as an integer - new_output: name of the new output as a string + - new_output_id: new output id as an integer ``` screen 2 -cg-ipc{"event_name":"switch_output","old_output":"eDP-1","new_output":"HDMI-A-1"} +cg-ipc{"event_name":"switch_output","old_output":"eDP-1","old_output_id":1,"new_output":"HDMI-A-1","new_output_id":2} ``` switch_ws @@ -488,10 +513,11 @@ switch_ws - old_workspace: old workspace number as an integer - new_workspace: new workspace number as an integer - output: name of the output as a string + - output_id: id of the output as an integer ``` workspace 2 -cg-ipc{"event_name":"switch_ws","old_workspace":1,"new_workspace":2,"output":"eDP-1"} +cg-ipc{"event_name":"switch_ws","old_workspace":1,"new_workspace":2,"output":"eDP-1","output_id":1} ``` *view_map* @@ -502,11 +528,12 @@ cg-ipc{"event_name":"switch_ws","old_workspace":1,"new_workspace":2,"output":"eD - tile_id: tile id as an integer - workspace: workspace number as an integer - output: name of the output as a string + - output_id: id of the output as an integer - view_pid: pid of the process ``` # process opens a view -cg-ipc{"event_name":"view_map","view_id":28,"tile_id":14,"workspace":1,"output":"eDP-1","view_pid":39827} +cg-ipc{"event_name":"view_map","view_id":28,"tile_id":14,"workspace":1,"output":"eDP-1","output_id":1,"view_pid":39827} ``` *view_unmap* @@ -517,11 +544,12 @@ cg-ipc{"event_name":"view_map","view_id":28,"tile_id":14,"workspace":1,"output": - tile_id: tile id as an integer - workspace: workspace number as an integer - output: name of the output as a string + - output_id: id of the output as an integer - view_pid: pid of the process ``` # view is closed by the process -cg-ipc{"event_name":"view_unmap","view_id":24,"tile_id":13,"workspace":1,"output":"eDP-1","view_pid":39544} +cg-ipc{"event_name":"view_unmap","view_id":24,"tile_id":13,"workspace":1,"output":"eDP-1","output_id":1,"view_pid":39544} ``` ## SECURITY From 65b237536a8adaeba9b6d8628dfb7d0b5ac18d53 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 8 Jan 2023 17:22:07 +0100 Subject: [PATCH 559/689] Set man page release time --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 61c6af1..9d2913f 100644 --- a/meson.build +++ b/meson.build @@ -258,7 +258,7 @@ install_data('examples/config', install_dir : '/etc/xdg/cagebreak') if get_option('man-pages') scdoc = find_program('scdoc') - secssinceepoch = 1664566469 + secssinceepoch = 1673193959 shcommand = 'export SOURCE_DATE_EPOCH=' + secssinceepoch.to_string() + ' ; @0@ < @INPUT@'.format(scdoc.path()) sh = find_program('sh') mandir1 = join_paths(get_option('mandir'), 'man1') From 87e50fc63e2ab1d28938f41e6a17151af8c9a8d9 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 8 Jan 2023 17:22:20 +0100 Subject: [PATCH 560/689] Fix man page indentation --- man/cagebreak-socket.7.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/man/cagebreak-socket.7.md b/man/cagebreak-socket.7.md index d73d420..d21ce84 100644 --- a/man/cagebreak-socket.7.md +++ b/man/cagebreak-socket.7.md @@ -102,10 +102,10 @@ cg-ipc{"event_name":"configure_output","output":"eDP-1","output_id":1} - JSON - event_name: "cursor_switch_tile" - old_output: name of the old output as a string - - old_output_id: old output id as an integer + - old_output_id: old output id as an integer - old_tile: number of the old tile as an integer - new_output: name of the new output as a string - - new_output_id: new output id as an integer + - new_output_id: new output id as an integer - new_tile: number of the new tile as an integer ``` @@ -118,9 +118,9 @@ cg-ipc{"event_name":"cursor_switch_tile","old_output":"eDP-1","old_output_id":1, - JSON - event_name: "cycle_outputs" - old_output: old output name as string - - old_output_id: old output id as an integer + - old_output_id: old output id as an integer - new_output: new output name as string - - new_output_id: new output id as an integer + - new_output_id: new output id as an integer - reverse: "0" if *nextscreen* or "1" if *prevscreen* ``` @@ -133,13 +133,13 @@ cg-ipc{"event_name":"cycle_outputs","old_output":"eDP-1","old_output_id":1,"new_ - JSON - event_name: "cycle_views" - old_view_id: old view id as an integer - - old_view_pid: pid of old view + - old_view_pid: pid of old view - new_view_id: new view id as an interger - - new_view_pid: pid of new view + - new_view_pid: pid of new view - tile_id: tile id as an integer - workspace: workspace number as an integer - output: name of the output as a string - - output_id: id of the output as an integer + - output_id: id of the output as an integer ``` next @@ -191,7 +191,7 @@ cg-ipc{"event_name":"definemode","mode":"foo"} - JSON - event_name: "destroy_output" - output: name of the output as a string - - output_id: id of the output as an integer + - output_id: id of the output as an integer ``` # remove output from the device From 1990b203af7798228eef035ea45185e5ef35c4d8 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 8 Jan 2023 17:22:38 +0100 Subject: [PATCH 561/689] Add Changelog --- Changelog.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/Changelog.md b/Changelog.md index ff24285..2168673 100644 --- a/Changelog.md +++ b/Changelog.md @@ -64,3 +64,46 @@ Adds libinput configuration and virtual keyboard and pointer support. - Add new cagebreak email contact gpg key - Add new project-repo AUR gpg key (relevant for cagebreak-pkgbuild) +## Release 2.0.0 + +This is a major release and includes BREAKING changes! + +Breaking Changes: + * More intuitive switch of focus, next, prev and exchange (#20, 40 in Bugs.md) + Cagebreak will probably still feel broadly the same though. + * Remove -r flag - This is replaced by output configuration. + * Socket disabled by default - The socket is enabled by invoking Cagebreak with the -e flag. + * Socket permissions restricted to the user of the Cagebreak process (700) + This may require modification of scripts interacting with the socket with + different UIDs than the UID of the Cagebreak process. + * Rename "Current frame" indicator to "Current tile" + +Changelog: + * Move to wlr_scene + * Add events displaying change over the socket + * this enables scripting tools + * Add test suite based on socket information + * Add support for scaling outputs (thanks to Oliver Friedmann) + * Remove -r flag + * Add rotation to output configuration + * Add cursor enable|disable flag + * Add input keyboard configuration + * Custom path flag for configuration file + * Restrict socket permissions to the user running cagebreak (700) + * Fix Issue #31 (resolve some terminology) 38 in Bugs.md + * Fix Issue #30 - 39 in Bugs.md + * Fix Issue #20 - 40 in Bugs.md + * Fix Issue #12 - 41 in Bugs.md (dump + events over socket) + * Fix Bugs found via scan-build static analysis (42 - 45 in Bugs.md) + * Fix Issue #33 - 46 in Bugs.md + * Fix Issue #32 - 47 in Bugs.md + * Fix Issue #16 - 48 in Bugs.md + * Fix Issue #3 - 49 in Bugs.md (disabling keybinding interpretation for specific keyboards is now possible) + * Fix Issue #26 - 50 in Bugs.md + * Fix Issue #7 - 51 in Bugs.md (Change cursor to square while Cagebreak is waiting for a key) + * Fix config bug for some commands - 52 in Bugs.md + * Fix Issue #35 - 53 in Bugs.md (update to wlroots 0.16.1) + * Improve FAQ.md (related to some Issues) + * Disable outputs when unable to set any mode (crashed previously) + * Add Code of Conduct + * Print version number on startup From 1796c38b03ec3d8f27301bfd2edabe1f24e080b3 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 8 Jan 2023 18:10:18 +0100 Subject: [PATCH 562/689] Add link to Bugs.md --- Bugs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bugs.md b/Bugs.md index 1aeb7df..25eeeca 100644 --- a/Bugs.md +++ b/Bugs.md @@ -881,7 +881,7 @@ dump functionality which would enable almost arbitrary scripting. Related Material: - [cagebreak-config man page](man/cagebreak-config.md) - [cagebreak-socket man page](man/cagebreak-socket.md) -- scripting examples TODO +- [scripting examples](https://github.com/project-repo/cagebreak/tree/development/example_scripts) The github issue discussion is partially reproduced below: From b9dd21c0b44fa0dbb47ed7766623051a1ed3e248 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 8 Jan 2023 21:30:38 +0100 Subject: [PATCH 563/689] Review README --- README.md | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 5375410..1dba0b5 100644 --- a/README.md +++ b/README.md @@ -144,11 +144,11 @@ from. #### Usage Philosophy -Cagebreak is built to suit the needs of its creators. This section outlines -how we intended some parts of cagebreak and might ease the learning curve a +Cagebreak was originally built to suit the needs of its creators. This section outlines +how we intended some parts of cagebreak and might ease learning how to use cagebreak a little bit. Please note that this does not replace the man pages or the FAQ. -Also, cagebreak is a few bits that modify some other bits and pixels, -if it works for you in some different way that's ok too. +Also, this is in no way intended as a guide on how cagebreak must be used but rather +as a source of inspiration and of explanations for why certain particularities. 1. Cagebreak is keyboard-based. Everything regarding cagebreak can be done through the keyboard and it is our view that it should be. This does not mean @@ -156,13 +156,13 @@ if it works for you in some different way that's ok too. that do require them. 2. Cagebreak is a tiling compositor. Every view takes up as much screen space - as possible. We believe this is useful as only very few programs are typically + as possible. We believe this is useful, as only very few programs are typically necessary to complete a task. To manage multiple tasks concurrently, we use workspaces. 3. Each task deserves its own workspace. Any given task (the sort of thing you might find in your calendar or on your todo list) probably requires very few - views and ideally those take up as much of the screen as possible. + views and ideally, these take up as much of the screen as possible. > Combining 2. and 3. might look like this in practice: @@ -180,10 +180,11 @@ if it works for you in some different way that's ok too. > * open chat application > Now each task has its own workspace and switching between tasks is possible -> by switching between workspaces. +> by switching between workspaces. -> Note that using the socket more advanced setups are possible. But the user -> is warned that excessive tweaking eats into the work to be done. +> Note that, for example by using the socket, more advanced setups are +> possible. But the user is warned that excessive tweaking eats into the work +> to be done. 4. Use keybindings and terminal emulators for the right purpose. Given the philosophy outlined above you probably launch the same few programs very @@ -194,11 +195,11 @@ if it works for you in some different way that's ok too. variables and file paths anyway. > In practice this means thinking about the applications and cagebreak commands -> you use and take your keyboard layout into account when defining keybindings for +> you use and taking your keyboard layout into account when defining keybindings for > your individual needs. -5. Cagebreak can't do everything but with scripting you can do most things. - Through the socket and with a bit of scripting you can use the internal state +5. Cagebreak can't do everything, but with scripting you can do most things. + Through the socket and with a bit of scripting, you can use the internal state of cagebreak in combination with cagebreak commands and the full power of a scripting language of your choice to do almost whatever you want. @@ -209,10 +210,10 @@ if it works for you in some different way that's ok too. * Read this document. * Just [open an issue](https://github.com/project-repo/cagebreak/issues/new) and state your feature request. We will consider the proposal and get back to you. - * Don't open a pull request. We might not accept your code and - it would be sad to waste the effort. + * Don't open a pull request without asking first. We might not accept your + code and it would be sad to waste the effort. * Respect the [Code of Conduct](CODE_OF_CONDUCT.md) (To date, we never - had to intervene - Keep it that way!) + had to intervene - Please keep it that way!) ### Good First Contributions From 66ef231d582f487c08dac8854dc44a2fb2f4ef03 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 8 Jan 2023 21:40:18 +0100 Subject: [PATCH 564/689] Remove useless note --- seat.c | 1 - 1 file changed, 1 deletion(-) diff --git a/seat.c b/seat.c index 3ffd06b..a3e09a0 100644 --- a/seat.c +++ b/seat.c @@ -837,7 +837,6 @@ handle_request_start_drag(struct wl_listener *listener, void *data) { return; } - // TODO: tablet grabs wlr_log(WLR_DEBUG, "Ignoring start_drag request: " "could not validate pointer/touch serial %" PRIu32, From 7abfd5b0b3f7e53b1839e5d55383670cb327d247 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 8 Jan 2023 21:40:53 +0100 Subject: [PATCH 565/689] Rename old signatures --- ...reak-config.5.sig => 1.9.1-cagebreak-config.sig} | Bin .../{cagebreak.1.sig => 1.9.1-cagebreak.1.sig} | Bin signatures/{cagebreak.sig => 1.9.1-cagebreak.sig} | Bin 3 files changed, 0 insertions(+), 0 deletions(-) rename signatures/{cagebreak-config.5.sig => 1.9.1-cagebreak-config.sig} (100%) rename signatures/{cagebreak.1.sig => 1.9.1-cagebreak.1.sig} (100%) rename signatures/{cagebreak.sig => 1.9.1-cagebreak.sig} (100%) diff --git a/signatures/cagebreak-config.5.sig b/signatures/1.9.1-cagebreak-config.sig similarity index 100% rename from signatures/cagebreak-config.5.sig rename to signatures/1.9.1-cagebreak-config.sig diff --git a/signatures/cagebreak.1.sig b/signatures/1.9.1-cagebreak.1.sig similarity index 100% rename from signatures/cagebreak.1.sig rename to signatures/1.9.1-cagebreak.1.sig diff --git a/signatures/cagebreak.sig b/signatures/1.9.1-cagebreak.sig similarity index 100% rename from signatures/cagebreak.sig rename to signatures/1.9.1-cagebreak.sig From 3d9f8d596f9cbffec988f1000e8e40896d4369ca Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 8 Jan 2023 22:07:39 +0100 Subject: [PATCH 566/689] Add release information --- Changelog.md | 1 - Hashes.md | 16 ++++++++-------- signatures/cagebreak-config.5.sig | Bin 0 -> 566 bytes signatures/cagebreak-socket.7.sig | Bin 0 -> 566 bytes signatures/cagebreak.1.sig | Bin 0 -> 566 bytes signatures/cagebreak.sig | Bin 0 -> 566 bytes 6 files changed, 8 insertions(+), 9 deletions(-) create mode 100644 signatures/cagebreak-config.5.sig create mode 100644 signatures/cagebreak-socket.7.sig create mode 100644 signatures/cagebreak.1.sig create mode 100644 signatures/cagebreak.sig diff --git a/Changelog.md b/Changelog.md index 2168673..e469a6c 100644 --- a/Changelog.md +++ b/Changelog.md @@ -82,7 +82,6 @@ Changelog: * Move to wlr_scene * Add events displaying change over the socket * this enables scripting tools - * Add test suite based on socket information * Add support for scaling outputs (thanks to Oliver Friedmann) * Remove -r flag * Add rotation to output configuration diff --git a/Hashes.md b/Hashes.md index 2c75bc0..627d428 100644 --- a/Hashes.md +++ b/Hashes.md @@ -2,23 +2,23 @@ 2.0.0 cagebreak - * sha 256: TODO - * sha 512: TODO + * sha 256: 45f88abdae03bbc7dad5734dd6fb1a00e1bf37d3e0c4016dad2fa3de832335cf + * sha 512: dc261a788ea1843e701f4fb6985200c4813113fda0f911bee4e3cc9b20fd082055e40e9fc60647128674a94ece75f4aa55d1faede8e94e6e1940b02d8a6de8e0 2.0.0 cagebreak.1 - * sha 256: TODO - * sha 512: TODO + * sha 256: 0d96947c2054fb42b284b31cc4ea793944a4562509f5f00b7927d11d0046041d + * sha 512: 4f3eadc88680d994f9ebcf85be38626b7e95971bc3233d710613cee58496553e0bb1e65258956f8a50c633bdd4dbc5c0283826fd5b661e9de0092366cc47caae 2.0.0 cagebreak-config.5 - * sha 256: TODO - * sha 512: TODO + * sha 256: 4ee6ed443ce93cd6af3df49fe5e32244baeca04ca167993fb3d71970bf20939d + * sha 512: d6bf8f73ed8c9084b784653e88e1f149fbab35997f412f6c505972d3299a47bec1238aecd4334dd597bb32e46ced93f36d488badd25c6a8d61bdb73f3aea87ab 2.0.0 cagebreak-socket.7 - * sha 256: TODO - * sha 512: TODO + * sha 256: 682b3cc46ad059147b7d7ab814ac1831689511e31c0d6f2b91732e85244da99e + * sha 512: 92057e4cbbcec4f4dbd98f3a99cb4c450ef31aef557705e5f8f2927b53653149b232771b455f9b9ae8435a7351667a4e663b7d120b76a0bbb5c7ba04db551489 1.9.1 cagebreak diff --git a/signatures/cagebreak-config.5.sig b/signatures/cagebreak-config.5.sig new file mode 100644 index 0000000000000000000000000000000000000000..0e839de1d6a4029c6b1906c9b74962341d1add5f GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j+_E$ufVhrCX*AwCnJ$3ujQV~JG-0%N-{RR9VJ5TM6H zgoft}d; zziNM$mHaAa9)z0kM}k45Z8dji9bL_riL4a>UFDl@2~vN)41xxj>0Wkv89j=;{oGKX z^A~tQ>S74ILHP>WV@`i(UJnzI_6ghUGvSviq^gF9-;B}ZwsE4*kBy9-<)XZK{!@-* z&hgGuZ9r%P+u`LAa@MFpzhROnVSl9{sv$bv!}2h11Wu|i%@`|^jQk!tgq0|XF EQh$jSv;Y7A literal 0 HcmV?d00001 diff --git a/signatures/cagebreak-socket.7.sig b/signatures/cagebreak-socket.7.sig new file mode 100644 index 0000000000000000000000000000000000000000..6c5048b79c2991fa9f1d0e86234926ebacf415f9 GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j+_E$ufVhrCX*AwCnJ$3ujQV~JG-0%N-{SpW(N5TM6H zgo@`h?n#LyK;!8^ONVafw0hZ759^be#Y5vvgbS%8( zr6n3>4_q-c_!#_23y|DeU*kv5#txLZxT816ne-fd-!;@V;T)X~gqMQ{iX%R67+OZ_ zI`x>h8*Sip|C8?buduzg8~y&`13b(lX32~JcTXu(TM$EK5w8pCL~ymwj?-6S)3yQ^ zB*#VzH%Kmu$?vl9b~bh7$E4ik!qrRt$Ed4TMQN}|OR6HW?UYr*g7DUnhJMgBw;nM* z1>Y0>*+l8s3*`{~IuLZXCSx|G<46>Ui8}k4@w0lPHpzL@@HTt9xFCK2;ANwxC`qm- zWjihvK~{&;PJ11k>O7vH*!jup2amsEe-67?M@iEJ1yQ=4ZQ%9d->9I;7X~(e5o?4y zPz7~!Orl)9PT|fOh`DE5V3_3~g3U@K`&jwfN_lbvSoDS4|7>tfbJbo97H7iFZAB`% z5U31S9^%K6x>%xCS((x^bfuuSTMjPZOQ+J!`*!ce7GUO z?As)9nZcoKyA>hlqBPC+$qBrL$?4S7HT$MGCAy3F?Ir8Z6hS>oQjwU<$y--2)xBBg zfKT`j8tN|YtvSI(xo}IO?>#DuJbdcngI4H~7WO^9Fd2xhI`RoId;=@YV5|dvbu@V1 EVY~ho;{X5v literal 0 HcmV?d00001 diff --git a/signatures/cagebreak.1.sig b/signatures/cagebreak.1.sig new file mode 100644 index 0000000000000000000000000000000000000000..3dfee2837dfb06f16aeb167a6ad00914d94a8ed8 GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j+_E$ufVhrCX*AwCnJ$3ujQV~JG-0%N-{Pyh-E5TM6H zgo-W2!BHfPS^Gi=& z#hxq3RE#DT_XU3Sr|Czh@wMVJO0qKWy9dkq16QF=9rR-O0 zit<#6*?r0L>G%Xc> z%-+Z&xLZP9MEe#bN&|k<{0yaInV#E_xJy*4(5-U|h2tIvr9v5WPn?;|ZXM792R5`d zZ7?G}sUF_$$_eJc-&#VR5Q1@;0R`LVvXiLInzcu6I|j2= z8{Q@LjBpjyT-evrjEX-YJ;5fHH^C*Xm_9;^pJyxoON+B&p7in$HPpq&+Rdr!IMZUv zD;VMLXTOERHdZ6NDW+<~|7$l}du?(0kOkjV4F{mD-tn!LcGd!(Ob7l>d$9NggHZ}3 zILXX`N{g=8+J_HN1azWvA-$!xv$D{&1B>8w&=EFhN{rQJkkbCb1D<9<&C%L+zzfq0 EXp65H@&Et; literal 0 HcmV?d00001 diff --git a/signatures/cagebreak.sig b/signatures/cagebreak.sig new file mode 100644 index 0000000000000000000000000000000000000000..93517d0a5f58e4bcf66f09efccfcb8761670e9f0 GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j+_E$ufVhrCX*AwCnJ$3ujQV~JG-0%N-{OaKZA5TM6H zgo~=l{n)7QRnbU#$jeo7v*QE0H zNx?bqB`M~SowqBA>1{{Hat|LCP@pbGzpQ_pnZJCS<_CgpKC>*E$Z2K6mZ@nDbTmy9 zHic)f>9}PZT4OI$Cp=J_8zs2f1XR0tFZ`A(%{iF-=EhI44#(?5=#8%v3pE|6<;6wx zH84@?CzI9M^K_<&h>`e2c~=f{ljMum&}Ul6qgaL?iCV+tIv#Xtfq2Q>B3G9EC^)n{ z>yx6ahB%H|=skK6Yjyb&Kq$nr-{b+xY=cKV$th1ir4hb6?9Lf6k3y(_%5azjqq~Uc zP2f;<^+*2)PIG+ZO)Wo>H+A)SD85>gw_hk(P4oeW@SZjvNW-0{+~+(hZ~pNcuxxAVv_{@@5*G>mKizHnNPkZ1k(y2*Zkc E89-GH$N&HU literal 0 HcmV?d00001 From 9ad7c921d6c70eadb9aadc31828354b1e35d9f9f Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Mon, 9 Jan 2023 16:20:24 +0000 Subject: [PATCH 567/689] Unbreak build on FreeBSD (#37) * Disable POSIX compliance when using reallocarray cagebreak.c:197:11: warning: implicit declaration of function 'reallocarray' is invalid in C99 [-Wimplicit-function-declaration] line = reallocarray(line, line_length, sizeof(char)); ^ cagebreak.c:197:9: warning: incompatible integer to pointer conversion assigning to 'char *' from 'int' [-Wint-conversion] line = reallocarray(line, line_length, sizeof(char)); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ipc_server.c:248:25: warning: implicit declaration of function 'reallocarray' is invalid in C99 [-Wimplicit-function-declaration] client->read_buffer = reallocarray(client->read_buffer, ^ ipc_server.c:248:23: warning: incompatible integer to pointer conversion assigning to 'char *' from 'int' [-Wint-conversion] client->read_buffer = reallocarray(client->read_buffer, ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Promote -Wimplicit-function-declaration to -Werror To help find bugs caused by _POSIX_C_SOURCE. Already errors in C++ and C23. * Fix -Wstrict-prototypes, default in Clang >= 15 In file included from output.c:30: keybinding.h:136:21: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] keybinding_list_init(); ^ void output.c:335:20: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] empty_output_config() { ^ void In file included from seat.c:29: input_manager.h:19:40: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] input_manager_create_empty_input_config(); ^ void input_manager.c:92:40: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] input_manager_create_empty_input_config() { ^ void keybinding.c:129:21: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] keybinding_list_init() { ^ void See also https://github.com/llvm/llvm-project/commit/11da1b53d8c https://discourse.llvm.org/t/rfc-enabling-wstrict-prototypes-by-default-in-c/60521 --- cagebreak.c | 1 - input_manager.c | 2 +- input_manager.h | 2 +- ipc_server.c | 1 - keybinding.c | 2 +- keybinding.h | 2 +- meson.build | 1 + output.c | 2 +- 8 files changed, 6 insertions(+), 7 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index 0c5c247..28e363f 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -1,7 +1,6 @@ // Copyright 2020 - 2023, project-repo and the cagebreak contributors // SPDX -License-Identifier: MIT -#define _POSIX_C_SOURCE 200812L #define _DEFAULT_SOURCE #include "config.h" diff --git a/input_manager.c b/input_manager.c index 29e4d1d..83cb966 100644 --- a/input_manager.c +++ b/input_manager.c @@ -89,7 +89,7 @@ input_manager_handle_device_destroy(struct wl_listener *listener, void *data) { } struct cg_input_config * -input_manager_create_empty_input_config() { +input_manager_create_empty_input_config(void) { struct cg_input_config *cfg = calloc(1, sizeof(struct cg_input_config)); if(cfg == NULL) { return NULL; diff --git a/input_manager.h b/input_manager.h index 1def1df..86dcf2e 100644 --- a/input_manager.h +++ b/input_manager.h @@ -16,7 +16,7 @@ input_manager_handle_device_destroy(struct wl_listener *listener, void *data); uint32_t input_manager_get_mouse_button(const char *name, char **error); struct cg_input_config * -input_manager_create_empty_input_config(); +input_manager_create_empty_input_config(void); struct cg_input_config * input_manager_merge_input_configs(struct cg_input_config *cfg1, struct cg_input_config *cfg2); diff --git a/ipc_server.c b/ipc_server.c index c5295e7..c28979d 100644 --- a/ipc_server.c +++ b/ipc_server.c @@ -1,7 +1,6 @@ // Copyright 2020 - 2023, project-repo and the cagebreak contributors // SPDX -License-Identifier: MIT -#define _POSIX_C_SOURCE 200112L #define _DEFAULT_SOURCE #include "ipc_server.h" diff --git a/keybinding.c b/keybinding.c index 0c96d4b..c2f29bb 100644 --- a/keybinding.c +++ b/keybinding.c @@ -126,7 +126,7 @@ keybinding_list_push(struct keybinding_list *list, } struct keybinding_list * -keybinding_list_init() { +keybinding_list_init(void) { struct keybinding_list *list = malloc(sizeof(struct keybinding_list)); list->keybindings = malloc(sizeof(struct keybinding *)); list->capacity = 1; diff --git a/keybinding.h b/keybinding.h index 872f12d..c11de23 100644 --- a/keybinding.h +++ b/keybinding.h @@ -133,7 +133,7 @@ struct keybinding ** find_keybinding(const struct keybinding_list *list, const struct keybinding *keybinding); struct keybinding_list * -keybinding_list_init(); +keybinding_list_init(void); int run_action(enum keybinding_action action, struct cg_server *server, diff --git a/meson.build b/meson.build index 9d2913f..81d9b0f 100644 --- a/meson.build +++ b/meson.build @@ -11,6 +11,7 @@ default_options : ['c_std=c11', 'warning_level=3'] add_project_arguments( [ '-DWLR_USE_UNSTABLE', + '-Werror=implicit-function-declaration', '-Wundef', '-Wno-unused-parameter', ], diff --git a/output.c b/output.c index b36d724..a75f532 100644 --- a/output.c +++ b/output.c @@ -332,7 +332,7 @@ output_apply_config(struct cg_server *server, struct cg_output *output, } struct cg_output_config * -empty_output_config() { +empty_output_config(void) { struct cg_output_config *cfg = calloc(1, sizeof(struct cg_output_config)); if(cfg == NULL) { wlr_log(WLR_ERROR, "Could not allocate output configuration."); From b291f59d543a934f005ddd25e94b3e2d58d0b20b Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 9 Jan 2023 17:34:44 +0100 Subject: [PATCH 568/689] Add Issue 54 (#36) --- Bugs.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Bugs.md b/Bugs.md index 25eeeca..c1792c4 100644 --- a/Bugs.md +++ b/Bugs.md @@ -1110,3 +1110,13 @@ Under these circumstances Cagebreak did not quit right after startup. * Fixed: 2.0.0 Cagebreak did not build with wlroots 0.16.1 and this was adjusted. + +## Issue 54 + + * github issue numer: #36 + * Fixed: 2.0.1 + +Cagebreak was not compatible with clang 15 and POSIX which was causing issues +with building under FreeBSD. + +Thanks to Jan Beich for pointing this out and providing a PR. From a5749888e0cbd51c2a341e2cea1641956b8d0948 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 9 Jan 2023 17:45:31 +0100 Subject: [PATCH 569/689] Adjust versions for release 2.0.1 --- README.md | 2 +- man/cagebreak-config.5.md | 2 +- man/cagebreak-socket.7.md | 2 +- man/cagebreak.1.md | 2 +- meson.build | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 1dba0b5..4c284b0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Cagebreak: A Wayland Tiling Compositor -[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/6532/badge)](https://bestpractices.coreinfrastructure.org/projects/6532) [![Packaging status](https://repology.org/badge/tiny-repos/cagebreak.svg)](https://repology.org/project/cagebreak/versions) [![AUR package](https://repology.org/badge/version-for-repo/aur/cagebreak.svg?minversion=2.0.0)](https://repology.org/project/cagebreak/versions) +[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/6532/badge)](https://bestpractices.coreinfrastructure.org/projects/6532) [![Packaging status](https://repology.org/badge/tiny-repos/cagebreak.svg)](https://repology.org/project/cagebreak/versions) [![AUR package](https://repology.org/badge/version-for-repo/aur/cagebreak.svg?minversion=2.0.1)](https://repology.org/project/cagebreak/versions) ## Quick Introduction diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index a93734f..9fa63e3 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -1,4 +1,4 @@ -cagebreak-config(5) "Version 2.0.0" "Cagebreak Manual" +cagebreak-config(5) "Version 2.0.1" "Cagebreak Manual" # NAME diff --git a/man/cagebreak-socket.7.md b/man/cagebreak-socket.7.md index d21ce84..66dd156 100644 --- a/man/cagebreak-socket.7.md +++ b/man/cagebreak-socket.7.md @@ -1,4 +1,4 @@ -cagebreak-socket(7) "Version 2.0.0" "Cagebreak Manual" +cagebreak-socket(7) "Version 2.0.1" "Cagebreak Manual" # NAME diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index 7feccc1..e05ae29 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -1,4 +1,4 @@ -cagebreak(1) "Version 2.0.0" "Cagebreak Manual" +cagebreak(1) "Version 2.0.1" "Cagebreak Manual" # NAME diff --git a/meson.build b/meson.build index 81d9b0f..29dbcd1 100644 --- a/meson.build +++ b/meson.build @@ -3,7 +3,7 @@ project( 'cagebreak', 'c', -version : '2.0.0', +version : '2.0.1', license : 'MIT', default_options : ['c_std=c11', 'warning_level=3'] ) @@ -259,7 +259,7 @@ install_data('examples/config', install_dir : '/etc/xdg/cagebreak') if get_option('man-pages') scdoc = find_program('scdoc') - secssinceepoch = 1673193959 + secssinceepoch = 1673282376 shcommand = 'export SOURCE_DATE_EPOCH=' + secssinceepoch.to_string() + ' ; @0@ < @INPUT@'.format(scdoc.path()) sh = find_program('sh') mandir1 = join_paths(get_option('mandir'), 'man1') From fc100100211bf040751cffcb4f0d685470d0bbd8 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 9 Jan 2023 18:47:14 +0100 Subject: [PATCH 570/689] Prepare 2.0.1 release --- Hashes.md | 18 ++++++++++++++++++ signatures/2.0.0-cagebreak-config.5.sig | Bin 0 -> 566 bytes signatures/2.0.0-cagebreak-socket.7.sig | Bin 0 -> 566 bytes signatures/2.0.0-cagebreak.1.sig | Bin 0 -> 566 bytes signatures/2.0.0-cagebreak.sig | Bin 0 -> 566 bytes signatures/cagebreak-config.5.sig | Bin 566 -> 566 bytes signatures/cagebreak-socket.7.sig | Bin 566 -> 566 bytes signatures/cagebreak.1.sig | Bin 566 -> 566 bytes signatures/cagebreak.sig | Bin 566 -> 566 bytes 9 files changed, 18 insertions(+) create mode 100644 signatures/2.0.0-cagebreak-config.5.sig create mode 100644 signatures/2.0.0-cagebreak-socket.7.sig create mode 100644 signatures/2.0.0-cagebreak.1.sig create mode 100644 signatures/2.0.0-cagebreak.sig diff --git a/Hashes.md b/Hashes.md index 627d428..1fe4b4a 100644 --- a/Hashes.md +++ b/Hashes.md @@ -1,5 +1,23 @@ # Hashes +2.0.1 cagebreak + + * sha 256: 3d7cdf511976248614617b1738246a3c5fa94543838e798c0c3a9aec325027b9 + * sha 512: 3b584e7a124e8b32b9d6584e82d256ca4a0b8c30423efc4678c8991d7a6f9b43edd29967eda7be6284e3583209e607b14d88e8ec65b19706849d0263a3188852 + +2.0.1 cagebreak.1 + + * sha 256: bb93d7d3af98b4b14a5b6968065ded51ad5006e6d81736ee1806ee62a99a137e + * sha 512: 90e8d4c5628cc556001da3b96194c5649cc948389697c4c70e10e5e259ce6a52150c6231b2fb9009d2834d52b64c0ebc5896403b9fd0c584d4c873e45846250f +2.0.1 cagebreak-config.5 + + * sha 256: 1870c1274848e6535edda170ec0349befb2aa78bc812c56bdc66df99600c86f0 + * sha 512: 4b546e77a722375cc6fd22562f3b4724e5cccc0907a935db5854fa4fe2a0eef16adbd2e7e2b35b023ac9609e5d97a341d62ade730c76acd6b3f80ba6f65d8a24 + +2.0.1 cagebreak-socket.7 + * sha 256: 1276c37af5cf32276b2f5bcb3f13d4d00c9a7957ef4d51cb2fa62d2fc3643c6f + * sha 512: 60b38a0b43d2a0d5026ecf2ec660538cd384b5a2e84f7a1a41ac916e67de54ae7a55e45492ed5654d3f248e1d6693ba7c4d596987b03082841a4c3c953c57846 + 2.0.0 cagebreak * sha 256: 45f88abdae03bbc7dad5734dd6fb1a00e1bf37d3e0c4016dad2fa3de832335cf diff --git a/signatures/2.0.0-cagebreak-config.5.sig b/signatures/2.0.0-cagebreak-config.5.sig new file mode 100644 index 0000000000000000000000000000000000000000..0e839de1d6a4029c6b1906c9b74962341d1add5f GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j+_E$ufVhrCX*AwCnJ$3ujQV~JG-0%N-{RR9VJ5TM6H zgoft}d; zziNM$mHaAa9)z0kM}k45Z8dji9bL_riL4a>UFDl@2~vN)41xxj>0Wkv89j=;{oGKX z^A~tQ>S74ILHP>WV@`i(UJnzI_6ghUGvSviq^gF9-;B}ZwsE4*kBy9-<)XZK{!@-* z&hgGuZ9r%P+u`LAa@MFpzhROnVSl9{sv$bv!}2h11Wu|i%@`|^jQk!tgq0|XF EQh$jSv;Y7A literal 0 HcmV?d00001 diff --git a/signatures/2.0.0-cagebreak-socket.7.sig b/signatures/2.0.0-cagebreak-socket.7.sig new file mode 100644 index 0000000000000000000000000000000000000000..6c5048b79c2991fa9f1d0e86234926ebacf415f9 GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j+_E$ufVhrCX*AwCnJ$3ujQV~JG-0%N-{SpW(N5TM6H zgo@`h?n#LyK;!8^ONVafw0hZ759^be#Y5vvgbS%8( zr6n3>4_q-c_!#_23y|DeU*kv5#txLZxT816ne-fd-!;@V;T)X~gqMQ{iX%R67+OZ_ zI`x>h8*Sip|C8?buduzg8~y&`13b(lX32~JcTXu(TM$EK5w8pCL~ymwj?-6S)3yQ^ zB*#VzH%Kmu$?vl9b~bh7$E4ik!qrRt$Ed4TMQN}|OR6HW?UYr*g7DUnhJMgBw;nM* z1>Y0>*+l8s3*`{~IuLZXCSx|G<46>Ui8}k4@w0lPHpzL@@HTt9xFCK2;ANwxC`qm- zWjihvK~{&;PJ11k>O7vH*!jup2amsEe-67?M@iEJ1yQ=4ZQ%9d->9I;7X~(e5o?4y zPz7~!Orl)9PT|fOh`DE5V3_3~g3U@K`&jwfN_lbvSoDS4|7>tfbJbo97H7iFZAB`% z5U31S9^%K6x>%xCS((x^bfuuSTMjPZOQ+J!`*!ce7GUO z?As)9nZcoKyA>hlqBPC+$qBrL$?4S7HT$MGCAy3F?Ir8Z6hS>oQjwU<$y--2)xBBg zfKT`j8tN|YtvSI(xo}IO?>#DuJbdcngI4H~7WO^9Fd2xhI`RoId;=@YV5|dvbu@V1 EVY~ho;{X5v literal 0 HcmV?d00001 diff --git a/signatures/2.0.0-cagebreak.1.sig b/signatures/2.0.0-cagebreak.1.sig new file mode 100644 index 0000000000000000000000000000000000000000..3dfee2837dfb06f16aeb167a6ad00914d94a8ed8 GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j+_E$ufVhrCX*AwCnJ$3ujQV~JG-0%N-{Pyh-E5TM6H zgo-W2!BHfPS^Gi=& z#hxq3RE#DT_XU3Sr|Czh@wMVJO0qKWy9dkq16QF=9rR-O0 zit<#6*?r0L>G%Xc> z%-+Z&xLZP9MEe#bN&|k<{0yaInV#E_xJy*4(5-U|h2tIvr9v5WPn?;|ZXM792R5`d zZ7?G}sUF_$$_eJc-&#VR5Q1@;0R`LVvXiLInzcu6I|j2= z8{Q@LjBpjyT-evrjEX-YJ;5fHH^C*Xm_9;^pJyxoON+B&p7in$HPpq&+Rdr!IMZUv zD;VMLXTOERHdZ6NDW+<~|7$l}du?(0kOkjV4F{mD-tn!LcGd!(Ob7l>d$9NggHZ}3 zILXX`N{g=8+J_HN1azWvA-$!xv$D{&1B>8w&=EFhN{rQJkkbCb1D<9<&C%L+zzfq0 EXp65H@&Et; literal 0 HcmV?d00001 diff --git a/signatures/2.0.0-cagebreak.sig b/signatures/2.0.0-cagebreak.sig new file mode 100644 index 0000000000000000000000000000000000000000..93517d0a5f58e4bcf66f09efccfcb8761670e9f0 GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j+_E$ufVhrCX*AwCnJ$3ujQV~JG-0%N-{OaKZA5TM6H zgo~=l{n)7QRnbU#$jeo7v*QE0H zNx?bqB`M~SowqBA>1{{Hat|LCP@pbGzpQ_pnZJCS<_CgpKC>*E$Z2K6mZ@nDbTmy9 zHic)f>9}PZT4OI$Cp=J_8zs2f1XR0tFZ`A(%{iF-=EhI44#(?5=#8%v3pE|6<;6wx zH84@?CzI9M^K_<&h>`e2c~=f{ljMum&}Ul6qgaL?iCV+tIv#Xtfq2Q>B3G9EC^)n{ z>yx6ahB%H|=skK6Yjyb&Kq$nr-{b+xY=cKV$th1ir4hb6?9Lf6k3y(_%5azjqq~Uc zP2f;<^+*2)PIG+ZO)Wo>H+A)SD85>gw_hk(P4oeW@SZjvNW-0{+~+(hZ~pNcuxxAVv_{@@5*G>mKizHnNPkZ1k(y2*Zkc E89-GH$N&HU literal 0 HcmV?d00001 diff --git a/signatures/cagebreak-config.5.sig b/signatures/cagebreak-config.5.sig index 0e839de1d6a4029c6b1906c9b74962341d1add5f..c2c27ba4cdab34262ca28c6967ed61e555cd3522 100644 GIT binary patch delta 542 zcmV+(0^$9(1hxc_BY(V7%m4}r5TM6Hgoex zR_Un)RS6y%eva5{`l)fDw66bDb`cBjD>QVC41E6Fz@B*M#b|#x29>1{!YV7Nz^-R= z7SvfjTRDQ>(`W?ggT!_n!I<56{)f)pU+a~!*wr}U%8<eWKUSyl%YwY@l?ied|Y4fWUjo zz9P@2?IO?R57}`2{hf|S@!u|dNSv_{vfJTz8d#Ghy=zL&>0SMcq5JvxzQ4J&x0ssI2 delta 542 zcmV+(0^$9(1hxc_BY(RvRR9VJ5TM6HgoxlyB5yY2ZmH?%W?iDE;lfb*TpyC#?^L>EX&iYztF{#7cvy{Lz${?G-OwA z&pic^dQ)e&eT(R~c@dsP?a?TuB@x)6?KuV%vL)R~Qh~=R)T{420pG++NdBr0a^3O) zaQ0k~Kd-$SX@B|L&7tR#d_b}-`{MC*5fCxpZj6}RV#(g2+6>?&(!8OBT&}P4lj*&-E-#-lIf2V($Q!qrwFu8%9*!sU}f0mW}Dt~7lgqrY2f3;s)mT)jM3z_aiY(Ujf|b;qP%(jQ;uZL@y=6iKxhNo;pGu>)~G?hVUj3ef2AO* gAv)c|@)s~~1Wu|i%@`|^jQk!tgq0|XFQu(wHf&c&j diff --git a/signatures/cagebreak-socket.7.sig b/signatures/cagebreak-socket.7.sig index 6c5048b79c2991fa9f1d0e86234926ebacf415f9..d7dfe41453bb2d1880310eda8d18b9b4fe1c26d4 100644 GIT binary patch delta 542 zcmV+(0^$9(1hxc_BY(V7&j1Pu5TM6Hgo0G6)?0C%_jEhB-K%m)L|XuI0e zVr~(+2J{j)bw=k~v4ztla|Ulh4{tTL?n7|@R5VB@$QBWg2`Xth9#FpXdV&3{9jNBeNd4ukHgYDcGU zgtU3vPqyFcq#!B)g=<6MYPnT9b;t!b5HbblkdH2VDf%k|x1XCNs!lD4O#kDjOB~C9 zRWBLyq|_OgEY_gA6(tne>c-us!z0~#zeLyKGR4OE01brUdZm0*%Poo47GQuupAR;! z(<1J}Tf++ohJUfLfE{Zw`%)cSFPzZ*MFyt8;4UZzx|z1?~qh^>C{DX z&n9iVP0R9+ gmHR@3Zx_>dzDwh6xjlT^`T4CsO__z*ttqyiy|R%H_W%F@ delta 542 zcmV+(0^$9(1hxc_BY(RvSpW(N5TM6Hgo@`h?n#LyK z;!8^ONVafw0hZ759^be#Y5vvgbS%8(r6n3>4_q-c_!#_23y|DeU*kv5#txLZxT816 zne-fd-!;@V;T)X~gqMQ{iX%R67+OZ_I`x>h8*Sip|C8?buYa(;wj2Ha;sZR)BWB5r z0e4R+Q(F*2Wf89n>O^q0&yLeqV$-$)7bM3<3pYqEiplS?@pd+Kr!h-PDk%oTIHMbryJ_X+s{n1G; znenrFqc+KT(|_Cpve~oHh&Rogga0Lb#qLjT)j@=&KZcgXIo&HsZa7=U6UJMpz!p?0)D!CA-3|AiF$A6N#SfW;0nbI?KrJ%N34ldwJ zr_#;)cJIaH+!E=@3ekvG5+O{3zr~^Ho<;QR+az(B!J%xs6(Q%MG|l$O3A}~L>D1FT z`=&T0x{LVjCF{-MriBIl)D_a7&`^Jt~VleCpzZ gR_Kuy_7^?AFd2xhI`RoId;=@YV5|dvbu@V1VKgQXu>b%7 diff --git a/signatures/cagebreak.1.sig b/signatures/cagebreak.1.sig index 3dfee2837dfb06f16aeb167a6ad00914d94a8ed8..02074e9b5e5ef03999cd64d2f6009e46fe0ec97c 100644 GIT binary patch delta 542 zcmV+(0^$9(1hxc_BY(V7$p8uo5TM6HgoUQEay2giu5l#VbH z-k@YujY!wvF;B+95U(nst7|ESnDJWkB%qF40HT=vqlJ58?3j}{ubwXf9G;ktbhzBF zy}<`WoH&}tb^3G`NTIh;h&p{1gyppn)~v1W)p)!Had&G07=IL@qr6Mvg#McQ3Gr4d zFZr-GqM@+)dYrm)Mc+Inss!`e>`UHsi?_wEK#>b&&R_)Cch$E5*#>cu!)hArj+dTI z_s{LQ98*BzCr#zooX<-{@?N~VzSWBWEEx*-`WVg{xl`X#n_Q*>LD-&V$pypqfv9~B42vCm58=q^=YdTtg66nx{37LdlWMZNS*kER0-W2!BHfPS^Gi=&#hxq3RE#DT_A zsLkaGkDGpeSyWzB=Mgc=bCZngrw|E{$b_=m|92^RCU^2_d>B>T{ke#kB}R4ceC858 zoRV}11ss3>x#p$(gW9eGi@2J#M{YX?vsD}3CH0JO6@S!R*w@mGia#Me!6ueB!6mJj zK0=D0XDk0pi?d>$^zsii)Wyfz&8h1+(_+di7~$_{zlFm#RwKMArfS6hYd2eaZE^aL z1>aN+2cWIq@vWA2)&ibP2mVfbu=oXoQ3@nD$;^RDi>}z(hYwH$bfR-1y`{FZve2~y gi{N$85f?USN{rQJkkbCb1D<9<&C%L+zzfq0XbgoCzyJUM diff --git a/signatures/cagebreak.sig b/signatures/cagebreak.sig index 93517d0a5f58e4bcf66f09efccfcb8761670e9f0..f557280a419d0db0be93fa754e95b2d6ea52fbb1 100644 GIT binary patch delta 542 zcmV+(0^$9(1hxc_BY(V7w*U$W5TM6HgonoJ9) z&{>5tT5ZYWEbw zY+?4ze$HBqg?TYBE&N{%N9fV;_F(n~22V3{4^xijR`KOu5rnJ@%zq~CJ z$-~%G2Elb9TYq7|Q#u3wWHsX7A=IMGr#wGBz5C?<9qg@Kec{|p8~|&6XLbwgzZ+M5 zpG{Pg98BuZOnnb^Z|6+`z4uWlPfp`2hz^w8SfCP($lehpB;iL{x#wG>!Op4l=S2E! z@;7*$dWWDl)|H+{#)GQ2p9_)U#cY-##psc}3m!L{bAL7VqzUE>fP{j3VkEVk<c` zf8LrW!E#C5iSU6z3f5^_9jJR}vF`U#e9JeMkAxvvkF*Y;EP-LTu->_Jl7)vMQ@fE( zKHYE>OoptX7xs>u$}htyX4<+M#f7B@(IdNeBv|S)phoi9=#+o=Lzj|cKe-!Z1l$_u go*Ezbw-@=5uM{#~(Avm1<9w&TWl{z`1X>|Rchm|4=l}o! delta 542 zcmV+(0^$9(1hxc_BY(RvOaKZA5TM6Hgo~=m47(n08!`gNyfA=uTijk zmhk+FQwz3qRuHi;Rip0phYCHhm0uS1j`5Z9FvtfguE0;$!}^OGQ7Ka9Ao7(XG_h0D zHGX(P@)q`anF*Y8Lyc>*=#77^)7PZ(_DR7x?qF>`uM-P39jN8SMf5c=QR*j?)!OrPrih4<_(XYE4sw&^i`LL* zTF9eVh98Mq!{j<1bZUWk$=o7Wmi;I=v^?vRqO68Ej(=L{J$evpb@>uND8#bgmKizHnNPkZ1k(y2*Zkc8KCk9mH+?% From a9d5db02543a64eb7d9a25dfd95795a8d26fcae0 Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 2 Feb 2023 10:36:02 +0100 Subject: [PATCH 571/689] Update LICENSE date --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 538d78c..e0aba93 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2020-2022 The Cagebreak authors +Copyright (c) 2020-2023 The Cagebreak authors Copyright (c) 2018-2020 Jente Hidskes Copyright (c) 2019 The Sway authors From 7102d3ee96f38a44d35bcc7c84af5f2b10ac9594 Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 2 Feb 2023 10:36:29 +0100 Subject: [PATCH 572/689] Add more explicit license info to README --- README.md | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4c284b0..e1988cc 100644 --- a/README.md +++ b/README.md @@ -568,5 +568,24 @@ see [SECURITY.md](SECURITY.md). ## License -MIT, please see [LICENSE](https://github.com/project-repo/cagebreak/blob/master/LICENSE). +Copyright (c) 2020-2023 The Cagebreak authors +Copyright (c) 2018-2020 Jente Hidskes +Copyright (c) 2019 The Sway authors +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From b63fa48f30b9314543135edff60ca4c23af223e9 Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 2 Feb 2023 10:36:52 +0100 Subject: [PATCH 573/689] Improve release procedure --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index e1988cc..fa6e42f 100644 --- a/README.md +++ b/README.md @@ -430,6 +430,8 @@ The release procedure outlines the process for a release to occur. * [ ] Check features for SECURITY.md relevance (changes to socket scope for example) * [ ] Synchronize any socket changes to cagebreak-socket man page + * [ ] Updated internal wiki + * [ ] Added new files to meson.build or hardcoded testing variable * [ ] Fixed bugs documented in Bugs.md * [ ] Include issue discussion from github, where applicable * [ ] Testing From d6c07d1443c96322427a10ec9e79d753f69e41e6 Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 2 Feb 2023 10:37:53 +0100 Subject: [PATCH 574/689] Adjust version numbers --- README.md | 2 +- man/cagebreak-config.5.md | 2 +- man/cagebreak-socket.7.md | 2 +- man/cagebreak.1.md | 2 +- meson.build | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index fa6e42f..b8995ec 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Cagebreak: A Wayland Tiling Compositor -[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/6532/badge)](https://bestpractices.coreinfrastructure.org/projects/6532) [![Packaging status](https://repology.org/badge/tiny-repos/cagebreak.svg)](https://repology.org/project/cagebreak/versions) [![AUR package](https://repology.org/badge/version-for-repo/aur/cagebreak.svg?minversion=2.0.1)](https://repology.org/project/cagebreak/versions) +[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/6532/badge)](https://bestpractices.coreinfrastructure.org/projects/6532) [![Packaging status](https://repology.org/badge/tiny-repos/cagebreak.svg)](https://repology.org/project/cagebreak/versions) [![AUR package](https://repology.org/badge/version-for-repo/aur/cagebreak.svg?minversion=2.0.2)](https://repology.org/project/cagebreak/versions) ## Quick Introduction diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index 9fa63e3..a705f01 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -1,4 +1,4 @@ -cagebreak-config(5) "Version 2.0.1" "Cagebreak Manual" +cagebreak-config(5) "Version 2.0.2" "Cagebreak Manual" # NAME diff --git a/man/cagebreak-socket.7.md b/man/cagebreak-socket.7.md index 66dd156..7bd7f1d 100644 --- a/man/cagebreak-socket.7.md +++ b/man/cagebreak-socket.7.md @@ -1,4 +1,4 @@ -cagebreak-socket(7) "Version 2.0.1" "Cagebreak Manual" +cagebreak-socket(7) "Version 2.0.2" "Cagebreak Manual" # NAME diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index e05ae29..52ee305 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -1,4 +1,4 @@ -cagebreak(1) "Version 2.0.1" "Cagebreak Manual" +cagebreak(1) "Version 2.0.2" "Cagebreak Manual" # NAME diff --git a/meson.build b/meson.build index 29dbcd1..0ba1157 100644 --- a/meson.build +++ b/meson.build @@ -3,7 +3,7 @@ project( 'cagebreak', 'c', -version : '2.0.1', +version : '2.0.2', license : 'MIT', default_options : ['c_std=c11', 'warning_level=3'] ) From d7f58ce07f58582e1ebf4551362faed8d0af6694 Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 2 Feb 2023 10:38:57 +0100 Subject: [PATCH 575/689] Adjust reproducible build versions --- meson.build | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index 0ba1157..0f0f289 100644 --- a/meson.build +++ b/meson.build @@ -206,8 +206,8 @@ reproducible_build_versions = { 'wayland_cursor': '1.21.0', 'wlroots': '0.16.1', 'xkbcommon': '1.5.0', - 'fontconfig': '2.14.1', - 'libinput': '1.22.0', + 'fontconfig': '2.14.2', + 'libinput': '1.22.1', 'libevdev': '1.13.0', 'libudev': '252', 'pango': '1.50.12', @@ -238,7 +238,7 @@ foreach name, dep : cagebreak_dependencies_dict endforeach reproducible_build_compiler = 'gcc' -reproducible_build_compiler_version = '12.2.0' +reproducible_build_compiler_version = '12.2.1' if cc.get_id() != reproducible_build_compiler warning('The compiler "' + cc.get_id() + '" differs from the one used to generate to binary specified in Hashes.md (' + reproducible_build_compiler + ').') From b32659963ccb5102295adb82aed820c23e3606d9 Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 2 Feb 2023 10:41:24 +0100 Subject: [PATCH 576/689] Fix SPDX-License-Identifier typo --- cagebreak.c | 2 +- config.h.in | 2 +- example_scripts/cb_script_header.sh | 2 +- example_scripts/focus_follows_cursor.sh | 2 +- example_scripts/show_workspace_views.sh | 2 +- examples/config | 2 +- fuzz/execl_override.c | 2 +- fuzz/fuzz-lib.c | 2 +- fuzz/fuzz-lib.h | 2 +- fuzz/fuzz-parse.c | 2 +- fuzz/meson.build | 2 +- idle_inhibit_v1.c | 2 +- idle_inhibit_v1.h | 2 +- input.h | 2 +- input_manager.c | 2 +- input_manager.h | 2 +- ipc_server.c | 2 +- ipc_server.h | 2 +- keybinding.c | 2 +- keybinding.h | 2 +- libinput.c | 2 +- meson.build | 2 +- meson_options.txt | 2 +- message.c | 2 +- message.h | 2 +- output.c | 2 +- output.h | 2 +- pango.c | 2 +- pango.h | 2 +- parse.c | 2 +- parse.h | 2 +- seat.c | 2 +- seat.h | 2 +- server.c | 10 ++-------- server.h | 3 +++ util.c | 2 +- util.h | 2 +- view.c | 2 +- view.h | 2 +- workspace.c | 2 +- workspace.h | 2 +- xdg_shell.c | 2 +- xdg_shell.h | 2 +- xwayland.c | 2 +- xwayland.h | 2 +- 45 files changed, 48 insertions(+), 51 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index 28e363f..e7edb4a 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -1,5 +1,5 @@ // Copyright 2020 - 2023, project-repo and the cagebreak contributors -// SPDX -License-Identifier: MIT +// SPDX-License-Identifier: MIT #define _DEFAULT_SOURCE diff --git a/config.h.in b/config.h.in index a79a80c..35dd0a6 100644 --- a/config.h.in +++ b/config.h.in @@ -1,5 +1,5 @@ // Copyright 2020 - 2023, project-repo and the cagebreak contributors -// SPDX -License-Identifier: MIT +// SPDX-License-Identifier: MIT #ifndef CG_CONFIG_H #define CG_CONFIG_H diff --git a/example_scripts/cb_script_header.sh b/example_scripts/cb_script_header.sh index 9533beb..770f075 100644 --- a/example_scripts/cb_script_header.sh +++ b/example_scripts/cb_script_header.sh @@ -1,6 +1,6 @@ #!/bin/bash # Copyright 2023, project-repo and the cagebreak contributors -# SPDX -License-Identifier: MIT +# SPDX-License-Identifier: MIT named_pipe_send="$(mktemp -u)" named_pipe_recv="$(mktemp -u)" diff --git a/example_scripts/focus_follows_cursor.sh b/example_scripts/focus_follows_cursor.sh index 79e2889..e47bf88 100644 --- a/example_scripts/focus_follows_cursor.sh +++ b/example_scripts/focus_follows_cursor.sh @@ -1,6 +1,6 @@ #!/bin/bash # Copyright 2023, project-repo and the cagebreak contributors -# SPDX -License-Identifier: MIT +# SPDX-License-Identifier: MIT # This script uses the cagebreak socket to modify the compositor's behaviour in # such a way that the currently focussed tile follows the cursor, i.e. that the diff --git a/example_scripts/show_workspace_views.sh b/example_scripts/show_workspace_views.sh index 3be9cbb..b5a42ae 100644 --- a/example_scripts/show_workspace_views.sh +++ b/example_scripts/show_workspace_views.sh @@ -1,6 +1,6 @@ #!/bin/bash # Copyright 2020 - 2023, project-repo and the cagebreak contributors -# SPDX -License-Identifier: MIT +# SPDX-License-Identifier: MIT # This script displays the process names of the views on the current workspace. diff --git a/examples/config b/examples/config index d79a792..6708e42 100644 --- a/examples/config +++ b/examples/config @@ -1,5 +1,5 @@ # Copyright 2020 - 2023, project-repo and the cagebreak contributors -# SPDX -License-Identifier: MIT +# SPDX-License-Identifier: MIT ###################### # General settings an key bindings ###################### diff --git a/fuzz/execl_override.c b/fuzz/execl_override.c index 9fc9e6e..308bd73 100644 --- a/fuzz/execl_override.c +++ b/fuzz/execl_override.c @@ -1,5 +1,5 @@ // Copyright 2020 - 2023, project-repo and the cagebreak contributors -// SPDX -License-Identifier: MIT +// SPDX-License-Identifier: MIT // This file is used by the fuzzer in order to prevent executing shell commands. #define _GNU_SOURCE diff --git a/fuzz/fuzz-lib.c b/fuzz/fuzz-lib.c index c159538..5211e05 100644 --- a/fuzz/fuzz-lib.c +++ b/fuzz/fuzz-lib.c @@ -1,5 +1,5 @@ // Copyright 2020 - 2023, project-repo and the cagebreak contributors -// SPDX -License-Identifier: MIT +// SPDX-License-Identifier: MIT #define _POSIX_C_SOURCE 200812L diff --git a/fuzz/fuzz-lib.h b/fuzz/fuzz-lib.h index 950f455..9254ced 100644 --- a/fuzz/fuzz-lib.h +++ b/fuzz/fuzz-lib.h @@ -1,5 +1,5 @@ // Copyright 2020 - 2023, project-repo and the cagebreak contributors -// SPDX -License-Identifier: MIT +// SPDX-License-Identifier: MIT #ifndef CG_FUZZ_LIB_H #define CG_FUZZ_LIB_H diff --git a/fuzz/fuzz-parse.c b/fuzz/fuzz-parse.c index 0fc060c..b0cb125 100644 --- a/fuzz/fuzz-parse.c +++ b/fuzz/fuzz-parse.c @@ -1,5 +1,5 @@ // Copyright 2020 - 2023, project-repo and the cagebreak contributors -// SPDX -License-Identifier: MIT +// SPDX-License-Identifier: MIT #define _POSIX_C_SOURCE 200812L diff --git a/fuzz/meson.build b/fuzz/meson.build index 01fdd3e..f1c08ac 100644 --- a/fuzz/meson.build +++ b/fuzz/meson.build @@ -1,5 +1,5 @@ # Copyright 2020 - 2023, project-repo and the cagebreak contributors -# SPDX -License-Identifier: MIT +# SPDX-License-Identifier: MIT fuzz_sources = [ 'fuzz-parse.c', diff --git a/idle_inhibit_v1.c b/idle_inhibit_v1.c index 9bc3f7a..b4f91f9 100644 --- a/idle_inhibit_v1.c +++ b/idle_inhibit_v1.c @@ -1,5 +1,5 @@ // Copyright 2020 - 2023, project-repo and the cagebreak contributors -// SPDX -License-Identifier: MIT +// SPDX-License-Identifier: MIT #include #include diff --git a/idle_inhibit_v1.h b/idle_inhibit_v1.h index f0dce64..74ae956 100644 --- a/idle_inhibit_v1.h +++ b/idle_inhibit_v1.h @@ -1,5 +1,5 @@ // Copyright 2020 - 2023, project-repo and the cagebreak contributors -// SPDX -License-Identifier: MIT +// SPDX-License-Identifier: MIT #ifndef CG_IDLE_INHIBIT_H #define CG_IDLE_INHIBIT_H diff --git a/input.h b/input.h index f7877c5..f45e735 100644 --- a/input.h +++ b/input.h @@ -1,5 +1,5 @@ // Copyright 2020 - 2023, project-repo and the cagebreak contributors -// SPDX -License-Identifier: MIT +// SPDX-License-Identifier: MIT #ifndef _CG_INPUT_H #define _CG_INPUT_H diff --git a/input_manager.c b/input_manager.c index 83cb966..cfde2c9 100644 --- a/input_manager.c +++ b/input_manager.c @@ -1,5 +1,5 @@ // Copyright 2020 - 2023, project-repo and the cagebreak contributors -// SPDX -License-Identifier: MIT +// SPDX-License-Identifier: MIT #define _POSIX_C_SOURCE 200812L diff --git a/input_manager.h b/input_manager.h index 86dcf2e..b3eb006 100644 --- a/input_manager.h +++ b/input_manager.h @@ -1,5 +1,5 @@ // Copyright 2020 - 2023, project-repo and the cagebreak contributors -// SPDX -License-Identifier: MIT +// SPDX-License-Identifier: MIT #ifndef CG_INPUT_MANAGER_H #define CG_INPUT_MANAGER_H diff --git a/ipc_server.c b/ipc_server.c index c28979d..ced183a 100644 --- a/ipc_server.c +++ b/ipc_server.c @@ -1,5 +1,5 @@ // Copyright 2020 - 2023, project-repo and the cagebreak contributors -// SPDX -License-Identifier: MIT +// SPDX-License-Identifier: MIT #define _DEFAULT_SOURCE diff --git a/ipc_server.h b/ipc_server.h index 2c66b83..41d7b88 100644 --- a/ipc_server.h +++ b/ipc_server.h @@ -1,5 +1,5 @@ // Copyright 2020 - 2023, project-repo and the cagebreak contributors -// SPDX -License-Identifier: MIT +// SPDX-License-Identifier: MIT #ifndef CG_IPC_SERVER_H #define CG_IPC_SERVER_H diff --git a/keybinding.c b/keybinding.c index c2f29bb..fa37619 100644 --- a/keybinding.c +++ b/keybinding.c @@ -1,5 +1,5 @@ // Copyright 2020 - 2023, project-repo and the cagebreak contributors -// SPDX -License-Identifier: MIT +// SPDX-License-Identifier: MIT #define _POSIX_C_SOURCE 200809L diff --git a/keybinding.h b/keybinding.h index c11de23..ba96c3d 100644 --- a/keybinding.h +++ b/keybinding.h @@ -1,5 +1,5 @@ // Copyright 2020 - 2023, project-repo and the cagebreak contributors -// SPDX -License-Identifier: MIT +// SPDX-License-Identifier: MIT #ifndef KEYBINDING_H diff --git a/libinput.c b/libinput.c index dcb9d1f..e980060 100644 --- a/libinput.c +++ b/libinput.c @@ -1,5 +1,5 @@ // Copyright 2020 - 2023, project-repo and the cagebreak contributors -// SPDX -License-Identifier: MIT +// SPDX-License-Identifier: MIT #include "input.h" #include "input_manager.h" diff --git a/meson.build b/meson.build index 0f0f289..a40f08f 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ # Copyright 2020 - 2023, project-repo and the cagebreak contributors -# SPDX -License-Identifier: MIT +# SPDX-License-Identifier: MIT project( 'cagebreak', 'c', diff --git a/meson_options.txt b/meson_options.txt index 6d4a787..b7fc956 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,5 +1,5 @@ # Copyright 2020 - 2023, project-repo and the cagebreak contributors -# SPDX -License-Identifier: MIT +# SPDX-License-Identifier: MIT option('xwayland', type: 'boolean', value: 'false', description: 'Enable support for X11 applications') option('man-pages', type: 'boolean', value: 'false', description: 'Build man pages (requires pandoc)') option('fuzz', type: 'boolean', value: 'false', description: 'Enable building fuzzer targets') diff --git a/message.c b/message.c index f0c2c64..74b1d0a 100644 --- a/message.c +++ b/message.c @@ -1,5 +1,5 @@ // Copyright 2020 - 2023, project-repo and the cagebreak contributors -// SPDX -License-Identifier: MIT +// SPDX-License-Identifier: MIT #include #include diff --git a/message.h b/message.h index 25bf692..806307c 100644 --- a/message.h +++ b/message.h @@ -1,5 +1,5 @@ // Copyright 2020 - 2023, project-repo and the cagebreak contributors -// SPDX -License-Identifier: MIT +// SPDX-License-Identifier: MIT #ifndef MESSAGE_H diff --git a/output.c b/output.c index a75f532..b8fc627 100644 --- a/output.c +++ b/output.c @@ -1,5 +1,5 @@ // Copyright 2020 - 2023, project-repo and the cagebreak contributors -// SPDX -License-Identifier: MIT +// SPDX-License-Identifier: MIT #define _POSIX_C_SOURCE 200809L diff --git a/output.h b/output.h index 0a255df..90cd615 100644 --- a/output.h +++ b/output.h @@ -1,5 +1,5 @@ // Copyright 2020 - 2023, project-repo and the cagebreak contributors -// SPDX -License-Identifier: MIT +// SPDX-License-Identifier: MIT #ifndef CG_OUTPUT_H #define CG_OUTPUT_H diff --git a/pango.c b/pango.c index c513f97..3af6f7f 100644 --- a/pango.c +++ b/pango.c @@ -1,5 +1,5 @@ // Copyright 2020 - 2023, project-repo and the cagebreak contributors -// SPDX -License-Identifier: MIT +// SPDX-License-Identifier: MIT #include #include diff --git a/pango.h b/pango.h index 30f2865..53a78cc 100644 --- a/pango.h +++ b/pango.h @@ -1,5 +1,5 @@ // Copyright 2020 - 2023, project-repo and the cagebreak contributors -// SPDX -License-Identifier: MIT +// SPDX-License-Identifier: MIT #ifndef _SWAY_PANGO_H #define _SWAY_PANGO_H diff --git a/parse.c b/parse.c index d250439..93fdbf4 100644 --- a/parse.c +++ b/parse.c @@ -1,5 +1,5 @@ // Copyright 2020 - 2023, project-repo and the cagebreak contributors -// SPDX -License-Identifier: MIT +// SPDX-License-Identifier: MIT #define _POSIX_C_SOURCE 200812L diff --git a/parse.h b/parse.h index 4e38ea9..2949315 100644 --- a/parse.h +++ b/parse.h @@ -1,5 +1,5 @@ // Copyright 2020 - 2023, project-repo and the cagebreak contributors -// SPDX -License-Identifier: MIT +// SPDX-License-Identifier: MIT #ifndef PARSE_H diff --git a/seat.c b/seat.c index a3e09a0..f75ff62 100644 --- a/seat.c +++ b/seat.c @@ -1,5 +1,5 @@ // Copyright 2020 - 2023, project-repo and the cagebreak contributors -// SPDX -License-Identifier: MIT +// SPDX-License-Identifier: MIT #define _POSIX_C_SOURCE 200812L diff --git a/seat.h b/seat.h index e44d808..74f4092 100644 --- a/seat.h +++ b/seat.h @@ -1,5 +1,5 @@ // Copyright 2020 - 2023, project-repo and the cagebreak contributors -// SPDX -License-Identifier: MIT +// SPDX-License-Identifier: MIT #ifndef CG_SEAT_H #define CG_SEAT_H diff --git a/server.c b/server.c index 292d0b0..c50f528 100644 --- a/server.c +++ b/server.c @@ -1,11 +1,5 @@ -/* - * Cagebreak: A Wayland tiling compositor. - * - * Copyright (C) 2020-2022 The Cagebreak Authors - * Copyright (C) 2018-2019 Jente Hidskes - * - * See the LICENSE file accompanying this file. - */ +// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// SPDX-License-Identifier: MIT #define _POSIX_C_SOURCE 200809L diff --git a/server.h b/server.h index 39d26f4..3c13c4e 100644 --- a/server.h +++ b/server.h @@ -1,3 +1,6 @@ +// Copyright 2020 - 2023, project-repo and the cagebreak contributors +// SPDX-License-Identifier: MIT + #ifndef CG_SERVER_H #define CG_SERVER_H diff --git a/util.c b/util.c index 455f306..f8c7a82 100644 --- a/util.c +++ b/util.c @@ -1,5 +1,5 @@ // Copyright 2020 - 2023, project-repo and the cagebreak contributors -// SPDX -License-Identifier: MIT +// SPDX-License-Identifier: MIT #include diff --git a/util.h b/util.h index ef3f532..b509a00 100644 --- a/util.h +++ b/util.h @@ -1,5 +1,5 @@ // Copyright 2020 - 2023, project-repo and the cagebreak contributors -// SPDX -License-Identifier: MIT +// SPDX-License-Identifier: MIT #ifndef CG_UTIL_H #define CG_UTIL_H diff --git a/view.c b/view.c index 74c31b8..99e2e7c 100644 --- a/view.c +++ b/view.c @@ -1,5 +1,5 @@ // Copyright 2020 - 2023, project-repo and the cagebreak contributors -// SPDX -License-Identifier: MIT +// SPDX-License-Identifier: MIT #define _POSIX_C_SOURCE 200809L diff --git a/view.h b/view.h index 99e3e65..b3b2ed6 100644 --- a/view.h +++ b/view.h @@ -1,5 +1,5 @@ // Copyright 2020 - 2023, project-repo and the cagebreak contributors -// SPDX -License-Identifier: MIT +// SPDX-License-Identifier: MIT #ifndef CG_VIEW_H #define CG_VIEW_H diff --git a/workspace.c b/workspace.c index 1caff0d..3f84c6f 100644 --- a/workspace.c +++ b/workspace.c @@ -1,5 +1,5 @@ // Copyright 2020 - 2023, project-repo and the cagebreak contributors -// SPDX -License-Identifier: MIT +// SPDX-License-Identifier: MIT #define _POSIX_C_SOURCE 200809L diff --git a/workspace.h b/workspace.h index e0f2473..b669cec 100644 --- a/workspace.h +++ b/workspace.h @@ -1,5 +1,5 @@ // Copyright 2020 - 2023, project-repo and the cagebreak contributors -// SPDX -License-Identifier: MIT +// SPDX-License-Identifier: MIT #ifndef CG_WORKSPACE_H #define CG_WORKSPACE_H diff --git a/xdg_shell.c b/xdg_shell.c index fc251c7..164ede0 100644 --- a/xdg_shell.c +++ b/xdg_shell.c @@ -1,5 +1,5 @@ // Copyright 2020 - 2023, project-repo and the cagebreak contributors -// SPDX -License-Identifier: MIT +// SPDX-License-Identifier: MIT #define _POSIX_C_SOURCE 200809L diff --git a/xdg_shell.h b/xdg_shell.h index e066208..fd80b99 100644 --- a/xdg_shell.h +++ b/xdg_shell.h @@ -1,5 +1,5 @@ // Copyright 2020 - 2023, project-repo and the cagebreak contributors -// SPDX -License-Identifier: MIT +// SPDX-License-Identifier: MIT #ifndef CG_XDG_SHELL_H #define CG_XDG_SHELL_H diff --git a/xwayland.c b/xwayland.c index f601a0f..fd8d174 100644 --- a/xwayland.c +++ b/xwayland.c @@ -1,5 +1,5 @@ // Copyright 2020 - 2023, project-repo and the cagebreak contributors -// SPDX -License-Identifier: MIT +// SPDX-License-Identifier: MIT #include "config.h" diff --git a/xwayland.h b/xwayland.h index cde30c5..71a0b7a 100644 --- a/xwayland.h +++ b/xwayland.h @@ -1,5 +1,5 @@ // Copyright 2020 - 2023, project-repo and the cagebreak contributors -// SPDX -License-Identifier: MIT +// SPDX-License-Identifier: MIT #ifndef CG_XWAYLAND_H #define CG_XWAYLAND_H From 0ccbd554d34ea0efb9f2b77e4106dbd9f2d97264 Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 2 Feb 2023 20:18:48 +0100 Subject: [PATCH 577/689] Fix potential npd --- seat.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/seat.c b/seat.c index f75ff62..d2b947c 100644 --- a/seat.c +++ b/seat.c @@ -214,8 +214,10 @@ handle_command_key_bindings(struct cg_server *server, xkb_keysym_t sym, wlr_scene_buffer_from_node(node)); if(scene_surface != NULL) { surface = scene_surface->surface; + if(surface!=NULL) { + wlr_seat_pointer_notify_enter(wlr_seat, surface, sx, sy); + } } - wlr_seat_pointer_notify_enter(wlr_seat, surface, sx, sy); } } } @@ -701,8 +703,10 @@ process_cursor_motion(struct cg_seat *seat, uint32_t time) { wlr_scene_surface_from_buffer(wlr_scene_buffer_from_node(node)); if(scene_surface != NULL) { surface = scene_surface->surface; + if(surface!=NULL) { + wlr_seat_pointer_notify_enter(wlr_seat, surface, sx, sy); + } } - wlr_seat_pointer_notify_enter(wlr_seat, surface, sx, sy); bool focus_changed = wlr_seat->pointer_state.focused_surface != surface; if(!focus_changed && time > 0) { From 15590ab39ac4ac8fd040bd08c261af7fa59fc35f Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 2 Feb 2023 20:22:16 +0100 Subject: [PATCH 578/689] Fix npd --- keybinding.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/keybinding.c b/keybinding.c index fa37619..8661db4 100644 --- a/keybinding.c +++ b/keybinding.c @@ -699,18 +699,20 @@ keybinding_cycle_views(struct cg_server *server, bool reverse, bool ipc) { seat_set_focus(server->seat, next_view); if(ipc) { + int curr_id=-1; + int curr_pid=-1; + if(current_view!=NULL && current_view->link.next != curr_workspace->views.next) { + curr_id=current_view->id; + curr_pid=current_view->impl->get_pid(current_view); + } ipc_send_event( curr_workspace->output->server, "{\"event_name\":\"cycle_views\",\"old_view_id\":%d,\"old_view_" "pid\":%d," "\"new_view_id\":%d,\"new_view_pid\":%d,\"tile_id\":%d," "\"workspace\":%d,\"output\":\"%s\",\"output_id\":%d}", - current_view->link.next == curr_workspace->views.next - ? -1 - : (int)current_view->id, - current_view->link.next == curr_workspace->views.next - ? -1 - : (int)current_view->impl->get_pid(current_view), + curr_id, + curr_pid, next_view == NULL ? -1 : (int)next_view->id, next_view == NULL ? -1 : (int)next_view->impl->get_pid(next_view), next_view->tile->id, curr_workspace->num + 1, From 73fcbbf1428cc9ccb09b1c8341dc78050706df73 Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 2 Feb 2023 20:37:42 +0100 Subject: [PATCH 579/689] Change some output from stderr to stdout --- cagebreak.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index e7edb4a..710e9fa 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -611,7 +611,7 @@ main(int argc, char *argv[]) { wlr_log_errno(WLR_ERROR, "Unable to set WAYLAND_DISPLAY.", "Clients may not be able to connect"); } else { - fprintf(stderr, + fprintf(stdout, "Cagebreak " CG_VERSION " is running on Wayland display %s\n", socket); } @@ -623,7 +623,7 @@ main(int argc, char *argv[]) { if(show_info) { char *msg = server_show_info(&server); if(msg != NULL) { - fprintf(stderr, "%s", msg); + fprintf(stdout, "%s", msg); free(msg); } else { wlr_log(WLR_ERROR, "Failed to get info on cagebreak setup\n"); From 0ee4e286b991bfcb8ac637385bd4c05af578c050 Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 2 Feb 2023 21:03:10 +0100 Subject: [PATCH 580/689] Add Bugs.md description for some issues - #37 - two npds --- Bugs.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/Bugs.md b/Bugs.md index c1792c4..527110a 100644 --- a/Bugs.md +++ b/Bugs.md @@ -1120,3 +1120,36 @@ Cagebreak was not compatible with clang 15 and POSIX which was causing issues with building under FreeBSD. Thanks to Jan Beich for pointing this out and providing a PR. + +## Issue 55 + + * github issue number: N/A + * Fixed: 2.0.2 + +Prior to release 2.0.2, cagebreak sometimes crased due to a null pointer +derefrence when the cursor was moved. + +## Issue 56 + + * github issue numner: N/A + * Fixed: 2.0.2 + +Prior to release 2.0.2, the following workflow caused cagebreak to +crash: + + * Split an empty workspace. + * Open 2 windows on the left tile. + * exchangeright + * focus left + * cycle views + +The reason for this is that the ipc send event did not handle +focussing the background correctly when cycling. + +## Issue 57 + + * github issue number: #39 + * Fixed: 2.0.2 + +maxhbr pointed out that there was a spelling mistake in the +SPDX-License-Identifier. From defaaea9d1f814157d90f2774d87c5d074a51da5 Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 2 Feb 2023 21:08:22 +0100 Subject: [PATCH 581/689] Apply clang-format --- keybinding.c | 15 +++++++-------- seat.c | 7 ++++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/keybinding.c b/keybinding.c index 8661db4..e699dfd 100644 --- a/keybinding.c +++ b/keybinding.c @@ -699,11 +699,12 @@ keybinding_cycle_views(struct cg_server *server, bool reverse, bool ipc) { seat_set_focus(server->seat, next_view); if(ipc) { - int curr_id=-1; - int curr_pid=-1; - if(current_view!=NULL && current_view->link.next != curr_workspace->views.next) { - curr_id=current_view->id; - curr_pid=current_view->impl->get_pid(current_view); + int curr_id = -1; + int curr_pid = -1; + if(current_view != NULL && + current_view->link.next != curr_workspace->views.next) { + curr_id = current_view->id; + curr_pid = current_view->impl->get_pid(current_view); } ipc_send_event( curr_workspace->output->server, @@ -711,9 +712,7 @@ keybinding_cycle_views(struct cg_server *server, bool reverse, bool ipc) { "pid\":%d," "\"new_view_id\":%d,\"new_view_pid\":%d,\"tile_id\":%d," "\"workspace\":%d,\"output\":\"%s\",\"output_id\":%d}", - curr_id, - curr_pid, - next_view == NULL ? -1 : (int)next_view->id, + curr_id, curr_pid, next_view == NULL ? -1 : (int)next_view->id, next_view == NULL ? -1 : (int)next_view->impl->get_pid(next_view), next_view->tile->id, curr_workspace->num + 1, curr_workspace->output->wlr_output->name, diff --git a/seat.c b/seat.c index d2b947c..cd085be 100644 --- a/seat.c +++ b/seat.c @@ -214,8 +214,9 @@ handle_command_key_bindings(struct cg_server *server, xkb_keysym_t sym, wlr_scene_buffer_from_node(node)); if(scene_surface != NULL) { surface = scene_surface->surface; - if(surface!=NULL) { - wlr_seat_pointer_notify_enter(wlr_seat, surface, sx, sy); + if(surface != NULL) { + wlr_seat_pointer_notify_enter(wlr_seat, surface, sx, + sy); } } } @@ -703,7 +704,7 @@ process_cursor_motion(struct cg_seat *seat, uint32_t time) { wlr_scene_surface_from_buffer(wlr_scene_buffer_from_node(node)); if(scene_surface != NULL) { surface = scene_surface->surface; - if(surface!=NULL) { + if(surface != NULL) { wlr_seat_pointer_notify_enter(wlr_seat, surface, sx, sy); } } From c23c8995157f8762beb5a8742ff0b391c9f5f3ad Mon Sep 17 00:00:00 2001 From: project-repo Date: Wed, 8 Feb 2023 19:21:15 +0100 Subject: [PATCH 582/689] Fix loading of default config file --- cagebreak.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index e7edb4a..174b925 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -197,7 +197,7 @@ set_configuration(struct cg_server *server, if(line == NULL) { wlr_log(WLR_ERROR, "Could not allocate buffer for reading " "configuration file."); - return 1; + return 2; } } if(strlen(line) == 0) { @@ -632,27 +632,25 @@ main(int argc, char *argv[]) { } { // config_file should only be visible as long as it is valid + int conf_ret=1; char *config_file = get_config_file(config_path); if(config_file == NULL) { wlr_log(WLR_ERROR, "Unable to get path to config file"); ret = 1; goto end; + } else { + conf_ret=set_configuration(&server, config_file); + free(config_file); } - int conf_ret = set_configuration(&server, config_file); - // Configurtion file not found - if(conf_ret != 0) { - if(config_file == NULL) { + // Configuration file not found + if(conf_ret == 1) { char *default_conf = "/etc/xdg/cagebreak/config"; wlr_log(WLR_INFO, "Loading default configuration file: \"%s\"", default_conf); conf_ret = set_configuration(&server, default_conf); - } else { - conf_ret = 1; - } } - free(config_file); if(conf_ret != 0 || !server.running) { ret = 1; goto end; From eaaef616d6dc7d1619928a680a5dc1ff54a5e291 Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 9 Feb 2023 20:34:48 +0100 Subject: [PATCH 583/689] Add Issue 58 (#40) to Bugs.md --- Bugs.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Bugs.md b/Bugs.md index 527110a..d5df883 100644 --- a/Bugs.md +++ b/Bugs.md @@ -1153,3 +1153,14 @@ focussing the background correctly when cycling. maxhbr pointed out that there was a spelling mistake in the SPDX-License-Identifier. + +## Issue 58 + + * github issue number: #40 + * Fixed: 2.0.2 + +Prior to version 2.0.2, the logic behind configuration file loading was +broken. This had the effect, that the default configuration file was not +loaded when the user-specific config file was not present, instead +leading to a termination of cagebreak. + From 1bcfce8d4f520652c6295ee217687276c04627b1 Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 9 Feb 2023 22:06:58 +0100 Subject: [PATCH 584/689] Add License as meson install target --- meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/meson.build b/meson.build index a40f08f..717149f 100644 --- a/meson.build +++ b/meson.build @@ -256,6 +256,7 @@ executable( ) install_data('examples/config', install_dir : '/etc/xdg/cagebreak') +install_data('LICENSE', install_dir : '/usr/share/licenses/' + meson.project_name() + '/') if get_option('man-pages') scdoc = find_program('scdoc') From 567f12c29ff31603dbacec4ede7edc023632da65 Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 9 Feb 2023 22:15:28 +0100 Subject: [PATCH 585/689] Apply clang-format --- cagebreak.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index 885d8ed..513c240 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -632,23 +632,23 @@ main(int argc, char *argv[]) { } { // config_file should only be visible as long as it is valid - int conf_ret=1; + int conf_ret = 1; char *config_file = get_config_file(config_path); if(config_file == NULL) { wlr_log(WLR_ERROR, "Unable to get path to config file"); ret = 1; goto end; } else { - conf_ret=set_configuration(&server, config_file); + conf_ret = set_configuration(&server, config_file); free(config_file); } // Configuration file not found if(conf_ret == 1) { - char *default_conf = "/etc/xdg/cagebreak/config"; - wlr_log(WLR_INFO, "Loading default configuration file: \"%s\"", - default_conf); - conf_ret = set_configuration(&server, default_conf); + char *default_conf = "/etc/xdg/cagebreak/config"; + wlr_log(WLR_INFO, "Loading default configuration file: \"%s\"", + default_conf); + conf_ret = set_configuration(&server, default_conf); } if(conf_ret != 0 || !server.running) { From e7c9cd047122bd45878ce463c588a10ae7709599 Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 9 Feb 2023 22:16:05 +0100 Subject: [PATCH 586/689] Adjust meson repro build versions --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 717149f..708651b 100644 --- a/meson.build +++ b/meson.build @@ -211,7 +211,7 @@ reproducible_build_versions = { 'libevdev': '1.13.0', 'libudev': '252', 'pango': '1.50.12', - 'cairo': '1.17.6', + 'cairo': '1.17.8', 'pangocairo': '1.50.12', 'math': '-1' } From f0a31d31564c7c76c5e6b753c4e5b430b4a340ad Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 9 Feb 2023 22:35:22 +0100 Subject: [PATCH 587/689] Add test suite to check arguments --- meson.build | 4 ++ test/arguments | 53 +++++++++++++++++++++++++++ test/testing-configurations/-c-config | 2 + test/testing-configurations/config | 2 + 4 files changed, 61 insertions(+) create mode 100644 test/arguments create mode 100644 test/testing-configurations/-c-config create mode 100644 test/testing-configurations/config diff --git a/meson.build b/meson.build index 708651b..266e6c3 100644 --- a/meson.build +++ b/meson.build @@ -307,3 +307,7 @@ summary = [ '' ] message('\n'.join(summary)) + +# Test Suite + +test('Arguments', find_program('test/arguments'), args : [ meson.project_version() ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic') diff --git a/test/arguments b/test/arguments new file mode 100644 index 0000000..2d6c15a --- /dev/null +++ b/test/arguments @@ -0,0 +1,53 @@ +#!/bin/bash + +testdir=$(mktemp -d) + +readonly helptext="Usage: ./cagebreak [OPTIONS] + + -c Load configuration file from + -e Enable socket + -h Display this help message + -s Show information about the current setup and exit + -v Show the version number and exit" + +readonly basicheadless="Cagebreak $1 is running on Wayland display wayland-1 +Outputs: + * HEADLESS-1 +Inputs:" + +RESULT=0 + +# check -c option +## Check without config file +[[ $(2>&1 ./cagebreak -c | head -1 ) = "./cagebreak: option requires an argument -- 'c'" ]] || RESULT=1 +[[ $(2>&1 ./cagebreak -c | tail -n +2 ) = "$helptext" ]] || RESULT=1 +## Check with config file +cp $MESONCURRENTCONFIGDIR/test/testing-configurations/-c-config $testdir +sed -i "s|CONFIGPATH|$testdir\/result|g" $testdir/-c-config +WLR_BACKENDS=headless ./cagebreak -c $testdir/-c-config +[[ $(cat $testdir/result) = "SUCCESS" ]] || RESULT=1 + +# check -e option +## Check without socket +cp $MESONCURRENTCONFIGDIR/test/testing-configurations/config $testdir +readonly oldsocket=$CAGEBREAK_SOCKET +sed -i "s|CONFIGPATH|$testdir\/socket|g" $testdir/config +$(WLR_BACKENDS=headless ./cagebreak -c $testdir/config) +[[ $(cat $testdir/socket) = $oldsocket ]] || RESULT=1 +## Check with socket +cp $MESONCURRENTCONFIGDIR/test/testing-configurations/config $testdir +sed -i "s|CONFIGPATH|$testdir\/socket|g" $testdir/config +$(WLR_BACKENDS=headless ./cagebreak -e -c $testdir/config) +[[ ! $(cat $testdir/socket) = $oldsocket ]] || RESULT=1 + +# check -h option +[[ $(./cagebreak -h) = "$helptext" ]] || RESULT=1 + +# check -s option +[[ $(WLR_BACKENDS=headless ./cagebreak -s) = "$basicheadless" ]] || RESULT=1 + + +# check -v option +[[ $(./cagebreak -v) = "Cagebreak version $1" ]] || RESULT=1 + +exit $RESULT diff --git a/test/testing-configurations/-c-config b/test/testing-configurations/-c-config new file mode 100644 index 0000000..d6c7b48 --- /dev/null +++ b/test/testing-configurations/-c-config @@ -0,0 +1,2 @@ +exec (echo "SUCCESS" > CONFIGPATH ) +quit diff --git a/test/testing-configurations/config b/test/testing-configurations/config new file mode 100644 index 0000000..aa56584 --- /dev/null +++ b/test/testing-configurations/config @@ -0,0 +1,2 @@ +exec (echo $CAGEBREAK_SOCKET > CONFIGPATH) +quit From d9f61d86fb01d6d71d149e0cc55a572b81400168 Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 9 Feb 2023 22:37:33 +0100 Subject: [PATCH 588/689] Add test to check scan-build status --- meson.build | 1 + test/scan-build | 11 +++++++++++ test/testing-configurations/my-scan-build | 3 +++ 3 files changed, 15 insertions(+) create mode 100644 test/scan-build create mode 100755 test/testing-configurations/my-scan-build diff --git a/meson.build b/meson.build index 266e6c3..27c2420 100644 --- a/meson.build +++ b/meson.build @@ -311,3 +311,4 @@ message('\n'.join(summary)) # Test Suite test('Arguments', find_program('test/arguments'), args : [ meson.project_version() ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic') +test('Scan-build static analysis', find_program('test/scan-build'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'release') diff --git a/test/scan-build b/test/scan-build new file mode 100644 index 0000000..7dd468f --- /dev/null +++ b/test/scan-build @@ -0,0 +1,11 @@ +#!/bin/bash + +RESULT=0 + +cd $MESONCURRENTCONFIGDIR +rm -rf test/test-scan-build +meson setup test/test-scan-build -Dxwayland=true -Dman-pages=true --buildtype=release || RESULT=1 +SCANBUILD="$(pwd)/test/testing-configurations/my-scan-build" ninja -C test/test-scan-build scan-build || RESULT=1 +rm -rf test/test-scan-build + +exit $RESULT diff --git a/test/testing-configurations/my-scan-build b/test/testing-configurations/my-scan-build new file mode 100755 index 0000000..22517fa --- /dev/null +++ b/test/testing-configurations/my-scan-build @@ -0,0 +1,3 @@ +#!/bin/bash + +scan-build --status-bugs "$@" From a222a5a60fba1490d93e5e8ef3350f383fdd44ab Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 9 Feb 2023 22:40:00 +0100 Subject: [PATCH 589/689] Add test to check clang-format --- meson.build | 1 + test/clang-format | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 test/clang-format diff --git a/meson.build b/meson.build index 27c2420..2d47aa2 100644 --- a/meson.build +++ b/meson.build @@ -310,5 +310,6 @@ message('\n'.join(summary)) # Test Suite +test('Clang-format formatting check', find_program('test/clang-format'), args : [ cagebreak_main_file + cagebreak_source_strings + cagebreak_header_strings ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic') test('Arguments', find_program('test/arguments'), args : [ meson.project_version() ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic') test('Scan-build static analysis', find_program('test/scan-build'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'release') diff --git a/test/clang-format b/test/clang-format new file mode 100644 index 0000000..f37b545 --- /dev/null +++ b/test/clang-format @@ -0,0 +1,25 @@ +#! /bin/sh + +readonly declared_deps="${@}" +readonly hardcoded_deps="fuzz/execl_override.c fuzz/fuzz-lib.c fuzz/fuzz-lib.h fuzz/fuzz-parse.c" +readonly deps="${declared_deps} ${hardcoded_deps}" + +RESULT=0 + +set -x + +echo $MESONCURRENTCONFIGDIR + +for file in ${deps} +do + echo "${file}" + if $(clang-format -Werror --dry-run "$MESONCURRENTCONFIGDIR/${file}") + then + echo " [x] clang-format" + else + RESULT=1 + echo " [ ] clang-format" + fi +done + +exit "${RESULT}" From 628dbc13141e0c6e0000536af09a8bfef2638b72 Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 9 Feb 2023 22:40:51 +0100 Subject: [PATCH 590/689] Add tests for correct build --- meson.build | 2 ++ test/build-w-o-warnings | 12 ++++++++++++ test/build-w-o-xwayland | 12 ++++++++++++ 3 files changed, 26 insertions(+) create mode 100644 test/build-w-o-warnings create mode 100644 test/build-w-o-xwayland diff --git a/meson.build b/meson.build index 2d47aa2..3bc5241 100644 --- a/meson.build +++ b/meson.build @@ -310,6 +310,8 @@ message('\n'.join(summary)) # Test Suite +test('Build without warnings', find_program('test/build-w-o-warnings'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic') +test('Build without xwayland', find_program('test/build-w-o-xwayland'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic') test('Clang-format formatting check', find_program('test/clang-format'), args : [ cagebreak_main_file + cagebreak_source_strings + cagebreak_header_strings ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic') test('Arguments', find_program('test/arguments'), args : [ meson.project_version() ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic') test('Scan-build static analysis', find_program('test/scan-build'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'release') diff --git a/test/build-w-o-warnings b/test/build-w-o-warnings new file mode 100644 index 0000000..0eaa509 --- /dev/null +++ b/test/build-w-o-warnings @@ -0,0 +1,12 @@ +#! /bin/sh + +RESULT=0 + +cd $MESONCURRENTCONFIGDIR +echo "Build standard release build" +rm -rf test/test-w-o-warnings +meson setup test/test-w-o-warnings -Dxwayland=true -Dman-pages=true --buildtype=release --fatal-meson-warnings || RESULT=1 +ninja -C test/test-w-o-warnings || RESULT=1 +rm -rf test/test-w-o-warnings + +exit "${RESULT}" diff --git a/test/build-w-o-xwayland b/test/build-w-o-xwayland new file mode 100644 index 0000000..5e10109 --- /dev/null +++ b/test/build-w-o-xwayland @@ -0,0 +1,12 @@ +#! /bin/sh + +RESULT=0 + +cd $MESONCURRENTCONFIGDIR +echo "Build without xwayland" +rm -rf test/test-w-o-xwayland +meson setup test/test-w-o-xwayland -Dxwayland=false -Dman-pages=false --buildtype=release --fatal-meson-warnings || RESULT=1 +ninja -C test/test-w-o-xwayland || RESULT=1 +rm -rf test/test-w-o-xwayland + +exit "${RESULT}" From c1d0902a6de8e722fc96b9e10ef9cc74f7d36d73 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 12 Feb 2023 22:32:19 +0100 Subject: [PATCH 591/689] Update wlroots repro build version --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 3bc5241..95583a8 100644 --- a/meson.build +++ b/meson.build @@ -204,7 +204,7 @@ reproducible_build_versions = { 'wayland_server': '1.19.0', 'wayland_client': '1.21.0', 'wayland_cursor': '1.21.0', - 'wlroots': '0.16.1', + 'wlroots': '0.16.2', 'xkbcommon': '1.5.0', 'fontconfig': '2.14.2', 'libinput': '1.22.1', From 401733d092558ebd2d298177ac99328dbad79e64 Mon Sep 17 00:00:00 2001 From: project-repo Date: Tue, 14 Feb 2023 20:21:09 +0100 Subject: [PATCH 592/689] Improve quotation of test script --- test/scan-build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/scan-build b/test/scan-build index 7dd468f..d5f3201 100644 --- a/test/scan-build +++ b/test/scan-build @@ -2,10 +2,10 @@ RESULT=0 -cd $MESONCURRENTCONFIGDIR +cd "${MESONCURRENTCONFIGDIR}" rm -rf test/test-scan-build meson setup test/test-scan-build -Dxwayland=true -Dman-pages=true --buildtype=release || RESULT=1 SCANBUILD="$(pwd)/test/testing-configurations/my-scan-build" ninja -C test/test-scan-build scan-build || RESULT=1 rm -rf test/test-scan-build -exit $RESULT +exit "${RESULT}" From 1a8912c9c2f2e74929ec2c6551691ae5bb7ec805 Mon Sep 17 00:00:00 2001 From: project-repo Date: Tue, 14 Feb 2023 20:21:51 +0100 Subject: [PATCH 593/689] Adjust scripting quotations --- test/clang-format | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/clang-format b/test/clang-format index f37b545..bd3a7ae 100644 --- a/test/clang-format +++ b/test/clang-format @@ -8,12 +8,12 @@ RESULT=0 set -x -echo $MESONCURRENTCONFIGDIR +echo "${MESONCURRENTCONFIGDIR}" for file in ${deps} do echo "${file}" - if $(clang-format -Werror --dry-run "$MESONCURRENTCONFIGDIR/${file}") + if $(clang-format -Werror --dry-run "${MESONCURRENTCONFIGDIR}/${file}") then echo " [x] clang-format" else From 89a4c5d609d15f7cac71616ce678fee47f1968ec Mon Sep 17 00:00:00 2001 From: project-repo Date: Tue, 14 Feb 2023 20:22:31 +0100 Subject: [PATCH 594/689] Add env var tests --- meson.build | 1 + test/environment-variables | 33 ++++++++++++++++++++++ test/testing-configurations/env-var-config | 2 ++ 3 files changed, 36 insertions(+) create mode 100644 test/environment-variables create mode 100644 test/testing-configurations/env-var-config diff --git a/meson.build b/meson.build index 95583a8..b77048e 100644 --- a/meson.build +++ b/meson.build @@ -315,3 +315,4 @@ test('Build without xwayland', find_program('test/build-w-o-xwayland'), env : [ test('Clang-format formatting check', find_program('test/clang-format'), args : [ cagebreak_main_file + cagebreak_source_strings + cagebreak_header_strings ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic') test('Arguments', find_program('test/arguments'), args : [ meson.project_version() ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic') test('Scan-build static analysis', find_program('test/scan-build'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'release') +test('Environment Variables', find_program('test/environment-variables'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic') diff --git a/test/environment-variables b/test/environment-variables new file mode 100644 index 0000000..8a4b313 --- /dev/null +++ b/test/environment-variables @@ -0,0 +1,33 @@ +#!/bin/bash + +testdir=$(mktemp -d) +mkdir "${testdir}/cagebreak" + +RESULT=0 + +# CAGEBREAK_SOCKET (duplicate of arguments test) +## Check without socket +cp $MESONCURRENTCONFIGDIR/test/testing-configurations/config $testdir +readonly oldsocket=$CAGEBREAK_SOCKET +sed -i "s|CONFIGPATH|$testdir\/socket|g" $testdir/config +$(WLR_BACKENDS=headless ./cagebreak -c $testdir/config) +[[ $(cat $testdir/socket) = $oldsocket ]] || RESULT=1 +## Check with socket +cp $MESONCURRENTCONFIGDIR/test/testing-configurations/config $testdir +sed -i "s|CONFIGPATH|$testdir\/socket|g" $testdir/config +$(WLR_BACKENDS=headless ./cagebreak -e -c $testdir/config) +[[ ! $(cat $testdir/socket) = $oldsocket ]] || RESULT=1 + +# XDG_CONFIG_HOME +cp "${MESONCURRENTCONFIGDIR}/test/testing-configurations/env-var-config" "${testdir}/cagebreak/config" +sed -i "s|CONFIGPATH|${testdir}\/result|g" "${testdir}/cagebreak/config" +XDG_CONFIG_HOME="${testdir}/" WLR_BACKENDS=headless ./cagebreak +[[ $(cat "${testdir}/result") = "SUCCESS" ]] || RESULT=1 + +# The XKB_DEFAULT_* family of variables is not found in the source code +# of Cagebreak but necessary to configure software for use with Cagebreak. + +exit "${RESULT}" + + + diff --git a/test/testing-configurations/env-var-config b/test/testing-configurations/env-var-config new file mode 100644 index 0000000..d6c7b48 --- /dev/null +++ b/test/testing-configurations/env-var-config @@ -0,0 +1,2 @@ +exec (echo "SUCCESS" > CONFIGPATH ) +quit From 67ad8480025a2c68003bc591282540927c011403 Mon Sep 17 00:00:00 2001 From: project-repo Date: Tue, 14 Feb 2023 20:52:28 +0100 Subject: [PATCH 595/689] Integrate fuzz meson.build to facilitate testing --- fuzz/meson.build | 38 -------------------------------------- meson.build | 40 ++++++++++++++++++++++++++++++++++++++-- test/clang-format | 3 +-- 3 files changed, 39 insertions(+), 42 deletions(-) delete mode 100644 fuzz/meson.build diff --git a/fuzz/meson.build b/fuzz/meson.build deleted file mode 100644 index f1c08ac..0000000 --- a/fuzz/meson.build +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright 2020 - 2023, project-repo and the cagebreak contributors -# SPDX-License-Identifier: MIT - -fuzz_sources = [ - 'fuzz-parse.c', - 'fuzz-lib.c', - ] - -fuzz_headers = [ - '../parse.h', - 'fuzz-lib.h', - ] - -inc = include_directories(['..','../build/']) - -fuzz_dependencies = cagebreak_dependencies -if fuzzing_engine.found() - fuzz_dependencies += fuzzing_engine -else - link_args = [ '-fsanitize=fuzzer', ] -endif - -override_lib = shared_library('execl_override', - [ 'execl_override.c' ], - dependencies: [ cairo,pango,pangocairo ], - install: false - ) - -executable( - 'fuzz-parse', - fuzz_sources + fuzz_headers + cagebreak_headers + cagebreak_sources, - dependencies: fuzz_dependencies, - install: false, - include_directories: inc, - link_args: link_args + fuzz_link_args, - c_args: fuzz_compile_args, - link_with: override_lib, - ) diff --git a/meson.build b/meson.build index b77048e..a7be9eb 100644 --- a/meson.build +++ b/meson.build @@ -295,8 +295,44 @@ if get_option('man-pages') ) endif +fuzz_sources = [ + 'fuzz/fuzz-parse.c', + 'fuzz/fuzz-lib.c', + ] + +fuzz_headers = [ + 'parse.h', + 'fuzz/fuzz-lib.h', + ] + +fuzz_override_lib = [ 'fuzz/execl_override.c' ] + if get_option('fuzz') - subdir('fuzz') + inc = include_directories(['.','build/']) + + fuzz_dependencies = cagebreak_dependencies + if fuzzing_engine.found() + fuzz_dependencies += fuzzing_engine + else + link_args = [ '-fsanitize=fuzzer', ] + endif + +override_lib = shared_library('execl_override', + [ fuzz_override_lib ], + dependencies: [ cairo,pango,pangocairo ], + install: false + ) + + executable( + 'fuzz-parse', + fuzz_sources + fuzz_headers + cagebreak_headers + cagebreak_sources, + dependencies: fuzz_dependencies, + install: false, + include_directories: inc, + link_args: link_args + fuzz_link_args, + c_args: fuzz_compile_args, + link_with: override_lib, + ) endif summary = [ @@ -312,7 +348,7 @@ message('\n'.join(summary)) test('Build without warnings', find_program('test/build-w-o-warnings'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic') test('Build without xwayland', find_program('test/build-w-o-xwayland'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic') -test('Clang-format formatting check', find_program('test/clang-format'), args : [ cagebreak_main_file + cagebreak_source_strings + cagebreak_header_strings ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic') +test('Clang-format (formatting check)', find_program('test/clang-format'), args : [ cagebreak_main_file + cagebreak_source_strings + cagebreak_header_strings + fuzz_sources + fuzz_headers + fuzz_override_lib ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'devel') test('Arguments', find_program('test/arguments'), args : [ meson.project_version() ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic') test('Scan-build static analysis', find_program('test/scan-build'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'release') test('Environment Variables', find_program('test/environment-variables'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic') diff --git a/test/clang-format b/test/clang-format index bd3a7ae..ef5037b 100644 --- a/test/clang-format +++ b/test/clang-format @@ -1,8 +1,7 @@ #! /bin/sh readonly declared_deps="${@}" -readonly hardcoded_deps="fuzz/execl_override.c fuzz/fuzz-lib.c fuzz/fuzz-lib.h fuzz/fuzz-parse.c" -readonly deps="${declared_deps} ${hardcoded_deps}" +readonly deps="${declared_deps}" RESULT=0 From ceb61e6492e548cd6b54f4a48aecf4bc2308e580 Mon Sep 17 00:00:00 2001 From: project-repo Date: Tue, 14 Feb 2023 20:58:00 +0100 Subject: [PATCH 596/689] Adjust fuzzing documentation --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b8995ec..fa80900 100644 --- a/README.md +++ b/README.md @@ -305,7 +305,7 @@ CC=clang meson setup build -Dfuzz=true -Db_sanitize=address,undefined -Db_lundef ninja -C build/ mkdir build/fuzz_corpus cp examples/config build/fuzz_corpus/ -WLR_BACKENDS=headless ./build/fuzz/fuzz-parse -jobs=12 -max_len=50000 -close_fd_mask=3 build/fuzz_corpus/ +WLR_BACKENDS=headless ./build/fuzz-parse -jobs=12 -max_len=50000 -close_fd_mask=3 build/fuzz_corpus/ ``` You may want to tweak `-jobs` or add other options depending on your own setup. From d209a7801f3729886df369857a55a8fc41aa62d1 Mon Sep 17 00:00:00 2001 From: project-repo Date: Tue, 14 Feb 2023 21:01:30 +0100 Subject: [PATCH 597/689] Adjust test suite naming --- meson.build | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index a7be9eb..0202d6b 100644 --- a/meson.build +++ b/meson.build @@ -346,9 +346,9 @@ message('\n'.join(summary)) # Test Suite -test('Build without warnings', find_program('test/build-w-o-warnings'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic') -test('Build without xwayland', find_program('test/build-w-o-xwayland'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic') +test('Build without warnings', find_program('test/build-w-o-warnings'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'devel') +test('Build without xwayland', find_program('test/build-w-o-xwayland'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'devel') test('Clang-format (formatting check)', find_program('test/clang-format'), args : [ cagebreak_main_file + cagebreak_source_strings + cagebreak_header_strings + fuzz_sources + fuzz_headers + fuzz_override_lib ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'devel') test('Arguments', find_program('test/arguments'), args : [ meson.project_version() ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic') -test('Scan-build static analysis', find_program('test/scan-build'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'release') test('Environment Variables', find_program('test/environment-variables'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic') +test('Scan-build (static analysis)', find_program('test/scan-build'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'release') From 439385750d5e2bb738d9257cb2b0330fcfa6f784 Mon Sep 17 00:00:00 2001 From: project-repo Date: Tue, 14 Feb 2023 21:58:29 +0100 Subject: [PATCH 598/689] Add Copyright/License notice to test files --- test/arguments | 2 ++ test/build-w-o-warnings | 2 ++ test/build-w-o-xwayland | 2 ++ test/clang-format | 2 ++ test/environment-variables | 2 ++ test/scan-build | 2 ++ test/testing-configurations/-c-config | 2 ++ test/testing-configurations/config | 2 ++ test/testing-configurations/env-var-config | 2 ++ test/testing-configurations/my-scan-build | 2 ++ 10 files changed, 20 insertions(+) diff --git a/test/arguments b/test/arguments index 2d6c15a..e5e16ea 100644 --- a/test/arguments +++ b/test/arguments @@ -1,4 +1,6 @@ #!/bin/bash +# Copyright 2023, project-repo and the cagebreak contributors +# SPDX-License-Identifier: MIT testdir=$(mktemp -d) diff --git a/test/build-w-o-warnings b/test/build-w-o-warnings index 0eaa509..02d049a 100644 --- a/test/build-w-o-warnings +++ b/test/build-w-o-warnings @@ -1,4 +1,6 @@ #! /bin/sh +# Copyright 2023, project-repo and the cagebreak contributors +# SPDX-License-Identifier: MIT RESULT=0 diff --git a/test/build-w-o-xwayland b/test/build-w-o-xwayland index 5e10109..b97d62c 100644 --- a/test/build-w-o-xwayland +++ b/test/build-w-o-xwayland @@ -1,4 +1,6 @@ #! /bin/sh +# Copyright 2023, project-repo and the cagebreak contributors +# SPDX-License-Identifier: MIT RESULT=0 diff --git a/test/clang-format b/test/clang-format index ef5037b..c3dc561 100644 --- a/test/clang-format +++ b/test/clang-format @@ -1,4 +1,6 @@ #! /bin/sh +# Copyright 2023, project-repo and the cagebreak contributors +# SPDX-License-Identifier: MIT readonly declared_deps="${@}" readonly deps="${declared_deps}" diff --git a/test/environment-variables b/test/environment-variables index 8a4b313..a3a6d50 100644 --- a/test/environment-variables +++ b/test/environment-variables @@ -1,4 +1,6 @@ #!/bin/bash +# Copyright 2023, project-repo and the cagebreak contributors +# SPDX-License-Identifier: MIT testdir=$(mktemp -d) mkdir "${testdir}/cagebreak" diff --git a/test/scan-build b/test/scan-build index d5f3201..fd5aef4 100644 --- a/test/scan-build +++ b/test/scan-build @@ -1,4 +1,6 @@ #!/bin/bash +# Copyright 2023, project-repo and the cagebreak contributors +# SPDX-License-Identifier: MIT RESULT=0 diff --git a/test/testing-configurations/-c-config b/test/testing-configurations/-c-config index d6c7b48..a769e73 100644 --- a/test/testing-configurations/-c-config +++ b/test/testing-configurations/-c-config @@ -1,2 +1,4 @@ +# Copyright 2023, project-repo and the cagebreak contributors +# SPDX-License-Identifier: MIT exec (echo "SUCCESS" > CONFIGPATH ) quit diff --git a/test/testing-configurations/config b/test/testing-configurations/config index aa56584..9925aec 100644 --- a/test/testing-configurations/config +++ b/test/testing-configurations/config @@ -1,2 +1,4 @@ +# Copyright 2023, project-repo and the cagebreak contributors +# SPDX-License-Identifier: MIT exec (echo $CAGEBREAK_SOCKET > CONFIGPATH) quit diff --git a/test/testing-configurations/env-var-config b/test/testing-configurations/env-var-config index d6c7b48..a769e73 100644 --- a/test/testing-configurations/env-var-config +++ b/test/testing-configurations/env-var-config @@ -1,2 +1,4 @@ +# Copyright 2023, project-repo and the cagebreak contributors +# SPDX-License-Identifier: MIT exec (echo "SUCCESS" > CONFIGPATH ) quit diff --git a/test/testing-configurations/my-scan-build b/test/testing-configurations/my-scan-build index 22517fa..526f1dd 100755 --- a/test/testing-configurations/my-scan-build +++ b/test/testing-configurations/my-scan-build @@ -1,3 +1,5 @@ #!/bin/bash +# Copyright 2023, project-repo and the cagebreak contributors +# SPDX-License-Identifier: MIT scan-build --status-bugs "$@" From 1889c604842a828ebb3d0ec72db0f79c08148374 Mon Sep 17 00:00:00 2001 From: project-repo Date: Tue, 14 Feb 2023 22:32:03 +0100 Subject: [PATCH 599/689] Add basic tests --- meson.build | 2 ++ test/copyright-license | 42 ++++++++++++++++++++++++++++++++++++++++++ test/illegal-strings | 30 ++++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 test/copyright-license create mode 100644 test/illegal-strings diff --git a/meson.build b/meson.build index 0202d6b..9240d98 100644 --- a/meson.build +++ b/meson.build @@ -348,7 +348,9 @@ message('\n'.join(summary)) test('Build without warnings', find_program('test/build-w-o-warnings'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'devel') test('Build without xwayland', find_program('test/build-w-o-xwayland'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'devel') +test('Copyright and LICENSE', find_program('test/copyright-license'), args : [ cagebreak_main_file + cagebreak_source_strings + cagebreak_header_strings + fuzz_sources + fuzz_headers + fuzz_override_lib ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()), ''.join('MESONLICENSE=', meson.project_license())], suite: 'devel' ) test('Clang-format (formatting check)', find_program('test/clang-format'), args : [ cagebreak_main_file + cagebreak_source_strings + cagebreak_header_strings + fuzz_sources + fuzz_headers + fuzz_override_lib ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'devel') test('Arguments', find_program('test/arguments'), args : [ meson.project_version() ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic') test('Environment Variables', find_program('test/environment-variables'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic') test('Scan-build (static analysis)', find_program('test/scan-build'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'release') +test('Check for strings indicating problems', find_program('test/illegal-strings'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'release') diff --git a/test/copyright-license b/test/copyright-license new file mode 100644 index 0000000..a299327 --- /dev/null +++ b/test/copyright-license @@ -0,0 +1,42 @@ +#! /bin/sh +# Copyright 2023, project-repo and the cagebreak contributors +# SPDX-License-Identifier: MIT + +readonly declared_deps="${@}" +readonly hardcoded_deps="meson_options.txt meson.build" +readonly test_deps=$(cd "${MESONCURRENTCONFIGDIR}" ; find . -type f | grep test/) +readonly examples_deps=$(cd "${MESONCURRENTCONFIGDIR}" ; find . -type f | grep examples/) +readonly example_scripts_deps=$(cd "${MESONCURRENTCONFIGDIR}" ; find . -type f | grep example_scripts/) +readonly deps="${declared_deps} ${hardcoded_deps} ${test_deps} ${examples_deps} ${example_scripts_deps}" +readonly curryear=$(date +%Y) + +RESULT=0 + +for file in ${deps} +do + echo "${file}" + if $(grep -q "Copyright.*${curryear}, project-repo and the cagebreak contributors" "$MESONCURRENTCONFIGDIR/${file}") + then + echo " [x] Copyright Notice" + else + RESULT=1 + echo " [ ] Copyright Notice" + fi + if $(grep -q "SPDX-License-Identifier: MIT" "$MESONCURRENTCONFIGDIR/${file}") + then + echo " [x] SPDX-License-Identifier" + else + RESULT=1 + echo " [ ] SPDX-License-Identifier" + fi +done + +[[ "${MESONLICENSE}" = "MIT" ]] || RESULT=1 + +cd "${MESONCURRENTCONFIGDIR}" + +[[ $(cat LICENSE) = $(cat README.md | tail -$(wc -l LICENSE)) ]] || RESULT=1 + +[[ "Copyright (c) 2020-${curryear} The Cagebreak authors" = $(cat LICENSE | head -1) ]] || RESULT=1 + +exit "${RESULT}" diff --git a/test/illegal-strings b/test/illegal-strings new file mode 100644 index 0000000..fc9129d --- /dev/null +++ b/test/illegal-strings @@ -0,0 +1,30 @@ +#!/bin/bash +# Copyright 2023, project-repo and the cagebreak contributors +# SPDX-License-Identifier: MIT + +testdir=$(mktemp -d) + +RESULT=0 + +cd "${MESONCURRENTCONFIGDIR}" + +# Check that no TODO statements remain in the release directory +if ! grep -Rq "TODO" . +then + echo "[x] TODO" +else + echo "[ ] TODO" + RESULT=1 +fi + +# Check that Cagebreak does not falsely claim to be POSIX compliant +if ! grep -Rq "_POSIX_C_SOURCE" . +then + echo "[x] _POSIX_C_SOURCE" +else + echo "[ ] _POSIX_C_SOURCE" + RESULT=1 +fi + + +exit "${RESULT}" From 78212cc83042a3769948c47a5601952fff1ee977 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 17 Feb 2023 09:55:20 +0100 Subject: [PATCH 600/689] Fix compiler warnings --- fuzz/execl_override.c | 2 +- fuzz/fuzz-lib.c | 2 +- fuzz/fuzz-lib.h | 2 +- fuzz/fuzz-parse.c | 3 +-- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/fuzz/execl_override.c b/fuzz/execl_override.c index 308bd73..275d4f0 100644 --- a/fuzz/execl_override.c +++ b/fuzz/execl_override.c @@ -10,7 +10,7 @@ #include int -fork() { +fork(void) { return 1; } diff --git a/fuzz/fuzz-lib.c b/fuzz/fuzz-lib.c index 5211e05..38754f5 100644 --- a/fuzz/fuzz-lib.c +++ b/fuzz/fuzz-lib.c @@ -88,7 +88,7 @@ drop_permissions(void) { } void -cleanup() { +cleanup(void) { server.running = false; #if CG_HAS_XWAYLAND if(xwayland != NULL) { diff --git a/fuzz/fuzz-lib.h b/fuzz/fuzz-lib.h index 9254ced..46aefd2 100644 --- a/fuzz/fuzz-lib.h +++ b/fuzz/fuzz-lib.h @@ -21,7 +21,7 @@ extern struct wlr_xcursor_manager *xcursor_manager; #endif void -cleanup(); +cleanup(void); int LLVMFuzzerInitialize(int *argc, char ***argv); diff --git a/fuzz/fuzz-parse.c b/fuzz/fuzz-parse.c index b0cb125..303c168 100644 --- a/fuzz/fuzz-parse.c +++ b/fuzz/fuzz-parse.c @@ -29,8 +29,7 @@ int set_configuration(struct cg_server *server, char *content) { char *line; - for(unsigned int line_num = 1; - (line = strtok_r(NULL, "\n", &content)) != NULL; ++line_num) { + while((line = strtok_r(NULL, "\n", &content)) != NULL) { line[strcspn(line, "\n")] = '\0'; if(*line != '\0' && *line != '#') { char *errstr = NULL; From 358f7591667d1d5cc440067cb768d836a62e1710 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 17 Feb 2023 14:10:41 +0100 Subject: [PATCH 601/689] Apply clang-format --- fuzz/fuzz-parse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fuzz/fuzz-parse.c b/fuzz/fuzz-parse.c index 303c168..d0bd5ab 100644 --- a/fuzz/fuzz-parse.c +++ b/fuzz/fuzz-parse.c @@ -29,7 +29,7 @@ int set_configuration(struct cg_server *server, char *content) { char *line; - while((line = strtok_r(NULL, "\n", &content)) != NULL) { + while((line = strtok_r(NULL, "\n", &content)) != NULL) { line[strcspn(line, "\n")] = '\0'; if(*line != '\0' && *line != '#') { char *errstr = NULL; From 8fbcba1c38fecb9ac75e45ca62f28f8201b4032f Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 17 Feb 2023 21:31:02 +0100 Subject: [PATCH 602/689] Apply shellcheck --- example_scripts/show_workspace_views.sh | 1 + meson.build | 1 + test/arguments | 26 ++++++++++++------------- test/build-w-o-warnings | 3 ++- test/build-w-o-xwayland | 3 ++- test/clang-format | 4 ++-- test/copyright-license | 18 +++++++++++------ test/environment-variables | 16 +++++++-------- test/illegal-strings | 7 +++---- test/scan-build | 1 + test/shellcheck | 16 +++++++++++++++ 11 files changed, 61 insertions(+), 35 deletions(-) create mode 100644 test/shellcheck diff --git a/example_scripts/show_workspace_views.sh b/example_scripts/show_workspace_views.sh index b5a42ae..be6f0f9 100644 --- a/example_scripts/show_workspace_views.sh +++ b/example_scripts/show_workspace_views.sh @@ -19,6 +19,7 @@ do curr_workspace="$(echo "${event}"|jq -r ".outputs.${curr_output}.curr_workspace")" # Print the process names of the view on the current workspace. jq retrieves # their PID and ps is then used to retrieve the process names. + # shellcheck disable=2046 (echo -n "message ";ps -o comm=Command -p $(echo "${event}"|jq -r ".outputs.${curr_output}.workspaces[$((curr_workspace-1))].views[].pid")|tail +2|sed ':a; N; $!ba; s/\n/||/g') >&3 break fi diff --git a/meson.build b/meson.build index 9240d98..e73851e 100644 --- a/meson.build +++ b/meson.build @@ -350,6 +350,7 @@ test('Build without warnings', find_program('test/build-w-o-warnings'), env : [ test('Build without xwayland', find_program('test/build-w-o-xwayland'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'devel') test('Copyright and LICENSE', find_program('test/copyright-license'), args : [ cagebreak_main_file + cagebreak_source_strings + cagebreak_header_strings + fuzz_sources + fuzz_headers + fuzz_override_lib ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()), ''.join('MESONLICENSE=', meson.project_license())], suite: 'devel' ) test('Clang-format (formatting check)', find_program('test/clang-format'), args : [ cagebreak_main_file + cagebreak_source_strings + cagebreak_header_strings + fuzz_sources + fuzz_headers + fuzz_override_lib ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'devel') +test('Shellcheck (script linting)', find_program('test/shellcheck'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'devel') test('Arguments', find_program('test/arguments'), args : [ meson.project_version() ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic') test('Environment Variables', find_program('test/environment-variables'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic') test('Scan-build (static analysis)', find_program('test/scan-build'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'release') diff --git a/test/arguments b/test/arguments index e5e16ea..e276516 100644 --- a/test/arguments +++ b/test/arguments @@ -24,23 +24,23 @@ RESULT=0 [[ $(2>&1 ./cagebreak -c | head -1 ) = "./cagebreak: option requires an argument -- 'c'" ]] || RESULT=1 [[ $(2>&1 ./cagebreak -c | tail -n +2 ) = "$helptext" ]] || RESULT=1 ## Check with config file -cp $MESONCURRENTCONFIGDIR/test/testing-configurations/-c-config $testdir -sed -i "s|CONFIGPATH|$testdir\/result|g" $testdir/-c-config -WLR_BACKENDS=headless ./cagebreak -c $testdir/-c-config -[[ $(cat $testdir/result) = "SUCCESS" ]] || RESULT=1 +cp "${MESONCURRENTCONFIGDIR}/test/testing-configurations/-c-config" "${testdir}" +sed -i "s|CONFIGPATH|${testdir}\/result|g" "${testdir}/-c-config" +WLR_BACKENDS=headless ./cagebreak -c "${testdir}/-c-config" +[[ $(cat "${testdir}/result") = "SUCCESS" ]] || RESULT=1 # check -e option ## Check without socket -cp $MESONCURRENTCONFIGDIR/test/testing-configurations/config $testdir +cp "${MESONCURRENTCONFIGDIR}/test/testing-configurations/config" "${testdir}" readonly oldsocket=$CAGEBREAK_SOCKET -sed -i "s|CONFIGPATH|$testdir\/socket|g" $testdir/config -$(WLR_BACKENDS=headless ./cagebreak -c $testdir/config) -[[ $(cat $testdir/socket) = $oldsocket ]] || RESULT=1 +sed -i "s|CONFIGPATH|${testdir}\/socket|g" "${testdir}/config" +(WLR_BACKENDS=headless ./cagebreak -c "${testdir}/config") +[[ $(cat "${testdir}/socket") = "${oldsocket}" ]] || RESULT=1 ## Check with socket -cp $MESONCURRENTCONFIGDIR/test/testing-configurations/config $testdir -sed -i "s|CONFIGPATH|$testdir\/socket|g" $testdir/config -$(WLR_BACKENDS=headless ./cagebreak -e -c $testdir/config) -[[ ! $(cat $testdir/socket) = $oldsocket ]] || RESULT=1 +cp "${MESONCURRENTCONFIGDIR}/test/testing-configurations/config" "${testdir}" +sed -i "s|CONFIGPATH|$testdir\/socket|g" "${testdir}/config" +(WLR_BACKENDS=headless ./cagebreak -e -c "${testdir}/config") +[[ ! $(cat "${testdir}/socket") = "${oldsocket}" ]] || RESULT=1 # check -h option [[ $(./cagebreak -h) = "$helptext" ]] || RESULT=1 @@ -52,4 +52,4 @@ $(WLR_BACKENDS=headless ./cagebreak -e -c $testdir/config) # check -v option [[ $(./cagebreak -v) = "Cagebreak version $1" ]] || RESULT=1 -exit $RESULT +exit "${RESULT}" diff --git a/test/build-w-o-warnings b/test/build-w-o-warnings index 02d049a..da76db5 100644 --- a/test/build-w-o-warnings +++ b/test/build-w-o-warnings @@ -4,7 +4,8 @@ RESULT=0 -cd $MESONCURRENTCONFIGDIR +# shellcheck disable=SC2164 +cd "${MESONCURRENTCONFIGDIR}" echo "Build standard release build" rm -rf test/test-w-o-warnings meson setup test/test-w-o-warnings -Dxwayland=true -Dman-pages=true --buildtype=release --fatal-meson-warnings || RESULT=1 diff --git a/test/build-w-o-xwayland b/test/build-w-o-xwayland index b97d62c..3c8c789 100644 --- a/test/build-w-o-xwayland +++ b/test/build-w-o-xwayland @@ -4,7 +4,8 @@ RESULT=0 -cd $MESONCURRENTCONFIGDIR +# shellcheck disable=2164 +cd "${MESONCURRENTCONFIGDIR}" echo "Build without xwayland" rm -rf test/test-w-o-xwayland meson setup test/test-w-o-xwayland -Dxwayland=false -Dman-pages=false --buildtype=release --fatal-meson-warnings || RESULT=1 diff --git a/test/clang-format b/test/clang-format index c3dc561..cf7e553 100644 --- a/test/clang-format +++ b/test/clang-format @@ -2,7 +2,7 @@ # Copyright 2023, project-repo and the cagebreak contributors # SPDX-License-Identifier: MIT -readonly declared_deps="${@}" +readonly declared_deps="${*}" readonly deps="${declared_deps}" RESULT=0 @@ -14,7 +14,7 @@ echo "${MESONCURRENTCONFIGDIR}" for file in ${deps} do echo "${file}" - if $(clang-format -Werror --dry-run "${MESONCURRENTCONFIGDIR}/${file}") + if (clang-format -Werror --dry-run "${MESONCURRENTCONFIGDIR}/${file}") then echo " [x] clang-format" else diff --git a/test/copyright-license b/test/copyright-license index a299327..4fe517f 100644 --- a/test/copyright-license +++ b/test/copyright-license @@ -1,13 +1,17 @@ -#! /bin/sh +#! /bin/bash # Copyright 2023, project-repo and the cagebreak contributors # SPDX-License-Identifier: MIT -readonly declared_deps="${@}" +readonly declared_deps="${*}" readonly hardcoded_deps="meson_options.txt meson.build" +# shellcheck disable=2155,2164,2046 readonly test_deps=$(cd "${MESONCURRENTCONFIGDIR}" ; find . -type f | grep test/) +# shellcheck disable=2155,2164,2046 readonly examples_deps=$(cd "${MESONCURRENTCONFIGDIR}" ; find . -type f | grep examples/) +# shellcheck disable=2155,2164,2046 readonly example_scripts_deps=$(cd "${MESONCURRENTCONFIGDIR}" ; find . -type f | grep example_scripts/) readonly deps="${declared_deps} ${hardcoded_deps} ${test_deps} ${examples_deps} ${example_scripts_deps}" +# shellcheck disable=2046,2155 readonly curryear=$(date +%Y) RESULT=0 @@ -15,14 +19,14 @@ RESULT=0 for file in ${deps} do echo "${file}" - if $(grep -q "Copyright.*${curryear}, project-repo and the cagebreak contributors" "$MESONCURRENTCONFIGDIR/${file}") + if (grep -q "Copyright.*${curryear}, project-repo and the cagebreak contributors" "$MESONCURRENTCONFIGDIR/${file}") then echo " [x] Copyright Notice" else RESULT=1 echo " [ ] Copyright Notice" fi - if $(grep -q "SPDX-License-Identifier: MIT" "$MESONCURRENTCONFIGDIR/${file}") + if (grep -q "SPDX-License-Identifier: MIT" "$MESONCURRENTCONFIGDIR/${file}") then echo " [x] SPDX-License-Identifier" else @@ -33,10 +37,12 @@ done [[ "${MESONLICENSE}" = "MIT" ]] || RESULT=1 +# shellcheck disable=2164 cd "${MESONCURRENTCONFIGDIR}" -[[ $(cat LICENSE) = $(cat README.md | tail -$(wc -l LICENSE)) ]] || RESULT=1 +# shellcheck disable=2046,2002 +[[ $(cat LICENSE) = $( cat README.md | tail -$(wc -l LICENSE)) ]] || RESULT=1 -[[ "Copyright (c) 2020-${curryear} The Cagebreak authors" = $(cat LICENSE | head -1) ]] || RESULT=1 +[[ "Copyright (c) 2020-${curryear} The Cagebreak authors" = $( head -1 LICENSE) ]] || RESULT=1 exit "${RESULT}" diff --git a/test/environment-variables b/test/environment-variables index a3a6d50..d0d26c6 100644 --- a/test/environment-variables +++ b/test/environment-variables @@ -9,16 +9,16 @@ RESULT=0 # CAGEBREAK_SOCKET (duplicate of arguments test) ## Check without socket -cp $MESONCURRENTCONFIGDIR/test/testing-configurations/config $testdir +cp "${MESONCURRENTCONFIGDIR}/test/testing-configurations/config" "${testdir}" readonly oldsocket=$CAGEBREAK_SOCKET -sed -i "s|CONFIGPATH|$testdir\/socket|g" $testdir/config -$(WLR_BACKENDS=headless ./cagebreak -c $testdir/config) -[[ $(cat $testdir/socket) = $oldsocket ]] || RESULT=1 +sed -i "s|CONFIGPATH|$testdir\/socket|g" "${testdir}/config" +(WLR_BACKENDS=headless ./cagebreak -c "${testdir}/config") +[[ $(cat "${testdir}/socket") = "${oldsocket}" ]] || RESULT=1 ## Check with socket -cp $MESONCURRENTCONFIGDIR/test/testing-configurations/config $testdir -sed -i "s|CONFIGPATH|$testdir\/socket|g" $testdir/config -$(WLR_BACKENDS=headless ./cagebreak -e -c $testdir/config) -[[ ! $(cat $testdir/socket) = $oldsocket ]] || RESULT=1 +cp "${MESONCURRENTCONFIGDIR}/test/testing-configurations/config" "${testdir}" +sed -i "s|CONFIGPATH|$testdir\/socket|g" "${testdir}/config" +(WLR_BACKENDS=headless ./cagebreak -e -c "${testdir}/config") +[[ ! $(cat "${testdir}/socket") = "${oldsocket}" ]] || RESULT=1 # XDG_CONFIG_HOME cp "${MESONCURRENTCONFIGDIR}/test/testing-configurations/env-var-config" "${testdir}/cagebreak/config" diff --git a/test/illegal-strings b/test/illegal-strings index fc9129d..5ae9dc0 100644 --- a/test/illegal-strings +++ b/test/illegal-strings @@ -2,10 +2,9 @@ # Copyright 2023, project-repo and the cagebreak contributors # SPDX-License-Identifier: MIT -testdir=$(mktemp -d) - RESULT=0 +# shellcheck disable=2164 cd "${MESONCURRENTCONFIGDIR}" # Check that no TODO statements remain in the release directory @@ -13,8 +12,8 @@ if ! grep -Rq "TODO" . then echo "[x] TODO" else - echo "[ ] TODO" RESULT=1 + echo "[ ] TODO" fi # Check that Cagebreak does not falsely claim to be POSIX compliant @@ -22,8 +21,8 @@ if ! grep -Rq "_POSIX_C_SOURCE" . then echo "[x] _POSIX_C_SOURCE" else - echo "[ ] _POSIX_C_SOURCE" RESULT=1 + echo "[ ] _POSIX_C_SOURCE" fi diff --git a/test/scan-build b/test/scan-build index fd5aef4..c7942fd 100644 --- a/test/scan-build +++ b/test/scan-build @@ -4,6 +4,7 @@ RESULT=0 +# shellcheck disable=2164 cd "${MESONCURRENTCONFIGDIR}" rm -rf test/test-scan-build meson setup test/test-scan-build -Dxwayland=true -Dman-pages=true --buildtype=release || RESULT=1 diff --git a/test/shellcheck b/test/shellcheck new file mode 100644 index 0000000..0727178 --- /dev/null +++ b/test/shellcheck @@ -0,0 +1,16 @@ +#!/bin/bash +# Copyright 2023, project-repo and the cagebreak contributors +# SPDX-License-Identifier: MIT + +RESULT=0 + +set -x +# shellcheck disable=2164 +cd "${MESONCURRENTCONFIGDIR}/test" +# shellcheck disable=2046 +shellcheck --source-path=../example_scripts/ $(ls -Itesting-configurations) || RESULT=1 + +cd "${MESONCURRENTCONFIGDIR}/example_scripts/" || RESULT=1 +shellcheck ./* + +exit "${RESULT}" From 5856b3c9c5962de9bf334344f3e8138e679868e3 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 17 Feb 2023 21:54:11 +0100 Subject: [PATCH 603/689] Add semantic versioning check --- meson.build | 1 + test/versions | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 test/versions diff --git a/meson.build b/meson.build index e73851e..e906db7 100644 --- a/meson.build +++ b/meson.build @@ -355,3 +355,4 @@ test('Arguments', find_program('test/arguments'), args : [ meson.project_version test('Environment Variables', find_program('test/environment-variables'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic') test('Scan-build (static analysis)', find_program('test/scan-build'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'release') test('Check for strings indicating problems', find_program('test/illegal-strings'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'release') +test('Semantic versioning', find_program('test/versions'), args : [ meson.project_version() ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'release') diff --git a/test/versions b/test/versions new file mode 100644 index 0000000..b408c71 --- /dev/null +++ b/test/versions @@ -0,0 +1,42 @@ +#!/bin/bash +# Copyright 2023, project-repo and the cagebreak contributors +# SPDX-License-Identifier: MIT + +readonly newversion="${1}" +# shellcheck disable=2155 +readonly oldversion=$(git describe --match=master --abbrev=0) + +RESULT=0 + +# meson.build version +if [[ $(vercmp "${newversion}" "${oldversion}") -gt 0 ]] +then + echo "[x] meson.build version respects semantic versioning" +else + RESULT=1 + echo "[ ] meson.build version is NOT semantic version" +fi + +# shellcheck disable=2164 +cd "${MESONCURRENTCONFIGDIR}" + +for file in man/* +do + if [[ $(head -1 "${file}" | cut -d ' ' -f 3 | rev | cut -c2- | rev ) = "${newversion}" ]] + then + echo "[x] ${file} version is meson.build version" + else + RESULT=1 + echo "[ ] ${file} version is NOT meson.build version" + fi +done + +if head -3 README.md | tail -1 | grep -q "minversion=${newversion}" +then + echo "[x] README.md repology minversion" +else + RESULT=1 + echo "[ ] README.md repology minversion" +fi + +exit "${RESULT}" From 09c75e5a15567655881eefc00c4c9ee56d55751f Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 18 Feb 2023 00:10:27 +0100 Subject: [PATCH 604/689] Move test build dirs to _build* --- test/build-w-o-warnings | 8 ++++---- test/build-w-o-xwayland | 8 ++++---- test/scan-build | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/test/build-w-o-warnings b/test/build-w-o-warnings index da76db5..3866aff 100644 --- a/test/build-w-o-warnings +++ b/test/build-w-o-warnings @@ -7,9 +7,9 @@ RESULT=0 # shellcheck disable=SC2164 cd "${MESONCURRENTCONFIGDIR}" echo "Build standard release build" -rm -rf test/test-w-o-warnings -meson setup test/test-w-o-warnings -Dxwayland=true -Dman-pages=true --buildtype=release --fatal-meson-warnings || RESULT=1 -ninja -C test/test-w-o-warnings || RESULT=1 -rm -rf test/test-w-o-warnings +rm -rf _build-w-o-warnings +meson setup _build-w-o-warnings -Dxwayland=true -Dman-pages=true --buildtype=release --fatal-meson-warnings || RESULT=1 +ninja -C _build-w-o-warnings || RESULT=1 +rm -rf _build-w-o-warnings exit "${RESULT}" diff --git a/test/build-w-o-xwayland b/test/build-w-o-xwayland index 3c8c789..6164f6e 100644 --- a/test/build-w-o-xwayland +++ b/test/build-w-o-xwayland @@ -7,9 +7,9 @@ RESULT=0 # shellcheck disable=2164 cd "${MESONCURRENTCONFIGDIR}" echo "Build without xwayland" -rm -rf test/test-w-o-xwayland -meson setup test/test-w-o-xwayland -Dxwayland=false -Dman-pages=false --buildtype=release --fatal-meson-warnings || RESULT=1 -ninja -C test/test-w-o-xwayland || RESULT=1 -rm -rf test/test-w-o-xwayland +rm -rf _build-w-o-xwayland +meson setup _build-w-o-xwayland -Dxwayland=false -Dman-pages=false --buildtype=release --fatal-meson-warnings || RESULT=1 +ninja -C _build-w-o-xwayland || RESULT=1 +rm -rf _build-w-o-xwayland exit "${RESULT}" diff --git a/test/scan-build b/test/scan-build index c7942fd..562fb42 100644 --- a/test/scan-build +++ b/test/scan-build @@ -6,9 +6,9 @@ RESULT=0 # shellcheck disable=2164 cd "${MESONCURRENTCONFIGDIR}" -rm -rf test/test-scan-build -meson setup test/test-scan-build -Dxwayland=true -Dman-pages=true --buildtype=release || RESULT=1 -SCANBUILD="$(pwd)/test/testing-configurations/my-scan-build" ninja -C test/test-scan-build scan-build || RESULT=1 -rm -rf test/test-scan-build +rm -rf _build-scan-build +meson setup _build-scan-build -Dxwayland=true -Dman-pages=true --buildtype=release || RESULT=1 +SCANBUILD="$(pwd)/test/testing-configurations/my-scan-build" ninja -C _build-scan-build scan-build || RESULT=1 +rm -rf _build-scan-build exit "${RESULT}" From 37beab89946e00a426f815a5055df54809a2c121 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 18 Feb 2023 00:12:33 +0100 Subject: [PATCH 605/689] Adjust file sync for parallel testing --- meson.build | 2 +- test/arguments | 3 +++ test/environment-variables | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index e906db7..74f37a4 100644 --- a/meson.build +++ b/meson.build @@ -351,8 +351,8 @@ test('Build without xwayland', find_program('test/build-w-o-xwayland'), env : [ test('Copyright and LICENSE', find_program('test/copyright-license'), args : [ cagebreak_main_file + cagebreak_source_strings + cagebreak_header_strings + fuzz_sources + fuzz_headers + fuzz_override_lib ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()), ''.join('MESONLICENSE=', meson.project_license())], suite: 'devel' ) test('Clang-format (formatting check)', find_program('test/clang-format'), args : [ cagebreak_main_file + cagebreak_source_strings + cagebreak_header_strings + fuzz_sources + fuzz_headers + fuzz_override_lib ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'devel') test('Shellcheck (script linting)', find_program('test/shellcheck'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'devel') +test('Scan-build (static analysis)', find_program('test/scan-build'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'devel-long') test('Arguments', find_program('test/arguments'), args : [ meson.project_version() ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic') test('Environment Variables', find_program('test/environment-variables'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic') -test('Scan-build (static analysis)', find_program('test/scan-build'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'release') test('Check for strings indicating problems', find_program('test/illegal-strings'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'release') test('Semantic versioning', find_program('test/versions'), args : [ meson.project_version() ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'release') diff --git a/test/arguments b/test/arguments index e276516..05d24e3 100644 --- a/test/arguments +++ b/test/arguments @@ -27,6 +27,7 @@ RESULT=0 cp "${MESONCURRENTCONFIGDIR}/test/testing-configurations/-c-config" "${testdir}" sed -i "s|CONFIGPATH|${testdir}\/result|g" "${testdir}/-c-config" WLR_BACKENDS=headless ./cagebreak -c "${testdir}/-c-config" +sync [[ $(cat "${testdir}/result") = "SUCCESS" ]] || RESULT=1 # check -e option @@ -35,11 +36,13 @@ cp "${MESONCURRENTCONFIGDIR}/test/testing-configurations/config" "${testdir}" readonly oldsocket=$CAGEBREAK_SOCKET sed -i "s|CONFIGPATH|${testdir}\/socket|g" "${testdir}/config" (WLR_BACKENDS=headless ./cagebreak -c "${testdir}/config") +sync [[ $(cat "${testdir}/socket") = "${oldsocket}" ]] || RESULT=1 ## Check with socket cp "${MESONCURRENTCONFIGDIR}/test/testing-configurations/config" "${testdir}" sed -i "s|CONFIGPATH|$testdir\/socket|g" "${testdir}/config" (WLR_BACKENDS=headless ./cagebreak -e -c "${testdir}/config") +sync [[ ! $(cat "${testdir}/socket") = "${oldsocket}" ]] || RESULT=1 # check -h option diff --git a/test/environment-variables b/test/environment-variables index d0d26c6..ceb74c6 100644 --- a/test/environment-variables +++ b/test/environment-variables @@ -13,17 +13,20 @@ cp "${MESONCURRENTCONFIGDIR}/test/testing-configurations/config" "${testdir}" readonly oldsocket=$CAGEBREAK_SOCKET sed -i "s|CONFIGPATH|$testdir\/socket|g" "${testdir}/config" (WLR_BACKENDS=headless ./cagebreak -c "${testdir}/config") +sync [[ $(cat "${testdir}/socket") = "${oldsocket}" ]] || RESULT=1 ## Check with socket cp "${MESONCURRENTCONFIGDIR}/test/testing-configurations/config" "${testdir}" sed -i "s|CONFIGPATH|$testdir\/socket|g" "${testdir}/config" (WLR_BACKENDS=headless ./cagebreak -e -c "${testdir}/config") +sync [[ ! $(cat "${testdir}/socket") = "${oldsocket}" ]] || RESULT=1 # XDG_CONFIG_HOME cp "${MESONCURRENTCONFIGDIR}/test/testing-configurations/env-var-config" "${testdir}/cagebreak/config" sed -i "s|CONFIGPATH|${testdir}\/result|g" "${testdir}/cagebreak/config" XDG_CONFIG_HOME="${testdir}/" WLR_BACKENDS=headless ./cagebreak +sync [[ $(cat "${testdir}/result") = "SUCCESS" ]] || RESULT=1 # The XKB_DEFAULT_* family of variables is not found in the source code From e852d3487aec6ab1fdacf5f66bbe9f59c78d974e Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 18 Feb 2023 00:13:29 +0100 Subject: [PATCH 606/689] Document testing --- README.md | 53 +++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 47 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index fa80900..518d336 100644 --- a/README.md +++ b/README.md @@ -287,6 +287,51 @@ and after #endif ``` +### Test Suite + +``` +meson test -C build +``` + +invokes the all tests. This is required for a release to occur. + +There are four test suites: + + * basic: tests actual outward-facing functionality + * Note optional dependencies for efficient socket interaction + * nc (openbsd-netcat) + * jq + * devel: tests internal properties of the repository + * Note potentially heavier dependencies such as + * shellcheck + * clang-format + * devel-long: applies more costly testing + * Note potentially heavier dependencies such as + * scan-build (static analysis (including security-relevant issues)) + * release: tests release specific considerations + * Note that this is only expected to pass just before + a release. This checks mostly administrative things + to check that a release is ready. + +Every commit should pass at least the basic and devel suites. + +It is expected that cagebreak passes at least the +basic, devel and devel-long suites when commits are pushed: + +``` +meson test -C build --suite basic --suite devel +``` + +The basic suite can be used to test a binary. This is +useful for PKGBUILDs and their equivalents in other +systems. + +``` +meson test -C build --suite basic +``` + +TODO CI with Dockerfile on Github + ### Fuzzing Along with the project source code, a fuzzing framework based on `libfuzzer` is @@ -415,8 +460,6 @@ The release procedure outlines the process for a release to occur. * [ ] Adjust version number * [ ] meson.build * [ ] git tag - * [ ] man pages - * [ ] README.md repology badges minversion * [ ] Relevant Documentation completed * [ ] New features * [ ] man pages @@ -437,11 +480,8 @@ The release procedure outlines the process for a release to occur. * [ ] Testing * [ ] Manual testing * [ ] Libfuzzer testing - * [ ] Build version without xwayland support - * [ ] meson.build reproducible build versions are current archlinux libraries and gcc + * [ ] Arch Build System is up to date * [ ] wlr_xdg_shell version check - * [ ] `ninja -C build clang-format` makes no changes - * [ ] `ninja -C build scan-build` shows no issues * [ ] Cagebreak is reproducible on multiple machines * [ ] Documented reproducible build artefacts * [ ] Hashes of the artefacts in Hashes.md @@ -451,6 +491,7 @@ The release procedure outlines the process for a release to occur. * [ ] `gpg --detach-sign -u keyid cagebreak.1` * [ ] `gpg --detach-sign -u keyid cagebreak-config.5` * [ ] `gpg --detach-sign -u keyid cagebreak-socket.7` + * [ ] `meson test -C build` * [ ] `git add` relevant files * [ ] `git commit` * [ ] `git push origin development` From 480298d96b752fcae96a98226e63d73877c8dcae Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 18 Feb 2023 11:12:04 +0100 Subject: [PATCH 607/689] Update dependencies --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 74f37a4..0d69475 100644 --- a/meson.build +++ b/meson.build @@ -209,7 +209,7 @@ reproducible_build_versions = { 'fontconfig': '2.14.2', 'libinput': '1.22.1', 'libevdev': '1.13.0', - 'libudev': '252', + 'libudev': '253', 'pango': '1.50.12', 'cairo': '1.17.8', 'pangocairo': '1.50.12', From 441cee33c717e3cd7352cc39f88805f2c9fb94fc Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 18 Feb 2023 11:18:14 +0100 Subject: [PATCH 608/689] Remove whitespace --- test/environment-variables | 3 --- 1 file changed, 3 deletions(-) diff --git a/test/environment-variables b/test/environment-variables index ceb74c6..cd5c4ec 100644 --- a/test/environment-variables +++ b/test/environment-variables @@ -33,6 +33,3 @@ sync # of Cagebreak but necessary to configure software for use with Cagebreak. exit "${RESULT}" - - - From a7f1e3fa3646dd85c88e2c63ce89c9a405cab2b8 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 18 Feb 2023 11:48:11 +0100 Subject: [PATCH 609/689] Fix env var test --- test/environment-variables | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/environment-variables b/test/environment-variables index cd5c4ec..0d797db 100644 --- a/test/environment-variables +++ b/test/environment-variables @@ -10,7 +10,7 @@ RESULT=0 # CAGEBREAK_SOCKET (duplicate of arguments test) ## Check without socket cp "${MESONCURRENTCONFIGDIR}/test/testing-configurations/config" "${testdir}" -readonly oldsocket=$CAGEBREAK_SOCKET +readonly oldsocket="${CAGEBREAK_SOCKET}" sed -i "s|CONFIGPATH|$testdir\/socket|g" "${testdir}/config" (WLR_BACKENDS=headless ./cagebreak -c "${testdir}/config") sync From d6fb8d19f3e81603db11d098ec3ba0bb039a291b Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 18 Feb 2023 12:15:28 +0100 Subject: [PATCH 610/689] Fix README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 518d336..cd6d0f4 100644 --- a/README.md +++ b/README.md @@ -148,7 +148,7 @@ Cagebreak was originally built to suit the needs of its creators. This section o how we intended some parts of cagebreak and might ease learning how to use cagebreak a little bit. Please note that this does not replace the man pages or the FAQ. Also, this is in no way intended as a guide on how cagebreak must be used but rather -as a source of inspiration and of explanations for why certain particularities. +as a source of inspiration and explanations for certain particularities. 1. Cagebreak is keyboard-based. Everything regarding cagebreak can be done through the keyboard and it is our view that it should be. This does not mean @@ -293,7 +293,7 @@ and after meson test -C build ``` -invokes the all tests. This is required for a release to occur. +invokes all tests. This is required for a release to occur. There are four test suites: From 25d6610038177d931072080c3bf8c47305d889de Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 18 Feb 2023 19:02:05 +0100 Subject: [PATCH 611/689] Adjust arg/env var dir handling --- test/arguments | 27 +++++++++++++++------------ test/environment-variables | 21 ++++++++++++--------- 2 files changed, 27 insertions(+), 21 deletions(-) diff --git a/test/arguments b/test/arguments index 05d24e3..4bd543a 100644 --- a/test/arguments +++ b/test/arguments @@ -3,6 +3,7 @@ # SPDX-License-Identifier: MIT testdir=$(mktemp -d) +mkdir "${testdir}/arguments/" readonly helptext="Usage: ./cagebreak [OPTIONS] @@ -24,26 +25,26 @@ RESULT=0 [[ $(2>&1 ./cagebreak -c | head -1 ) = "./cagebreak: option requires an argument -- 'c'" ]] || RESULT=1 [[ $(2>&1 ./cagebreak -c | tail -n +2 ) = "$helptext" ]] || RESULT=1 ## Check with config file -cp "${MESONCURRENTCONFIGDIR}/test/testing-configurations/-c-config" "${testdir}" -sed -i "s|CONFIGPATH|${testdir}\/result|g" "${testdir}/-c-config" -WLR_BACKENDS=headless ./cagebreak -c "${testdir}/-c-config" +cp "${MESONCURRENTCONFIGDIR}/test/testing-configurations/-c-config" "${testdir}/arguments/" +sed -i "s|CONFIGPATH|${testdir}\/arguments\/result|g" "${testdir}/arguments/-c-config" +WLR_BACKENDS=headless ./cagebreak -c "${testdir}/arguments/-c-config" sync -[[ $(cat "${testdir}/result") = "SUCCESS" ]] || RESULT=1 +[[ $(cat "${testdir}/arguments/result") = "SUCCESS" ]] || RESULT=1 # check -e option ## Check without socket -cp "${MESONCURRENTCONFIGDIR}/test/testing-configurations/config" "${testdir}" +cp "${MESONCURRENTCONFIGDIR}/test/testing-configurations/config" "${testdir}/arguments" readonly oldsocket=$CAGEBREAK_SOCKET -sed -i "s|CONFIGPATH|${testdir}\/socket|g" "${testdir}/config" -(WLR_BACKENDS=headless ./cagebreak -c "${testdir}/config") +sed -i "s|CONFIGPATH|${testdir}\/arguments\/socket|g" "${testdir}/arguments/config" +(WLR_BACKENDS=headless ./cagebreak -c "${testdir}/arguments/config") sync -[[ $(cat "${testdir}/socket") = "${oldsocket}" ]] || RESULT=1 +[[ $(cat "${testdir}/arguments/socket") = "${oldsocket}" ]] || RESULT=1 ## Check with socket -cp "${MESONCURRENTCONFIGDIR}/test/testing-configurations/config" "${testdir}" -sed -i "s|CONFIGPATH|$testdir\/socket|g" "${testdir}/config" -(WLR_BACKENDS=headless ./cagebreak -e -c "${testdir}/config") +cp "${MESONCURRENTCONFIGDIR}/test/testing-configurations/config" "${testdir}/arguments" +sed -i "s|CONFIGPATH|$testdir\/arguments\/socket|g" "${testdir}/arguments/config" +(WLR_BACKENDS=headless ./cagebreak -e -c "${testdir}/arguments/config") sync -[[ ! $(cat "${testdir}/socket") = "${oldsocket}" ]] || RESULT=1 +[[ ! $(cat "${testdir}/arguments/socket") = "${oldsocket}" ]] || RESULT=1 # check -h option [[ $(./cagebreak -h) = "$helptext" ]] || RESULT=1 @@ -55,4 +56,6 @@ sync # check -v option [[ $(./cagebreak -v) = "Cagebreak version $1" ]] || RESULT=1 +rm -rf "${testdir}" + exit "${RESULT}" diff --git a/test/environment-variables b/test/environment-variables index 0d797db..aa67dfa 100644 --- a/test/environment-variables +++ b/test/environment-variables @@ -3,33 +3,36 @@ # SPDX-License-Identifier: MIT testdir=$(mktemp -d) +mkdir "${testdir}/envvars/" mkdir "${testdir}/cagebreak" RESULT=0 # CAGEBREAK_SOCKET (duplicate of arguments test) ## Check without socket -cp "${MESONCURRENTCONFIGDIR}/test/testing-configurations/config" "${testdir}" +cp "${MESONCURRENTCONFIGDIR}/test/testing-configurations/config" "${testdir}/envvars" readonly oldsocket="${CAGEBREAK_SOCKET}" -sed -i "s|CONFIGPATH|$testdir\/socket|g" "${testdir}/config" -(WLR_BACKENDS=headless ./cagebreak -c "${testdir}/config") +sed -i "s|CONFIGPATH|$testdir\/envvars\/socket|g" "${testdir}/envvars/config" +(WLR_BACKENDS=headless ./cagebreak -c "${testdir}/envvars/config") sync -[[ $(cat "${testdir}/socket") = "${oldsocket}" ]] || RESULT=1 +[[ $(cat "${testdir}/envvars/socket") = "${oldsocket}" ]] || RESULT=1 ## Check with socket -cp "${MESONCURRENTCONFIGDIR}/test/testing-configurations/config" "${testdir}" -sed -i "s|CONFIGPATH|$testdir\/socket|g" "${testdir}/config" -(WLR_BACKENDS=headless ./cagebreak -e -c "${testdir}/config") +cp "${MESONCURRENTCONFIGDIR}/test/testing-configurations/config" "${testdir}/envvars" +sed -i "s|CONFIGPATH|$testdir\/envvars\/socket|g" "${testdir}/envvars/config" +(WLR_BACKENDS=headless ./cagebreak -e -c "${testdir}/envvars/config") sync [[ ! $(cat "${testdir}/socket") = "${oldsocket}" ]] || RESULT=1 # XDG_CONFIG_HOME cp "${MESONCURRENTCONFIGDIR}/test/testing-configurations/env-var-config" "${testdir}/cagebreak/config" -sed -i "s|CONFIGPATH|${testdir}\/result|g" "${testdir}/cagebreak/config" +sed -i "s|CONFIGPATH|${testdir}\/cagebreak\/result|g" "${testdir}/cagebreak/config" XDG_CONFIG_HOME="${testdir}/" WLR_BACKENDS=headless ./cagebreak sync -[[ $(cat "${testdir}/result") = "SUCCESS" ]] || RESULT=1 +[[ $(cat "${testdir}/cagebreak/result") = "SUCCESS" ]] || RESULT=1 # The XKB_DEFAULT_* family of variables is not found in the source code # of Cagebreak but necessary to configure software for use with Cagebreak. +rm -rf "${testdir}" + exit "${RESULT}" From 9f5a0291569e7e35d6d29418fc3430212bd83e75 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 19 Feb 2023 09:58:21 +0100 Subject: [PATCH 612/689] Fix dump output --- keybinding.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/keybinding.c b/keybinding.c index e699dfd..567d689 100644 --- a/keybinding.c +++ b/keybinding.c @@ -1181,8 +1181,16 @@ keybinding_dump(struct cg_server *server) { print_str(&str, "\"nws\":%d,\n", server->nws); print_str(&str, "\"bg_color\":[%f,%f,%f],\n", server->bg_color[0], server->bg_color[1], server->bg_color[2]); - print_str(&str, "\"views_curr_id\":%d,\n", server->views_curr_id); - print_str(&str, "\"tiles_curr_id\":%d,\n", server->tiles_curr_id); + struct cg_view *focused_view=seat_get_focus(server->seat); + int curr_view_id=-1,curr_tile_id=-1; + if(focused_view != NULL) { + curr_view_id=focused_view->id; + if(focused_view->tile != NULL) { + curr_tile_id=focused_view->tile->id; + } + } + print_str(&str, "\"views_curr_id\":%d,\n", curr_view_id); + print_str(&str, "\"tiles_curr_id\":%d,\n", curr_tile_id); print_str(&str, "\"curr_output\":\"%s\",\n", server->curr_output->wlr_output->name); print_str(&str, "\"default_mode\":\"%s\",\n", From 699974e910c26c5cc90b3dedff9dc7a6b46bb2f1 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 19 Feb 2023 12:28:55 +0100 Subject: [PATCH 613/689] Apply clang-format --- keybinding.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/keybinding.c b/keybinding.c index 567d689..a87ab99 100644 --- a/keybinding.c +++ b/keybinding.c @@ -1181,12 +1181,12 @@ keybinding_dump(struct cg_server *server) { print_str(&str, "\"nws\":%d,\n", server->nws); print_str(&str, "\"bg_color\":[%f,%f,%f],\n", server->bg_color[0], server->bg_color[1], server->bg_color[2]); - struct cg_view *focused_view=seat_get_focus(server->seat); - int curr_view_id=-1,curr_tile_id=-1; + struct cg_view *focused_view = seat_get_focus(server->seat); + int curr_view_id = -1, curr_tile_id = -1; if(focused_view != NULL) { - curr_view_id=focused_view->id; + curr_view_id = focused_view->id; if(focused_view->tile != NULL) { - curr_tile_id=focused_view->tile->id; + curr_tile_id = focused_view->tile->id; } } print_str(&str, "\"views_curr_id\":%d,\n", curr_view_id); From 270405cb3ceb30a627a84b9ed98461975241e3b0 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 19 Feb 2023 12:32:16 +0100 Subject: [PATCH 614/689] Adjust version numbers --- README.md | 2 +- man/cagebreak-config.5.md | 2 +- man/cagebreak-socket.7.md | 2 +- man/cagebreak.1.md | 2 +- meson.build | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index cd6d0f4..2fa7092 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Cagebreak: A Wayland Tiling Compositor -[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/6532/badge)](https://bestpractices.coreinfrastructure.org/projects/6532) [![Packaging status](https://repology.org/badge/tiny-repos/cagebreak.svg)](https://repology.org/project/cagebreak/versions) [![AUR package](https://repology.org/badge/version-for-repo/aur/cagebreak.svg?minversion=2.0.2)](https://repology.org/project/cagebreak/versions) +[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/6532/badge)](https://bestpractices.coreinfrastructure.org/projects/6532) [![Packaging status](https://repology.org/badge/tiny-repos/cagebreak.svg)](https://repology.org/project/cagebreak/versions) [![AUR package](https://repology.org/badge/version-for-repo/aur/cagebreak.svg?minversion=2.1.0)](https://repology.org/project/cagebreak/versions) ## Quick Introduction diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index a705f01..4d0746b 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -1,4 +1,4 @@ -cagebreak-config(5) "Version 2.0.2" "Cagebreak Manual" +cagebreak-config(5) "Version 2.1.0" "Cagebreak Manual" # NAME diff --git a/man/cagebreak-socket.7.md b/man/cagebreak-socket.7.md index 7bd7f1d..6d5bc21 100644 --- a/man/cagebreak-socket.7.md +++ b/man/cagebreak-socket.7.md @@ -1,4 +1,4 @@ -cagebreak-socket(7) "Version 2.0.2" "Cagebreak Manual" +cagebreak-socket(7) "Version 2.1.0" "Cagebreak Manual" # NAME diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index 52ee305..ad4c682 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -1,4 +1,4 @@ -cagebreak(1) "Version 2.0.2" "Cagebreak Manual" +cagebreak(1) "Version 2.1.0" "Cagebreak Manual" # NAME diff --git a/meson.build b/meson.build index 0d69475..c4fb594 100644 --- a/meson.build +++ b/meson.build @@ -3,7 +3,7 @@ project( 'cagebreak', 'c', -version : '2.0.2', +version : '2.1.0', license : 'MIT', default_options : ['c_std=c11', 'warning_level=3'] ) From 4c0f4f7d7a1853a3a80ff174a296c4bce289f9d4 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 20 Feb 2023 22:28:10 +0100 Subject: [PATCH 615/689] Adjust test suites --- test/arguments | 3 ++- test/environment-variables | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/test/arguments b/test/arguments index 4bd543a..04800fc 100644 --- a/test/arguments +++ b/test/arguments @@ -2,7 +2,8 @@ # Copyright 2023, project-repo and the cagebreak contributors # SPDX-License-Identifier: MIT -testdir=$(mktemp -d) +testdir="${MESONCURRENTCONFIGDIR}/_build-arguments/" +mkdir "${testdir}" mkdir "${testdir}/arguments/" readonly helptext="Usage: ./cagebreak [OPTIONS] diff --git a/test/environment-variables b/test/environment-variables index aa67dfa..f1c9fac 100644 --- a/test/environment-variables +++ b/test/environment-variables @@ -2,7 +2,8 @@ # Copyright 2023, project-repo and the cagebreak contributors # SPDX-License-Identifier: MIT -testdir=$(mktemp -d) +testdir="${MESONCURRENTCONFIGDIR}/_build-envvars" +mkdir "${testdir}" mkdir "${testdir}/envvars/" mkdir "${testdir}/cagebreak" From 8f13be1f7cfa0c37613d120fee1c7a0885d9c3b0 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 20 Feb 2023 22:30:13 +0100 Subject: [PATCH 616/689] Fix arguments test --- test/arguments | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/arguments b/test/arguments index 04800fc..d858069 100644 --- a/test/arguments +++ b/test/arguments @@ -14,9 +14,9 @@ readonly helptext="Usage: ./cagebreak [OPTIONS] -s Show information about the current setup and exit -v Show the version number and exit" -readonly basicheadless="Cagebreak $1 is running on Wayland display wayland-1 +readonly basicheadless="Cagebreak ${1} is running on Wayland display wayland-. Outputs: - * HEADLESS-1 + \\* HEADLESS-1 Inputs:" RESULT=0 @@ -51,7 +51,7 @@ sync [[ $(./cagebreak -h) = "$helptext" ]] || RESULT=1 # check -s option -[[ $(WLR_BACKENDS=headless ./cagebreak -s) = "$basicheadless" ]] || RESULT=1 +[[ $(WLR_BACKENDS=headless ./cagebreak -s) =~ ${basicheadless} ]] || RESULT=1 # check -v option From e433bead8b0a2e2fa84dec56a9bbb3814753d7f0 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 20 Feb 2023 22:36:56 +0100 Subject: [PATCH 617/689] Make arguments test more robust --- test/arguments | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/arguments b/test/arguments index d858069..825dc2d 100644 --- a/test/arguments +++ b/test/arguments @@ -14,7 +14,7 @@ readonly helptext="Usage: ./cagebreak [OPTIONS] -s Show information about the current setup and exit -v Show the version number and exit" -readonly basicheadless="Cagebreak ${1} is running on Wayland display wayland-. +readonly basicheadless="Cagebreak ${1} is running on Wayland display wayland-.* Outputs: \\* HEADLESS-1 Inputs:" From e4699167664eee7b2929e8b4a8561fe75b2a8b6b Mon Sep 17 00:00:00 2001 From: project-repo Date: Wed, 22 Feb 2023 23:25:19 +0100 Subject: [PATCH 618/689] Update dependencies --- meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index c4fb594..c0d1661 100644 --- a/meson.build +++ b/meson.build @@ -210,9 +210,9 @@ reproducible_build_versions = { 'libinput': '1.22.1', 'libevdev': '1.13.0', 'libudev': '253', - 'pango': '1.50.12', + 'pango': '1.50.13', 'cairo': '1.17.8', - 'pangocairo': '1.50.12', + 'pangocairo': '1.50.13', 'math': '-1' } From 0c0e9aa0836f0ee87c9d0d5e396f29863a859df6 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 6 Mar 2023 17:41:36 +0100 Subject: [PATCH 619/689] Add bs option --- cagebreak.c | 16 +++++++++++++--- keybinding.c | 7 ++++++- server.h | 1 + view.h | 1 + xdg_shell.c | 8 ++++++++ xwayland.c | 8 ++++++++ 6 files changed, 37 insertions(+), 4 deletions(-) diff --git a/cagebreak.c b/cagebreak.c index 513c240..c12058f 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -6,6 +6,7 @@ #include "config.h" #include +#include #include #include #include @@ -128,17 +129,25 @@ usage(FILE *file, const char *const cage) { " -e\t\t Enable socket\n" " -h\t\t Display this help message\n" " -s\t\t Show information about the current setup and exit\n" - " -v\t\t Show the version number and exit\n", + " -v\t\t Show the version number and exit\n" + " --bs\t\t \"bad security\": Enable features with potential " + "security implications (see man page)\n", cage); } static bool parse_args(struct cg_server *server, int argc, char *argv[], char **config_path) { - int c; + int c, option_index; server->enable_socket = false; - while((c = getopt(argc, argv, "c:hvse")) != -1) { + static struct option long_options[] = {{"bs", no_argument, 0, 0}, + {0, 0, 0, 0}}; + while((c = getopt_long(argc, argv, "c:hvse", long_options, + &option_index)) != -1) { switch(c) { + case 0: + server->bs = true; + break; case 'h': usage(stdout, argv[0]); return false; @@ -275,6 +284,7 @@ main(int argc, char *argv[]) { wl_list_init(&server.output_priorities); int ret = 0; + server.bs = 0; char *config_path = NULL; if(!parse_args(&server, argc, argv, &config_path)) { diff --git a/keybinding.c b/keybinding.c index a87ab99..a4fcbef 100644 --- a/keybinding.c +++ b/keybinding.c @@ -868,10 +868,15 @@ print_view(struct cg_view *view) { struct dyn_str outp_str; outp_str.len = 0; outp_str.cur_pos = 0; - uint32_t nmemb = 4; + uint32_t nmemb = 5; outp_str.str_arr = calloc(nmemb, sizeof(char *)); print_str(&outp_str, "\"id\": %d,\n", view->id); print_str(&outp_str, "\"pid\": %d,\n", view->impl->get_pid(view)); + if(view->server->bs == true) { + char *title_str = view->impl->get_title(view); + print_str(&outp_str, "\"title\": \"%s\",\n", + title_str == NULL ? "" : title_str); + } print_str(&outp_str, "\"coords\": {\"x\":%d,\"y\":%d},\n", view->ox, view->oy); #if CG_HAS_XWAYLAND diff --git a/server.h b/server.h index 3c13c4e..9f6eca6 100644 --- a/server.h +++ b/server.h @@ -57,6 +57,7 @@ struct cg_server { struct cg_ipc_handle ipc; bool enable_socket; + bool bs; bool running; char **modes; uint16_t nws; diff --git a/view.h b/view.h index b3b2ed6..a3b61ed 100644 --- a/view.h +++ b/view.h @@ -39,6 +39,7 @@ struct cg_view { struct cg_view_impl { pid_t (*get_pid)(const struct cg_view *view); + char *(*get_title)(const struct cg_view *view); bool (*is_primary)(const struct cg_view *view); void (*activate)(struct cg_view *view, bool activate); void (*close)(struct cg_view *view); diff --git a/xdg_shell.c b/xdg_shell.c index 164ede0..afa3352 100644 --- a/xdg_shell.c +++ b/xdg_shell.c @@ -110,6 +110,13 @@ get_pid(const struct cg_view *view) { return pid; } +static char * +get_title(const struct cg_view *view) { + const struct cg_xdg_shell_view *xdg_shell_view = + xdg_shell_view_from_const_view(view); + return xdg_shell_view->xdg_surface->toplevel->title; +} + static bool is_primary(const struct cg_view *view) { const struct cg_xdg_shell_view *xdg_shell_view = @@ -208,6 +215,7 @@ handle_xdg_shell_surface_destroy(struct wl_listener *listener, void *_data) { } static const struct cg_view_impl xdg_shell_view_impl = {.get_pid = get_pid, + .get_title = get_title, .is_primary = is_primary, .activate = activate, diff --git a/xwayland.c b/xwayland.c index fd8d174..ece9e5a 100644 --- a/xwayland.c +++ b/xwayland.c @@ -46,6 +46,13 @@ get_pid(const struct cg_view *view) { return surf->pid; } +static char * +get_title(const struct cg_view *view) { + const struct cg_xwayland_view *xwayland_view = + xwayland_view_from_const_view(view); + return xwayland_view->xwayland_surface->title; +} + static bool is_primary(const struct cg_view *view) { const struct cg_xwayland_view *xwayland_view = @@ -157,6 +164,7 @@ handle_xwayland_surface_destroy(struct wl_listener *listener, void *_data) { } static const struct cg_view_impl xwayland_view_impl = { + .get_title = get_title, .get_pid = get_pid, .is_primary = is_primary, .activate = activate, From aeec55f30de8b3fb1916f310d7bc1f6c9762854e Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 27 Mar 2023 20:59:50 +0200 Subject: [PATCH 620/689] Add new signing keys --- keys/cagebreak@project-repo.co.pub | 157 ++++++++++-------- keys/cagebreak@project-repo.co.pub-legacy-3 | 76 +++++++++ ...gebreak_signing_key_11@project-repo.co.pub | 64 +++++++ ...gebreak_signing_key_12@project-repo.co.pub | 64 +++++++ 4 files changed, 288 insertions(+), 73 deletions(-) create mode 100644 keys/cagebreak@project-repo.co.pub-legacy-3 create mode 100644 keys/cagebreak_signing_key_11@project-repo.co.pub create mode 100644 keys/cagebreak_signing_key_12@project-repo.co.pub diff --git a/keys/cagebreak@project-repo.co.pub b/keys/cagebreak@project-repo.co.pub index c266665..648618b 100644 --- a/keys/cagebreak@project-repo.co.pub +++ b/keys/cagebreak@project-repo.co.pub @@ -1,76 +1,87 @@ -----BEGIN PGP PUBLIC KEY BLOCK----- -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 -PbvoKi4FeWdszeakeWuqdmKEi/+ltIk= -=uqsg +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 +=bl5A -----END PGP PUBLIC KEY BLOCK----- diff --git a/keys/cagebreak@project-repo.co.pub-legacy-3 b/keys/cagebreak@project-repo.co.pub-legacy-3 new file mode 100644 index 0000000..c266665 --- /dev/null +++ b/keys/cagebreak@project-repo.co.pub-legacy-3 @@ -0,0 +1,76 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +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 +PbvoKi4FeWdszeakeWuqdmKEi/+ltIk= +=uqsg +-----END PGP PUBLIC KEY BLOCK----- diff --git a/keys/cagebreak_signing_key_11@project-repo.co.pub b/keys/cagebreak_signing_key_11@project-repo.co.pub new file mode 100644 index 0000000..e9e5720 --- /dev/null +++ b/keys/cagebreak_signing_key_11@project-repo.co.pub @@ -0,0 +1,64 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +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 +=aQvd +-----END PGP PUBLIC KEY BLOCK----- diff --git a/keys/cagebreak_signing_key_12@project-repo.co.pub b/keys/cagebreak_signing_key_12@project-repo.co.pub new file mode 100644 index 0000000..e8a379f --- /dev/null +++ b/keys/cagebreak_signing_key_12@project-repo.co.pub @@ -0,0 +1,64 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +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 +=ZVRm +-----END PGP PUBLIC KEY BLOCK----- From 94773ebdeb301dff713d6de90d0331bf80263624 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 27 Mar 2023 21:14:45 +0200 Subject: [PATCH 621/689] Document bs option --- man/cagebreak.1.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index ad4c682..a8ef121 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -47,6 +47,12 @@ are displayed in a message box at the top right of the screen. *-v* Show version number and exit +*--bs* + "bad security". Enable features with potential security implications. + Currently, this option has the following effects (possible implications + in parentheses): + - Print view titles in `dump` output (an attacker may be able to read sensitive information contained in the view title). + # ENVIRONMENT *CAGEBREAK_SOCKET* From 299eeb10d67555f77c12f789ab78d9a13c98366e Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 27 Mar 2023 21:14:49 +0200 Subject: [PATCH 622/689] Update dependency versions --- meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index c0d1661..20b07de 100644 --- a/meson.build +++ b/meson.build @@ -210,9 +210,9 @@ reproducible_build_versions = { 'libinput': '1.22.1', 'libevdev': '1.13.0', 'libudev': '253', - 'pango': '1.50.13', + 'pango': '1.50.14', 'cairo': '1.17.8', - 'pangocairo': '1.50.13', + 'pangocairo': '1.50.14', 'math': '-1' } From b59be56e36216d00e399f96233b8e9e056177404 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 27 Mar 2023 21:32:56 +0200 Subject: [PATCH 623/689] Update arguments unit test --- test/arguments | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/arguments b/test/arguments index 825dc2d..3112ca4 100644 --- a/test/arguments +++ b/test/arguments @@ -12,7 +12,8 @@ readonly helptext="Usage: ./cagebreak [OPTIONS] -e Enable socket -h Display this help message -s Show information about the current setup and exit - -v Show the version number and exit" + -v Show the version number and exit + --bs \"bad security\": Enable features with potential security implications (see man page)" readonly basicheadless="Cagebreak ${1} is running on Wayland display wayland-.* Outputs: From 88378f38ce2f7dc640d2b5e5af8c0a9bcfdc9dd2 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 27 Mar 2023 21:45:28 +0200 Subject: [PATCH 624/689] Silence clang analyzer false positive --- cagebreak.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cagebreak.c b/cagebreak.c index c12058f..4437331 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -142,6 +142,7 @@ parse_args(struct cg_server *server, int argc, char *argv[], server->enable_socket = false; static struct option long_options[] = {{"bs", no_argument, 0, 0}, {0, 0, 0, 0}}; +#ifndef __clang_analyzer__ while((c = getopt_long(argc, argv, "c:hvse", long_options, &option_index)) != -1) { switch(c) { @@ -176,6 +177,7 @@ parse_args(struct cg_server *server, int argc, char *argv[], usage(stderr, argv[0]); return false; } +#endif return true; } From 604bcff8ab7e1089d81d5cffa8ff3be4028b4477 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 3 Apr 2023 18:16:35 +0200 Subject: [PATCH 625/689] Document new key fingerprints in relevant documentation --- README.md | 4 ++-- SECURITY.md | 4 +++- man/cagebreak-config.5.md | 1 + man/cagebreak-socket.7.md | 1 + man/cagebreak.1.md | 1 + 5 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2fa7092..f933980 100644 --- a/README.md +++ b/README.md @@ -330,8 +330,6 @@ systems. meson test -C build --suite basic ``` -TODO CI with Dockerfile on Github - ### Fuzzing Along with the project source code, a fuzzing framework based on `libfuzzer` is @@ -421,6 +419,8 @@ keys. * AA927AFD50AF7C6810E69FE8274F2C605359E31B * BE2DED372287BC4EB2213E13A0C743848A638955 * 0F3476E4B2404F95EC41600683D5810F7911B020 + * 4E82C72C6B3E58A7BC4FF8554909F84CA83BB867 + * 5AEB1A2EB0D13F67E306AC59DC0CC81BE006FD85 Should we at any point retire a key, we will only replace it with keys signed by at least one of the above collection. diff --git a/SECURITY.md b/SECURITY.md index bd7c388..2f33197 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -42,6 +42,7 @@ in `keys/` and sign your message with your own key. * B15B92642760E11FE002DE168708D42451A94AB5 * F8DD9F8DD12B85A28F5827C4678E34D2E753AA3C * 3ACEA46CCECD59E4C8222F791CBEB493681E8693 +* 0A268C188D7949FEB39FD1462F2AD980247E4918 Note that our keys are signed by cagebreak signing keys. @@ -62,7 +63,8 @@ screens, ipc and potentially other documented local channels. ### STRIDE Threat List This is not a thorough analysis, just an overview of the ways in which cagebreak -has (no) attack surface. +has (no) attack surface. Please reference the man pages for details but especially +the -e and --bs options. #### Spoofing diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index 4d0746b..1c65b78 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -420,6 +420,7 @@ GPG Fingerprints: - B15B92642760E11FE002DE168708D42451A94AB5 - F8DD9F8DD12B85A28F5827C4678E34D2E753AA3C - 3ACEA46CCECD59E4C8222F791CBEB493681E8693 +- 0A268C188D7949FEB39FD1462F2AD980247E4918 # LICENSE diff --git a/man/cagebreak-socket.7.md b/man/cagebreak-socket.7.md index 6d5bc21..b8e8d9c 100644 --- a/man/cagebreak-socket.7.md +++ b/man/cagebreak-socket.7.md @@ -582,6 +582,7 @@ GPG Fingerprints: - B15B92642760E11FE002DE168708D42451A94AB5 - F8DD9F8DD12B85A28F5827C4678E34D2E753AA3C - 3ACEA46CCECD59E4C8222F791CBEB493681E8693 +- 0A268C188D7949FEB39FD1462F2AD980247E4918 # LICENSE diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index a8ef121..b3fd209 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -90,6 +90,7 @@ GPG Fingerprints: - B15B92642760E11FE002DE168708D42451A94AB5 - F8DD9F8DD12B85A28F5827C4678E34D2E753AA3C - 3ACEA46CCECD59E4C8222F791CBEB493681E8693 +- 0A268C188D7949FEB39FD1462F2AD980247E4918 # LICENSE From 336ed715009e2594b8632582f9396a3f768772e7 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 3 Apr 2023 18:40:24 +0200 Subject: [PATCH 626/689] Adjust Bugs.md for 2.1.0 --- Bugs.md | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/Bugs.md b/Bugs.md index d5df883..d8a33a1 100644 --- a/Bugs.md +++ b/Bugs.md @@ -1124,17 +1124,17 @@ Thanks to Jan Beich for pointing this out and providing a PR. ## Issue 55 * github issue number: N/A - * Fixed: 2.0.2 + * Fixed: 2.1.0 -Prior to release 2.0.2, cagebreak sometimes crased due to a null pointer +Prior to release 2.1.0, cagebreak sometimes crased due to a null pointer derefrence when the cursor was moved. ## Issue 56 * github issue numner: N/A - * Fixed: 2.0.2 + * Fixed: 2.1.0 -Prior to release 2.0.2, the following workflow caused cagebreak to +Prior to release 2.1.0, the following workflow caused cagebreak to crash: * Split an empty workspace. @@ -1149,7 +1149,7 @@ focussing the background correctly when cycling. ## Issue 57 * github issue number: #39 - * Fixed: 2.0.2 + * Fixed: 2.1.0 maxhbr pointed out that there was a spelling mistake in the SPDX-License-Identifier. @@ -1157,10 +1157,16 @@ SPDX-License-Identifier. ## Issue 58 * github issue number: #40 - * Fixed: 2.0.2 + * Fixed: 2.1.0 -Prior to version 2.0.2, the logic behind configuration file loading was +Prior to version 2.1.0, the logic behind configuration file loading was broken. This had the effect, that the default configuration file was not loaded when the user-specific config file was not present, instead leading to a termination of cagebreak. +## Issue 59 + + * github issue number: N/A + * Fixed: 2.1.0 + +Prior to release 2.1.0 `meson install` did not work perfectly. From b64c38a1b9158432ff23c0b0a8fa4b61e78aaefd Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 3 Apr 2023 18:43:54 +0200 Subject: [PATCH 627/689] Update epoch --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 20b07de..5901d33 100644 --- a/meson.build +++ b/meson.build @@ -260,7 +260,7 @@ install_data('LICENSE', install_dir : '/usr/share/licenses/' + meson.project_nam if get_option('man-pages') scdoc = find_program('scdoc') - secssinceepoch = 1673282376 + secssinceepoch = 1680540192 shcommand = 'export SOURCE_DATE_EPOCH=' + secssinceepoch.to_string() + ' ; @0@ < @INPUT@'.format(scdoc.path()) sh = find_program('sh') mandir1 = join_paths(get_option('mandir'), 'man1') From 89dbf74e70313f71f7c820adc28cfa04bfc85a22 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 3 Apr 2023 19:27:34 +0200 Subject: [PATCH 628/689] Update meson.build for 2.1.0 --- meson.build | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 5901d33..f9708e7 100644 --- a/meson.build +++ b/meson.build @@ -207,7 +207,7 @@ reproducible_build_versions = { 'wlroots': '0.16.2', 'xkbcommon': '1.5.0', 'fontconfig': '2.14.2', - 'libinput': '1.22.1', + 'libinput': '1.23.0', 'libevdev': '1.13.0', 'libudev': '253', 'pango': '1.50.14', @@ -354,5 +354,4 @@ test('Shellcheck (script linting)', find_program('test/shellcheck'), env : [ ''. test('Scan-build (static analysis)', find_program('test/scan-build'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'devel-long') test('Arguments', find_program('test/arguments'), args : [ meson.project_version() ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic') test('Environment Variables', find_program('test/environment-variables'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic') -test('Check for strings indicating problems', find_program('test/illegal-strings'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'release') test('Semantic versioning', find_program('test/versions'), args : [ meson.project_version() ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'release') From a5e10f8c6f9c5d8ddb60ea5fc82902882b65f2bb Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 3 Apr 2023 19:37:54 +0200 Subject: [PATCH 629/689] Add Changelog for 2.1.0 --- Changelog.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Changelog.md b/Changelog.md index e469a6c..da11ce9 100644 --- a/Changelog.md +++ b/Changelog.md @@ -106,3 +106,16 @@ Changelog: * Disable outputs when unable to set any mode (crashed previously) * Add Code of Conduct * Print version number on startup + +## Release 2.1.0 + + * Add -bs (bad security) option as addition to -e option to enable view of frame titles and other private information + * Fix Issue 57 (SPDX spelling error #39) + * Fix Issue 59 (meson install settings) + * Fix Issue 55 (npd) + * Fix Issue 56 (npd) + * Fix Issue 58 (#40 config) + * Improve release procedure + * Add miniscule test suite + * Adjust Cagebreak to wlroots 0.16.2 + * New GPG Keys From f8df676572535e2a78494a8d172ebf93d3b1cc50 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 3 Apr 2023 21:29:33 +0200 Subject: [PATCH 630/689] Remove undocumented feature --- keybinding.c | 3 --- keybinding.h | 1 - parse.c | 17 ----------------- 3 files changed, 21 deletions(-) diff --git a/keybinding.c b/keybinding.c index a4fcbef..44ccffb 100644 --- a/keybinding.c +++ b/keybinding.c @@ -1798,9 +1798,6 @@ run_action(enum keybinding_action action, struct cg_server *server, server->curr_output->workspaces[server->curr_output->curr_workspace] ->focused_tile->view); break; - case KEYBINDING_FOCUS_TILE: - keybinding_focus_tile(server, data.u); - break; default: { wlr_log(WLR_ERROR, "run_action was called with a value not present in \"enum " diff --git a/keybinding.h b/keybinding.h index ba96c3d..6d6cf87 100644 --- a/keybinding.h +++ b/keybinding.h @@ -74,7 +74,6 @@ struct cg_server; KEYBINDING(KEYBINDING_FOCUS_RIGHT, focusright) \ KEYBINDING(KEYBINDING_FOCUS_TOP, focusup) \ KEYBINDING(KEYBINDING_FOCUS_BOTTOM, focusdown) \ - KEYBINDING(KEYBINDING_FOCUS_TILE, focus_tile) \ \ KEYBINDING(KEYBINDING_DEFINEKEY, \ definekey) /* data.kb is the keybinding definition */ \ diff --git a/parse.c b/parse.c index 93fdbf4..68767c6 100644 --- a/parse.c +++ b/parse.c @@ -786,23 +786,6 @@ parse_command(struct cg_server *server, struct keybinding *keybinding, keybinding->action = KEYBINDING_SHOW_INFO; } else if(strcmp(action, "close") == 0) { keybinding->action = KEYBINDING_CLOSE_VIEW; - } else if(strcmp(action, "focus_tile") == 0) { - keybinding->action = KEYBINDING_FOCUS_TILE; - char *nws_str = strtok_r(NULL, " ", &saveptr); - if(nws_str == NULL) { - *errstr = log_error( - "Expected argument for \"focus_tile\" action, got none."); - return -1; - } - - long tile_id = strtol(nws_str, NULL, 10); - if(tile_id < 1) { - *errstr = log_error( - "Tile id for focus_tile must be a positive integer. Got %l\n", - tile_id); - return -1; - } - keybinding->data.u = tile_id; } else if(strcmp(action, "focus") == 0) { keybinding->action = KEYBINDING_CYCLE_TILES; keybinding->data.b = false; From f8273dec9fa2147d6102418f6ab6d2cc0bf93864 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 3 Apr 2023 22:25:42 +0200 Subject: [PATCH 631/689] Fix stack use after return in fuzzer --- fuzz/fuzz-lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fuzz/fuzz-lib.c b/fuzz/fuzz-lib.c index 38754f5..d331880 100644 --- a/fuzz/fuzz-lib.c +++ b/fuzz/fuzz-lib.c @@ -251,7 +251,7 @@ LLVMFuzzerInitialize(int *argc, char ***argv) { wlr_renderer_init_wl_display(server.renderer, server.wl_display); - server.bg_color = (float[4]){0, 0, 0, 1}; + server.bg_color = calloc(4, sizeof(float *)); server.output_layout = wlr_output_layout_create(); if(!server.output_layout) { wlr_log(WLR_ERROR, "Unable to create output layout"); From 89d9dae4ca94177580bb6cc4723a58d978ad9b7b Mon Sep 17 00:00:00 2001 From: project-repo Date: Tue, 4 Apr 2023 13:58:10 +0200 Subject: [PATCH 632/689] Prepare 2.1.0 release --- Changelog.md | 2 +- Hashes.md | 20 ++++++++++++++++++++ signatures/2.0.1-cagebreak-config.5.sig | Bin 0 -> 566 bytes signatures/2.0.1-cagebreak-socket.7.sig | Bin 0 -> 566 bytes signatures/2.0.1-cagebreak.1.sig | Bin 0 -> 566 bytes signatures/2.0.1-cagebreak.sig | Bin 0 -> 566 bytes signatures/cagebreak-config.5.sig | Bin 566 -> 566 bytes signatures/cagebreak-socket.7.sig | Bin 566 -> 566 bytes signatures/cagebreak.1.sig | Bin 566 -> 566 bytes signatures/cagebreak.sig | Bin 566 -> 566 bytes 10 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 signatures/2.0.1-cagebreak-config.5.sig create mode 100644 signatures/2.0.1-cagebreak-socket.7.sig create mode 100644 signatures/2.0.1-cagebreak.1.sig create mode 100644 signatures/2.0.1-cagebreak.sig diff --git a/Changelog.md b/Changelog.md index da11ce9..c33e179 100644 --- a/Changelog.md +++ b/Changelog.md @@ -109,7 +109,7 @@ Changelog: ## Release 2.1.0 - * Add -bs (bad security) option as addition to -e option to enable view of frame titles and other private information + * Add -bs (bad security) option * Fix Issue 57 (SPDX spelling error #39) * Fix Issue 59 (meson install settings) * Fix Issue 55 (npd) diff --git a/Hashes.md b/Hashes.md index 1fe4b4a..4e28e1e 100644 --- a/Hashes.md +++ b/Hashes.md @@ -1,5 +1,25 @@ # Hashes +2.1.0 cagebreak + + * sha 256: 0c90ba529ffc916306a1ca04d4c56a800c62a98d184d3cfcc2ce67dcdffad324 + * sha 512: 097007da750c8acd09ee63159aeff5a5584cbab45525bd8fe81a379da5cc0e9f2bf776b809122d1b599f4716ef7feb0ccc0cf98be47a71d4819e2a8cd7a2f495 + +2.1.0 cagebreak.1 + + * sha 256: 6509c9126a9a140c517111f9352bf787a31dd8451fa9976135fc1dfbe40ed23d + * sha 512: 96a8c3d5b9677a95255c09b3674559aea7ff130370baa1cce40212501cb288c047048cf9bfbf78bc2cfab35e346fd49ef6b9d5d67f8ab5d07f8991f66e8de3aa + +2.1.0 cagebreak-config.5 + + * sha 256: dbccee812d59209ddad73b376bfbb823611e2a8a92078b55e847ab678122bd54 + * sha 512: a8d0b31007208d7ca38f691ded77d9f13318f47046d9237efd6738d0e10dd8402a35fc48230e72493b17aeeb174cb246440301626a1cd5a48c7d03d0800d0128 + +2.1.0 cagebreak-socket.7 + + * sha 256: e7b85f15665da4a4422ad223b4b2748ff4315d315a8b108df279ff3b13b8c4c9 + * sha 512: 01dc53b4867ebc18f0091c3b1a239a89959403686c05e5e22aebf8155a46b82492b9aed27198a78e2777a9ff44b03f6e10ca82283062a29e1fa0114b97bb36a3 + 2.0.1 cagebreak * sha 256: 3d7cdf511976248614617b1738246a3c5fa94543838e798c0c3a9aec325027b9 diff --git a/signatures/2.0.1-cagebreak-config.5.sig b/signatures/2.0.1-cagebreak-config.5.sig new file mode 100644 index 0000000000000000000000000000000000000000..c2c27ba4cdab34262ca28c6967ed61e555cd3522 GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j+_E$ufVhrCX*AwCnJ$3ujQV~JG-0%N>V%m4}r5TM6H zgo8S-(2_71Lj@WDZsd1sSuK!ea5ex4t zG<1y&eE!_Po_OfRXn!~cm8B5EDl4hLu4i)=)LA}TIfCBPXawnl#C9FQnB92(htAz! z>y@(D)i~kGkj)K}no#5%0G(l=Y)}|}AmrOFO5`g@pSbgF&pM^k{nd&<5d&+Q;0$DwF)__Kmu6w9uUE`=LedD0LPpZ=WpI$&C0NLk}{~mJUD^KP_#=zL&>0SMcq5Jvxz EQJJ_DGynhq literal 0 HcmV?d00001 diff --git a/signatures/2.0.1-cagebreak-socket.7.sig b/signatures/2.0.1-cagebreak-socket.7.sig new file mode 100644 index 0000000000000000000000000000000000000000..d7dfe41453bb2d1880310eda8d18b9b4fe1c26d4 GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j+_E$ufVhrCX*AwCnJ$3ujQV~JG-0%N>V&j1Pu5TM6H zgo0G6)?0C%_jEhB-K%m)L|XuI0eVr~(+2J{j)bw=k~v4ztla|Ulh4{tTL z?n7|@R5VB@$Q zBWg2`Xth9#FpXdV%|o0=`*6q(gYKznN2hOuw0YZ4w%_WcASwWbYeV5`xm7xK$OShL zG6m<5k1l&D`YQvspPMAAPA!N`|Kq1i9Ls=JFB$Ws)ESp7)}Xr;B^24}#@(jFBi(wx zMAzan#m4yn4TRx(rF>J%Es53^V1PlN4>qpTBJRUm!wU$8v9f?1hd}uaes)atFl~jf z3|mvj;m|N@y?#TF??W9xatvKQtam21k3xdP$zPvDk=$lsYA?Bh7p~NEtl-6|zjj_) zQ1t(=(XX?U4PQ0VTxMTap50^2ik`E4KFb6`s8nUo;(yt&3gjO4Q7sI070S=2lEb%Z z`(0P9=``1;jT?tkEx-MpQ16gbdFj+ea^%f4vj}&@b3kaTx?Wn|S#&caun#P;owpr^ z*}OPqgZ_?aH$}tY){U&W+rbU0s#cE7!u?)Y*f|rQ{zfdGVjs~2V$p8uo5TM6H zgoUQEay2giu5l#VbH-k@YujY!wvF;B+95U(nst7|ESnDJWk zB%qF40HT=vqlJ58?3j}{ubwXf9G;ktbhzBFy}<`WoH&}tb^3G`NTIh;h&p{1gyppn z)~v1W)p)!Had&G07!;wSyi4MQ{+jy<@m4D@`LH&kp|JUSoVs#F-#jI%1oPVLOWt&g zx5ckOkqc$cUmQ)M2AbmJ!D-r57rIvB>Jv050RoD9#ou#5SAUk&<{SNJ1>M0VD`E_2UH@>7( z2S6vhoDzWXeZ?qcZ9%23RL@y1K!W)cQeH;Uc6ZkX`7s^tz)`|Nl*uVw*U$W5TM6H zgonoJ9)&{i1#gpM}@m{|lw|Ku2CUQS)TLtAvj-K;Vh zb|POEmZojMp*F!d#Dl4|Q+nO#!|4Q7BJN<12^` zl-yXL5{<~-5hWzyM_IY&Tcg3wsr2VW`fTzyc%6EOpf}c)o<_!ls<)pDk>SN`mLbLH zk-ZBZH=A=c_M{2s41k1!dtxNDoX;4*Qh(l>C&6+_+==jkK?>GsS{|R EcZ1Uk8UO$Q literal 0 HcmV?d00001 diff --git a/signatures/cagebreak-config.5.sig b/signatures/cagebreak-config.5.sig index c2c27ba4cdab34262ca28c6967ed61e555cd3522..25072cbc7ec479dc03f8b0e58fb181f393b6019f 100644 GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j*qg2yatK3J!`Pxw_y3HVH?JGf^B0%R-@H2?|;5J?I6 zOsG4!XTI7G{wRJJEi`J}KeQfb1JU@66Z3T<6NTy#--hMh*c8j3d2~hbi^ZX=-TrKn ztD7j~V&53Q9i%4h8U#_7hK7oj`CIlD=;Mc4GwQ>a)J-YmdG`Vl;8s)}69L&?L5d~& z$20iJNFBNWK|tDpKg-~|d82IW#CC`j7nDWB&(z58T;2M2wvtE4dP=d?zp?WD0=p9* zUPU`tsJ{U-0GdW{DSNRrlKUGFVqhO3@k!$cL3*Qp6odwyB-0xQnq)@N!PVe$1`L>|k=$CLVHK?O+TkwoVUh!Xj=V&t>{#C*0%ot(iIdi&^gyH8KlU zhBT+I4>=Rc$+O;JZ!`T~Bm7w_#GKcp?kq#s$P0|Y^(i`zme%V+VSapC^`l@oRL1{@BcO}re zf)i0-Wdr6R<0JhvON1>o?yPvCFw8vYk{DbTrXy>~v!h&yhCb5?O?zZ$sp$kzmLK)j EGK$X>3IG5A literal 566 zcmV-60?GY}0y6{v0SEvc79j+_E$ufVhrCX*AwCnJ$3ujQV~JG-0%N>V%m4}r5TM6H zgo8S-(2_71Lj@WDZsd1sSuK!ea5ex4t zG<1y&eE!_Po_OfRXn!~cm8B5EDl4hLu4i)=)LA}TIfCBPXawnl#C9FQnB92(htAz! z>y@(D)i~kGkj)K}no#5%0G(l=Y)}|}AmrOFO5`g@pSbgF&pM^k{nd&<5d&+Q;0$DwF)__Kmu6w9uUE`=LedD0LPpZ=WpI$&C0NLk}{~mJUD^KP_#=zL&>0SMcq5Jvxz EQJJ_DGynhq diff --git a/signatures/cagebreak-socket.7.sig b/signatures/cagebreak-socket.7.sig index d7dfe41453bb2d1880310eda8d18b9b4fe1c26d4..67c2e166279805704204ef4ba7843177146a8340 100644 GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j*qg2yatK3J!`Pxw_y3HVH?JGf^B0%R-@I{*p^5J?I6 zOsG4!XJ?rY{wb7ikpWvUjL5LXPboA72(rh}Um;IL{Hr(?cZ{Hcdvsw7)6JwNk7BnM zayXykj0YkR+Jh2Hwq|Y^A zPu`ugLAlCp?L0U!>F;Zuu;aVM2bI~8Xj333 zsC7lgX`xb^ETu!?Bw8FNyQ$U4&W>=On~*_~z-WZIC6s*H>m*Fo>YN z3NqSep3ktdUAbS8m_Vjw$@OzLcpWk*swcy9j=(Zt11%qsS1}G4A(U&PU%nG0<@*JgP<=etYs$Pl@IShl2ReE?BjM En*g&E-T(jq literal 566 zcmV-60?GY}0y6{v0SEvc79j+_E$ufVhrCX*AwCnJ$3ujQV~JG-0%N>V&j1Pu5TM6H zgo0G6)?0C%_jEhB-K%m)L|XuI0eVr~(+2J{j)bw=k~v4ztla|Ulh4{tTL z?n7|@R5VB@$Q zBWg2`Xth9#FpXdV%|o0=`*6q(gYKznN2hOuw0YZ4w%_WcASwWbYeV5`xm7xK$OShL zG6m<5k1l&D`YQvspPMAAPA!N`|Kq1i9Ls=JFB$Ws)ESp7)}Xr;B^24}#@(jFBi(wx zMAzan#m4yn4TRx(rF>J%Es53^V1PlN4>qpTBJRUm!wU$8v9f?1hd}uaes)atFl~jf z3|mvj;m|N@y?#TF??W9xatvKQtam21k3xdP$zPvDk=$lsYA?Bh7p~NEtl-6|zjj_) zQ1t(=(XX?U4PQ0VTxMTap50^2ik`E4KFb6`s8nUo;(yt&3gjO4Q7sI070S=2lEb%Z z`(0P9=``1;jT?tkEx-MpQ16gbdFj+ea^%f4vj}&@b3kaTx?Wn|S#&caun#P;owpr^ z*}OPqgZ_?aH$}tY){U&W+rbU0s#cE7!u?)Y*f|rQ{zfdGVjs~2(fZ&kfv`E=xo zinXUoT!}dOjO)=zs&(12$gG=(A+U zCuHOF=LWtU(1Dednc%h`JboeK64+cz8-y0Yk7+1^yM3lwplgw@i?XqZjEFM^_-h0Z z@*BzMK7ViM?i+E-b1U5=bh>3>h#N%FkvtOpAiTrt%rBrS4;{wW z#YEh;zE>EsLm_eFyq|IMThIw)Ro#1BO`vWh!8CFn|>I$Jm(P9-y7 z!he0ilG@?V$p8uo5TM6H zgoUQEay2giu5l#VbH-k@YujY!wvF;B+95U(nst7|ESnDJWk zB%qF40HT=vqlJ58?3j}{ubwXf9G;ktbhzBFy}<`WoH&}tb^3G`NTIh;h&p{1gyppn z)~v1W)p)!Had&G07!;wSyi4MQ{+jy<@m4D@`LH&kp|JUSoVs#F-#jI%1oPVLOWt&g zx5ckOkqc$cUmQ)M2AbmJ!D-r57rIvB>Jv050RoD9#ou#5SAUk&<{SNJ1>M0VD`E_2UH@>7( z2S6vhoDzWXeZ?qcZ9%23RL@y1K!W)cQeH;Uc6ZkX`7s^tz)`|Nl*um)J zJ{eq<2(d=d+Cpi7$j%0c)kbInMA%wt<+aJ-)*bD#_1BbxZ)|xCbL@ctO6~R@_Yax; ztz>7&y$BT!7q(-3!{XjbzOdope4li@9B$gEPsc6ep)BMU=j$b*W(L=2xx4%aHp6O( z7~7&h?CgJ;Y7fxOYMx`k^J-@2HA?d{Nqqb-Nx|}M5-;vQBp9R!+q}?FrR-=x3L{11 zX969$BPXz2{2CKuBWFU)jUhbLXVmrPv>nUqh3+4CF$V;Jk3r<2*J+2=tj2xT%|&ZHd?OR?L2P;|Rb_ANCh zPF{g+^Ao3WzoSl#rc9|q`MH>0@plcedJVZl=KE%i5jp}Oii=6Ioj%WE$eO}I?`J)d z0v84f93fy1zigPkk+j$?-pb1~hneUMuYKNRY_)GY8L#g!H@eW3r_OiO(=HN>$zcI9 EDjqQqh5!Hn literal 566 zcmV-60?GY}0y6{v0SEvc79j+_E$ufVhrCX*AwCnJ$3ujQV~JG-0%N>Vw*U$W5TM6H zgonoJ9)&{i1#gpM}@m{|lw|Ku2CUQS)TLtAvj-K;Vh zb|POEmZojMp*F!d#Dl4|Q+nO#!|4Q7BJN<12^` zl-yXL5{<~-5hWzyM_IY&Tcg3wsr2VW`fTzyc%6EOpf}c)o<_!ls<)pDk>SN`mLbLH zk-ZBZH=A=c_M{2s41k1!dtxNDoX;4*Qh(l>C&6+_+==jkK?>GsS{|R EcZ1Uk8UO$Q From 9c2aa861821f43ac973732dd021394dbdad2f992 Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 6 Apr 2023 21:32:42 +0200 Subject: [PATCH 633/689] Add non-auto tests --- meson.build | 1 + release-non-auto-checks/Bugs.md | 0 release-non-auto-checks/WLR_XDG_VERSION | 0 release-non-auto-checks/coverity | 0 release-non-auto-checks/release-note | 2 ++ test/non-auto-tests | 25 +++++++++++++++++++++++++ 6 files changed, 28 insertions(+) create mode 100644 release-non-auto-checks/Bugs.md create mode 100644 release-non-auto-checks/WLR_XDG_VERSION create mode 100644 release-non-auto-checks/coverity create mode 100644 release-non-auto-checks/release-note create mode 100644 test/non-auto-tests diff --git a/meson.build b/meson.build index f9708e7..393a439 100644 --- a/meson.build +++ b/meson.build @@ -355,3 +355,4 @@ test('Scan-build (static analysis)', find_program('test/scan-build'), env : [ '' test('Arguments', find_program('test/arguments'), args : [ meson.project_version() ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic') test('Environment Variables', find_program('test/environment-variables'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic') test('Semantic versioning', find_program('test/versions'), args : [ meson.project_version() ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'release') +test('Non-auto tests', find_program('test/non-auto-tests'), args : [ meson.project_version() ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'release') diff --git a/release-non-auto-checks/Bugs.md b/release-non-auto-checks/Bugs.md new file mode 100644 index 0000000..e69de29 diff --git a/release-non-auto-checks/WLR_XDG_VERSION b/release-non-auto-checks/WLR_XDG_VERSION new file mode 100644 index 0000000..e69de29 diff --git a/release-non-auto-checks/coverity b/release-non-auto-checks/coverity new file mode 100644 index 0000000..e69de29 diff --git a/release-non-auto-checks/release-note b/release-non-auto-checks/release-note new file mode 100644 index 0000000..92d5898 --- /dev/null +++ b/release-non-auto-checks/release-note @@ -0,0 +1,2 @@ +2.1.0 +2023-04-06 diff --git a/test/non-auto-tests b/test/non-auto-tests new file mode 100644 index 0000000..470d494 --- /dev/null +++ b/test/non-auto-tests @@ -0,0 +1,25 @@ +#!/bin/bash +# Copyright 2023, project-repo and the cagebreak contributors +# SPDX-License-Identifier: MIT + +VERSION=$1 +RESULT=0 + +# shellcheck disable=2164 +cd "${MESONCURRENTCONFIGDIR}/release-non-auto-checks" + +filevar="$VERSION +$(date +%Y-%m-%d)" + +for check in ./* +do + if [[ $(cat "$check") = "${filevar}" ]] + then + echo "[x] ${check}" + else + RESULT=1 + echo "[ ] ${check}" + fi +done + +exit "${RESULT}" From d00de8fb1eb7b3f7eaf003141570a215e6514a77 Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 6 Apr 2023 22:32:23 +0200 Subject: [PATCH 634/689] Add Hashes.md test --- README.md | 7 +++++++ meson.build | 1 + test/hashes-md | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 test/hashes-md diff --git a/README.md b/README.md index f933980..e66bfe1 100644 --- a/README.md +++ b/README.md @@ -312,6 +312,11 @@ There are four test suites: * Note that this is only expected to pass just before a release. This checks mostly administrative things to check that a release is ready. + * Note that non-auto tests are files in `release-non-auto-checks` + and have to contain the release version and current date in + YYYY-mm-dd format on seperate lines. This is our imperfect attempt + to guarantee some hard-to-automate checks are carried out before + a release is undertaken. Every commit should pass at least the basic and devel suites. @@ -457,6 +462,7 @@ The release procedure outlines the process for a release to occur. * [ ] `git pull origin development` * [ ] `git push origin development` * [ ] New semantic version number determined + * [ ] `meson test -C build/` just to get an overview * [ ] Adjust version number * [ ] meson.build * [ ] git tag @@ -503,6 +509,7 @@ The release procedure outlines the process for a release to occur. * [ ] `git commit` and insert message * [ ] `git tag -u keyid version HEAD` and insert message * [ ] `git tag -v version` and check output + * [ ] `meson test -C build/` last check before the push * [ ] `git push --tags origin master` * [ ] `git checkout development` (merge to development depends on whether release was a hotfix) * [ ] `git merge master` diff --git a/meson.build b/meson.build index 393a439..65576da 100644 --- a/meson.build +++ b/meson.build @@ -355,4 +355,5 @@ test('Scan-build (static analysis)', find_program('test/scan-build'), env : [ '' test('Arguments', find_program('test/arguments'), args : [ meson.project_version() ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic') test('Environment Variables', find_program('test/environment-variables'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic') test('Semantic versioning', find_program('test/versions'), args : [ meson.project_version() ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'release') +test('Hashes.md', find_program('test/hashes-md'), args : [ meson.project_version() ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'release') test('Non-auto tests', find_program('test/non-auto-tests'), args : [ meson.project_version() ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'release') diff --git a/test/hashes-md b/test/hashes-md new file mode 100644 index 0000000..30a5529 --- /dev/null +++ b/test/hashes-md @@ -0,0 +1,53 @@ +#!/bin/bash +# Copyright 2023, project-repo and the cagebreak contributors +# SPDX-License-Identifier: MIT + +VERSION=$1 +RESULT=0 + +# shellcheck disable=2164 +cd "${MESONCURRENTCONFIGDIR}" + +cb256=$(sha256sum build/cagebreak | cut -d " " -f1 ) +cb256man1=$(sha256sum build/cagebreak.1 | cut -d " " -f1 ) +cb256man5=$(sha256sum build/cagebreak-config.5 | cut -d " " -f1 ) +cb256man7=$(sha256sum build/cagebreak-socket.7 | cut -d " " -f1 ) +cb512=$(sha512sum build/cagebreak | cut -d " " -f1 ) +cb512man1=$(sha512sum build/cagebreak.1 | cut -d " " -f1 ) +cb512man5=$(sha512sum build/cagebreak-config.5 | cut -d " " -f1 ) +cb512man7=$(sha512sum build/cagebreak-socket.7 | cut -d " " -f1 ) + +hashesdoc=$(head -21 Hashes.md) + +testdoc="# Hashes + +$VERSION cagebreak + + * sha 256: ${cb256} + * sha 512: ${cb512} + +$VERSION cagebreak.1 + + * sha 256: ${cb256man1} + * sha 512: ${cb512man1} + +$VERSION cagebreak-config.5 + + * sha 256: ${cb256man5} + * sha 512: ${cb512man5} + +$VERSION cagebreak-socket.7 + + * sha 256: ${cb256man7} + * sha 512: ${cb512man7}" + +# email key +if [[ "${hashesdoc}" = "${testdoc}" ]] +then + echo "[x] Hashes.md" +else + RESULT=1 + echo "[ ] Hashes.md" +fi + +exit "${RESULT}" From a76f0d6d5578f035e88411b5f0bda37a0257124d Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 6 Apr 2023 22:38:34 +0200 Subject: [PATCH 635/689] Add gpg signatures check --- meson.build | 1 + test/gpg-signatures | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 test/gpg-signatures diff --git a/meson.build b/meson.build index 65576da..2d039e5 100644 --- a/meson.build +++ b/meson.build @@ -355,5 +355,6 @@ test('Scan-build (static analysis)', find_program('test/scan-build'), env : [ '' test('Arguments', find_program('test/arguments'), args : [ meson.project_version() ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic') test('Environment Variables', find_program('test/environment-variables'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic') test('Semantic versioning', find_program('test/versions'), args : [ meson.project_version() ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'release') +test('Signature validity', find_program('test/gpg-signatures'), suite: 'release') test('Hashes.md', find_program('test/hashes-md'), args : [ meson.project_version() ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'release') test('Non-auto tests', find_program('test/non-auto-tests'), args : [ meson.project_version() ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'release') diff --git a/test/gpg-signatures b/test/gpg-signatures new file mode 100644 index 0000000..c5d63fd --- /dev/null +++ b/test/gpg-signatures @@ -0,0 +1,43 @@ +#!/bin/bash +# Copyright 2023, project-repo and the cagebreak contributors +# SPDX-License-Identifier: MIT + +RESULT=0 + +# cagebreak +if gpg --verify ../signatures/cagebreak.sig cagebreak +then + echo "[x] cagebreak binary" +else + RESULT=1 + echo "[ ] cagebreak binary" +fi + +# cagebreak-man +if gpg --verify ../signatures/cagebreak.1.sig cagebreak.1 +then + echo "[x] cagebreak.1 man" +else + RESULT=1 + echo "[ ] cagebreak.1 man" +fi + +# cagebreak-config man +if gpg --verify ../signatures/cagebreak-config.5.sig cagebreak-config.5 +then + echo "[x] cagebreak-config.5 man" +else + RESULT=1 + echo "[ ] cagebreak-config.5 man" +fi + +# cagebreak-socket man +if gpg --verify ../signatures/cagebreak-socket.7.sig cagebreak-socket.7 +then + echo "[x] cagebreak-socket.7 man" +else + RESULT=1 + echo "[ ] cagebreak-socket.7 man" +fi + +exit "${RESULT}" From 0fce2a807f6b11898480dcd0b6e02e79adb4719e Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 6 Apr 2023 22:39:56 +0200 Subject: [PATCH 636/689] Add gpg key validity check --- meson.build | 1 + test/gpg-validity | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 test/gpg-validity diff --git a/meson.build b/meson.build index 2d039e5..cbd1307 100644 --- a/meson.build +++ b/meson.build @@ -351,6 +351,7 @@ test('Build without xwayland', find_program('test/build-w-o-xwayland'), env : [ test('Copyright and LICENSE', find_program('test/copyright-license'), args : [ cagebreak_main_file + cagebreak_source_strings + cagebreak_header_strings + fuzz_sources + fuzz_headers + fuzz_override_lib ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()), ''.join('MESONLICENSE=', meson.project_license())], suite: 'devel' ) test('Clang-format (formatting check)', find_program('test/clang-format'), args : [ cagebreak_main_file + cagebreak_source_strings + cagebreak_header_strings + fuzz_sources + fuzz_headers + fuzz_override_lib ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'devel') test('Shellcheck (script linting)', find_program('test/shellcheck'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'devel') +test('GPG key validity', find_program('test/gpg-validity'), args : [ meson.project_version() ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'devel') test('Scan-build (static analysis)', find_program('test/scan-build'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'devel-long') test('Arguments', find_program('test/arguments'), args : [ meson.project_version() ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic') test('Environment Variables', find_program('test/environment-variables'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic') diff --git a/test/gpg-validity b/test/gpg-validity new file mode 100644 index 0000000..6340105 --- /dev/null +++ b/test/gpg-validity @@ -0,0 +1,46 @@ +#!/bin/bash +# Copyright 2023, project-repo and the cagebreak contributors +# SPDX-License-Identifier: MIT + +RESULT=0 + +# shellcheck disable=2164 +cd "${MESONCURRENTCONFIGDIR}/keys" +stoday=$(date +%s) +signingmargin=90 + +# shellcheck disable=2046 +skey11exptime=$(date --date=$(gpg --show-keys cagebreak_signing_key_11\@project-repo.co.pub | tail -2 | head -1 | cut -d " " -f 8 | rev | cut -c2- | rev) '+%s') +# shellcheck disable=2046 +skey12exptime=$(date --date=$(gpg --show-keys cagebreak_signing_key_12\@project-repo.co.pub | tail -2 | head -1 | cut -d " " -f 8 | rev | cut -c2- | rev) '+%s') +# shellcheck disable=2046 +mailexptime=$(date --date=$(gpg --show-keys cagebreak\@project-repo.co.pub | tail -2 | head -1 | cut -d " " -f 8 | rev | cut -c2- | rev) '+%s') + +# signing keys +## signing key 11 +if [[ $(( (stoday - skey11exptime) / 86400 )) -lt $signingmargin ]] +then + echo "[x] signign key 11" +else + RESULT=1 + echo "[ ] signing key 11" +fi +## signing key 12 +if [[ $(( (stoday - skey12exptime) / 86400 )) -lt $signingmargin ]] +then + echo "[x] signign key 12" +else + RESULT=1 + echo "[ ] signing key 12" +fi + +# email key +if [[ $(( (stoday - mailexptime) / 86400 )) -lt $signingmargin ]] +then + echo "[x] mail key" +else + RESULT=1 + echo "[ ] mail key" +fi + +exit "${RESULT}" From 3e895dfa419671487c008075490a261659af4f1e Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 6 Apr 2023 22:43:32 +0200 Subject: [PATCH 637/689] Adjust README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index e66bfe1..a6386f8 100644 --- a/README.md +++ b/README.md @@ -468,6 +468,7 @@ The release procedure outlines the process for a release to occur. * [ ] git tag * [ ] Relevant Documentation completed * [ ] New features + * [ ] tests added and old test scripts adjusted * [ ] man pages * [ ] cagebreak * [ ] cagebreak-config From 9123464c3edec22692d57727fb36a06820ff472a Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 6 Apr 2023 23:47:50 +0200 Subject: [PATCH 638/689] Add non-auto checks --- release-non-auto-checks/FAQ.md | 0 release-non-auto-checks/SECURITY.md | 0 release-non-auto-checks/changelog-major-minor | 0 release-non-auto-checks/internal-wiki | 0 release-non-auto-checks/meson-epoch | 0 release-non-auto-checks/reproducibility-checked | 0 release-non-auto-checks/security-to-man-page-info-transfer | 0 7 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 release-non-auto-checks/FAQ.md create mode 100644 release-non-auto-checks/SECURITY.md create mode 100644 release-non-auto-checks/changelog-major-minor create mode 100644 release-non-auto-checks/internal-wiki create mode 100644 release-non-auto-checks/meson-epoch create mode 100644 release-non-auto-checks/reproducibility-checked create mode 100644 release-non-auto-checks/security-to-man-page-info-transfer diff --git a/release-non-auto-checks/FAQ.md b/release-non-auto-checks/FAQ.md new file mode 100644 index 0000000..e69de29 diff --git a/release-non-auto-checks/SECURITY.md b/release-non-auto-checks/SECURITY.md new file mode 100644 index 0000000..e69de29 diff --git a/release-non-auto-checks/changelog-major-minor b/release-non-auto-checks/changelog-major-minor new file mode 100644 index 0000000..e69de29 diff --git a/release-non-auto-checks/internal-wiki b/release-non-auto-checks/internal-wiki new file mode 100644 index 0000000..e69de29 diff --git a/release-non-auto-checks/meson-epoch b/release-non-auto-checks/meson-epoch new file mode 100644 index 0000000..e69de29 diff --git a/release-non-auto-checks/reproducibility-checked b/release-non-auto-checks/reproducibility-checked new file mode 100644 index 0000000..e69de29 diff --git a/release-non-auto-checks/security-to-man-page-info-transfer b/release-non-auto-checks/security-to-man-page-info-transfer new file mode 100644 index 0000000..e69de29 From b2e8bc7f5ad0c220d2198490453599f67f57bb01 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 7 Apr 2023 09:00:41 +0200 Subject: [PATCH 639/689] Add git tag check --- meson.build | 1 + test/git-tag | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 test/git-tag diff --git a/meson.build b/meson.build index cbd1307..734e772 100644 --- a/meson.build +++ b/meson.build @@ -359,3 +359,4 @@ test('Semantic versioning', find_program('test/versions'), args : [ meson.projec test('Signature validity', find_program('test/gpg-signatures'), suite: 'release') test('Hashes.md', find_program('test/hashes-md'), args : [ meson.project_version() ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'release') test('Non-auto tests', find_program('test/non-auto-tests'), args : [ meson.project_version() ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'release') +test('Git tag', find_program('test/git-tag'), args : [ meson.project_version() ], suite: 'release') diff --git a/test/git-tag b/test/git-tag new file mode 100644 index 0000000..f080060 --- /dev/null +++ b/test/git-tag @@ -0,0 +1,16 @@ +#!/bin/bash +# Copyright 2023, project-repo and the cagebreak contributors +# SPDX-License-Identifier: MIT + +VERSION=$1 +RESULT=0 + +if git tag -v "${VERSION}" +then + echo "[x] git tag" +else + RESULT=1 + echo "[ ] git tag" +fi + +exit "${RESULT}" From 879f01da8995c068b7e539f6c4513f6eaff56cd9 Mon Sep 17 00:00:00 2001 From: project-repo Date: Wed, 12 Apr 2023 19:55:54 +0200 Subject: [PATCH 640/689] Update dependency versions --- meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 734e772..ef7f707 100644 --- a/meson.build +++ b/meson.build @@ -202,8 +202,8 @@ cagebreak_dependencies_dict = { reproducible_build_versions = { 'server_protos': '-1', 'wayland_server': '1.19.0', - 'wayland_client': '1.21.0', - 'wayland_cursor': '1.21.0', + 'wayland_client': '1.22.0', + 'wayland_cursor': '1.22.0', 'wlroots': '0.16.2', 'xkbcommon': '1.5.0', 'fontconfig': '2.14.2', From 333c1feb9ef346f8165c24bf7ca5a04e43a40d25 Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 13 Apr 2023 17:24:14 +0200 Subject: [PATCH 641/689] Add quick install script for dev env --- README.md | 18 ++++++++++++++++++ meson.build | 3 +++ scripts/install-development-environment | 5 +++++ test/copyright-license | 4 +++- test/shellcheck | 3 +++ 5 files changed, 32 insertions(+), 1 deletion(-) create mode 100755 scripts/install-development-environment diff --git a/README.md b/README.md index f933980..a194d55 100644 --- a/README.md +++ b/README.md @@ -260,6 +260,24 @@ need to ask for the distribution the user was having the issue on.)). You should use Arch Linux if you want to modify Cagebreak for yourself. +#### Development Environment + +Cloning the Cagebreak repository and building it is sufficient as a starting point. + +All other dependencies can be installed by invoking + +``` +meson compile devel-install -C build +``` + +if meson is already available or + +``` +./scripts/install-development-environment +``` + +otherwise. + ### GCC and -fanalyzer Cagebreak should compile with any reasonably new gcc or clang. Consider diff --git a/meson.build b/meson.build index f9708e7..e9388c2 100644 --- a/meson.build +++ b/meson.build @@ -344,6 +344,9 @@ summary = [ ] message('\n'.join(summary)) +run_target('devel-install', + command : ['scripts/install-development-environment']) + # Test Suite test('Build without warnings', find_program('test/build-w-o-warnings'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'devel') diff --git a/scripts/install-development-environment b/scripts/install-development-environment new file mode 100755 index 0000000..a5df5c4 --- /dev/null +++ b/scripts/install-development-environment @@ -0,0 +1,5 @@ +#!/bin/bash +# Copyright 2023, project-repo and the cagebreak contributors +# SPDX-License-Identifier: MIT + +sudo pacman -Syu --noconfirm git meson ninja clang gcc shellcheck jq openbsd-netcat gnupg binutils alacritty firefox wlroots wayland libxkbcommon cairo pango fontconfig libinput libevdev systemd-libs # systemd-libs is included because of libudev diff --git a/test/copyright-license b/test/copyright-license index 4fe517f..630f843 100644 --- a/test/copyright-license +++ b/test/copyright-license @@ -10,7 +10,9 @@ readonly test_deps=$(cd "${MESONCURRENTCONFIGDIR}" ; find . -type f | grep test/ readonly examples_deps=$(cd "${MESONCURRENTCONFIGDIR}" ; find . -type f | grep examples/) # shellcheck disable=2155,2164,2046 readonly example_scripts_deps=$(cd "${MESONCURRENTCONFIGDIR}" ; find . -type f | grep example_scripts/) -readonly deps="${declared_deps} ${hardcoded_deps} ${test_deps} ${examples_deps} ${example_scripts_deps}" +# shellcheck disable=2155,2164,2046 +readonly scripts_deps=$(cd "${MESONCURRENTCONFIGDIR}" ; find . -type f | grep scripts/) +readonly deps="${declared_deps} ${hardcoded_deps} ${test_deps} ${examples_deps} ${example_scripts_deps} ${scripts_deps}" # shellcheck disable=2046,2155 readonly curryear=$(date +%Y) diff --git a/test/shellcheck b/test/shellcheck index 0727178..cff3fff 100644 --- a/test/shellcheck +++ b/test/shellcheck @@ -13,4 +13,7 @@ shellcheck --source-path=../example_scripts/ $(ls -Itesting-configurations) || R cd "${MESONCURRENTCONFIGDIR}/example_scripts/" || RESULT=1 shellcheck ./* +cd "${MESONCURRENTCONFIGDIR}/scripts/" || RESULT=1 +shellcheck ./* + exit "${RESULT}" From e130498ecdb9439fa7abae279244dcca6364d5de Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 13 Apr 2023 17:45:00 +0200 Subject: [PATCH 642/689] Add gpg key import --- scripts/install-development-environment | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/install-development-environment b/scripts/install-development-environment index a5df5c4..c69efa1 100755 --- a/scripts/install-development-environment +++ b/scripts/install-development-environment @@ -3,3 +3,11 @@ # SPDX-License-Identifier: MIT sudo pacman -Syu --noconfirm git meson ninja clang gcc shellcheck jq openbsd-netcat gnupg binutils alacritty firefox wlroots wayland libxkbcommon cairo pango fontconfig libinput libevdev systemd-libs # systemd-libs is included because of libudev + +if [[ -n ${MESON_SOURCE_ROOT} ]] +then + # shellcheck disable=2164 + cd "${MESON_SOURCE_ROOT}" +fi + +gpg --import keys/* From 4f38f0f1e1065514c23064b2b8a84ab334aa8415 Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 13 Apr 2023 18:40:54 +0200 Subject: [PATCH 643/689] Add fuzzing script --- README.md | 16 ++++++++++++++++ meson.build | 3 +++ meson_options.txt | 1 + scripts/fuzz | 16 ++++++++++++++++ 4 files changed, 36 insertions(+) create mode 100755 scripts/fuzz diff --git a/README.md b/README.md index a194d55..03a0fc2 100644 --- a/README.md +++ b/README.md @@ -278,6 +278,22 @@ if meson is already available or otherwise. +#### Scripts + +Cagebreak provides a few convenience tools to facilitate development. + +##### Fuzzing + +If your fuzzing corpus is located in the directory `fuzz_corpus` you can +just call: + +``` +meson compile fuzz -C build +``` + +If you want to use a different directory, configure cagebreak with +`-Dcorpus=OTHERDIRECTORY` or call `./scripts/fuzz OTHERDIRECTORY`. + ### GCC and -fanalyzer Cagebreak should compile with any reasonably new gcc or clang. Consider diff --git a/meson.build b/meson.build index e9388c2..f43de32 100644 --- a/meson.build +++ b/meson.build @@ -347,6 +347,9 @@ message('\n'.join(summary)) run_target('devel-install', command : ['scripts/install-development-environment']) +run_target('fuzz', + command : ['scripts/fuzz', get_option('corpus')]) + # Test Suite test('Build without warnings', find_program('test/build-w-o-warnings'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'devel') diff --git a/meson_options.txt b/meson_options.txt index b7fc956..df62d70 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -4,3 +4,4 @@ option('xwayland', type: 'boolean', value: 'false', description: 'Enable support option('man-pages', type: 'boolean', value: 'false', description: 'Build man pages (requires pandoc)') option('fuzz', type: 'boolean', value: 'false', description: 'Enable building fuzzer targets') option('version_override', type: 'string', description: 'Set the project version to the string specified. Used for creating hashes for reproducible builds.') +option('corpus', type: 'string', value: 'fuzz_corpus', description: 'Set fuzzing corpus directory') diff --git a/scripts/fuzz b/scripts/fuzz new file mode 100755 index 0000000..8792016 --- /dev/null +++ b/scripts/fuzz @@ -0,0 +1,16 @@ +#!/bin/bash +# Copyright 2023, project-repo and the cagebreak contributors +# SPDX-License-Identifier: MIT + +readonly fuzzing_corpus="${1}" + +if [[ -n ${MESON_SOURCE_ROOT} ]] +then + # shellcheck disable=2164 + cd "${MESON_SOURCE_ROOT}" +fi + +rm -rf fuzzing-directory +CC=clang meson setup fuzzing-directory -Dfuzz=true -Db_sanitize=address,undefined -Db_lundef=false -Db_detect-leaks=0 +ninja -C fuzzing-directory/ +WLR_BACKENDS=headless ./fuzzing-directory/fuzz-parse -jobs=12 -max_len=50000 -close_fd_mask=3 "${fuzzing_corpus}" From 77e2b392ed94aee9ccbc196bcb8934396120d68c Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 13 Apr 2023 18:44:39 +0200 Subject: [PATCH 644/689] Adjust dev install deps --- scripts/install-development-environment | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install-development-environment b/scripts/install-development-environment index c69efa1..e5a161e 100755 --- a/scripts/install-development-environment +++ b/scripts/install-development-environment @@ -2,7 +2,7 @@ # Copyright 2023, project-repo and the cagebreak contributors # SPDX-License-Identifier: MIT -sudo pacman -Syu --noconfirm git meson ninja clang gcc shellcheck jq openbsd-netcat gnupg binutils alacritty firefox wlroots wayland libxkbcommon cairo pango fontconfig libinput libevdev systemd-libs # systemd-libs is included because of libudev +sudo pacman -Syu --noconfirm git grep sed meson ninja clang gcc shellcheck jq openbsd-netcat gnupg binutils alacritty firefox wlroots wayland libxkbcommon cairo pango fontconfig libinput libevdev systemd-libs # systemd-libs is included because of libudev if [[ -n ${MESON_SOURCE_ROOT} ]] then From f99c39516dffff6eac94919ffb47d088caf6c7c1 Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 13 Apr 2023 19:17:56 +0200 Subject: [PATCH 645/689] Add adjust-epoch script --- README.md | 15 +++++++++++++++ meson.build | 3 +++ scripts/adjust-epoch | 13 +++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 scripts/adjust-epoch diff --git a/README.md b/README.md index 03a0fc2..2b01291 100644 --- a/README.md +++ b/README.md @@ -294,6 +294,21 @@ meson compile fuzz -C build If you want to use a different directory, configure cagebreak with `-Dcorpus=OTHERDIRECTORY` or call `./scripts/fuzz OTHERDIRECTORY`. +##### Adjusting Epoch + +To facilitate the creation of reproducible man pages an arbitrary release +time has to be set in `meson.build`: + +``` +meson compile adjust-epoch -C build +``` + +or + +``` +./scripts/adjust-epoch +``` + ### GCC and -fanalyzer Cagebreak should compile with any reasonably new gcc or clang. Consider diff --git a/meson.build b/meson.build index f43de32..4d3d01c 100644 --- a/meson.build +++ b/meson.build @@ -350,6 +350,9 @@ run_target('devel-install', run_target('fuzz', command : ['scripts/fuzz', get_option('corpus')]) +run_target('adjust-epoch', + command : ['scripts/adjust-epoch']) + # Test Suite test('Build without warnings', find_program('test/build-w-o-warnings'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'devel') diff --git a/scripts/adjust-epoch b/scripts/adjust-epoch new file mode 100644 index 0000000..362c840 --- /dev/null +++ b/scripts/adjust-epoch @@ -0,0 +1,13 @@ +#!/bin/bash +# Copyright 2023, project-repo and the cagebreak contributors +# SPDX-License-Identifier: MIT + +if [[ -n ${MESON_SOURCE_ROOT} ]] +then + # shellcheck disable=2164 + cd "${MESON_SOURCE_ROOT}" +fi + +# shellcheck disable=2034 +ssepoch=$(date +%s) +sed -i -e "/secssinceepoch \=/s/[0-9]*$/$ssepoch/" meson.build From fb736d79868706ad4ba0336a60a63f97d9698f4e Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 13 Apr 2023 19:39:53 +0200 Subject: [PATCH 646/689] Adjust permissions --- scripts/adjust-epoch | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 scripts/adjust-epoch diff --git a/scripts/adjust-epoch b/scripts/adjust-epoch old mode 100644 new mode 100755 From b732b92cea29cc28ac0d685093ce7dd77fd95cb1 Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 13 Apr 2023 19:50:34 +0200 Subject: [PATCH 647/689] Add git-tag script --- README.md | 18 ++++++++++++++++++ meson.build | 3 +++ meson_options.txt | 1 + 3 files changed, 22 insertions(+) diff --git a/README.md b/README.md index 2b01291..f299362 100644 --- a/README.md +++ b/README.md @@ -309,6 +309,24 @@ or ./scripts/adjust-epoch ``` +##### Git tag + +If you are on the master branch, everything is ready and you want to create +a release tag you can call: + +``` +meson compule git-tag -C build +``` + +If you want to use another signing key than the prespecified one, configure +Cagebreak with `-Dgpg_id=GPGID`. + +``` +./scripts/git-tag GPGID CBVERSION +``` + +can be used alternatively. + ### GCC and -fanalyzer Cagebreak should compile with any reasonably new gcc or clang. Consider diff --git a/meson.build b/meson.build index 4d3d01c..501cc4f 100644 --- a/meson.build +++ b/meson.build @@ -353,6 +353,9 @@ run_target('fuzz', run_target('adjust-epoch', command : ['scripts/adjust-epoch']) +run_target('git-tag', + command : ['scripts/git-tag', get_option('gpg_id'), meson.project_version()]) + # Test Suite test('Build without warnings', find_program('test/build-w-o-warnings'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'devel') diff --git a/meson_options.txt b/meson_options.txt index df62d70..eba2f60 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -5,3 +5,4 @@ option('man-pages', type: 'boolean', value: 'false', description: 'Build man pag option('fuzz', type: 'boolean', value: 'false', description: 'Enable building fuzzer targets') option('version_override', type: 'string', description: 'Set the project version to the string specified. Used for creating hashes for reproducible builds.') option('corpus', type: 'string', value: 'fuzz_corpus', description: 'Set fuzzing corpus directory') +option('gpg_id', type: 'string', value: '4E82C72C6B3E58A7BC4FF8554909F84CA83BB867', description: 'Set gpg signing key for cagebreak') From 8af1286c57936b9d4ec3e8bac336cd058a00e36b Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 13 Apr 2023 19:52:13 +0200 Subject: [PATCH 648/689] Add git-tag script --- scripts/git-tag | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 scripts/git-tag diff --git a/scripts/git-tag b/scripts/git-tag new file mode 100755 index 0000000..bd8e541 --- /dev/null +++ b/scripts/git-tag @@ -0,0 +1,8 @@ +#!/bin/bash +# Copyright 2023, project-repo and the cagebreak contributors +# SPDX-License-Identifier: MIT + +readonly gpg_id="${1}" +readonly version="${2}" + +git tag -u "${gpg_id}" "${version}" HEAD From 6ee279c061c02f7bbcb3e68382dcd74cf55ff19c Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 13 Apr 2023 19:54:49 +0200 Subject: [PATCH 649/689] Adjust fuzz script --- scripts/fuzz | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/fuzz b/scripts/fuzz index 8792016..7f227ec 100755 --- a/scripts/fuzz +++ b/scripts/fuzz @@ -14,3 +14,4 @@ rm -rf fuzzing-directory CC=clang meson setup fuzzing-directory -Dfuzz=true -Db_sanitize=address,undefined -Db_lundef=false -Db_detect-leaks=0 ninja -C fuzzing-directory/ WLR_BACKENDS=headless ./fuzzing-directory/fuzz-parse -jobs=12 -max_len=50000 -close_fd_mask=3 "${fuzzing_corpus}" +rm -rf fuzzing-directory From d30f590569465377b30f119eb329e3846e3be11a Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 13 Apr 2023 19:57:23 +0200 Subject: [PATCH 650/689] Adjust gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 378eac2..a91faf5 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ build +fuzz_corpus +fuzzing-directory From 8abd46569a31d48eb3c24080835453f7b867d87a Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 13 Apr 2023 21:03:41 +0200 Subject: [PATCH 651/689] Add output-hashes script --- README.md | 17 +++++++++++++++ meson.build | 3 +++ scripts/output-hashes | 50 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 70 insertions(+) create mode 100755 scripts/output-hashes diff --git a/README.md b/README.md index f299362..63b1468 100644 --- a/README.md +++ b/README.md @@ -327,6 +327,23 @@ Cagebreak with `-Dgpg_id=GPGID`. can be used alternatively. +##### Output Hashes + +Hashes of release versions of all binaries can be output to `local-hashes.txt` +via: + +``` +meson compile output-hashes -C build +``` + +Or + +``` +./scripts/output-hashes VERSION +``` + +if meson is unavailable. + ### GCC and -fanalyzer Cagebreak should compile with any reasonably new gcc or clang. Consider diff --git a/meson.build b/meson.build index 501cc4f..d00d590 100644 --- a/meson.build +++ b/meson.build @@ -356,6 +356,9 @@ run_target('adjust-epoch', run_target('git-tag', command : ['scripts/git-tag', get_option('gpg_id'), meson.project_version()]) +run_target('output-hashes', + command : ['scripts/output-hashes', meson.project_version()]) + # Test Suite test('Build without warnings', find_program('test/build-w-o-warnings'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'devel') diff --git a/scripts/output-hashes b/scripts/output-hashes new file mode 100755 index 0000000..cf7cacf --- /dev/null +++ b/scripts/output-hashes @@ -0,0 +1,50 @@ +#!/bin/bash +# Copyright 2023, project-repo and the cagebreak contributors +# SPDX-License-Identifier: MIT + +if [[ -n ${MESON_SOURCE_ROOT} ]] +then + # shellcheck disable=2164 + cd "${MESON_SOURCE_ROOT}" +fi + +readonly version="${1}" + +rm -rf hashes +meson setup hashes -Dxwayland=true -Dman-pages=true --buildtype=release +ninja -C hashes + +cb256=$(sha256sum hashes/cagebreak | cut -d " " -f1) +cb512=$(sha512sum hashes/cagebreak | cut -d " " -f1) + +cb1man256=$(sha256sum hashes/cagebreak.1 | cut -d " " -f1) +cb1man512=$(sha512sum hashes/cagebreak.1 | cut -d " " -f1) + +cb5man256=$(sha256sum hashes/cagebreak-config.5 | cut -d " " -f1) +cb5man512=$(sha512sum hashes/cagebreak-config.5 | cut -d " " -f1) + +cb7man256=$(sha256sum hashes/cagebreak-socket.7 | cut -d " " -f1) +cb7man512=$(sha512sum hashes/cagebreak-socket.7 | cut -d " " -f1) + +echo "${version} cagebreak + + * sha 256: ${cb256} + * sha 512: ${cb512} + +${version} cagebreak.1 + + * sha 256: ${cb1man256} + * sha 512: ${cb1man512} + +${version} cagebreak-config.5 + + * sha 256: ${cb5man256} + * sha 512: ${cb5man512} + +${version} cagebreak-socket.7 + + * sha 256: ${cb7man256} + * sha 512: ${cb7man512} +" > local-hashes.txt + +rm -rf hashes From 47a24150222c73c15228fe3177074507486cf443 Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 13 Apr 2023 21:54:42 +0200 Subject: [PATCH 652/689] Add create-sigs script --- README.md | 17 +++++++++++++++++ meson.build | 3 +++ scripts/create-signatures | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+) create mode 100755 scripts/create-signatures diff --git a/README.md b/README.md index 63b1468..94e812e 100644 --- a/README.md +++ b/README.md @@ -344,6 +344,23 @@ Or if meson is unavailable. +##### Create Signatures + +Creation of signatures for releases can be acchieved through: + +``` +meson compile create-sigs -C build +``` + +Configure Cagebreak with `-Dgpg_id=GPGID` for a different gpg signing +key. + +Withou meson use: + +``` +./scripts/create-signatures GPGID +``` + ### GCC and -fanalyzer Cagebreak should compile with any reasonably new gcc or clang. Consider diff --git a/meson.build b/meson.build index d00d590..7d416ea 100644 --- a/meson.build +++ b/meson.build @@ -359,6 +359,9 @@ run_target('git-tag', run_target('output-hashes', command : ['scripts/output-hashes', meson.project_version()]) +run_target('create-sigs', + command : ['scripts/create-signatures', get_option('gpg_id')]) + # Test Suite test('Build without warnings', find_program('test/build-w-o-warnings'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'devel') diff --git a/scripts/create-signatures b/scripts/create-signatures new file mode 100755 index 0000000..68dc2ac --- /dev/null +++ b/scripts/create-signatures @@ -0,0 +1,36 @@ +#!/bin/bash +# Copyright 2023, project-repo and the cagebreak contributors +# SPDX-License-Identifier: MIT + +if [[ -n ${MESON_SOURCE_ROOT} ]] +then + # shellcheck disable=2164 + cd "${MESON_SOURCE_ROOT}" +fi + +readonly gpg_id="${1}" +readonly old_tags=$(git tag| tail -1) + +mv signatures/cagebreak.sig "signatures/${old_tags}-cagebreak.sig" +mv signatures/cagebreak.1.sig "signatures/${old_tags}-cagebreak.1.sig" +mv signatures/cagebreak-config.5.sig "signatures/${old_tags}-cagebreak-config.5.sig" +mv signatures/cagebreak-socket.7.sig "signatures/${old_tags}-cagebreak-socket.7.sig" + +git add "signatures/${old_tags}-cagebreak.sig" +git add "signatures/${old_tags}-cagebreak.1.sig" +git add "signatures/${old_tags}-cagebreak-config.5.sig" +git add "signatures/${old_tags}-cagebreak-socket.7.sig" + +rm -rf temp-sigs +meson setup temp-sigs -Dxwayland=true -Dman-pages=true --buildtype=release +ninja -C temp-sigs + +gpg -u "${gpg_id}" --detach-sign temp-sigs/cagebreak +gpg -u "${gpg_id}" --detach-sign temp-sigs/cagebreak.1 +gpg -u "${gpg_id}" --detach-sign temp-sigs/cagebreak-config.5 +gpg -u "${gpg_id}" --detach-sign temp-sigs/cagebreak-socket.7 + +cp temp-sigs/*.sig signatures/ + + +rm -rf temp-sigs From 47e9f28019ac7c02c5b3a70924d3f98bdf9061ee Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 13 Apr 2023 22:22:18 +0200 Subject: [PATCH 653/689] Add set-ver script --- README.md | 13 +++++++++++++ meson.build | 3 +++ scripts/set-version | 20 ++++++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100755 scripts/set-version diff --git a/README.md b/README.md index 94e812e..a88e2d2 100644 --- a/README.md +++ b/README.md @@ -361,6 +361,19 @@ Withou meson use: ./scripts/create-signatures GPGID ``` +##### Set Version Number + +Once the version number is set within meson.build, you can use + +``` +meson compile set-ver -C build +``` + +to set the version number in the man pages and README repology minversion. + +Use of the script without meson is discouraged because meson.build is +not touched by the script. + ### GCC and -fanalyzer Cagebreak should compile with any reasonably new gcc or clang. Consider diff --git a/meson.build b/meson.build index 7d416ea..c84ea9a 100644 --- a/meson.build +++ b/meson.build @@ -362,6 +362,9 @@ run_target('output-hashes', run_target('create-sigs', command : ['scripts/create-signatures', get_option('gpg_id')]) +run_target('set-ver', + command : ['scripts/set-version', meson.project_version()]) + # Test Suite test('Build without warnings', find_program('test/build-w-o-warnings'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'devel') diff --git a/scripts/set-version b/scripts/set-version new file mode 100755 index 0000000..c4506cb --- /dev/null +++ b/scripts/set-version @@ -0,0 +1,20 @@ +#!/bin/bash +# Copyright 2023, project-repo and the cagebreak contributors +# SPDX-License-Identifier: MIT + +# TODO man pages + +if [[ -n ${MESON_SOURCE_ROOT} ]] +then + # shellcheck disable=2164 + cd "${MESON_SOURCE_ROOT}" +fi + +# shellcheck disable=2034 +version="${1}" +sed -i -e "s/minversion\=[0-9]*\.[0-9]*.[0-9]*/minversion=$version/" README.md + + +sed -i -e "s/Version [0-9]*\.[0-9]*.[0-9]*/VERSION $version/" man/cagebreak.1.md +sed -i -e "s/Version [0-9]*\.[0-9]*.[0-9]*/VERSION $version/" man/cagebreak-config.5.md +sed -i -e "s/Version [0-9]*\.[0-9]*.[0-9]*/VERSION $version/" man/cagebreak-socket.7.md From 4be769b004e0752a6ba7ecffa2e40cb66d05f93f Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 13 Apr 2023 22:45:28 +0200 Subject: [PATCH 654/689] Fix shellcheck issue --- scripts/create-signatures | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/create-signatures b/scripts/create-signatures index 68dc2ac..3292374 100755 --- a/scripts/create-signatures +++ b/scripts/create-signatures @@ -9,6 +9,7 @@ then fi readonly gpg_id="${1}" +# shellcheck disable=2155 readonly old_tags=$(git tag| tail -1) mv signatures/cagebreak.sig "signatures/${old_tags}-cagebreak.sig" From a3a7e2c1cc55a617bc0c651e78fcc9be8f862a49 Mon Sep 17 00:00:00 2001 From: project-repo Date: Thu, 13 Apr 2023 22:46:19 +0200 Subject: [PATCH 655/689] Adjust to 2.1.1 --- README.md | 2 +- man/cagebreak-config.5.md | 2 +- man/cagebreak-socket.7.md | 2 +- man/cagebreak.1.md | 2 +- meson.build | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index a88e2d2..83e8451 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Cagebreak: A Wayland Tiling Compositor -[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/6532/badge)](https://bestpractices.coreinfrastructure.org/projects/6532) [![Packaging status](https://repology.org/badge/tiny-repos/cagebreak.svg)](https://repology.org/project/cagebreak/versions) [![AUR package](https://repology.org/badge/version-for-repo/aur/cagebreak.svg?minversion=2.1.0)](https://repology.org/project/cagebreak/versions) +[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/6532/badge)](https://bestpractices.coreinfrastructure.org/projects/6532) [![Packaging status](https://repology.org/badge/tiny-repos/cagebreak.svg)](https://repology.org/project/cagebreak/versions) [![AUR package](https://repology.org/badge/version-for-repo/aur/cagebreak.svg?minversion=2.1.1)](https://repology.org/project/cagebreak/versions) ## Quick Introduction diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index 1c65b78..bb04547 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -1,4 +1,4 @@ -cagebreak-config(5) "Version 2.1.0" "Cagebreak Manual" +cagebreak-config(5) "VERSION 2.1.1" "Cagebreak Manual" # NAME diff --git a/man/cagebreak-socket.7.md b/man/cagebreak-socket.7.md index b8e8d9c..19b7370 100644 --- a/man/cagebreak-socket.7.md +++ b/man/cagebreak-socket.7.md @@ -1,4 +1,4 @@ -cagebreak-socket(7) "Version 2.1.0" "Cagebreak Manual" +cagebreak-socket(7) "VERSION 2.1.1" "Cagebreak Manual" # NAME diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index b3fd209..fdc2da1 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -1,4 +1,4 @@ -cagebreak(1) "Version 2.1.0" "Cagebreak Manual" +cagebreak(1) "VERSION 2.1.1" "Cagebreak Manual" # NAME diff --git a/meson.build b/meson.build index c84ea9a..b31f8ff 100644 --- a/meson.build +++ b/meson.build @@ -3,7 +3,7 @@ project( 'cagebreak', 'c', -version : '2.1.0', +version : '2.1.1', license : 'MIT', default_options : ['c_std=c11', 'warning_level=3'] ) @@ -202,8 +202,8 @@ cagebreak_dependencies_dict = { reproducible_build_versions = { 'server_protos': '-1', 'wayland_server': '1.19.0', - 'wayland_client': '1.21.0', - 'wayland_cursor': '1.21.0', + 'wayland_client': '1.22.0', + 'wayland_cursor': '1.22.0', 'wlroots': '0.16.2', 'xkbcommon': '1.5.0', 'fontconfig': '2.14.2', From 3e0372125676ac65f4065df191f5a1fa80726036 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 14 Apr 2023 18:00:25 +0200 Subject: [PATCH 656/689] Add xev as dev dep --- scripts/install-development-environment | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install-development-environment b/scripts/install-development-environment index e5a161e..16fb810 100755 --- a/scripts/install-development-environment +++ b/scripts/install-development-environment @@ -2,7 +2,7 @@ # Copyright 2023, project-repo and the cagebreak contributors # SPDX-License-Identifier: MIT -sudo pacman -Syu --noconfirm git grep sed meson ninja clang gcc shellcheck jq openbsd-netcat gnupg binutils alacritty firefox wlroots wayland libxkbcommon cairo pango fontconfig libinput libevdev systemd-libs # systemd-libs is included because of libudev +sudo pacman -Syu --noconfirm git grep sed xev meson ninja clang gcc shellcheck jq openbsd-netcat gnupg binutils alacritty firefox wlroots wayland libxkbcommon cairo pango fontconfig libinput libevdev systemd-libs # systemd-libs is included because of libudev if [[ -n ${MESON_SOURCE_ROOT} ]] then From 562685feac7bca98c0edfa87fc13aff6d54978d7 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 14 Apr 2023 21:57:27 +0200 Subject: [PATCH 657/689] Fix minor error in shellcheck test --- test/shellcheck | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/shellcheck b/test/shellcheck index 0727178..0a3dbbe 100644 --- a/test/shellcheck +++ b/test/shellcheck @@ -4,13 +4,12 @@ RESULT=0 -set -x # shellcheck disable=2164 cd "${MESONCURRENTCONFIGDIR}/test" # shellcheck disable=2046 shellcheck --source-path=../example_scripts/ $(ls -Itesting-configurations) || RESULT=1 cd "${MESONCURRENTCONFIGDIR}/example_scripts/" || RESULT=1 -shellcheck ./* +shellcheck ./* || RESULT=1 exit "${RESULT}" From 3bcaa8122ddae2bcea7b25d2d83f0185935b3fa8 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 14 Apr 2023 22:04:51 +0200 Subject: [PATCH 658/689] Add arch linux notice to install script --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 83e8451..911d402 100644 --- a/README.md +++ b/README.md @@ -262,6 +262,9 @@ for yourself. #### Development Environment +CAVEAT: This script works exclusively on Arch Linux, which, as outlined above, +is the development distribution of Cagebreak. + Cloning the Cagebreak repository and building it is sufficient as a starting point. All other dependencies can be installed by invoking From 03e3b1cab8d7630f6342c696e05e17dd3f1f403b Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 14 Apr 2023 22:06:23 +0200 Subject: [PATCH 659/689] Fix typos --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 83e8451..7e5a5f5 100644 --- a/README.md +++ b/README.md @@ -315,7 +315,7 @@ If you are on the master branch, everything is ready and you want to create a release tag you can call: ``` -meson compule git-tag -C build +meson compile git-tag -C build ``` If you want to use another signing key than the prespecified one, configure @@ -346,7 +346,7 @@ if meson is unavailable. ##### Create Signatures -Creation of signatures for releases can be acchieved through: +Creation of signatures for releases can be achieved through: ``` meson compile create-sigs -C build @@ -355,7 +355,7 @@ meson compile create-sigs -C build Configure Cagebreak with `-Dgpg_id=GPGID` for a different gpg signing key. -Withou meson use: +Without meson use: ``` ./scripts/create-signatures GPGID @@ -473,7 +473,7 @@ find bugs in other areas of the code. #### Caveat Currently, there are memory leaks which do not seem to stem from our code but rather -the code of wl-roots or some other library we depend on. We are working on the problem. +the code of wlroots or some other library we depend on. We are working on the problem. In the meantime, add `-Db_detect-leaks=0` to the meson command to exclude memory leaks. ### Reproducible Builds From 0df01ea8d07b261a884fbf0065a0f96142e2e1b3 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 14 Apr 2023 22:06:43 +0200 Subject: [PATCH 660/689] Adjust dev env deps --- scripts/install-development-environment | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install-development-environment b/scripts/install-development-environment index 16fb810..d1b9793 100755 --- a/scripts/install-development-environment +++ b/scripts/install-development-environment @@ -2,7 +2,7 @@ # Copyright 2023, project-repo and the cagebreak contributors # SPDX-License-Identifier: MIT -sudo pacman -Syu --noconfirm git grep sed xev meson ninja clang gcc shellcheck jq openbsd-netcat gnupg binutils alacritty firefox wlroots wayland libxkbcommon cairo pango fontconfig libinput libevdev systemd-libs # systemd-libs is included because of libudev +sudo pacman -Syu --noconfirm git grep sed xev meson ninja clang gcc shellcheck jq openbsd-netcat gnupg binutils alacritty wlroots wayland libxkbcommon cairo pango fontconfig libinput libevdev systemd-libs # systemd-libs is included because of libudev if [[ -n ${MESON_SOURCE_ROOT} ]] then From d6885cec30c9305ec5d8b8f8e0e36c9f21f79b97 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 14 Apr 2023 22:34:45 +0200 Subject: [PATCH 661/689] Adjust shellcheck test --- test/shellcheck | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/shellcheck b/test/shellcheck index cff3fff..7c96d3d 100644 --- a/test/shellcheck +++ b/test/shellcheck @@ -14,6 +14,6 @@ cd "${MESONCURRENTCONFIGDIR}/example_scripts/" || RESULT=1 shellcheck ./* cd "${MESONCURRENTCONFIGDIR}/scripts/" || RESULT=1 -shellcheck ./* +shellcheck ./* || RESULT=1 exit "${RESULT}" From d39dae68b064abdae21b3f03bbcdaeef6a5c6d78 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 14 Apr 2023 22:54:18 +0200 Subject: [PATCH 662/689] Add create release artefacts script --- README.md | 13 +++++++++++ meson.build | 3 +++ scripts/create-release-artefacts | 39 ++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100755 scripts/create-release-artefacts diff --git a/README.md b/README.md index 02f64d8..02c8912 100644 --- a/README.md +++ b/README.md @@ -377,6 +377,19 @@ to set the version number in the man pages and README repology minversion. Use of the script without meson is discouraged because meson.build is not touched by the script. +##### Create Release Artefacts + +Once a release is completely ready to be published, the commit is tagged with the +version on the master branch etc. release artefacts have to be created. + +To aid this use: + +``` +meson compile create-artefacts -C build +``` + +Use of the script version is discouraged. + ### GCC and -fanalyzer Cagebreak should compile with any reasonably new gcc or clang. Consider diff --git a/meson.build b/meson.build index b31f8ff..57ef6b8 100644 --- a/meson.build +++ b/meson.build @@ -365,6 +365,9 @@ run_target('create-sigs', run_target('set-ver', command : ['scripts/set-version', meson.project_version()]) +run_target('create-artefacts', + command : ['scripts/create-release-artefacts', get_option('gpg_id'), meson.project_version()]) + # Test Suite test('Build without warnings', find_program('test/build-w-o-warnings'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'devel') diff --git a/scripts/create-release-artefacts b/scripts/create-release-artefacts new file mode 100755 index 0000000..2049725 --- /dev/null +++ b/scripts/create-release-artefacts @@ -0,0 +1,39 @@ +#!/bin/bash +# Copyright 2023, project-repo and the cagebreak contributors +# SPDX-License-Identifier: MIT + +if [[ -n ${MESON_SOURCE_ROOT} ]] +then + # shellcheck disable=2164 + cd "${MESON_SOURCE_ROOT}" +fi + +readonly gpg_id="${1}" +readonly version="${2}" + +git archive --prefix=cagebreak/ -o "release_${version}".tar.gz tags/version . + +rm -rf "release-artefacts_${version}" +mkdir "release-artefacts_${version}" + +rm -rf temp-rel-artefacts +meson setup temp-rel-artefacts -Dxwayland=true -Dman-pages=true --buildtype=release +ninja -C temp-rel-artefacts + +cp LICENSE "release-artefacts_${version}" +cp SECURITY.md "release-artefacts_${version}" +cp FAQ.md "release-artefacts_${version}" +cp README.md "release-artefacts_${version}" +cp temp-rel-artefacts/cagebreak "release-artefacts_${version}" +cp temp-rel-artefacts/cagebreak.1 "release-artefacts_${version}" +cp temp-rel-artefacts/cagebreak-config.5 "release-artefacts_${version}" +cp temp-rel-artefacts/cagebreak-socket.7 "release-artefacts_${version}" +cp signatures/cagebreak*.sig "release-artefacts_${version}" + +export SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) ; tar --sort=name --mtime= --owner=0 --group=0 --numeric-owner -czf release-artefacts_${version}.tar.gz release-artefacts_${version} + +gpg -u "${gpg_id}" --detach-sign "release-artefacts_${version}.tar.gz" +gpg -u "${gpg_id}" --detach-sign "release_${version}.tar.gz" + + +rm -rf temp-rel-artefacts From 58b91b7f42cfb61c026f699a0bb59e29dc510198 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 14 Apr 2023 23:13:14 +0200 Subject: [PATCH 663/689] Adjust release procedure --- README.md | 61 +++++++++++-------------------------------------------- 1 file changed, 12 insertions(+), 49 deletions(-) diff --git a/README.md b/README.md index 02c8912..ecd7e6b 100644 --- a/README.md +++ b/README.md @@ -586,10 +586,9 @@ The release procedure outlines the process for a release to occur. * [ ] `git checkout development` * [ ] `git pull origin development` * [ ] `git push origin development` - * [ ] New semantic version number determined - * [ ] Adjust version number - * [ ] meson.build - * [ ] git tag + * [ ] Update internal wiki + * [ ] Adjust version number in meson.build + * [ ] `meson compile set-ver -C build` * [ ] Relevant Documentation completed * [ ] New features * [ ] man pages @@ -597,42 +596,32 @@ The release procedure outlines the process for a release to occur. * [ ] cagebreak-config * [ ] cagebreak-socket * [ ] example config - * [ ] Set EPOCH to release day in man generation in meson.build * [ ] FAQ.md * [ ] Changelog.md for major and minor releases but not patches * [ ] Check features for SECURITY.md relevance (changes to socket scope for example) * [ ] Synchronize any socket changes to cagebreak-socket man page - * [ ] Updated internal wiki - * [ ] Added new files to meson.build or hardcoded testing variable * [ ] Fixed bugs documented in Bugs.md * [ ] Include issue discussion from github, where applicable + * [ ] Added new files to meson.build or hardcoded testing variable * [ ] Testing * [ ] Manual testing - * [ ] Libfuzzer testing + * [ ] `meson compile fuzz -C build` for at least one hour * [ ] Arch Build System is up to date - * [ ] wlr_xdg_shell version check - * [ ] Cagebreak is reproducible on multiple machines - * [ ] Documented reproducible build artefacts - * [ ] Hashes of the artefacts in Hashes.md - * [ ] Renamed previous signatures - * [ ] Created gpg signature of the artefacts - * [ ] `gpg --detach-sign -u keyid cagebreak` - * [ ] `gpg --detach-sign -u keyid cagebreak.1` - * [ ] `gpg --detach-sign -u keyid cagebreak-config.5` - * [ ] `gpg --detach-sign -u keyid cagebreak-socket.7` + * [ ] release-non-auto-checks + * [ ] `meson compile create-signatures -C build` + * [ ] Use `meson compile output-hashes -C build` to add Hashes or aid in repro check + * [ ] Commit and push signatures and hashes * [ ] `meson test -C build` * [ ] `git add` relevant files * [ ] `git commit` * [ ] `git push origin development` - * [ ] Determined commit and tag message (Start with "Release version_number\n\n") - * [ ] Mentioned fixed Bugs.md issues ("Fixed Issue n") - * [ ] Mentioned other important changes * [ ] `git checkout master` * [ ] `git merge --squash development` * [ ] `git commit` and insert message - * [ ] `git tag -u keyid version HEAD` and insert message - * [ ] `git tag -v version` and check output + * [ ] `meson compile git-tag -C build` + * [ ] `meson compile create-artefacts -C build` + * [ ] `meson test -C build` THIS MUST PASS WITHOUT ANY FAILURES WHATSOEVER * [ ] `git push --tags origin master` * [ ] `git checkout development` (merge to development depends on whether release was a hotfix) * [ ] `git merge master` @@ -640,32 +629,6 @@ The release procedure outlines the process for a release to occur. * [ ] `git checkout hotfix` (hotfix is to be kept current with master after releases) * [ ] `git merge master` * [ ] `git push --tags origin hotfix` - * [ ] `git archive --prefix=cagebreak/ -o release_version.tar.gz tags/version .` - * [ ] Create release-artefacts_version.tar.gz - * [ ] `mkdir release-artefacts_version` - * [ ] `cp build/cagebreak release-artefacts_version/` - * [ ] `cp build/cagebreak.sig release-artefacts_version/` - * [ ] `cp build/cagebreak.1 release-artefacts_version/` - * [ ] `cp build/cagebreak.1.sig release-artefacts_version/` - * [ ] `cp build/cagebreak-config.5 release-artefacts_version/` - * [ ] `cp build/cagebreak-config.5.sig release-artefacts_version/` - * [ ] `cp build/cagebreak-socket.7 release-artefacts_version/` - * [ ] `cp build/cagebreak-socket.7.sig release-artefacts_version/` - * [ ] `cp LICENSE release-artefacts_version/` - * [ ] `cp README.md release-artefacts_version/` - * [ ] `cp SECURITY.md release-artefacts_version/` - * [ ] `cp FAQ.md release-artefacts_version/` - * [ ] `export SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) ; tar --sort=name --mtime= --owner=0 --group=0 --numeric-owner -czf release-artefacts_version.tar.gz release-artefacts_version` - * [ ] Checked archive - * [ ] tar -xvf release_version.tar.gz - * [ ] cd cagebreak - * [ ] meson setup build -Dxwayland=true -Dman-pages=true --buildtype=release - * [ ] ninja -C build - * [ ] gpg --verify ../signatures/cagebreak.sig build/cagebreak - * [ ] cd .. - * [ ] rm -rf cagebreak - * [ ] `gpg --detach-sign -u keyid release_version.tar.gz` - * [ ] `gpg --detach-sign -u keyid release-artefacts_version.tar.gz` * [ ] Upload archives and signatures as release assets ## Roadmap From bb7c7e3ca1dd8b0c0ca60c3c4c85fa945e927847 Mon Sep 17 00:00:00 2001 From: project-repo Date: Fri, 14 Apr 2023 23:44:00 +0200 Subject: [PATCH 664/689] Add release artefacts test --- meson.build | 1 + scripts/create-release-artefacts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 57ef6b8..1e1f00f 100644 --- a/meson.build +++ b/meson.build @@ -379,3 +379,4 @@ test('Scan-build (static analysis)', find_program('test/scan-build'), env : [ '' test('Arguments', find_program('test/arguments'), args : [ meson.project_version() ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic') test('Environment Variables', find_program('test/environment-variables'), env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'basic') test('Semantic versioning', find_program('test/versions'), args : [ meson.project_version() ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'release') +test('Release-artefacts', find_program('test/check-artefacts'), args : [ meson.project_version() ], env : [ ''.join('MESONCURRENTCONFIGDIR=', meson.current_source_dir()) ], suite: 'release') diff --git a/scripts/create-release-artefacts b/scripts/create-release-artefacts index 2049725..971f72c 100755 --- a/scripts/create-release-artefacts +++ b/scripts/create-release-artefacts @@ -30,7 +30,8 @@ cp temp-rel-artefacts/cagebreak-config.5 "release-artefacts_${version}" cp temp-rel-artefacts/cagebreak-socket.7 "release-artefacts_${version}" cp signatures/cagebreak*.sig "release-artefacts_${version}" -export SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) ; tar --sort=name --mtime= --owner=0 --group=0 --numeric-owner -czf release-artefacts_${version}.tar.gz release-artefacts_${version} +# shellcheck disable=2155 +export SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct) ; tar --sort=name --mtime= --owner=0 --group=0 --numeric-owner -czf "release-artefacts_${version}.tar.gz" "release-artefacts_${version}" gpg -u "${gpg_id}" --detach-sign "release-artefacts_${version}.tar.gz" gpg -u "${gpg_id}" --detach-sign "release_${version}.tar.gz" From 22554f128f8ce4f01de77d15c20697c95adfd734 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 15 Apr 2023 00:17:51 +0200 Subject: [PATCH 665/689] Actually add artefacts test --- test/check-artefacts | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 test/check-artefacts diff --git a/test/check-artefacts b/test/check-artefacts new file mode 100644 index 0000000..8e5edb6 --- /dev/null +++ b/test/check-artefacts @@ -0,0 +1,27 @@ +#! /bin/sh +# Copyright 2023, project-repo and the cagebreak contributors +# SPDX-License-Identifier: MIT + +RESULT=0 + +readonly version="${1}" + +# shellcheck disable=SC2164 +cd "${MESONCURRENTCONFIGDIR}" + +gpg --verify "release_${version}.tar.gz.sig" || RESULT=1 +gpg --verify "release-artefacts_${version}.tar.gz.sig" || RESULT=1 + +tar -xvf "release_${version}.tar.gz" +cd cagebreak || RESULT=1 && exit 1 +meson setup build -Dxwayland=true -Dman-pages=true --buildtype=release +ninja -C build +gpg --verify ../signatures/cagebreak.sig build/cagebreak || RESULT=1 +gpg --verify ../signatures/cagebreak.1.sig build/cagebreak.1 || RESULT=1 +gpg --verify ../signatures/cagebreak-config.5.sig build/cagebreak-config.5 || RESULT=1 +gpg --verify ../signatures/cagebreak-socket.7.sig build/cagebreak-socket.7 || RESULT=1 +# shellcheck disable=2103 +cd .. +rm -rf cagebreak + +exit "${RESULT}" From de0f7a091b9dbd26bf24dbff8cd67c7effd4121f Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 15 Apr 2023 18:51:58 +0200 Subject: [PATCH 666/689] Slight rewording --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ecd7e6b..1b22bfe 100644 --- a/README.md +++ b/README.md @@ -379,10 +379,9 @@ not touched by the script. ##### Create Release Artefacts -Once a release is completely ready to be published, the commit is tagged with the -version on the master branch etc. release artefacts have to be created. - -To aid this use: +The following command generates the release artefacts which must be created +once a release is completely ready to be published (the commit is tagged with +the version of the master branch, etc.): ``` meson compile create-artefacts -C build From 3b22453ccab3f97507b7c59163bc031233901529 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 15 Apr 2023 18:56:30 +0200 Subject: [PATCH 667/689] Reword --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1b22bfe..4ab3b99 100644 --- a/README.md +++ b/README.md @@ -600,7 +600,7 @@ The release procedure outlines the process for a release to occur. * [ ] Check features for SECURITY.md relevance (changes to socket scope for example) * [ ] Synchronize any socket changes to cagebreak-socket man page - * [ ] Fixed bugs documented in Bugs.md + * [ ] Document fixed bugs in Bugs.md * [ ] Include issue discussion from github, where applicable * [ ] Added new files to meson.build or hardcoded testing variable * [ ] Testing From 75aea2cee2f5e229944ea6da81de83dac4212180 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 16 Apr 2023 11:22:09 +0200 Subject: [PATCH 668/689] Add note about accessibility. --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 21bbe5f..60b7fb3 100644 --- a/README.md +++ b/README.md @@ -703,6 +703,17 @@ independent of github, in case this service is unavailable. For other means of contacting the Cagebreak authors and for security issues see [SECURITY.md](SECURITY.md). +## Accessibility + + * We use text input/output to interact with the user whenever possible. For + example, sending text-based commands to the cagebreak sockets allows + one to change every configurable feature of cagebreak. + * Color is displayed but never a vital part to operating cagebreak. + * Text size can be increased and background color adjusted using text commands. + * There is no screen reader support per se but using a screen reader on socket output + would work and cagebreak does not preclude the use of a screen reader + for any software run with it. + ## Contributors * Aisha Tammy From 859fcb2efc55e1b96b7082f1a2b69ae97b29008f Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 16 Apr 2023 11:25:05 +0200 Subject: [PATCH 669/689] Add note on Review Requirements and DCO --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index 60b7fb3..b9e8512 100644 --- a/README.md +++ b/README.md @@ -260,6 +260,27 @@ need to ask for the distribution the user was having the issue on.)). You should use Arch Linux if you want to modify Cagebreak for yourself. +### Review Requirements + +Project-repo will review your proposal before your implementation for feasibility +and desirability. After your pull request, the code will be reviewed in conjunction +with all other changes before the release as per the release procedure. + +All reviews performed by project-repo are verified by at least two people internally. + +### Developer Certificate of Origin (DCO) + +On any pull requests please include a + +``` +signed-off-by: YOUR IDENTIFIER OR NAME +``` + +DCO statement. + +By doing this you claim that you are legally allowed to contribute the +code and agree to let project-repo publish it under the MIT License. + #### Development Environment CAVEAT: This script works exclusively on Arch Linux, which, as outlined above, From afd99dfaa0b847837f24f937c5f105f9d336ab60 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 16 Apr 2023 12:38:45 +0200 Subject: [PATCH 670/689] Adjust release procedure --- README.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index b9e8512..aca03a6 100644 --- a/README.md +++ b/README.md @@ -611,15 +611,15 @@ The release procedure outlines the process for a release to occur. * [ ] `git checkout development` * [ ] `git pull origin development` * [ ] `git push origin development` - * [ ] New semantic version number determined + * [ ] Arch Build System is up to date * [ ] `meson test -C build/` just to get an overview - * [ ] Adjust version number - * [ ] meson.build - * [ ] git tag * [ ] Update internal wiki * [ ] Adjust version number in meson.build * [ ] `meson compile set-ver -C build` - * [ ] Relevant Documentation completed + * [ ] Add new files to meson.build or hardcoded testing variable + * [ ] Commit changes + * [ ] `git push origin development` + * [ ] Complete relevant documentation * [ ] New features * [ ] tests added and old test scripts adjusted * [ ] man pages @@ -629,21 +629,20 @@ The release procedure outlines the process for a release to occur. * [ ] example config * [ ] FAQ.md * [ ] Changelog.md for major and minor releases but not patches - * [ ] Check features for SECURITY.md relevance (changes to socket scope - for example) + * [ ] Check changes for SECURITY.md relevance (changes to socket scope for example) * [ ] Synchronize any socket changes to cagebreak-socket man page * [ ] Document fixed bugs in Bugs.md * [ ] Include issue discussion from github, where applicable - * [ ] Added new files to meson.build or hardcoded testing variable + * [ ] Commit changes + * [ ] `git push origin development` * [ ] Testing * [ ] Manual testing * [ ] `meson compile fuzz -C build` for at least one hour - * [ ] Arch Build System is up to date - * [ ] release-non-auto-checks + * [ ] Complete release-non-auto-checks + * [ ] Use `meson compile output-hashes -C build` to add Hashes or aid in repro check * [ ] `meson compile create-signatures -C build` - * [ ] Use `meson compile output-hashes -C build` to add Hashes or aid in repro check - * [ ] Commit and push signatures and hashes - * [ ] `meson test -C build` + * [ ] Commit and push signatures, hashes and non-auto-check files + * [ ] `meson test -C build` passes everything except some release tests * [ ] `git add` relevant files * [ ] `git commit` * [ ] `git push origin development` @@ -661,6 +660,7 @@ The release procedure outlines the process for a release to occur. * [ ] `git merge master` * [ ] `git push --tags origin hotfix` * [ ] Upload archives and signatures as release assets + * [ ] Manage package release ## Roadmap From 4947fe31424198afc8b976bd28b8fc1da1b686b1 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 16 Apr 2023 12:52:17 +0200 Subject: [PATCH 671/689] Adjust non-auto checks --- release-non-auto-checks/coverity | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 release-non-auto-checks/coverity diff --git a/release-non-auto-checks/coverity b/release-non-auto-checks/coverity deleted file mode 100644 index e69de29..0000000 From f5060e58700a6c44634e5b1b7f1ece4642ad79ac Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 17 Apr 2023 21:24:42 +0200 Subject: [PATCH 672/689] Adjust epoch --- meson.build | 2 +- release-non-auto-checks/Bugs.md | 2 ++ release-non-auto-checks/FAQ.md | 2 ++ release-non-auto-checks/changelog-major-minor | 2 ++ release-non-auto-checks/internal-wiki | 2 ++ release-non-auto-checks/meson-epoch | 2 ++ release-non-auto-checks/release-note | 4 ++-- 7 files changed, 13 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index 5f7ecbf..26b0746 100644 --- a/meson.build +++ b/meson.build @@ -260,7 +260,7 @@ install_data('LICENSE', install_dir : '/usr/share/licenses/' + meson.project_nam if get_option('man-pages') scdoc = find_program('scdoc') - secssinceepoch = 1680540192 + secssinceepoch = 1681758922 shcommand = 'export SOURCE_DATE_EPOCH=' + secssinceepoch.to_string() + ' ; @0@ < @INPUT@'.format(scdoc.path()) sh = find_program('sh') mandir1 = join_paths(get_option('mandir'), 'man1') diff --git a/release-non-auto-checks/Bugs.md b/release-non-auto-checks/Bugs.md index e69de29..aa7d21e 100644 --- a/release-non-auto-checks/Bugs.md +++ b/release-non-auto-checks/Bugs.md @@ -0,0 +1,2 @@ +2.1.1 +2023-04-17 diff --git a/release-non-auto-checks/FAQ.md b/release-non-auto-checks/FAQ.md index e69de29..aa7d21e 100644 --- a/release-non-auto-checks/FAQ.md +++ b/release-non-auto-checks/FAQ.md @@ -0,0 +1,2 @@ +2.1.1 +2023-04-17 diff --git a/release-non-auto-checks/changelog-major-minor b/release-non-auto-checks/changelog-major-minor index e69de29..aa7d21e 100644 --- a/release-non-auto-checks/changelog-major-minor +++ b/release-non-auto-checks/changelog-major-minor @@ -0,0 +1,2 @@ +2.1.1 +2023-04-17 diff --git a/release-non-auto-checks/internal-wiki b/release-non-auto-checks/internal-wiki index e69de29..aa7d21e 100644 --- a/release-non-auto-checks/internal-wiki +++ b/release-non-auto-checks/internal-wiki @@ -0,0 +1,2 @@ +2.1.1 +2023-04-17 diff --git a/release-non-auto-checks/meson-epoch b/release-non-auto-checks/meson-epoch index e69de29..aa7d21e 100644 --- a/release-non-auto-checks/meson-epoch +++ b/release-non-auto-checks/meson-epoch @@ -0,0 +1,2 @@ +2.1.1 +2023-04-17 diff --git a/release-non-auto-checks/release-note b/release-non-auto-checks/release-note index 92d5898..aa7d21e 100644 --- a/release-non-auto-checks/release-note +++ b/release-non-auto-checks/release-note @@ -1,2 +1,2 @@ -2.1.0 -2023-04-06 +2.1.1 +2023-04-17 From 1b25c7278768ac3d5af8fc6894e9f22e6a07662e Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 17 Apr 2023 21:31:44 +0200 Subject: [PATCH 673/689] Perform release-non-auto-checks --- release-non-auto-checks/SECURITY.md | 2 ++ release-non-auto-checks/WLR_XDG_VERSION | 2 ++ release-non-auto-checks/reproducibility-checked | 2 ++ release-non-auto-checks/security-to-man-page-info-transfer | 2 ++ 4 files changed, 8 insertions(+) diff --git a/release-non-auto-checks/SECURITY.md b/release-non-auto-checks/SECURITY.md index e69de29..aa7d21e 100644 --- a/release-non-auto-checks/SECURITY.md +++ b/release-non-auto-checks/SECURITY.md @@ -0,0 +1,2 @@ +2.1.1 +2023-04-17 diff --git a/release-non-auto-checks/WLR_XDG_VERSION b/release-non-auto-checks/WLR_XDG_VERSION index e69de29..aa7d21e 100644 --- a/release-non-auto-checks/WLR_XDG_VERSION +++ b/release-non-auto-checks/WLR_XDG_VERSION @@ -0,0 +1,2 @@ +2.1.1 +2023-04-17 diff --git a/release-non-auto-checks/reproducibility-checked b/release-non-auto-checks/reproducibility-checked index e69de29..aa7d21e 100644 --- a/release-non-auto-checks/reproducibility-checked +++ b/release-non-auto-checks/reproducibility-checked @@ -0,0 +1,2 @@ +2.1.1 +2023-04-17 diff --git a/release-non-auto-checks/security-to-man-page-info-transfer b/release-non-auto-checks/security-to-man-page-info-transfer index e69de29..aa7d21e 100644 --- a/release-non-auto-checks/security-to-man-page-info-transfer +++ b/release-non-auto-checks/security-to-man-page-info-transfer @@ -0,0 +1,2 @@ +2.1.1 +2023-04-17 From 1a1fa3c7f902789781d54a4db2522c4b63dc2a75 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 17 Apr 2023 21:35:27 +0200 Subject: [PATCH 674/689] Update Hashes.md --- Hashes.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Hashes.md b/Hashes.md index 4e28e1e..e5da651 100644 --- a/Hashes.md +++ b/Hashes.md @@ -1,5 +1,25 @@ # Hashes +2.1.1 cagebreak + + * sha 256: 8632e7e49637e5a3e7ab425a05fbd63d71cf6025143c89d196f309dbf4efdd57 + * sha 512: ca853aca80bde974f00e4cfcb21a77159d2f9f639342e92d049a0c5290a57094a1b2b1f28ac76ebdf89cf76384bb1caca45813d25ba5ef8ba8996e8c10e51e7a + +2.1.1 cagebreak.1 + + * sha 256: 1d56762bcbe4ba5b9015dda3c19ab1d628d08c7a7c731042643c9f2e59cf3a7c + * sha 512: e421da32e8d6f9eec4559c53614427900fd7ae5c17bf9b9fdfa90764017d5d90c08e10e737aacbe46ed97966dbc4c76944b54bce367925fd9899ff8e41fa7947 + +2.1.1 cagebreak-config.5 + + * sha 256: f4405bd650d4cab29e536651f0d45443ebe51628c4dfef75576923ec903d781e + * sha 512: 451c85c7a02f724824499a43929ef6f05eee4d4c666186f766163c01e36503a36b7f6bbf2d5cb632cbd2cd0740b0b3becc2d8c388e914cb0bacfe6134a6ada92 + +2.1.1 cagebreak-socket.7 + + * sha 256: cd67c9de727d6f8727269bc06a80aa77ede26b5652eb4ab35c898939711ae429 + * sha 512: a572710972b19a3872269fd2c52f1afd09a11dd621b4108f6ec3cde383c088c52782d5a240b001328257a66143a045fbf967d327b434e2ca32c2ffafc3b18b7f + 2.1.0 cagebreak * sha 256: 0c90ba529ffc916306a1ca04d4c56a800c62a98d184d3cfcc2ce67dcdffad324 From def3d3a1182b797e9b67a0420ab97d25e8eb5320 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 17 Apr 2023 21:39:11 +0200 Subject: [PATCH 675/689] Add signatures --- signatures/2.1.0-cagebreak-config.5.sig | Bin 0 -> 566 bytes signatures/2.1.0-cagebreak-socket.7.sig | Bin 0 -> 566 bytes signatures/2.1.0-cagebreak.1.sig | Bin 0 -> 566 bytes signatures/2.1.0-cagebreak.sig | Bin 0 -> 566 bytes signatures/cagebreak-config.5.sig | Bin 566 -> 566 bytes signatures/cagebreak-socket.7.sig | Bin 566 -> 566 bytes signatures/cagebreak.1.sig | Bin 566 -> 566 bytes signatures/cagebreak.sig | Bin 566 -> 566 bytes 8 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 signatures/2.1.0-cagebreak-config.5.sig create mode 100644 signatures/2.1.0-cagebreak-socket.7.sig create mode 100644 signatures/2.1.0-cagebreak.1.sig create mode 100644 signatures/2.1.0-cagebreak.sig diff --git a/signatures/2.1.0-cagebreak-config.5.sig b/signatures/2.1.0-cagebreak-config.5.sig new file mode 100644 index 0000000000000000000000000000000000000000..25072cbc7ec479dc03f8b0e58fb181f393b6019f GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j*qg2yatK3J!`Pxw_y3HVH?JGf^B0%R-@H2?|;5J?I6 zOsG4!XTI7G{wRJJEi`J}KeQfb1JU@66Z3T<6NTy#--hMh*c8j3d2~hbi^ZX=-TrKn ztD7j~V&53Q9i%4h8U#_7hK7oj`CIlD=;Mc4GwQ>a)J-YmdG`Vl;8s)}69L&?L5d~& z$20iJNFBNWK|tDpKg-~|d82IW#CC`j7nDWB&(z58T;2M2wvtE4dP=d?zp?WD0=p9* zUPU`tsJ{U-0GdW{DSNRrlKUGFVqhO3@k!$cL3*Qp6odwyB-0xQnq)@N!PVe$1`L>|k=$CLVHK?O+TkwoVUh!Xj=V&t>{#C*0%ot(iIdi&^gyH8KlU zhBT+I4>=Rc$+O;JZ!`T~Bm7w_#GKcp?kq#s$P0|Y^(i`zme%V+VSapC^`l@oRL1{@BcO}re zf)i0-Wdr6R<0JhvON1>o?yPvCFw8vYk{DbTrXy>~v!h&yhCb5?O?zZ$sp$kzmLK)j EGK$X>3IG5A literal 0 HcmV?d00001 diff --git a/signatures/2.1.0-cagebreak-socket.7.sig b/signatures/2.1.0-cagebreak-socket.7.sig new file mode 100644 index 0000000000000000000000000000000000000000..67c2e166279805704204ef4ba7843177146a8340 GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j*qg2yatK3J!`Pxw_y3HVH?JGf^B0%R-@I{*p^5J?I6 zOsG4!XJ?rY{wb7ikpWvUjL5LXPboA72(rh}Um;IL{Hr(?cZ{Hcdvsw7)6JwNk7BnM zayXykj0YkR+Jh2Hwq|Y^A zPu`ugLAlCp?L0U!>F;Zuu;aVM2bI~8Xj333 zsC7lgX`xb^ETu!?Bw8FNyQ$U4&W>=On~*_~z-WZIC6s*H>m*Fo>YN z3NqSep3ktdUAbS8m_Vjw$@OzLcpWk*swcy9j=(Zt11%qsS1}G4A(U&PU%nG0<@*JgP<=etYs$Pl@IShl2ReE?BjM En*g&E-T(jq literal 0 HcmV?d00001 diff --git a/signatures/2.1.0-cagebreak.1.sig b/signatures/2.1.0-cagebreak.1.sig new file mode 100644 index 0000000000000000000000000000000000000000..b0c8dc15ac8fae31e58867f0a45a09b3ed2d1486 GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j*qg2yatK3J!`Pxw_y3HVH?JGf^B0%R-@FaQb(5J?I6 zOsG4!XQ9Rq`v;-NQB9`itOy7w8l=VA36V8d$O+C8V4siElG)?+-d>(fZ&kfv`E=xo zinXUoT!}dOjO)=zs&(12$gG=(A+U zCuHOF=LWtU(1Dednc%h`JboeK64+cz8-y0Yk7+1^yM3lwplgw@i?XqZjEFM^_-h0Z z@*BzMK7ViM?i+E-b1U5=bh>3>h#N%FkvtOpAiTrt%rBrS4;{wW z#YEh;zE>EsLm_eFyq|IMThIw)Ro#1BO`vWh!8CFn|>I$Jm(P9-y7 z!he0ilG@?m)J zJ{eq<2(d=d+Cpi7$j%0c)kbInMA%wt<+aJ-)*bD#_1BbxZ)|xCbL@ctO6~R@_Yax; ztz>7&y$BT!7q(-3!{XjbzOdope4li@9B$gEPsc6ep)BMU=j$b*W(L=2xx4%aHp6O( z7~7&h?CgJ;Y7fxOYMx`k^J-@2HA?d{Nqqb-Nx|}M5-;vQBp9R!+q}?FrR-=x3L{11 zX969$BPXz2{2CKuBWFU)jUhbLXVmrPv>nUqh3+4CF$V;Jk3r<2*J+2=tj2xT%|&ZHd?OR?L2P;|Rb_ANCh zPF{g+^Ao3WzoSl#rc9|q`MH>0@plcedJVZl=KE%i5jp}Oii=6Ioj%WE$eO}I?`J)d z0v84f93fy1zigPkk+j$?-pb1~hneUMuYKNRY_)GY8L#g!H@eW3r_OiO(=HN>$zcI9 EDjqQqh5!Hn literal 0 HcmV?d00001 diff --git a/signatures/cagebreak-config.5.sig b/signatures/cagebreak-config.5.sig index 25072cbc7ec479dc03f8b0e58fb181f393b6019f..e25e49c74428afbac6d7bd0466d556b92405bdfe 100644 GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j*$>l!Yw(LZP72CP}!49FYc2K|Kv0%Sd(xBv>V!tzCAjipv zwL*&XWDQ+NgCa63^5xd6*rRB5_M7Ys7zgiT1s~-o2YJ1 z);#uxIl2+qI$*0rlI_<5p|vN80hPq{9%)NYButb7%J%%KnV z2q1c)eISEOG|o0!{YFv#IK8B;M~-^UR+TC;oHi$U-&sQxB_Yrv&!_Me-|GPK$CZbO E66|6O`Tzg` literal 566 zcmV-60?GY}0y6{v0SEvc79j*qg2yatK3J!`Pxw_y3HVH?JGf^B0%R-@H2?|;5J?I6 zOsG4!XTI7G{wRJJEi`J}KeQfb1JU@66Z3T<6NTy#--hMh*c8j3d2~hbi^ZX=-TrKn ztD7j~V&53Q9i%4h8U#_7hK7oj`CIlD=;Mc4GwQ>a)J-YmdG`Vl;8s)}69L&?L5d~& z$20iJNFBNWK|tDpKg-~|d82IW#CC`j7nDWB&(z58T;2M2wvtE4dP=d?zp?WD0=p9* zUPU`tsJ{U-0GdW{DSNRrlKUGFVqhO3@k!$cL3*Qp6odwyB-0xQnq)@N!PVe$1`L>|k=$CLVHK?O+TkwoVUh!Xj=V&t>{#C*0%ot(iIdi&^gyH8KlU zhBT+I4>=Rc$+O;JZ!`T~Bm7w_#GKcp?kq#s$P0|Y^(i`zme%V+VSapC^`l@oRL1{@BcO}re zf)i0-Wdr6R<0JhvON1>o?yPvCFw8vYk{DbTrXy>~v!h&yhCb5?O?zZ$sp$kzmLK)j EGK$X>3IG5A diff --git a/signatures/cagebreak-socket.7.sig b/signatures/cagebreak-socket.7.sig index 67c2e166279805704204ef4ba7843177146a8340..6b1a6a53bea5fd958f39e4e1a3b2630bc6bcfdd0 100644 GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j*$>l!Yw(LZP72CP}!49FYc2K|Kv0%Sd(xBv<1}Fi}wvC0q8gc5j<2D--xgVi`D}qC? zVas)^fv%k{3!i4=+1r}fNLnDFBz&I`+q}yv?MCPXEhv(V#gT*E1@Ms!jzt)>6e6+| zX-u`yGyy-#sngzXi1tX8NCm+~i~>#s;PTeX{a!7a)AGH=S63U0u!;hLXdA$#rdSc0 z6YA!rPx9cY;iCCLmvPHMB{^o!+s?Nfmnp>f(39do*$Ir=a042`w^^;rkBk4a&zP(I zU}8wkO#P-KAM&EkhPF(rf9_C}R_T`%KR{cI)*$4uPZiJS2XunIn^uGgXo>%`hPIXv z`D{%Sh{dJ2P+)I$w3HP7lho0qk)zWVu*`U7``v1rG;;X^I`?&U`=Am_vS{j<0lMUE zmuvJ^o-(sqCPjoa+y8hZxkM`*=hB4tB^ zh_^{u14_Mg3N{t3Qi;moRnhiUR}1deAKy`A zPu`ugLAlCp?L0U!>F;Zuu;aVM2bI~8Xj333 zsC7lgX`xb^ETu!?Bw8FNyQ$U4&W>=On~*_~z-WZIC6s*H>m*Fo>YN z3NqSep3ktdUAbS8m_Vjw$@OzLcpWk*swcy9j=(Zt11%qsS1}G4A(U&PU%nG0<@*JgP<=etYs$Pl@IShl2ReE?BjM En*g&E-T(jq diff --git a/signatures/cagebreak.1.sig b/signatures/cagebreak.1.sig index b0c8dc15ac8fae31e58867f0a45a09b3ed2d1486..7674f52c5525457b35e37630f7e174105cdf97d9 100644 GIT binary patch literal 566 zcmV-60?GY}0y6{v0SEvc79j*$>l!Yw(LZP72CP}!49FYc2K|Kv0%Sd(w*U$W5ZnyN z8{h{0g$BP5|3+rAM~!0w2)qQtiHJcD&$F7&*Ws<|G9b8d%A9w%?95_vvKr+J)dzRT z7}Dgl#lO}{Xei>jJAKVPK7g8_Z;E9f2&>0R>{6hPo?`&kqf!UMp}tJ)Wsq+ISEiLc z7wO~hJp|Wc#X+~)`n?40XtTbraBHqbm7O6V;i}>0UJV#W;2C%VvTX#0btuAYjR6kK zV(WyW@T$+>F)0eIA#}TV0@9hAJJUyyy&M9IU|`_8J@ED)2L9y07q1&UNkZha0OUV- zzD8CJ_LtymJoE9Y+goAv*mFh$G!(CRd$NaiJ?a@9zGQOd|U9!Q9j1Hs(lb?99V8jsaHPjFUYU2Vou z5{B+uG9q~#=4~+u)zU8ZH5&c03;JsLZ`OT_OK~VtnV*H%Og}fPQLGtIKz<&l7hNw zXd}6GH50ZJcJ$7*KqSJ+o=(V*_Xs82+|+zDk=Tdh5m^n@F2~G0VK#2!Pg{B!-)gN& zw6%KZzQ%6kJxHm(P0kSI51z_n58^m{ogDeO4T6{-y(@0Q;GhiJ+aP^ E*P|>Ivj6}9 literal 566 zcmV-60?GY}0y6{v0SEvc79j*qg2yatK3J!`Pxw_y3HVH?JGf^B0%R-@FaQb(5J?I6 zOsG4!XQ9Rq`v;-NQB9`itOy7w8l=VA36V8d$O+C8V4siElG)?+-d>(fZ&kfv`E=xo zinXUoT!}dOjO)=zs&(12$gG=(A+U zCuHOF=LWtU(1Dednc%h`JboeK64+cz8-y0Yk7+1^yM3lwplgw@i?XqZjEFM^_-h0Z z@*BzMK7ViM?i+E-b1U5=bh>3>h#N%FkvtOpAiTrt%rBrS4;{wW z#YEh;zE>EsLm_eFyq|IMThIw)Ro#1BO`vWh!8CFn|>I$Jm(P9-y7 z!he0ilG@?l!Yw(LZP72CP}!49FYc2K|Kv0%Sd(w*U$W5ZnyN z8{h{0g|O`p|93+h`>T39v=djZ0&wOd*$K{aopV$L6nt}hx`hB&5Pf-?SaHqLIQKWAKFY)eQIZhM_TsTyth9BBvr?NCuIW4avXTAIt@Y<2T&n7p3kNrY! zqSc2?p^pZ(*T>#NcFb>weL^n7E3W>$GC?NFrG23dM+(TyWnpJ0Gx3H;|>bN zb4u`nR4`|f>GZAb=#_=PzeB?U&iWE&nPq(yXa9ud%8?4xOz%Omilkz`{YlRd^H~E3 zx98;1k+8JlLoJbo6%@FZ`jLoSn_zx{I`)X*_k9X&K-^K)Hd7Cd7R^550PG4Oeg4-m<1JL!W$2>2kLobN-?OLq z|LzkmP}4FyS|(AAzV-Ft1r%Nw+tRy1fEVK9fRa<;&NO>1m_X=8F<`g0s%*;X%p-IT zK#Fz}rdXasS2uaDJFVCNrH64xK49yEpCUp8p|%F? E)OoZP+yDRo literal 566 zcmV-60?GY}0y6{v0SEvc79j*qg2yatK3J!`Pxw_y3HVH?JGf^B0%R-@EdUA$5J?I6 zOsG4!XUo$N0E5~0P~h*DH~*A2hTro%z;sAA=WxosF)hl-_!M(1uj5Le+}S87X>m)J zJ{eq<2(d=d+Cpi7$j%0c)kbInMA%wt<+aJ-)*bD#_1BbxZ)|xCbL@ctO6~R@_Yax; ztz>7&y$BT!7q(-3!{XjbzOdope4li@9B$gEPsc6ep)BMU=j$b*W(L=2xx4%aHp6O( z7~7&h?CgJ;Y7fxOYMx`k^J-@2HA?d{Nqqb-Nx|}M5-;vQBp9R!+q}?FrR-=x3L{11 zX969$BPXz2{2CKuBWFU)jUhbLXVmrPv>nUqh3+4CF$V;Jk3r<2*J+2=tj2xT%|&ZHd?OR?L2P;|Rb_ANCh zPF{g+^Ao3WzoSl#rc9|q`MH>0@plcedJVZl=KE%i5jp}Oii=6Ioj%WE$eO}I?`J)d z0v84f93fy1zigPkk+j$?-pb1~hneUMuYKNRY_)GY8L#g!H@eW3r_OiO(=HN>$zcI9 EDjqQqh5!Hn From 053e0c9a501e5ada4d06bd9401beefcca6175209 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 17 Apr 2023 22:01:03 +0200 Subject: [PATCH 676/689] Fix create-release-artefacts --- scripts/create-release-artefacts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/create-release-artefacts b/scripts/create-release-artefacts index 971f72c..4b16167 100755 --- a/scripts/create-release-artefacts +++ b/scripts/create-release-artefacts @@ -11,7 +11,7 @@ fi readonly gpg_id="${1}" readonly version="${2}" -git archive --prefix=cagebreak/ -o "release_${version}".tar.gz tags/version . +git archive --prefix=cagebreak/ -o "release_${version}.tar.gz" "tags/${version}" . rm -rf "release-artefacts_${version}" mkdir "release-artefacts_${version}" From f0ebae61a68ffe6cebc20c25ada363728f83ccae Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 17 Apr 2023 22:13:00 +0200 Subject: [PATCH 677/689] Fix test/check-artefacts --- test/check-artefacts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/check-artefacts b/test/check-artefacts index 8e5edb6..9e62bb5 100644 --- a/test/check-artefacts +++ b/test/check-artefacts @@ -13,7 +13,7 @@ gpg --verify "release_${version}.tar.gz.sig" || RESULT=1 gpg --verify "release-artefacts_${version}.tar.gz.sig" || RESULT=1 tar -xvf "release_${version}.tar.gz" -cd cagebreak || RESULT=1 && exit 1 +cd cagebreak || exit 1 meson setup build -Dxwayland=true -Dman-pages=true --buildtype=release ninja -C build gpg --verify ../signatures/cagebreak.sig build/cagebreak || RESULT=1 From 66a4f9f00a5dc8dd9616afc3962beafb36d8831e Mon Sep 17 00:00:00 2001 From: project-repo Date: Tue, 18 Apr 2023 21:44:41 +0200 Subject: [PATCH 678/689] Adjust release procedure --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index aca03a6..fc5bcab 100644 --- a/README.md +++ b/README.md @@ -638,9 +638,11 @@ The release procedure outlines the process for a release to occur. * [ ] Testing * [ ] Manual testing * [ ] `meson compile fuzz -C build` for at least one hour + * [ ] Adjust Hashes.md - Use `meson compile output-hashes -C build` to add Hashes or aid in repro check + * [ ] Commit changes + * [ ] `git push origin development` * [ ] Complete release-non-auto-checks - * [ ] Use `meson compile output-hashes -C build` to add Hashes or aid in repro check - * [ ] `meson compile create-signatures -C build` + * [ ] `meson compile create-sigs -C build` * [ ] Commit and push signatures, hashes and non-auto-check files * [ ] `meson test -C build` passes everything except some release tests * [ ] `git add` relevant files @@ -660,6 +662,7 @@ The release procedure outlines the process for a release to occur. * [ ] `git merge master` * [ ] `git push --tags origin hotfix` * [ ] Upload archives and signatures as release assets + * [ ] Delete feature branches if appropriate * [ ] Manage package release ## Roadmap From c2e95272ea3233f8f0de4a083472af72b87bf236 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 23 Apr 2023 18:12:47 +0200 Subject: [PATCH 679/689] Prepare basics for release 2.1.2 --- README.md | 5 ++++- meson.build | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fc5bcab..43118bd 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Cagebreak: A Wayland Tiling Compositor -[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/6532/badge)](https://bestpractices.coreinfrastructure.org/projects/6532) [![Packaging status](https://repology.org/badge/tiny-repos/cagebreak.svg)](https://repology.org/project/cagebreak/versions) [![AUR package](https://repology.org/badge/version-for-repo/aur/cagebreak.svg?minversion=2.1.1)](https://repology.org/project/cagebreak/versions) +[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/6532/badge)](https://bestpractices.coreinfrastructure.org/projects/6532) [![Packaging status](https://repology.org/badge/tiny-repos/cagebreak.svg)](https://repology.org/project/cagebreak/versions) [![AUR package](https://repology.org/badge/version-for-repo/aur/cagebreak.svg?minversion=2.1.2)](https://repology.org/project/cagebreak/versions) ## Quick Introduction @@ -633,6 +633,7 @@ The release procedure outlines the process for a release to occur. * [ ] Synchronize any socket changes to cagebreak-socket man page * [ ] Document fixed bugs in Bugs.md * [ ] Include issue discussion from github, where applicable + * [ ] `meson compile adjust-epoch -C build` * [ ] Commit changes * [ ] `git push origin development` * [ ] Testing @@ -746,6 +747,8 @@ see [SECURITY.md](SECURITY.md). * Oliver Friedmann * [Add output scaling](https://github.com/project-repo/cagebreak/pull/34), released in 2.0.0 with slight modifications + * Tom Greif + * Fix bug in merge_output_configs in 2.1.2 ## License diff --git a/meson.build b/meson.build index 26b0746..02ad9d7 100644 --- a/meson.build +++ b/meson.build @@ -3,7 +3,7 @@ project( 'cagebreak', 'c', -version : '2.1.1', +version : '2.1.2', license : 'MIT', default_options : ['c_std=c11', 'warning_level=3'] ) From 750bf48cda1048214f0c51066c561a37819b77c6 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 23 Apr 2023 18:17:46 +0200 Subject: [PATCH 680/689] Adjust man page versions --- man/cagebreak-config.5.md | 2 +- man/cagebreak-socket.7.md | 2 +- man/cagebreak.1.md | 2 +- scripts/set-version | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index bb04547..b9632dd 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -1,4 +1,4 @@ -cagebreak-config(5) "VERSION 2.1.1" "Cagebreak Manual" +cagebreak-config(5) "Version 2.1.2" "Cagebreak Manual" # NAME diff --git a/man/cagebreak-socket.7.md b/man/cagebreak-socket.7.md index 19b7370..4c1a31a 100644 --- a/man/cagebreak-socket.7.md +++ b/man/cagebreak-socket.7.md @@ -1,4 +1,4 @@ -cagebreak-socket(7) "VERSION 2.1.1" "Cagebreak Manual" +cagebreak-socket(7) "Version 2.1.2" "Cagebreak Manual" # NAME diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index fdc2da1..c8fc85e 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -1,4 +1,4 @@ -cagebreak(1) "VERSION 2.1.1" "Cagebreak Manual" +cagebreak(1) "Version 2.1.2" "Cagebreak Manual" # NAME diff --git a/scripts/set-version b/scripts/set-version index c4506cb..3ee035c 100755 --- a/scripts/set-version +++ b/scripts/set-version @@ -15,6 +15,6 @@ version="${1}" sed -i -e "s/minversion\=[0-9]*\.[0-9]*.[0-9]*/minversion=$version/" README.md -sed -i -e "s/Version [0-9]*\.[0-9]*.[0-9]*/VERSION $version/" man/cagebreak.1.md -sed -i -e "s/Version [0-9]*\.[0-9]*.[0-9]*/VERSION $version/" man/cagebreak-config.5.md -sed -i -e "s/Version [0-9]*\.[0-9]*.[0-9]*/VERSION $version/" man/cagebreak-socket.7.md +sed -i -e "s/Version [0-9]*\.[0-9]*.[0-9]*/Version $version/" man/cagebreak.1.md +sed -i -e "s/Version [0-9]*\.[0-9]*.[0-9]*/Version $version/" man/cagebreak-config.5.md +sed -i -e "s/Version [0-9]*\.[0-9]*.[0-9]*/Version $version/" man/cagebreak-socket.7.md From 000e6f141043a9cd62614fd39aeb01f827d21d3e Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 23 Apr 2023 18:43:22 +0200 Subject: [PATCH 681/689] Adjust non-auto checks --- release-non-auto-checks/meson-epoch | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 release-non-auto-checks/meson-epoch diff --git a/release-non-auto-checks/meson-epoch b/release-non-auto-checks/meson-epoch deleted file mode 100644 index aa7d21e..0000000 --- a/release-non-auto-checks/meson-epoch +++ /dev/null @@ -1,2 +0,0 @@ -2.1.1 -2023-04-17 From 8850488f0e886c7ff0efb544da62cd5a418cb2ab Mon Sep 17 00:00:00 2001 From: Uks2 Date: Mon, 24 Apr 2023 20:04:40 +0100 Subject: [PATCH 682/689] Fix bug in merge_output_configs (#44) We were accidentally copying angles into status! Signed-off-by: Tom Greig --- Bugs.md | 9 +++++++++ output.c | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Bugs.md b/Bugs.md index d8a33a1..5b5bd4a 100644 --- a/Bugs.md +++ b/Bugs.md @@ -1170,3 +1170,12 @@ leading to a termination of cagebreak. * Fixed: 2.1.0 Prior to release 2.1.0 `meson install` did not work perfectly. + +## Issue 60 + + * github issue number: N/A + * Fixed: 2.1.2 + +In the `merge_output_configs` function, when copying the properties of +one config to another, the `angles` element of an input structure was +being copied to the `status` element of the resultant structure. diff --git a/output.c b/output.c index b8fc627..506f5bd 100644 --- a/output.c +++ b/output.c @@ -399,7 +399,7 @@ merge_output_configs(struct cg_output_config *cfg1, out_cfg->scale = cfg1->scale; } if(cfg1->angle == out_cfg->angle) { - out_cfg->status = cfg2->angle; + out_cfg->angle = cfg2->angle; } else { out_cfg->angle = cfg1->angle; } From d65b1f6d95ec6cd602ce8a57de0341a3ebc1fa42 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 24 Apr 2023 21:06:54 +0200 Subject: [PATCH 683/689] Adjust epoch --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 02ad9d7..777c8d3 100644 --- a/meson.build +++ b/meson.build @@ -260,7 +260,7 @@ install_data('LICENSE', install_dir : '/usr/share/licenses/' + meson.project_nam if get_option('man-pages') scdoc = find_program('scdoc') - secssinceepoch = 1681758922 + secssinceepoch = 1682363199 shcommand = 'export SOURCE_DATE_EPOCH=' + secssinceepoch.to_string() + ' ; @0@ < @INPUT@'.format(scdoc.path()) sh = find_program('sh') mandir1 = join_paths(get_option('mandir'), 'man1') From 004935ae06904ad078fd6b844c6e3a19e63302c7 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 24 Apr 2023 21:23:20 +0200 Subject: [PATCH 684/689] Remove buggy script --- example_scripts/focus_follows_cursor.sh | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 example_scripts/focus_follows_cursor.sh diff --git a/example_scripts/focus_follows_cursor.sh b/example_scripts/focus_follows_cursor.sh deleted file mode 100644 index e47bf88..0000000 --- a/example_scripts/focus_follows_cursor.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -# Copyright 2023, project-repo and the cagebreak contributors -# SPDX-License-Identifier: MIT - -# This script uses the cagebreak socket to modify the compositor's behaviour in -# such a way that the currently focussed tile follows the cursor, i.e. that the -# currently focussed tile is always the one within which the cursor is located. - -# Start up the ipc link -source "$(dirname "${BASH_SOURCE[0]}")/cb_script_header.sh" - -while IFS= read -r -d $'\0' event -do - # Remove the cg-ipc header - event="${event:6}" - if [[ "$(echo "${event}" | jq ".event_name")" = "\"cursor_switch_tile\"" ]] - then - new_tile="$(echo "${event}"|jq -r ".new_tile")" - new_output_id="$(echo "${event}"|jq -r ".new_output_id")" - # Send the new tile to focus to cagebreak - echo -e "screen ${new_output_id}\nfocus_tile ${new_tile}" >&3 - fi -done <&4 From 6f5eb8f73fa4a8df92be648f9c1c9782d00abaeb Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 24 Apr 2023 21:27:13 +0200 Subject: [PATCH 685/689] Fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 43118bd..004239a 100644 --- a/README.md +++ b/README.md @@ -747,7 +747,7 @@ see [SECURITY.md](SECURITY.md). * Oliver Friedmann * [Add output scaling](https://github.com/project-repo/cagebreak/pull/34), released in 2.0.0 with slight modifications - * Tom Greif + * Tom Greig * Fix bug in merge_output_configs in 2.1.2 ## License From 443abb53b200f1e347c1193f148824ff26acbbe2 Mon Sep 17 00:00:00 2001 From: project-repo Date: Mon, 24 Apr 2023 22:35:30 +0200 Subject: [PATCH 686/689] Add custom event command --- keybinding.c | 15 +++++++++++++++ keybinding.h | 1 + parse.c | 9 +++++++++ 3 files changed, 25 insertions(+) diff --git a/keybinding.c b/keybinding.c index 44ccffb..de6a1e9 100644 --- a/keybinding.c +++ b/keybinding.c @@ -96,6 +96,12 @@ keybinding_free(struct keybinding *keybinding, bool recursive) { if(keybinding->data.c != NULL) { free(keybinding->data.c); } + break; + case KEYBINDING_SEND_CUSTOM_EVENT: + if(keybinding->data.c != NULL) { + free(keybinding->data.c); + } + break; default: break; } @@ -1245,6 +1251,12 @@ keybinding_display_message(struct cg_server *server, char *msg) { message_printf(server->curr_output, "%s", msg); } +void +keybinding_send_custom_event(struct cg_server *server, char *msg) { + ipc_send_event( server, + "{\"event_name\":\"custom_event\",\"message\":\"%s\"}", msg); +} + void keybinding_move_view_to_cycle_output(struct cg_server *server, bool reverse) { if(wl_list_length(&server->outputs) <= 1) { @@ -1706,6 +1718,9 @@ run_action(enum keybinding_action action, struct cg_server *server, case KEYBINDING_DISPLAY_MESSAGE: keybinding_display_message(server, data.c); break; + case KEYBINDING_SEND_CUSTOM_EVENT: + keybinding_send_custom_event(server, data.c); + break; case KEYBINDING_RESIZE_TILE_HORIZONTAL: resize_tile(server, data.i, 0); break; diff --git a/keybinding.h b/keybinding.h index 6d6cf87..a5958f0 100644 --- a/keybinding.h +++ b/keybinding.h @@ -63,6 +63,7 @@ struct cg_server; KEYBINDING(KEYBINDING_SHOW_TIME, time) \ KEYBINDING(KEYBINDING_SHOW_INFO, show_info) \ KEYBINDING(KEYBINDING_DISPLAY_MESSAGE, message) \ + KEYBINDING(KEYBINDING_SEND_CUSTOM_EVENT, custom_event) \ KEYBINDING(KEYBINDING_CURSOR, cursor) \ \ KEYBINDING(KEYBINDING_SWAP_LEFT, exchangeleft) \ diff --git a/parse.c b/parse.c index 68767c6..c163b3a 100644 --- a/parse.c +++ b/parse.c @@ -811,6 +811,15 @@ parse_command(struct cg_server *server, struct keybinding *keybinding, return -1; } keybinding->data.c = strdup(saveptr); + } else if(strcmp(action, "custom_event") == 0) { + keybinding->action = KEYBINDING_SEND_CUSTOM_EVENT; + if(saveptr == NULL) { + *errstr = + log_error("Not enough paramaters to \"custom_event\". Expected " + "string to send."); + return -1; + } + keybinding->data.c = strdup(saveptr); } else if(strcmp(action, "time") == 0) { keybinding->action = KEYBINDING_SHOW_TIME; } else if(strcmp(action, "nextscreen") == 0) { From bcb40fff72da99ff82489114e05595cc3430882b Mon Sep 17 00:00:00 2001 From: project-repo Date: Tue, 25 Apr 2023 18:46:04 +0200 Subject: [PATCH 687/689] Apply clang-format --- keybinding.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keybinding.c b/keybinding.c index de6a1e9..eaf2ae7 100644 --- a/keybinding.c +++ b/keybinding.c @@ -1253,8 +1253,8 @@ keybinding_display_message(struct cg_server *server, char *msg) { void keybinding_send_custom_event(struct cg_server *server, char *msg) { - ipc_send_event( server, - "{\"event_name\":\"custom_event\",\"message\":\"%s\"}", msg); + ipc_send_event(server, + "{\"event_name\":\"custom_event\",\"message\":\"%s\"}", msg); } void From f17bfab5ccc2e11ac58feb2feb9a445a3dbba530 Mon Sep 17 00:00:00 2001 From: project-repo Date: Sun, 14 May 2023 19:51:18 +0200 Subject: [PATCH 688/689] Add documentation --- man/cagebreak-config.5.md | 8 ++++++++ man/cagebreak-socket.7.md | 11 +++++++++++ 2 files changed, 19 insertions(+) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index b9632dd..d497542 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -81,9 +81,17 @@ configure_message display_time 4 *cursor [enable|disable]* Enable or disable cursor + This simply hides the cursor. Pointing and clicking is still possible. +*custom_event * + Send a custom event to the IPC socket + + This sends an event of time "custom_event" to all programs + listening to the IPC socket along with the string . + See *cagebreak-socket(7)* for more details. + *definekey * Bind to execute if pressed in - *definekey* is a more general version of *bind*. diff --git a/man/cagebreak-socket.7.md b/man/cagebreak-socket.7.md index 4c1a31a..e8b88d3 100644 --- a/man/cagebreak-socket.7.md +++ b/man/cagebreak-socket.7.md @@ -113,6 +113,17 @@ cg-ipc{"event_name":"configure_output","output":"eDP-1","output_id":1} cg-ipc{"event_name":"cursor_switch_tile","old_output":"eDP-1","old_output_id":1,"old_tile":2,"new_output":"eDP-1","new_output_id":1,"new_tile":3} ``` +*custom_event* + - Trigger: Cagebreak receives the *custom_event* command, either in the config file or via the IPC socket (see *cagebreak-config(5)*). + - JSON + - event_name: "custom_event" + - message: The message passed to the *custom_event* command + +``` +custom_event Hello World! +cg-ipc{"event_name":"custom_event","message":"Hello World!"} +``` + *cycle_outputs* - Trigger: *nextscreen* and *prevscreen* commands - JSON From 73f9bcf5ff2e3ee42e31ebbd3b6086d9f20cf071 Mon Sep 17 00:00:00 2001 From: project-repo Date: Tue, 16 May 2023 16:53:09 +0200 Subject: [PATCH 689/689] Fix typo --- man/cagebreak-config.5.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index d497542..cb7c91b 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -88,7 +88,7 @@ configure_message display_time 4 *custom_event * Send a custom event to the IPC socket - This sends an event of time "custom_event" to all programs + This sends an event of type "custom_event" to all programs listening to the IPC socket along with the string . See *cagebreak-socket(7)* for more details.