From 69b1c1870e7eb2bbbc159d0b3a3ea85bd7ca192f Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Sat, 1 Feb 2020 18:25:50 +0300 Subject: [PATCH] anvil.window_map: add Kind::equals --- anvil/src/window_map.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/anvil/src/window_map.rs b/anvil/src/window_map.rs index b15a37c..3a553c0 100644 --- a/anvil/src/window_map.rs +++ b/anvil/src/window_map.rs @@ -33,6 +33,15 @@ where 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 {