diff --git a/src/ifs/wl_seat.rs b/src/ifs/wl_seat.rs index 21991b38..fa8d2ebe 100644 --- a/src/ifs/wl_seat.rs +++ b/src/ifs/wl_seat.rs @@ -369,12 +369,7 @@ impl WlSeatGlobal { if old_ws.id == ws.id { return; } - let cn = match tl - .tl_data() - .parent - .get() - .and_then(|p| p.node_into_containing_node()) - { + let cn = match tl.tl_data().parent.get() { Some(cn) => cn, _ => return, }; diff --git a/src/ifs/wl_surface/x_surface/xwindow.rs b/src/ifs/wl_surface/x_surface/xwindow.rs index daa452bc..b6232705 100644 --- a/src/ifs/wl_surface/x_surface/xwindow.rs +++ b/src/ifs/wl_surface/x_surface/xwindow.rs @@ -385,14 +385,10 @@ impl ToplevelNode for Xwindow { self.x.surface.set_output(&ws.output.get()); } - fn tl_change_extents(self: Rc, rect: &Rect) { + fn tl_change_extents_impl(self: Rc, rect: &Rect) { // log::info!("xwin {} change_extents {:?}", self.data.window_id, rect); let old = self.data.info.extents.replace(*rect); if old != *rect { - if self.toplevel_data.is_floating.get() { - self.toplevel_data.float_width.set(rect.width()); - self.toplevel_data.float_height.set(rect.height()); - } if !self.data.info.override_redirect.get() { self.data .state diff --git a/src/ifs/wl_surface/xdg_surface/xdg_toplevel.rs b/src/ifs/wl_surface/xdg_surface/xdg_toplevel.rs index 60a21d87..c8ec92b4 100644 --- a/src/ifs/wl_surface/xdg_surface/xdg_toplevel.rs +++ b/src/ifs/wl_surface/xdg_surface/xdg_toplevel.rs @@ -483,15 +483,11 @@ impl ToplevelNode for XdgToplevel { self.xdg.set_workspace(ws); } - fn tl_change_extents(self: Rc, rect: &Rect) { + fn tl_change_extents_impl(self: Rc, rect: &Rect) { let nw = rect.width(); let nh = rect.height(); let de = self.xdg.absolute_desired_extents.get(); if de.width() != nw || de.height() != nh { - if self.toplevel_data.is_floating.get() { - self.toplevel_data.float_width.set(rect.width()); - self.toplevel_data.float_height.set(rect.height()); - } self.send_configure_checked(nw, nh); self.xdg.do_send_configure(); // self.xdg.surface.client.flush(); diff --git a/src/state.rs b/src/state.rs index f7bf0faa..3c0e03eb 100644 --- a/src/state.rs +++ b/src/state.rs @@ -522,7 +522,7 @@ impl State { ) { node.clone().tl_set_workspace(workspace); width += 2 * self.theme.sizes.border_width.get(); - height += 2 * self.theme.sizes.border_width.get() + self.theme.sizes.title_height.get(); + height += 2 * self.theme.sizes.border_width.get() + self.theme.sizes.title_height.get() + 1; let output = workspace.output.get(); let output_rect = output.global.pos.get(); let position = { diff --git a/src/tree/container.rs b/src/tree/container.rs index 665a029e..309a49b1 100644 --- a/src/tree/container.rs +++ b/src/tree/container.rs @@ -1440,7 +1440,7 @@ impl ToplevelNode for ContainerNode { } } - fn tl_change_extents(self: Rc, rect: &Rect) { + fn tl_change_extents_impl(self: Rc, rect: &Rect) { self.toplevel_data.pos.set(*rect); self.abs_x1.set(rect.x1()); self.abs_y1.set(rect.y1()); diff --git a/src/tree/placeholder.rs b/src/tree/placeholder.rs index b00c9f25..a3ca8117 100644 --- a/src/tree/placeholder.rs +++ b/src/tree/placeholder.rs @@ -156,7 +156,7 @@ impl ToplevelNode for PlaceholderNode { None } - fn tl_change_extents(self: Rc, rect: &Rect) { + fn tl_change_extents_impl(self: Rc, rect: &Rect) { self.toplevel.pos.set(*rect); if let Some(p) = self.toplevel.parent.get() { p.node_child_size_changed(self.deref(), rect.width(), rect.height()); diff --git a/src/tree/toplevel.rs b/src/tree/toplevel.rs index 25d4d2f2..d8a9cec2 100644 --- a/src/tree/toplevel.rs +++ b/src/tree/toplevel.rs @@ -149,9 +149,16 @@ pub trait ToplevelNode: Node { } fn tl_change_extents(self: Rc, rect: &Rect) { - let _ = rect; + let data = self.tl_data(); + if data.is_floating.get() { + data.float_width.set(rect.width()); + data.float_height.set(rect.height()); + } + self.tl_change_extents_impl(rect) } + fn tl_change_extents_impl(self: Rc, rect: &Rect); + fn tl_close(self: Rc) { // nothing }