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', 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;