Merge pull request #469 from cmeissl/fix/xdg_toplevel_parent
fix setting the parent of a ToplevelSurface
This commit is contained in:
commit
25d23448af
|
@ -1177,15 +1177,14 @@ impl ToplevelSurface {
|
||||||
/// The parent must be another toplevel equivalent surface.
|
/// The parent must be another toplevel equivalent surface.
|
||||||
///
|
///
|
||||||
/// If the parent is `None`, the parent-child relationship is removed.
|
/// If the parent is `None`, the parent-child relationship is removed.
|
||||||
pub fn set_parent(&self, parent: Option<wl_surface::WlSurface>) -> bool {
|
pub fn set_parent(&self, parent: Option<&wl_surface::WlSurface>) -> bool {
|
||||||
if let Some(parent) = parent {
|
if let Some(parent) = parent {
|
||||||
if !is_toplevel_equivalent(&parent) {
|
if !is_toplevel_equivalent(parent) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unset the parent
|
xdg_handlers::set_parent(&self.shell_surface, parent.cloned());
|
||||||
xdg_handlers::set_parent(&self.shell_surface, None);
|
|
||||||
|
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
|
@ -447,7 +447,7 @@ fn imported_implementation(
|
||||||
.map(|export| export.surface.clone())
|
.map(|export| export.surface.clone())
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
toplevel_surface.set_parent(Some(imported_parent));
|
toplevel_surface.set_parent(Some(&imported_parent));
|
||||||
}
|
}
|
||||||
|
|
||||||
_ => unreachable!(),
|
_ => unreachable!(),
|
||||||
|
|
Loading…
Reference in New Issue