diff --git a/Bugs.md b/Bugs.md index 2c909fe..822f3f6 100644 --- a/Bugs.md +++ b/Bugs.md @@ -628,3 +628,27 @@ wlroots-0.15.1 Cagebreak crashed when a touch device was removed due to a call to `wl_list_remove` on a pointer which was never initialized. +## Issue 35 + + * github issue number: N/A + * Fixed: 1.9.1 + +Cagebreak 1.9.0 broke the nextscreen and prevscreen functionality. +This issue was not present in earlier releases. + +## Issue 36 + + * github issue number: N/A + * Fixed: 1.9.1 + +Cagebreak 1.9.0 broke the configure_message functionality. +This issue was not present in earlier releases. + +## Issue 37 + + * github issue number: N/A + * Fixed: 1.9.1 + +Cagebreak 1.9.0 broke the screen/movetoscreen functionality. +This issue was not present in earlier releases. + diff --git a/Hashes.md b/Hashes.md index abffe85..97d6217 100644 --- a/Hashes.md +++ b/Hashes.md @@ -1,5 +1,20 @@ # Hashes +1.9.1 cagebreak + + * sha 256: 262c67170eb2a39174d40f97d940707029dca0b2b613b514a1cca29152a12665 + * sha 512: bbd962eaf90441338a67215fc7ac0a717b8cb7bd93ce7ef7ed446aa1df9f4e44026994cc1172e6245e5cd4b9c588150ed9c894941069c5c132c9e2009523c241 + +1.9.1 cagebreak.1 + + * sha 256: f9c1ee94c0788b98f1e8d93433a0e39d4265ed5c8107e964648da11c60c995ed + * sha 512: 1d39748c42a56852ce21aa5ea872160da0810d0539901f6c307b141d4c2545c52a7de98d924e4e45827dafa8cb76b483abf5e02403e6536f69d2144575d3dfdb + +1.9.1 cagebreak-config.5 + + * sha 256: 2b0d5655e01942cb5130a95c7209e32c1ce3f44411f2a3294a160d6a2232bef4 + * sha 512: c13a92e091e56aad099c12c4bf652943bf43dad5aace61677af992331a2700d3d2f433cd2a674cbc2cc080e971169516973835c44416de555a85b5aae9da9a9d + 1.9.0 cagebreak * sha 256: 91096b4c558970666c5ef1ebd5c16301fbb40b52b34a73589f18a14c48edf5c1 diff --git a/cagebreak.c b/cagebreak.c index 00712f9..97f4f91 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -297,7 +297,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 = @@ -626,6 +637,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/keybinding.c b/keybinding.c index 5207d24..ec83acc 100644 --- a/keybinding.c +++ b/keybinding.c @@ -76,6 +76,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; } @@ -594,23 +600,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] @@ -618,6 +609,26 @@ 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) { @@ -837,6 +848,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 = @@ -865,6 +919,23 @@ 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) { @@ -883,6 +954,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); } @@ -910,6 +982,30 @@ 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) {} @@ -950,9 +1046,15 @@ run_action(enum keybinding_action action, struct cg_server *server, case KEYBINDING_CYCLE_TILES: keybinding_cycle_tiles(server, data.b); break; + case KEYBINDING_CYCLE_OUTPUT: + keybinding_cycle_outputs(server, data.b); + break; 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; @@ -981,6 +1083,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] @@ -1048,6 +1154,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/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index b931db4..541e713 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 1.9.1" "Cagebreak Manual" # NAME diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index fd6584c..7ef7963 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 1.9.1" "Cagebreak Manual" # NAME diff --git a/meson.build b/meson.build index b4c7dfd..172741f 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('cagebreak', 'c', - version: '1.9.0', + version: '1.9.1', license: 'MIT', default_options: [ 'c_std=c11', @@ -204,18 +204,18 @@ cagebreak_dependencies_dict = { reproducible_build_versions = { 'server_protos': '-1', 'wayland_server': '1.19.0', - 'wayland_client': '1.20.0', - 'wayland_cursor': '1.20.0', + 'wayland_client': '1.21.0', + 'wayland_cursor': '1.21.0', 'wlroots': '0.15.1', - 'xkbcommon': '1.4.0', + 'xkbcommon': '1.4.1', 'fontconfig': '2.14.0', - 'libinput': '1.20.1', + 'libinput': '1.21.0', 'libevdev': '1.12.1', - 'libudev': '250', + 'libudev': '251', 'pixman': '0.40.0', - 'pango': '1.50.7', + 'pango': '1.50.8', 'cairo': '1.17.6', - 'pangocairo': '1.50.7', + 'pangocairo': '1.50.8', 'math': '-1' } @@ -241,7 +241,7 @@ foreach name, dep : cagebreak_dependencies_dict endforeach reproducible_build_compiler = 'gcc' -reproducible_build_compiler_version = '11.2.0' +reproducible_build_compiler_version = '12.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 + ').') @@ -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=1650564686 ; @0@ < @INPUT@'.format(scdoc.path())], + command : [sh, '-c', 'export SOURCE_DATE_EPOCH=1658688233 ; @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=1650564686 ; @0@ < @INPUT@'.format(scdoc.path())], + command : [sh, '-c', 'export SOURCE_DATE_EPOCH=1658688233 ; @0@ < @INPUT@'.format(scdoc.path())], install: true, install_dir: mandir5 ) diff --git a/message.c b/message.c index 0bcb5f1..9e600bb 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,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, 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 +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); - 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); @@ -175,7 +178,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 @@ -194,7 +197,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/server.h b/server.h index 092f7bf..a5139f6 100644 --- a/server.h +++ b/server.h @@ -3,6 +3,7 @@ #include "config.h" #include "ipc_server.h" +#include "message.h" #include #include @@ -44,6 +45,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; diff --git a/signatures/1.9.0-cagebreak-config.5.sig b/signatures/1.9.0-cagebreak-config.5.sig new file mode 100644 index 0000000..d6ac6bb Binary files /dev/null and b/signatures/1.9.0-cagebreak-config.5.sig differ diff --git a/signatures/1.9.0-cagebreak.1.sig b/signatures/1.9.0-cagebreak.1.sig new file mode 100644 index 0000000..47ba7f2 Binary files /dev/null and b/signatures/1.9.0-cagebreak.1.sig differ diff --git a/signatures/1.9.0.sig b/signatures/1.9.0.sig new file mode 100644 index 0000000..2cc14a8 Binary files /dev/null and b/signatures/1.9.0.sig differ diff --git a/signatures/cagebreak-config.5.sig b/signatures/cagebreak-config.5.sig index d6ac6bb..7349ebc 100644 Binary files a/signatures/cagebreak-config.5.sig and b/signatures/cagebreak-config.5.sig differ diff --git a/signatures/cagebreak.1.sig b/signatures/cagebreak.1.sig index 47ba7f2..e0a399b 100644 Binary files a/signatures/cagebreak.1.sig and b/signatures/cagebreak.1.sig differ diff --git a/signatures/cagebreak.sig b/signatures/cagebreak.sig index 2cc14a8..1813ed2 100644 Binary files a/signatures/cagebreak.sig and b/signatures/cagebreak.sig differ