diff --git a/README.md b/README.md index ef88746..939a682 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.3 cagebreak + + * sha 256: 85803b75b1be0d9bf600175ce6aa981a1632768872e5afddea7569f825c1f7c3 + * sha 512: 96c9b33804bbd7c652e32556d5001e12c2b07ab7127118a050be513bd6e0d6241fb78c80d9cce50447ae32a7b33c5c6a6cf1def36efaf3d8e8ddb028bcd769df + +1.8.3 cagebreak.1 + + * sha 256: e583f818d73484cbcae65dbe6ffc226ea58fdad87363213ea5b1059d866216e4 + * sha 512: b96d8f9308d31bb1faa346267136fd7a53caed95065e7da09713b5f64addb42c835b27cd6cfa6bcf8c5b5d572a73b1e828f47b14e06a00b0871a77a25a286597 + +1.8.3 cagebreak-config.5 + + * sha 256: d0be008e0e5d47b876ccfb8cf70967097673b81fa93718838db45f4056b76bc0 + * sha 512: 42f8d25eb89219aebd00e927627a51fd8b7f6fda6f7c6147abbc0e4fae5de1ceb5827b79a814127a0706cc213d7717733e02cfa5275960cb0cce23eb54493b1e + 1.8.2 cagebreak * sha 256: f4d275d48ba3d999969f8cb3c8142d27aa8e8d362106ee7575e4b13c02173b2a diff --git a/cagebreak.c b/cagebreak.c index 838078f..b6fbcab 100644 --- a/cagebreak.c +++ b/cagebreak.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -244,7 +245,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; @@ -338,8 +338,20 @@ 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.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, 0, 1}; wl_list_init(&server.outputs); @@ -352,7 +364,7 @@ main(int argc, char *argv[]) { goto end; } - compositor = wlr_compositor_create(server.wl_display, renderer); + compositor = wlr_compositor_create(server.wl_display, server.renderer); if(!compositor) { wlr_log(WLR_ERROR, "Unable to create the wlroots compositor"); ret = 1; diff --git a/fuzz/fuzz-lib.c b/fuzz/fuzz-lib.c index 7f9eb78..c94dd8b 100644 --- a/fuzz/fuzz-lib.c +++ b/fuzz/fuzz-lib.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -127,7 +128,6 @@ 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; @@ -215,8 +215,20 @@ LLVMFuzzerInitialize(int *argc, char ***argv) { wl_list_init(&server.output_config); - 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.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 = malloc(4 * sizeof(float)); server.bg_color[0] = 0; @@ -343,7 +355,7 @@ LLVMFuzzerInitialize(int *argc, char ***argv) { goto end; } - compositor = wlr_compositor_create(server.wl_display, renderer); + compositor = wlr_compositor_create(server.wl_display, server.renderer); if(!compositor) { wlr_log(WLR_ERROR, "Unable to create the wlroots compositor"); ret = 1; diff --git a/input.h b/input.h index 7cec2ca..0b6eb7e 100644 --- a/input.h +++ b/input.h @@ -13,7 +13,7 @@ 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 +bool cg_input_reset_libinput_device(struct cg_input_device *device); bool 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/libinput.c b/libinput.c index f6dd957..2510857 100644 --- a/libinput.c +++ b/libinput.c @@ -368,10 +368,10 @@ cg_input_configure_libinput_device(struct cg_input_device *input_device) { } } -void +bool cg_input_reset_libinput_device(struct cg_input_device *input_device) { if(!wlr_input_device_is_libinput(input_device->wlr_device)) { - return; + return false; } struct libinput_device *device = @@ -416,6 +416,7 @@ cg_input_reset_libinput_device(struct cg_input_device *input_device) { float matrix[6]; libinput_device_config_calibration_get_default_matrix(device, matrix); changed |= set_calibration_matrix(device, matrix); + return changed; } bool diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index 670c58e..4eea4c5 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -1,4 +1,4 @@ -cagebreak-config(1) "Version 1.8.2" "Cagebreak Manual" +cagebreak-config(1) "Version 1.8.3" "Cagebreak Manual" # NAME diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index cfb0a22..4fe5c6c 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -1,4 +1,4 @@ -cagebreak(1) "Version 1.8.2" "Cagebreak Manual" +cagebreak(1) "Version 1.8.3" "Cagebreak Manual" # NAME diff --git a/meson.build b/meson.build index b81b261..10afb69 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('cagebreak', 'c', - version: '1.8.2', + version: '1.8.3', license: 'MIT', default_options: [ 'c_std=c11', @@ -53,7 +53,7 @@ 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') @@ -204,18 +204,18 @@ 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', + 'wayland_client': '1.20.0', + 'wayland_cursor': '1.20.0', + 'wlroots': '0.15.0', 'xkbcommon': '1.3.1', 'fontconfig': '2.13.94', - 'libinput': '1.19.2', + 'libinput': '1.19.3', 'libevdev': '1.12.0', - 'libudev': '249', + 'libudev': '250', 'pixman': '0.40.0', - 'pango': '1.50.0', + 'pango': '1.50.3', 'cairo': '1.17.4', - 'pangocairo': '1.50.0', + 'pangocairo': '1.50.3', 'math': '-1' } diff --git a/message.c b/message.c index f05b175..0bcb5f1 100644 --- a/message.c +++ b/message.c @@ -86,10 +86,9 @@ 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); + texture = + wlr_texture_from_pixels(output->server->renderer, DRM_FORMAT_ARGB8888, + stride, width, height, data); cairo_surface_destroy(surface); g_object_unref(pango); cairo_destroy(cairo); diff --git a/output.c b/output.c index 8feaec9..3ce60c4 100644 --- a/output.c +++ b/output.c @@ -615,6 +615,12 @@ 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"); diff --git a/output.h b/output.h index 42cb629..7a0dc7c 100644 --- a/output.h +++ b/output.h @@ -2,7 +2,7 @@ #define CG_OUTPUT_H #include -#include +#include struct cg_server; struct cg_view; diff --git a/render.c b/render.c index ca4a2d2..53ed0ea 100644 --- a/render.c +++ b/render.c @@ -12,11 +12,11 @@ #include #include #include -#include #include #include #include #include +#include #include #include @@ -29,8 +29,8 @@ #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); +scissor_output(struct wlr_output *output, pixman_box32_t *rect, + struct wlr_renderer *renderer) { struct wlr_box box = { .x = rect->x1, @@ -56,10 +56,7 @@ struct render_data { 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); - + 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, @@ -72,7 +69,7 @@ render_texture(struct wlr_output *wlr_output, pixman_region32_t *output_damage, int nrects; pixman_box32_t *rects = pixman_region32_rectangles(&damage, &nrects); for(int i = 0; i < nrects; i++) { - scissor_output(wlr_output, &rects[i]); + scissor_output(wlr_output, &rects[i], renderer); wlr_render_texture_with_matrix(renderer, texture, matrix, 1.0F); } @@ -109,7 +106,8 @@ render_surface_iterator(struct cg_output *output, struct wlr_surface *surface, box->height = box->height > data->tile_height ? data->tile_height : box->height; } - render_texture(wlr_output, output_damage, texture, box, matrix); + render_texture(wlr_output, output_damage, texture, box, matrix, + output->server->renderer); } static void @@ -179,8 +177,7 @@ 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); + struct wlr_renderer *renderer = output->server->renderer; if(!renderer) { wlr_log(WLR_DEBUG, "Expected the output backend to have a renderer"); return; @@ -202,7 +199,7 @@ output_render(struct cg_output *output, pixman_region32_t *damage) { int nrects; pixman_box32_t *rects = pixman_region32_rectangles(damage, &nrects); for(int i = 0; i < nrects; i++) { - scissor_output(wlr_output, &rects[i]); + scissor_output(wlr_output, &rects[i], renderer); wlr_renderer_clear(renderer, server->bg_color); } @@ -238,7 +235,7 @@ output_render(struct cg_output *output, pixman_region32_t *damage) { WL_OUTPUT_TRANSFORM_NORMAL, 0.0F, wlr_output->transform_matrix); render_texture(output->wlr_output, damage, message->message, - message->position, matrix); + message->position, matrix, renderer); } render_drag_icons(output, damage, &server->seat->drag_icons); diff --git a/server.c b/server.c index e5b6137..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/server.h b/server.h index 9ee21e1..092f7bf 100644 --- a/server.h +++ b/server.h @@ -22,6 +22,8 @@ struct cg_server { struct cg_seat *seat; struct cg_input_manager *input; struct wlr_backend *backend; + struct wlr_renderer *renderer; + struct wlr_allocator *allocator; struct wlr_idle *idle; struct wlr_idle_inhibit_manager_v1 *idle_inhibit_v1; struct wl_listener new_idle_inhibitor_v1; diff --git a/signatures/1.8.1.sig b/signatures/1.8.1.sig new file mode 100644 index 0000000..ecd7a25 Binary files /dev/null and b/signatures/1.8.1.sig differ diff --git a/signatures/1.8.2-cagebreak-config.5.sig b/signatures/1.8.2-cagebreak-config.5.sig new file mode 100644 index 0000000..ee831f3 Binary files /dev/null and b/signatures/1.8.2-cagebreak-config.5.sig differ diff --git a/signatures/1.8.2-cagebreak.1.sig b/signatures/1.8.2-cagebreak.1.sig new file mode 100644 index 0000000..e4133eb Binary files /dev/null and b/signatures/1.8.2-cagebreak.1.sig differ diff --git a/signatures/1.8.2.sig b/signatures/1.8.2.sig index ecd7a25..1aab7aa 100644 Binary files a/signatures/1.8.2.sig and b/signatures/1.8.2.sig differ diff --git a/signatures/cagebreak-config.5.sig b/signatures/cagebreak-config.5.sig index ee831f3..2c25210 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 e4133eb..e5280a3 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 1aab7aa..6ac0f63 100644 Binary files a/signatures/cagebreak.sig and b/signatures/cagebreak.sig differ diff --git a/util.c b/util.c index 1e7fa7c..4c26b74 100644 --- a/util.c +++ b/util.c @@ -7,7 +7,7 @@ * See the LICENSE file accompanying this file. */ -#include +#include #include "util.h" #include diff --git a/view.c b/view.c index 09fc463..0bbd03b 100644 --- a/view.c +++ b/view.c @@ -12,11 +12,11 @@ #include #include #include -#include #include #include #include #include +#include #include "output.h" #include "seat.h" @@ -311,13 +311,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->current.subsurfaces_above, + current.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->current.subsurfaces_below, + current.link) { subsurface_create(NULL, view, subsurface); } diff --git a/workspace.h b/workspace.h index a5da674..0e8f91f 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; diff --git a/xdg_shell.c b/xdg_shell.c index 7972b5f..6b9b074 100644 --- a/xdg_shell.c +++ b/xdg_shell.c @@ -11,10 +11,10 @@ #include #include -#include #include #include #include +#include #include #include diff --git a/xwayland.c b/xwayland.c index daf3658..f2285e5 100644 --- a/xwayland.c +++ b/xwayland.c @@ -10,9 +10,9 @@ #include #include #include -#include #include #include +#include #include #include