mirror of
https://github.com/swaywm/sway.git
synced 2024-12-30 17:06:40 +01:00
Merge pull request #2403 from RyanDwyer/fix-transaction-unmap
Fix race condition crashes when unmapping views
This commit is contained in:
commit
23b5124a4d
1 changed files with 15 additions and 8 deletions
|
@ -195,11 +195,18 @@ static void transaction_apply(struct sway_transaction *transaction) {
|
||||||
sizeof(struct sway_container_state));
|
sizeof(struct sway_container_state));
|
||||||
|
|
||||||
if (container->type == C_VIEW) {
|
if (container->type == C_VIEW) {
|
||||||
if (container->sway_view->saved_buffer) {
|
if (container->destroying) {
|
||||||
view_remove_saved_buffer(container->sway_view);
|
if (container->instructions->length == 1 &&
|
||||||
}
|
container->sway_view->saved_buffer) {
|
||||||
if (container->instructions->length > 1) {
|
view_remove_saved_buffer(container->sway_view);
|
||||||
view_save_buffer(container->sway_view);
|
}
|
||||||
|
} else {
|
||||||
|
if (container->sway_view->saved_buffer) {
|
||||||
|
view_remove_saved_buffer(container->sway_view);
|
||||||
|
}
|
||||||
|
if (container->instructions->length > 1) {
|
||||||
|
view_save_buffer(container->sway_view);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -276,9 +283,9 @@ static void transaction_commit(struct sway_transaction *transaction) {
|
||||||
// mapping and its default geometry doesn't intersect an output.
|
// mapping and its default geometry doesn't intersect an output.
|
||||||
struct timespec when;
|
struct timespec when;
|
||||||
wlr_surface_send_frame_done(con->sway_view->surface, &when);
|
wlr_surface_send_frame_done(con->sway_view->surface, &when);
|
||||||
if (!con->sway_view->saved_buffer) {
|
}
|
||||||
view_save_buffer(con->sway_view);
|
if (con->type == C_VIEW && !con->sway_view->saved_buffer) {
|
||||||
}
|
view_save_buffer(con->sway_view);
|
||||||
}
|
}
|
||||||
list_add(con->instructions, instruction);
|
list_add(con->instructions, instruction);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue