autocommit 2022-04-20 18:33:59 CEST
This commit is contained in:
parent
1227ede560
commit
34e665cd8b
9 changed files with 82 additions and 15 deletions
|
|
@ -152,7 +152,7 @@ impl FullscreenData {
|
|||
}
|
||||
fd.workspace.fullscreen.take();
|
||||
if let Some(container) = fd.workspace.container.get() {
|
||||
container.set_visible(true);
|
||||
container.set_visible(node.as_node().node_visible());
|
||||
}
|
||||
if fd.placeholder.is_destroyed() {
|
||||
state.map_tiled(node.into_node());
|
||||
|
|
|
|||
|
|
@ -160,6 +160,9 @@ impl OutputNode {
|
|||
old.node_set_visible(false);
|
||||
}
|
||||
ws.node_set_visible(true);
|
||||
if let Some(fs) = ws.fullscreen.get() {
|
||||
fs.into_node().node_change_extents(&self.global.pos.get());
|
||||
}
|
||||
ws.change_extents(&self.workspace_rect());
|
||||
let node = ws.last_active_child();
|
||||
for seat in seats {
|
||||
|
|
@ -204,6 +207,9 @@ impl OutputNode {
|
|||
self.state.root.update_extents();
|
||||
self.update_render_data();
|
||||
if let Some(c) = self.workspace.get() {
|
||||
if let Some(fs) = c.fullscreen.get() {
|
||||
fs.into_node().node_change_extents(rect);
|
||||
}
|
||||
c.node_change_extents(&self.workspace_rect());
|
||||
}
|
||||
for layer in &self.layers {
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ use {
|
|||
FindTreeResult, FoundNode, FullscreenNode, Node, NodeId, NodeVisitor, SizedNode,
|
||||
SizedToplevelNode, ToplevelData, WorkspaceNode,
|
||||
},
|
||||
utils::clonecell::CloneCell,
|
||||
utils::{clonecell::CloneCell, errorfmt::ErrorFmt},
|
||||
},
|
||||
jay_config::Direction,
|
||||
std::{
|
||||
|
|
@ -25,7 +25,6 @@ use {
|
|||
rc::Rc,
|
||||
},
|
||||
};
|
||||
use crate::utils::errorfmt::ErrorFmt;
|
||||
|
||||
tree_id!(DetachedNodeId);
|
||||
pub struct PlaceholderNode {
|
||||
|
|
@ -139,6 +138,18 @@ impl SizedNode for PlaceholderNode {
|
|||
});
|
||||
}
|
||||
|
||||
fn move_focus(self: &Rc<Self>, seat: &Rc<WlSeatGlobal>, direction: Direction) {
|
||||
if let Some(parent) = self.parent.get() {
|
||||
parent.node_move_focus_from_child(seat, self.deref(), direction);
|
||||
}
|
||||
}
|
||||
|
||||
fn move_self(self: &Rc<Self>, direction: Direction) {
|
||||
if let Some(parent) = self.parent.get() {
|
||||
parent.node_move_child(self.clone(), direction);
|
||||
}
|
||||
}
|
||||
|
||||
fn absolute_position(&self) -> Rect {
|
||||
self.pos.get()
|
||||
}
|
||||
|
|
@ -159,8 +170,11 @@ impl SizedNode for PlaceholderNode {
|
|||
seat.enter_toplevel(self.clone());
|
||||
}
|
||||
|
||||
fn render(&self, renderer: &mut Renderer, x: i32, y: i32) {
|
||||
renderer.render_placeholder(self, x, y);
|
||||
}
|
||||
|
||||
fn change_extents(self: &Rc<Self>, rect: &Rect) {
|
||||
log::info!("{:?}", rect);
|
||||
self.pos.set(*rect);
|
||||
if let Some(p) = self.parent.get() {
|
||||
p.node_child_size_changed(self.deref(), rect.width(), rect.height());
|
||||
|
|
@ -179,7 +193,7 @@ impl SizedNode for PlaceholderNode {
|
|||
) {
|
||||
Ok(t) => {
|
||||
self.texture.set(Some(t));
|
||||
},
|
||||
}
|
||||
Err(e) => {
|
||||
log::warn!("Could not render fullscreen texture: {}", ErrorFmt(e));
|
||||
}
|
||||
|
|
@ -200,10 +214,6 @@ impl SizedNode for PlaceholderNode {
|
|||
fn client(&self) -> Option<Rc<Client>> {
|
||||
self.client.clone()
|
||||
}
|
||||
|
||||
fn render(&self, renderer: &mut Renderer, x: i32, y: i32) {
|
||||
renderer.render_placeholder(self, x, y);
|
||||
}
|
||||
}
|
||||
|
||||
impl SizedToplevelNode for PlaceholderNode {
|
||||
|
|
|
|||
|
|
@ -56,6 +56,9 @@ impl SizedNode for WorkspaceNode {
|
|||
self.output.get().node_remove_child(self);
|
||||
}
|
||||
self.output_link.set(None);
|
||||
if let Some(fs) = self.fullscreen.take() {
|
||||
fs.into_node().node_destroy(false);
|
||||
}
|
||||
if let Some(container) = self.container.take() {
|
||||
container.node_destroy(false);
|
||||
}
|
||||
|
|
@ -84,6 +87,9 @@ impl SizedNode for WorkspaceNode {
|
|||
}
|
||||
|
||||
fn last_active_child(self: &Rc<Self>) -> Rc<dyn Node> {
|
||||
if let Some(fs) = self.fullscreen.get() {
|
||||
return fs.into_node().node_last_active_child();
|
||||
}
|
||||
if let Some(c) = self.container.get() {
|
||||
return c.last_active_child();
|
||||
}
|
||||
|
|
@ -92,14 +98,18 @@ impl SizedNode for WorkspaceNode {
|
|||
|
||||
fn set_visible(&self, visible: bool) {
|
||||
self.visible.set(visible);
|
||||
if let Some(container) = self.container.get() {
|
||||
if let Some(fs) = self.fullscreen.get() {
|
||||
fs.as_node().node_set_visible(visible);
|
||||
} else if let Some(container) = self.container.get() {
|
||||
container.node_set_visible(visible);
|
||||
}
|
||||
self.seat_state.set_visible(self, visible);
|
||||
}
|
||||
|
||||
fn do_focus(self: &Rc<Self>, seat: &Rc<WlSeatGlobal>, direction: Direction) {
|
||||
if let Some(container) = self.container.get() {
|
||||
if let Some(fs) = self.fullscreen.get() {
|
||||
fs.into_node().node_do_focus(seat, direction);
|
||||
} else if let Some(container) = self.container.get() {
|
||||
container.do_focus(seat, direction);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue