1
0
Fork 0
forked from wry/wry

autocommit 2022-02-01 01:20:49 CET

This commit is contained in:
Julian Orth 2022-02-01 01:20:49 +01:00
parent f2117256b9
commit 7654e70f64
39 changed files with 830 additions and 761 deletions

View file

@ -1,3 +1,4 @@
use crate::ifs::wl_seat::NodeSeatState;
use crate::rect::Rect;
use crate::render::Renderer;
use crate::tree::{FindTreeResult, FoundNode, Node, NodeId, WorkspaceNode};
@ -7,7 +8,6 @@ use crate::{NumCell, State};
use ahash::AHashMap;
use std::cell::{Cell, RefCell};
use std::rc::Rc;
use crate::ifs::wl_seat::{NodeSeatState};
#[allow(dead_code)]
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
@ -75,7 +75,12 @@ impl ContainerChild {
}
impl ContainerNode {
pub fn new(state: &State, workspace: &Rc<WorkspaceNode>, parent: Rc<dyn Node>, child: Rc<dyn Node>) -> Self {
pub fn new(
state: &State,
workspace: &Rc<WorkspaceNode>,
parent: Rc<dyn Node>,
child: Rc<dyn Node>,
) -> Self {
child.clone().set_workspace(workspace);
let children = LinkedList::new();
let mut child_nodes = AHashMap::new();
@ -290,13 +295,11 @@ impl Node for ContainerNode {
let mut recurse = |content: Rect, child: NodeRef<ContainerChild>| {
if content.contains(x, y) {
let (x, y) = content.translate(x, y);
tree.push(
FoundNode {
node: child.node.clone(),
x,
y,
}
);
tree.push(FoundNode {
node: child.node.clone(),
x,
y,
});
child.node.find_tree_at(x, y, tree);
}
};

View file

@ -1,11 +1,14 @@
use crate::backend::{KeyState, OutputId, ScrollAxis};
use crate::client::ClientId;
use crate::fixed::Fixed;
use crate::ifs::wl_output::WlOutputGlobal;
use crate::ifs::wl_seat::{NodeSeatState, WlSeatGlobal};
use crate::rect::Rect;
use crate::render::Renderer;
use crate::utils::clonecell::CloneCell;
use crate::utils::copyhashmap::CopyHashMap;
use crate::utils::linkedlist::{LinkedList, LinkedNode};
use crate::xkbcommon::ModifierState;
use crate::NumCell;
pub use container::*;
use std::cell::{Cell, RefCell};
@ -13,9 +16,6 @@ use std::fmt::Display;
use std::ops::Deref;
use std::rc::Rc;
pub use workspace::*;
use crate::client::ClientId;
use crate::ifs::wl_output::WlOutputGlobal;
use crate::xkbcommon::ModifierState;
mod container;
mod workspace;
@ -227,7 +227,7 @@ impl Node for DisplayNode {
match stacked.find_tree_at(x, y, tree) {
FindTreeResult::AcceptsInput => {
return FindTreeResult::AcceptsInput;
},
}
FindTreeResult::Other => {
tree.drain(idx..);
}
@ -398,7 +398,8 @@ impl Node for FloatNode {
if let Some(c) = self.child.get() {
c.set_workspace(ws);
}
self.workspace_link.set(Some(ws.stacked.add_last(self.clone())));
self.workspace_link
.set(Some(ws.stacked.add_last(self.clone())));
self.workspace.set(ws.clone());
}
}

View file

@ -1,3 +1,4 @@
use crate::ifs::wl_seat::NodeSeatState;
use crate::rect::Rect;
use crate::render::Renderer;
use crate::tree::container::ContainerNode;
@ -5,7 +6,6 @@ use crate::tree::{AbsoluteNode, FindTreeResult, FoundNode, Node, NodeId, OutputN
use crate::utils::clonecell::CloneCell;
use crate::utils::linkedlist::LinkedList;
use std::rc::Rc;
use crate::ifs::wl_seat::NodeSeatState;
tree_id!(WorkspaceNodeId);