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. + 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 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 diff --git a/meson.build b/meson.build index 9f73e79..a87fae7 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', @@ -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' } diff --git a/signatures/1.4.1.sig b/signatures/1.4.1.sig new file mode 100644 index 0000000..07c06c7 Binary files /dev/null and b/signatures/1.4.1.sig differ diff --git a/signatures/cagebreak.sig b/signatures/cagebreak.sig index 07c06c7..af4b2f1 100644 Binary files a/signatures/cagebreak.sig and b/signatures/cagebreak.sig differ diff --git a/view.c b/view.c index a7817cf..90cc53f 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);