Root: fix crash on output disable
If there is a transaction inflight when an output is disabled then we must call View.commitTransaction() for any views evacuated from the disabled output to ensure transaction state remains consistent. Root.commitTransaction() will not call View.commitTransaction() for these evacuated views as their output is no longer around.
This commit is contained in:
@ -280,6 +280,10 @@ pub fn deactivateOutput(root: *Self, output: *Output) void {
|
||||
|
||||
view.inflight_wm_stack_link.remove();
|
||||
view.inflight_wm_stack_link.init();
|
||||
|
||||
if (view.inflight_transaction) {
|
||||
view.commitTransaction();
|
||||
}
|
||||
}
|
||||
}
|
||||
// Use the first output in the list as fallback. If the last real output
|
||||
@ -552,11 +556,16 @@ fn sendConfigures(root: *Self) void {
|
||||
while (output_it.next()) |output| {
|
||||
var focus_stack_it = output.inflight.focus_stack.iterator(.forward);
|
||||
while (focus_stack_it.next()) |view| {
|
||||
assert(!view.inflight_transaction);
|
||||
view.inflight_transaction = true;
|
||||
|
||||
// This can happen if a view is unmapped while a layout demand including it is inflight
|
||||
// If a view has been unmapped, don't send it a configure.
|
||||
if (!view.mapped) continue;
|
||||
|
||||
if (view.configure()) {
|
||||
root.inflight_configures += 1;
|
||||
|
||||
view.saveSurfaceTree();
|
||||
view.sendFrameDone();
|
||||
}
|
||||
@ -617,8 +626,6 @@ fn commitTransaction(root: *Self) void {
|
||||
|
||||
view.tree.node.reparent(root.hidden.tree);
|
||||
view.popup_tree.node.reparent(root.hidden.tree);
|
||||
|
||||
view.commitTransaction();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user