View: fix unmap/destroy control flow

Currently the view destruction sequence is started as soon as a view
is unmapped. However, this is incorrect as a client may map the view
again instead of destroying it.

Instead, only start the view destruction sequence when the underlying
xdg toplevel or xwayland surface is destroyed.
This commit is contained in:
Isaac Freund
2021-10-02 14:29:39 +02:00
parent e0784247b6
commit 9270a2df08
12 changed files with 65 additions and 69 deletions

View File

@ -630,7 +630,9 @@ fn xwaylandUnmanagedSurfaceAt(lx: f64, ly: f64) ?SurfaceAtResult {
}
fn surfaceAtFilter(view: *View, filter_tags: u32) bool {
return !view.destroying and view.current.tags & filter_tags != 0;
// TODO(wlroots): we can remove this view.surface != null check as surfaceAt
// will start filtering by mapped views by default in 0.15.0
return view.surface != null and view.current.tags & filter_tags != 0;
}
pub fn enterMode(self: *Self, mode: std.meta.Tag((Mode)), view: *View) void {