anvil.window_map: add Kind::equals

This commit is contained in:
Ivan Molodetskikh 2020-02-01 18:25:50 +03:00
parent e07a57885b
commit 69b1c1870e
No known key found for this signature in database
GPG Key ID: 02CE38DA47E9D691
1 changed files with 9 additions and 0 deletions

View File

@ -33,6 +33,15 @@ where
Kind::Wl(ref t) => t.get_surface(), Kind::Wl(ref t) => t.get_surface(),
} }
} }
/// Do this handle and the other one actually refer to the same toplevel surface?
pub fn equals(&self, other: &Self) -> bool {
match (self, other) {
(Kind::Xdg(a), Kind::Xdg(b)) => a.equals(b),
(Kind::Wl(a), Kind::Wl(b)) => a.equals(b),
_ => false,
}
}
} }
struct Window<R> { struct Window<R> {