autocommit 2022-04-19 13:08:10 CEST
This commit is contained in:
parent
54cf01f745
commit
c1773c0fee
12 changed files with 136 additions and 45 deletions
|
|
@ -293,7 +293,9 @@ impl SizedNode for XdgPopup {
|
|||
}
|
||||
|
||||
fn parent(&self) -> Option<Rc<dyn Node>> {
|
||||
self.parent.get().and_then(|x| x.workspace.get().map(|w| w as Rc<dyn Node>))
|
||||
self.parent
|
||||
.get()
|
||||
.and_then(|x| x.workspace.get().map(|w| w as Rc<dyn Node>))
|
||||
}
|
||||
|
||||
fn set_visible(&self, visible: bool) {
|
||||
|
|
|
|||
|
|
@ -319,9 +319,9 @@ impl XdgToplevel {
|
|||
}
|
||||
|
||||
fn map_floating(self: &Rc<Self>, workspace: &Rc<WorkspaceNode>) {
|
||||
let extents = self.xdg.extents.get();
|
||||
let (width, height) = self.toplevel_data.float_size(workspace);
|
||||
let state = &self.xdg.surface.client.state;
|
||||
state.map_floating(self.clone(), extents.width(), extents.height(), workspace);
|
||||
state.map_floating(self.clone(), width, height, workspace);
|
||||
}
|
||||
|
||||
fn map_child(self: &Rc<Self>, parent: &XdgToplevel) {
|
||||
|
|
@ -459,6 +459,10 @@ impl SizedNode for XdgToplevel {
|
|||
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();
|
||||
|
|
@ -471,6 +475,7 @@ impl SizedNode for XdgToplevel {
|
|||
}
|
||||
|
||||
fn set_parent(self: &Rc<Self>, parent: Rc<dyn Node>) {
|
||||
self.toplevel_data.is_floating.set(parent.node_is_float());
|
||||
self.parent_node.set(Some(parent));
|
||||
self.notify_parent();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -435,6 +435,10 @@ impl SizedNode for Xwindow {
|
|||
// 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
|
||||
|
|
@ -453,6 +457,7 @@ impl SizedNode for Xwindow {
|
|||
}
|
||||
|
||||
fn set_parent(self: &Rc<Self>, parent: Rc<dyn Node>) {
|
||||
self.toplevel_data.is_floating.set(parent.node_is_float());
|
||||
self.parent_node.set(Some(parent));
|
||||
self.notify_parent();
|
||||
}
|
||||
|
|
@ -508,10 +513,10 @@ impl ToplevelNode for Xwindow {
|
|||
self.data.state.map_tiled(self.clone());
|
||||
} else if let Some(ws) = self.workspace.get() {
|
||||
parent.node_remove_child(&*self);
|
||||
let extents = self.data.info.extents.get();
|
||||
let (width, height) = self.toplevel_data.float_size(&ws);
|
||||
self.data
|
||||
.state
|
||||
.map_floating(self.clone(), extents.width(), extents.height(), &ws);
|
||||
.map_floating(self.clone(), width, height, &ws);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue