tree: add Node::node_location
This commit is contained in:
parent
f75051281b
commit
289c201a69
20 changed files with 152 additions and 45 deletions
|
|
@ -752,6 +752,7 @@ fn create_dummy_output(state: &Rc<State>) {
|
||||||
state: state.clone(),
|
state: state.clone(),
|
||||||
is_dummy: true,
|
is_dummy: true,
|
||||||
output: CloneCell::new(dummy_output.clone()),
|
output: CloneCell::new(dummy_output.clone()),
|
||||||
|
output_id: Cell::new(dummy_output.id),
|
||||||
position: Default::default(),
|
position: Default::default(),
|
||||||
container: Default::default(),
|
container: Default::default(),
|
||||||
stacked: Default::default(),
|
stacked: Default::default(),
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ use {
|
||||||
},
|
},
|
||||||
leaks::Tracker,
|
leaks::Tracker,
|
||||||
object::{Object, Version},
|
object::{Object, Version},
|
||||||
|
tree::NodeLocation,
|
||||||
wire::{ExtSessionLockV1Id, ext_session_lock_v1::*},
|
wire::{ExtSessionLockV1Id, ext_session_lock_v1::*},
|
||||||
},
|
},
|
||||||
std::{cell::Cell, rc::Rc},
|
std::{cell::Cell, rc::Rc},
|
||||||
|
|
@ -87,7 +88,7 @@ impl ExtSessionLockV1RequestHandler for ExtSessionLockV1 {
|
||||||
node.set_lock_surface(Some(new.clone()));
|
node.set_lock_surface(Some(new.clone()));
|
||||||
let pos = node.global.pos.get();
|
let pos = node.global.pos.get();
|
||||||
new.change_extents(pos);
|
new.change_extents(pos);
|
||||||
new.surface.set_output(&node);
|
new.surface.set_output(&node, NodeLocation::Output(node.id));
|
||||||
self.client.state.tree_changed();
|
self.client.state.tree_changed();
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
||||||
|
|
@ -79,8 +79,8 @@ use {
|
||||||
rect::Rect,
|
rect::Rect,
|
||||||
state::{DeviceHandlerData, State},
|
state::{DeviceHandlerData, State},
|
||||||
tree::{
|
tree::{
|
||||||
ContainerNode, ContainerSplit, Direction, FoundNode, Node, NodeId, OutputNode,
|
ContainerNode, ContainerSplit, Direction, FoundNode, Node, NodeId, NodeLocation,
|
||||||
ToplevelNode, WorkspaceNode, generic_node_visitor, toplevel_create_split,
|
OutputNode, ToplevelNode, WorkspaceNode, generic_node_visitor, toplevel_create_split,
|
||||||
toplevel_parent_container, toplevel_set_floating, toplevel_set_workspace,
|
toplevel_parent_container, toplevel_set_floating, toplevel_set_workspace,
|
||||||
},
|
},
|
||||||
utils::{
|
utils::{
|
||||||
|
|
@ -717,7 +717,9 @@ impl WlSeatGlobal {
|
||||||
serial: u64,
|
serial: u64,
|
||||||
) -> Result<(), WlSeatError> {
|
) -> Result<(), WlSeatError> {
|
||||||
if let Some(icon) = &icon {
|
if let Some(icon) = &icon {
|
||||||
icon.surface().set_output(&self.pointer_cursor.output());
|
let output = self.pointer_cursor.output();
|
||||||
|
icon.surface()
|
||||||
|
.set_output(&output, NodeLocation::Output(output.id));
|
||||||
}
|
}
|
||||||
self.pointer_owner
|
self.pointer_owner
|
||||||
.start_drag(self, origin, source, icon, serial)
|
.start_drag(self, origin, source, icon, serial)
|
||||||
|
|
@ -1082,7 +1084,8 @@ impl WlSeatGlobal {
|
||||||
impl CursorUserOwner for WlSeatGlobal {
|
impl CursorUserOwner for WlSeatGlobal {
|
||||||
fn output_changed(&self, output: &Rc<OutputNode>) {
|
fn output_changed(&self, output: &Rc<OutputNode>) {
|
||||||
if let Some(dnd) = self.pointer_owner.dnd_icon() {
|
if let Some(dnd) = self.pointer_owner.dnd_icon() {
|
||||||
dnd.surface().set_output(output);
|
dnd.surface()
|
||||||
|
.set_output(output, NodeLocation::Output(output.id));
|
||||||
}
|
}
|
||||||
if let Some(drag) = self.pointer_owner.toplevel_drag()
|
if let Some(drag) = self.pointer_owner.toplevel_drag()
|
||||||
&& let Some(tl) = drag.toplevel.get()
|
&& let Some(tl) = drag.toplevel.get()
|
||||||
|
|
|
||||||
|
|
@ -76,8 +76,8 @@ use {
|
||||||
renderer::Renderer,
|
renderer::Renderer,
|
||||||
tree::{
|
tree::{
|
||||||
BeforeLatchListener, BeforeLatchResult, ContainerNode, FindTreeResult, FoundNode,
|
BeforeLatchListener, BeforeLatchResult, ContainerNode, FindTreeResult, FoundNode,
|
||||||
LatchListener, Node, NodeId, NodeVisitor, NodeVisitorBase, OutputNode, PlaceholderNode,
|
LatchListener, Node, NodeId, NodeLocation, NodeVisitor, NodeVisitorBase, OutputNode,
|
||||||
PresentationListener, ToplevelNode, VblankListener,
|
PlaceholderNode, PresentationListener, ToplevelNode, VblankListener,
|
||||||
},
|
},
|
||||||
utils::{
|
utils::{
|
||||||
cell_ext::CellExt, clonecell::CloneCell, copyhashmap::CopyHashMap,
|
cell_ext::CellExt, clonecell::CloneCell, copyhashmap::CopyHashMap,
|
||||||
|
|
@ -319,6 +319,7 @@ pub struct WlSurface {
|
||||||
idle_inhibitors: SmallMap<ZwpIdleInhibitorV1Id, Rc<ZwpIdleInhibitorV1>, 1>,
|
idle_inhibitors: SmallMap<ZwpIdleInhibitorV1Id, Rc<ZwpIdleInhibitorV1>, 1>,
|
||||||
viewporter: CloneCell<Option<Rc<WpViewport>>>,
|
viewporter: CloneCell<Option<Rc<WpViewport>>>,
|
||||||
output: CloneCell<Rc<OutputNode>>,
|
output: CloneCell<Rc<OutputNode>>,
|
||||||
|
location: Cell<NodeLocation>,
|
||||||
fractional_scale: CloneCell<Option<Rc<WpFractionalScaleV1>>>,
|
fractional_scale: CloneCell<Option<Rc<WpFractionalScaleV1>>>,
|
||||||
pub constraints: SmallMap<SeatId, Rc<SeatConstraint>, 1>,
|
pub constraints: SmallMap<SeatId, Rc<SeatConstraint>, 1>,
|
||||||
xwayland_serial: Cell<Option<u64>>,
|
xwayland_serial: Cell<Option<u64>>,
|
||||||
|
|
@ -623,6 +624,7 @@ pub struct StackElement {
|
||||||
|
|
||||||
impl WlSurface {
|
impl WlSurface {
|
||||||
pub fn new(id: WlSurfaceId, client: &Rc<Client>, version: Version, slf: &Weak<Self>) -> Self {
|
pub fn new(id: WlSurfaceId, client: &Rc<Client>, version: Version, slf: &Weak<Self>) -> Self {
|
||||||
|
let dummy_output = client.state.dummy_output.get().unwrap();
|
||||||
Self {
|
Self {
|
||||||
id,
|
id,
|
||||||
node_id: client.state.node_ids.next(),
|
node_id: client.state.node_ids.next(),
|
||||||
|
|
@ -662,7 +664,8 @@ impl WlSurface {
|
||||||
tracker: Default::default(),
|
tracker: Default::default(),
|
||||||
idle_inhibitors: Default::default(),
|
idle_inhibitors: Default::default(),
|
||||||
viewporter: Default::default(),
|
viewporter: Default::default(),
|
||||||
output: CloneCell::new(client.state.dummy_output.get().unwrap()),
|
location: Cell::new(NodeLocation::Output(dummy_output.id)),
|
||||||
|
output: CloneCell::new(dummy_output),
|
||||||
fractional_scale: Default::default(),
|
fractional_scale: Default::default(),
|
||||||
constraints: Default::default(),
|
constraints: Default::default(),
|
||||||
xwayland_serial: Default::default(),
|
xwayland_serial: Default::default(),
|
||||||
|
|
@ -715,7 +718,8 @@ impl WlSurface {
|
||||||
self.output.get()
|
self.output.get()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_output(&self, output: &Rc<OutputNode>) {
|
pub fn set_output(&self, output: &Rc<OutputNode>, location: NodeLocation) {
|
||||||
|
self.location.set(location);
|
||||||
let old = self.output.set(output.clone());
|
let old = self.output.set(output.clone());
|
||||||
if old.id == output.id {
|
if old.id == output.id {
|
||||||
return;
|
return;
|
||||||
|
|
@ -737,7 +741,7 @@ impl WlSurface {
|
||||||
let children = self.children.borrow_mut();
|
let children = self.children.borrow_mut();
|
||||||
if let Some(children) = &*children {
|
if let Some(children) = &*children {
|
||||||
for ss in children.subsurfaces.values() {
|
for ss in children.subsurfaces.values() {
|
||||||
ss.surface.set_output(output);
|
ss.surface.set_output(output, location);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1788,6 +1792,10 @@ impl Node for WlSurface {
|
||||||
Some(self.output.get())
|
Some(self.output.get())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn node_location(&self) -> Option<NodeLocation> {
|
||||||
|
Some(self.location.get())
|
||||||
|
}
|
||||||
|
|
||||||
fn node_active_changed(&self, active: bool) {
|
fn node_active_changed(&self, active: bool) {
|
||||||
if let Some(tl) = self.toplevel.get() {
|
if let Some(tl) = self.toplevel.get() {
|
||||||
tl.tl_surface_active_changed(active);
|
tl.tl_surface_active_changed(active);
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ use {
|
||||||
rect::Rect,
|
rect::Rect,
|
||||||
renderer::Renderer,
|
renderer::Renderer,
|
||||||
scale::Scale,
|
scale::Scale,
|
||||||
tree::{Node, NodeVisitorBase, OutputNode},
|
tree::{Node, NodeLocation, NodeVisitorBase, OutputNode},
|
||||||
},
|
},
|
||||||
std::{cell::Cell, ops::Deref, rc::Rc},
|
std::{cell::Cell, ops::Deref, rc::Rc},
|
||||||
};
|
};
|
||||||
|
|
@ -133,7 +133,8 @@ impl Cursor for CursorSurface {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_output(&self, output: &Rc<OutputNode>) {
|
fn set_output(&self, output: &Rc<OutputNode>) {
|
||||||
self.surface.set_output(output);
|
self.surface
|
||||||
|
.set_output(output, NodeLocation::Output(output.id));
|
||||||
}
|
}
|
||||||
|
|
||||||
fn handle_set(self: Rc<Self>) {
|
fn handle_set(self: Rc<Self>) {
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,10 @@ use {
|
||||||
leaks::Tracker,
|
leaks::Tracker,
|
||||||
object::{Object, Version},
|
object::{Object, Version},
|
||||||
rect::Rect,
|
rect::Rect,
|
||||||
tree::{FindTreeResult, FindTreeUsecase, FoundNode, Node, NodeId, NodeVisitor, OutputNode},
|
tree::{
|
||||||
|
FindTreeResult, FindTreeUsecase, FoundNode, Node, NodeId, NodeLocation, NodeVisitor,
|
||||||
|
OutputNode,
|
||||||
|
},
|
||||||
utils::numcell::NumCell,
|
utils::numcell::NumCell,
|
||||||
wire::{ExtSessionLockSurfaceV1Id, WlSurfaceId, ext_session_lock_surface_v1::*},
|
wire::{ExtSessionLockSurfaceV1Id, WlSurfaceId, ext_session_lock_surface_v1::*},
|
||||||
},
|
},
|
||||||
|
|
@ -131,6 +134,10 @@ impl Node for ExtSessionLockSurfaceV1 {
|
||||||
self.output.node()
|
self.output.node()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn node_location(&self) -> Option<NodeLocation> {
|
||||||
|
self.surface.node_location()
|
||||||
|
}
|
||||||
|
|
||||||
fn node_find_tree_at(
|
fn node_find_tree_at(
|
||||||
&self,
|
&self,
|
||||||
x: i32,
|
x: i32,
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,8 @@ use {
|
||||||
},
|
},
|
||||||
rect::Rect,
|
rect::Rect,
|
||||||
tree::{
|
tree::{
|
||||||
FindTreeResult, FindTreeUsecase, FoundNode, Node, NodeId, NodeVisitor, OutputNode,
|
FindTreeResult, FindTreeUsecase, FoundNode, Node, NodeId, NodeLocation, NodeVisitor,
|
||||||
StackedNode,
|
OutputNode, StackedNode,
|
||||||
},
|
},
|
||||||
utils::{
|
utils::{
|
||||||
copyhashmap::CopyHashMap,
|
copyhashmap::CopyHashMap,
|
||||||
|
|
@ -300,6 +300,10 @@ impl<T: TrayItem> Node for T {
|
||||||
self.data().output.node()
|
self.data().output.node()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn node_location(&self) -> Option<NodeLocation> {
|
||||||
|
self.data().surface.node_location()
|
||||||
|
}
|
||||||
|
|
||||||
fn node_find_tree_at(
|
fn node_find_tree_at(
|
||||||
&self,
|
&self,
|
||||||
x: i32,
|
x: i32,
|
||||||
|
|
@ -328,7 +332,8 @@ fn install<T: TrayItem>(item: &Rc<T>) -> Result<(), TrayItemError> {
|
||||||
data.surface.ext.set(item.clone());
|
data.surface.ext.set(item.clone());
|
||||||
data.surface.set_visible(false);
|
data.surface.set_visible(false);
|
||||||
if let Some(node) = data.output.node() {
|
if let Some(node) = data.output.node() {
|
||||||
data.surface.set_output(&node);
|
data.surface
|
||||||
|
.set_output(&node, NodeLocation::Output(node.id));
|
||||||
item.send_initial_configure();
|
item.send_initial_configure();
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
||||||
|
|
@ -186,7 +186,8 @@ impl WlSubsurface {
|
||||||
update_children_attach(self)?;
|
update_children_attach(self)?;
|
||||||
let (x, y) = self.parent.buffer_abs_pos.get().position();
|
let (x, y) = self.parent.buffer_abs_pos.get().position();
|
||||||
self.surface.set_absolute_position(x, y);
|
self.surface.set_absolute_position(x, y);
|
||||||
self.surface.set_output(&self.parent.output.get());
|
self.surface
|
||||||
|
.set_output(&self.parent.output.get(), self.parent.location.get());
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,9 @@ use {
|
||||||
state::State,
|
state::State,
|
||||||
tree::{
|
tree::{
|
||||||
ContainerSplit, Direction, FindTreeResult, FindTreeUsecase, FoundNode, Node, NodeId,
|
ContainerSplit, Direction, FindTreeResult, FindTreeUsecase, FoundNode, Node, NodeId,
|
||||||
NodeVisitor, OutputNode, StackedNode, TileDragDestination, ToplevelData, ToplevelNode,
|
NodeLocation, NodeVisitor, OutputNode, StackedNode, TileDragDestination, ToplevelData,
|
||||||
ToplevelNodeBase, ToplevelType, WorkspaceNode, default_tile_drag_destination,
|
ToplevelNode, ToplevelNodeBase, ToplevelType, WorkspaceNode,
|
||||||
|
default_tile_drag_destination,
|
||||||
},
|
},
|
||||||
utils::{clonecell::CloneCell, copyhashmap::CopyHashMap, linkedlist::LinkedNode},
|
utils::{clonecell::CloneCell, copyhashmap::CopyHashMap, linkedlist::LinkedNode},
|
||||||
wire::WlSurfaceId,
|
wire::WlSurfaceId,
|
||||||
|
|
@ -370,6 +371,10 @@ impl Node for Xwindow {
|
||||||
self.toplevel_data.output_opt()
|
self.toplevel_data.output_opt()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn node_location(&self) -> Option<NodeLocation> {
|
||||||
|
self.x.surface.node_location()
|
||||||
|
}
|
||||||
|
|
||||||
fn node_do_focus(self: Rc<Self>, seat: &Rc<WlSeatGlobal>, _direction: Direction) {
|
fn node_do_focus(self: Rc<Self>, seat: &Rc<WlSeatGlobal>, _direction: Direction) {
|
||||||
seat.focus_toplevel(self.clone());
|
seat.focus_toplevel(self.clone());
|
||||||
}
|
}
|
||||||
|
|
@ -446,7 +451,7 @@ impl ToplevelNodeBase for Xwindow {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn tl_set_workspace_ext(&self, ws: &Rc<WorkspaceNode>) {
|
fn tl_set_workspace_ext(&self, ws: &Rc<WorkspaceNode>) {
|
||||||
self.x.surface.set_output(&ws.output.get());
|
self.x.surface.set_output(&ws.output.get(), ws.location());
|
||||||
}
|
}
|
||||||
|
|
||||||
fn tl_change_extents_impl(self: Rc<Self>, rect: &Rect) {
|
fn tl_change_extents_impl(self: Rc<Self>, rect: &Rect) {
|
||||||
|
|
@ -456,7 +461,9 @@ impl ToplevelNodeBase for Xwindow {
|
||||||
if self.data.info.override_redirect.get() {
|
if self.data.info.override_redirect.get() {
|
||||||
let (x, y) = rect.center();
|
let (x, y) = rect.center();
|
||||||
let output = self.data.state.find_closest_output(x, y).0;
|
let output = self.data.state.find_closest_output(x, y).0;
|
||||||
self.x.surface.set_output(&output);
|
self.x
|
||||||
|
.surface
|
||||||
|
.set_output(&output, NodeLocation::Output(output.id));
|
||||||
} else {
|
} else {
|
||||||
self.data
|
self.data
|
||||||
.state
|
.state
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,9 @@ use {
|
||||||
leaks::Tracker,
|
leaks::Tracker,
|
||||||
object::Object,
|
object::Object,
|
||||||
rect::Rect,
|
rect::Rect,
|
||||||
tree::{FindTreeResult, FoundNode, Node, OutputNode, StackedNode, WorkspaceNode},
|
tree::{
|
||||||
|
FindTreeResult, FoundNode, Node, NodeLocation, OutputNode, StackedNode, WorkspaceNode,
|
||||||
|
},
|
||||||
utils::{
|
utils::{
|
||||||
clonecell::CloneCell,
|
clonecell::CloneCell,
|
||||||
copyhashmap::CopyHashMap,
|
copyhashmap::CopyHashMap,
|
||||||
|
|
@ -233,7 +235,7 @@ impl XdgSurface {
|
||||||
|
|
||||||
fn set_workspace(&self, ws: &Rc<WorkspaceNode>) {
|
fn set_workspace(&self, ws: &Rc<WorkspaceNode>) {
|
||||||
self.workspace.set(Some(ws.clone()));
|
self.workspace.set(Some(ws.clone()));
|
||||||
self.surface.set_output(&ws.output.get());
|
self.surface.set_output(&ws.output.get(), ws.location());
|
||||||
let pu = self.popups.lock();
|
let pu = self.popups.lock();
|
||||||
for pu in pu.values() {
|
for pu in pu.values() {
|
||||||
pu.popup.xdg.set_workspace(ws);
|
pu.popup.xdg.set_workspace(ws);
|
||||||
|
|
@ -241,7 +243,8 @@ impl XdgSurface {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_output(&self, output: &Rc<OutputNode>) {
|
pub fn set_output(&self, output: &Rc<OutputNode>) {
|
||||||
self.surface.set_output(output);
|
self.surface
|
||||||
|
.set_output(output, NodeLocation::Output(output.id));
|
||||||
let pu = self.popups.lock();
|
let pu = self.popups.lock();
|
||||||
for pu in pu.values() {
|
for pu in pu.values() {
|
||||||
pu.popup.xdg.set_output(output);
|
pu.popup.xdg.set_output(output);
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,8 @@ use {
|
||||||
rect::Rect,
|
rect::Rect,
|
||||||
renderer::Renderer,
|
renderer::Renderer,
|
||||||
tree::{
|
tree::{
|
||||||
FindTreeResult, FindTreeUsecase, FoundNode, Node, NodeId, NodeVisitor, OutputNode,
|
FindTreeResult, FindTreeUsecase, FoundNode, Node, NodeId, NodeLocation, NodeVisitor,
|
||||||
StackedNode,
|
OutputNode, StackedNode,
|
||||||
},
|
},
|
||||||
utils::clonecell::CloneCell,
|
utils::clonecell::CloneCell,
|
||||||
wire::{XdgPopupId, xdg_popup::*},
|
wire::{XdgPopupId, xdg_popup::*},
|
||||||
|
|
@ -319,6 +319,10 @@ impl Node for XdgPopup {
|
||||||
self.xdg.workspace.get().map(|w| w.output.get())
|
self.xdg.workspace.get().map(|w| w.output.get())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn node_location(&self) -> Option<NodeLocation> {
|
||||||
|
self.xdg.surface.node_location()
|
||||||
|
}
|
||||||
|
|
||||||
fn node_find_tree_at(
|
fn node_find_tree_at(
|
||||||
&self,
|
&self,
|
||||||
x: i32,
|
x: i32,
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ use {
|
||||||
state::State,
|
state::State,
|
||||||
tree::{
|
tree::{
|
||||||
ContainerSplit, Direction, FindTreeResult, FindTreeUsecase, FoundNode, Node, NodeId,
|
ContainerSplit, Direction, FindTreeResult, FindTreeUsecase, FoundNode, Node, NodeId,
|
||||||
NodeVisitor, OutputNode, TileDragDestination, ToplevelData, ToplevelNode,
|
NodeLocation, NodeVisitor, OutputNode, TileDragDestination, ToplevelData, ToplevelNode,
|
||||||
ToplevelNodeBase, ToplevelNodeId, ToplevelType, WorkspaceNode,
|
ToplevelNodeBase, ToplevelNodeId, ToplevelType, WorkspaceNode,
|
||||||
default_tile_drag_destination,
|
default_tile_drag_destination,
|
||||||
},
|
},
|
||||||
|
|
@ -512,7 +512,7 @@ impl XdgToplevel {
|
||||||
self.extents_changed();
|
self.extents_changed();
|
||||||
if let Some(workspace) = self.xdg.workspace.get() {
|
if let Some(workspace) = self.xdg.workspace.get() {
|
||||||
let output = workspace.output.get();
|
let output = workspace.output.get();
|
||||||
surface.set_output(&output);
|
surface.set_output(&output, workspace.location());
|
||||||
}
|
}
|
||||||
// {
|
// {
|
||||||
// let seats = surface.client.state.globals.lock_seats();
|
// let seats = surface.client.state.globals.lock_seats();
|
||||||
|
|
@ -573,6 +573,10 @@ impl Node for XdgToplevel {
|
||||||
self.toplevel_data.output_opt()
|
self.toplevel_data.output_opt()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn node_location(&self) -> Option<NodeLocation> {
|
||||||
|
self.xdg.surface.node_location()
|
||||||
|
}
|
||||||
|
|
||||||
fn node_do_focus(self: Rc<Self>, seat: &Rc<WlSeatGlobal>, _direction: Direction) {
|
fn node_do_focus(self: Rc<Self>, seat: &Rc<WlSeatGlobal>, _direction: Direction) {
|
||||||
seat.focus_toplevel(self.clone());
|
seat.focus_toplevel(self.clone());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,8 @@ use {
|
||||||
rect::Rect,
|
rect::Rect,
|
||||||
renderer::Renderer,
|
renderer::Renderer,
|
||||||
tree::{
|
tree::{
|
||||||
FindTreeResult, FindTreeUsecase, FoundNode, Node, NodeId, NodeVisitor, OutputNode,
|
FindTreeResult, FindTreeUsecase, FoundNode, Node, NodeId, NodeLocation, NodeVisitor,
|
||||||
StackedNode,
|
OutputNode, StackedNode,
|
||||||
},
|
},
|
||||||
utils::{
|
utils::{
|
||||||
bitflags::BitflagsExt,
|
bitflags::BitflagsExt,
|
||||||
|
|
@ -187,7 +187,8 @@ impl ZwlrLayerSurfaceV1 {
|
||||||
}
|
}
|
||||||
self.surface.ext.set(self.clone());
|
self.surface.ext.set(self.clone());
|
||||||
if let Some(output) = self.output.node() {
|
if let Some(output) = self.output.node() {
|
||||||
self.surface.set_output(&output);
|
self.surface
|
||||||
|
.set_output(&output, NodeLocation::Output(output.id));
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
@ -658,6 +659,10 @@ impl Node for ZwlrLayerSurfaceV1 {
|
||||||
self.output.node()
|
self.output.node()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn node_location(&self) -> Option<NodeLocation> {
|
||||||
|
self.surface.node_location()
|
||||||
|
}
|
||||||
|
|
||||||
fn node_find_tree_at(
|
fn node_find_tree_at(
|
||||||
&self,
|
&self,
|
||||||
x: i32,
|
x: i32,
|
||||||
|
|
|
||||||
10
src/tree.rs
10
src/tree.rs
|
|
@ -115,6 +115,15 @@ pub enum FindTreeUsecase {
|
||||||
SelectWorkspace,
|
SelectWorkspace,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Copy, Clone)]
|
||||||
|
pub enum NodeLocation {
|
||||||
|
Workspace(
|
||||||
|
#[expect(dead_code)] OutputNodeId,
|
||||||
|
#[expect(dead_code)] WorkspaceNodeId,
|
||||||
|
),
|
||||||
|
Output(#[expect(dead_code)] OutputNodeId),
|
||||||
|
}
|
||||||
|
|
||||||
pub trait Node: 'static {
|
pub trait Node: 'static {
|
||||||
fn node_id(&self) -> NodeId;
|
fn node_id(&self) -> NodeId;
|
||||||
fn node_seat_state(&self) -> &NodeSeatState;
|
fn node_seat_state(&self) -> &NodeSeatState;
|
||||||
|
|
@ -123,6 +132,7 @@ pub trait Node: 'static {
|
||||||
fn node_visible(&self) -> bool;
|
fn node_visible(&self) -> bool;
|
||||||
fn node_absolute_position(&self) -> Rect;
|
fn node_absolute_position(&self) -> Rect;
|
||||||
fn node_output(&self) -> Option<Rc<OutputNode>>;
|
fn node_output(&self) -> Option<Rc<OutputNode>>;
|
||||||
|
fn node_location(&self) -> Option<NodeLocation>;
|
||||||
|
|
||||||
fn node_child_title_changed(self: Rc<Self>, child: &dyn Node, title: &str) {
|
fn node_child_title_changed(self: Rc<Self>, child: &dyn Node, title: &str) {
|
||||||
let _ = child;
|
let _ = child;
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,8 @@ use {
|
||||||
text::TextTexture,
|
text::TextTexture,
|
||||||
tree::{
|
tree::{
|
||||||
ContainingNode, Direction, FindTreeResult, FindTreeUsecase, FloatNode, FoundNode, Node,
|
ContainingNode, Direction, FindTreeResult, FindTreeUsecase, FloatNode, FoundNode, Node,
|
||||||
NodeId, OutputNode, TddType, TileDragDestination, ToplevelData, ToplevelNode,
|
NodeId, NodeLocation, OutputNode, TddType, TileDragDestination, ToplevelData,
|
||||||
ToplevelNodeBase, ToplevelType, WorkspaceNode, default_tile_drag_bounds,
|
ToplevelNode, ToplevelNodeBase, ToplevelType, WorkspaceNode, default_tile_drag_bounds,
|
||||||
toplevel_set_floating, walker::NodeVisitor,
|
toplevel_set_floating, walker::NodeVisitor,
|
||||||
},
|
},
|
||||||
utils::{
|
utils::{
|
||||||
|
|
@ -129,6 +129,7 @@ pub struct ContainerNode {
|
||||||
focus_history: LinkedList<NodeRef<ContainerChild>>,
|
focus_history: LinkedList<NodeRef<ContainerChild>>,
|
||||||
child_nodes: RefCell<AHashMap<NodeId, LinkedNode<ContainerChild>>>,
|
child_nodes: RefCell<AHashMap<NodeId, LinkedNode<ContainerChild>>>,
|
||||||
workspace: CloneCell<Rc<WorkspaceNode>>,
|
workspace: CloneCell<Rc<WorkspaceNode>>,
|
||||||
|
location: Cell<NodeLocation>,
|
||||||
cursors: RefCell<AHashMap<CursorType, CursorState>>,
|
cursors: RefCell<AHashMap<CursorType, CursorState>>,
|
||||||
state: Rc<State>,
|
state: Rc<State>,
|
||||||
pub render_data: RefCell<ContainerRenderData>,
|
pub render_data: RefCell<ContainerRenderData>,
|
||||||
|
|
@ -235,6 +236,7 @@ impl ContainerNode {
|
||||||
focus_history: Default::default(),
|
focus_history: Default::default(),
|
||||||
child_nodes: RefCell::new(child_nodes),
|
child_nodes: RefCell::new(child_nodes),
|
||||||
workspace: CloneCell::new(workspace.clone()),
|
workspace: CloneCell::new(workspace.clone()),
|
||||||
|
location: Cell::new(workspace.location()),
|
||||||
cursors: RefCell::new(Default::default()),
|
cursors: RefCell::new(Default::default()),
|
||||||
state: state.clone(),
|
state: state.clone(),
|
||||||
render_data: Default::default(),
|
render_data: Default::default(),
|
||||||
|
|
@ -1547,6 +1549,10 @@ impl Node for ContainerNode {
|
||||||
self.toplevel_data.output_opt()
|
self.toplevel_data.output_opt()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn node_location(&self) -> Option<NodeLocation> {
|
||||||
|
Some(self.location.get())
|
||||||
|
}
|
||||||
|
|
||||||
fn node_child_title_changed(self: Rc<Self>, child: &dyn Node, title: &str) {
|
fn node_child_title_changed(self: Rc<Self>, child: &dyn Node, title: &str) {
|
||||||
if let Some(child) = self.child_nodes.borrow().get(&child.node_id()) {
|
if let Some(child) = self.child_nodes.borrow().get(&child.node_id()) {
|
||||||
self.update_child_title(child, title);
|
self.update_child_title(child, title);
|
||||||
|
|
@ -2085,6 +2091,7 @@ impl ToplevelNodeBase for ContainerNode {
|
||||||
|
|
||||||
fn tl_set_workspace_ext(&self, ws: &Rc<WorkspaceNode>) {
|
fn tl_set_workspace_ext(&self, ws: &Rc<WorkspaceNode>) {
|
||||||
self.workspace.set(ws.clone());
|
self.workspace.set(ws.clone());
|
||||||
|
self.location.set(ws.location());
|
||||||
for child in self.children.iter() {
|
for child in self.children.iter() {
|
||||||
child.node.clone().tl_set_workspace(ws);
|
child.node.clone().tl_set_workspace(ws);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,9 @@ use {
|
||||||
renderer::Renderer,
|
renderer::Renderer,
|
||||||
state::State,
|
state::State,
|
||||||
tree::{
|
tree::{
|
||||||
FindTreeResult, FindTreeUsecase, FoundNode, Node, NodeId, OutputNode, StackedNode,
|
FindTreeResult, FindTreeUsecase, FoundNode, Node, NodeId, NodeLocation, OutputNode,
|
||||||
TileDragDestination, WorkspaceDragDestination, WorkspaceNodeId, walker::NodeVisitor,
|
StackedNode, TileDragDestination, WorkspaceDragDestination, WorkspaceNodeId,
|
||||||
|
walker::NodeVisitor,
|
||||||
},
|
},
|
||||||
utils::{copyhashmap::CopyHashMap, linkedlist::LinkedList},
|
utils::{copyhashmap::CopyHashMap, linkedlist::LinkedList},
|
||||||
},
|
},
|
||||||
|
|
@ -150,6 +151,10 @@ impl Node for DisplayNode {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn node_location(&self) -> Option<NodeLocation> {
|
||||||
|
None
|
||||||
|
}
|
||||||
|
|
||||||
fn node_find_tree_at(
|
fn node_find_tree_at(
|
||||||
&self,
|
&self,
|
||||||
x: i32,
|
x: i32,
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,8 @@ use {
|
||||||
text::TextTexture,
|
text::TextTexture,
|
||||||
tree::{
|
tree::{
|
||||||
ContainingNode, Direction, FindTreeResult, FindTreeUsecase, FoundNode, Node, NodeId,
|
ContainingNode, Direction, FindTreeResult, FindTreeUsecase, FoundNode, Node, NodeId,
|
||||||
OutputNode, PinnedNode, StackedNode, TileDragDestination, ToplevelNode, WorkspaceNode,
|
NodeLocation, OutputNode, PinnedNode, StackedNode, TileDragDestination, ToplevelNode,
|
||||||
toplevel_set_floating, walker::NodeVisitor,
|
WorkspaceNode, toplevel_set_floating, walker::NodeVisitor,
|
||||||
},
|
},
|
||||||
utils::{
|
utils::{
|
||||||
asyncevent::AsyncEvent, clonecell::CloneCell, double_click_state::DoubleClickState,
|
asyncevent::AsyncEvent, clonecell::CloneCell, double_click_state::DoubleClickState,
|
||||||
|
|
@ -45,6 +45,7 @@ pub struct FloatNode {
|
||||||
pub workspace_link: Cell<Option<LinkedNode<Rc<dyn StackedNode>>>>,
|
pub workspace_link: Cell<Option<LinkedNode<Rc<dyn StackedNode>>>>,
|
||||||
pub pinned_link: RefCell<Option<LinkedNode<Rc<dyn PinnedNode>>>>,
|
pub pinned_link: RefCell<Option<LinkedNode<Rc<dyn PinnedNode>>>>,
|
||||||
pub workspace: CloneCell<Rc<WorkspaceNode>>,
|
pub workspace: CloneCell<Rc<WorkspaceNode>>,
|
||||||
|
pub location: Cell<NodeLocation>,
|
||||||
pub child: CloneCell<Option<Rc<dyn ToplevelNode>>>,
|
pub child: CloneCell<Option<Rc<dyn ToplevelNode>>>,
|
||||||
pub active: Cell<bool>,
|
pub active: Cell<bool>,
|
||||||
pub seat_state: NodeSeatState,
|
pub seat_state: NodeSeatState,
|
||||||
|
|
@ -124,6 +125,7 @@ impl FloatNode {
|
||||||
workspace_link: Cell::new(None),
|
workspace_link: Cell::new(None),
|
||||||
pinned_link: RefCell::new(None),
|
pinned_link: RefCell::new(None),
|
||||||
workspace: CloneCell::new(ws.clone()),
|
workspace: CloneCell::new(ws.clone()),
|
||||||
|
location: Cell::new(ws.location()),
|
||||||
child: CloneCell::new(Some(child.clone())),
|
child: CloneCell::new(Some(child.clone())),
|
||||||
active: Cell::new(false),
|
active: Cell::new(false),
|
||||||
seat_state: Default::default(),
|
seat_state: Default::default(),
|
||||||
|
|
@ -423,6 +425,7 @@ impl FloatNode {
|
||||||
self.workspace_link
|
self.workspace_link
|
||||||
.set(Some(ws.stacked.add_last(self.clone())));
|
.set(Some(ws.stacked.add_last(self.clone())));
|
||||||
self.workspace.set(ws.clone());
|
self.workspace.set(ws.clone());
|
||||||
|
self.location.set(ws.location());
|
||||||
if update_visible {
|
if update_visible {
|
||||||
self.stacked_set_visible(ws.float_visible());
|
self.stacked_set_visible(ws.float_visible());
|
||||||
}
|
}
|
||||||
|
|
@ -702,6 +705,10 @@ impl Node for FloatNode {
|
||||||
Some(self.workspace.get().output.get())
|
Some(self.workspace.get().output.get())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn node_location(&self) -> Option<NodeLocation> {
|
||||||
|
Some(self.location.get())
|
||||||
|
}
|
||||||
|
|
||||||
fn node_child_title_changed(self: Rc<Self>, _child: &dyn Node, title: &str) {
|
fn node_child_title_changed(self: Rc<Self>, _child: &dyn Node, title: &str) {
|
||||||
self.update_child_title(title);
|
self.update_child_title(title);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -43,9 +43,9 @@ use {
|
||||||
state::State,
|
state::State,
|
||||||
text::TextTexture,
|
text::TextTexture,
|
||||||
tree::{
|
tree::{
|
||||||
Direction, FindTreeResult, FindTreeUsecase, FoundNode, Node, NodeId, PinnedNode,
|
Direction, FindTreeResult, FindTreeUsecase, FoundNode, Node, NodeId, NodeLocation,
|
||||||
StackedNode, TddType, TileDragDestination, WorkspaceDragDestination, WorkspaceNode,
|
PinnedNode, StackedNode, TddType, TileDragDestination, WorkspaceDragDestination,
|
||||||
WorkspaceNodeId, walker::NodeVisitor,
|
WorkspaceNode, WorkspaceNodeId, walker::NodeVisitor,
|
||||||
},
|
},
|
||||||
utils::{
|
utils::{
|
||||||
asyncevent::AsyncEvent, bitflags::BitflagsExt, clonecell::CloneCell,
|
asyncevent::AsyncEvent, bitflags::BitflagsExt, clonecell::CloneCell,
|
||||||
|
|
@ -718,6 +718,7 @@ impl OutputNode {
|
||||||
state: self.state.clone(),
|
state: self.state.clone(),
|
||||||
is_dummy: false,
|
is_dummy: false,
|
||||||
output: CloneCell::new(self.clone()),
|
output: CloneCell::new(self.clone()),
|
||||||
|
output_id: Cell::new(self.id),
|
||||||
position: Cell::new(Default::default()),
|
position: Cell::new(Default::default()),
|
||||||
container: Default::default(),
|
container: Default::default(),
|
||||||
stacked: Default::default(),
|
stacked: Default::default(),
|
||||||
|
|
@ -1476,6 +1477,10 @@ impl Node for OutputNode {
|
||||||
self.global.opt.node()
|
self.global.opt.node()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn node_location(&self) -> Option<NodeLocation> {
|
||||||
|
Some(NodeLocation::Output(self.id))
|
||||||
|
}
|
||||||
|
|
||||||
fn node_do_focus(self: Rc<Self>, seat: &Rc<WlSeatGlobal>, direction: Direction) {
|
fn node_do_focus(self: Rc<Self>, seat: &Rc<WlSeatGlobal>, direction: Direction) {
|
||||||
if self.state.lock.locked.get() {
|
if self.state.lock.locked.get() {
|
||||||
if let Some(lock) = self.lock_surface.get() {
|
if let Some(lock) = self.lock_surface.get() {
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,8 @@ use {
|
||||||
text::TextTexture,
|
text::TextTexture,
|
||||||
tree::{
|
tree::{
|
||||||
ContainerSplit, Direction, FindTreeResult, FindTreeUsecase, FoundNode, Node, NodeId,
|
ContainerSplit, Direction, FindTreeResult, FindTreeUsecase, FoundNode, Node, NodeId,
|
||||||
NodeVisitor, OutputNode, TileDragDestination, ToplevelData, ToplevelNode,
|
NodeLocation, NodeVisitor, OutputNode, TileDragDestination, ToplevelData, ToplevelNode,
|
||||||
ToplevelNodeBase, ToplevelType, default_tile_drag_destination,
|
ToplevelNodeBase, ToplevelType, WorkspaceNode, default_tile_drag_destination,
|
||||||
},
|
},
|
||||||
utils::{
|
utils::{
|
||||||
asyncevent::AsyncEvent, errorfmt::ErrorFmt, on_drop_event::OnDropEvent,
|
asyncevent::AsyncEvent, errorfmt::ErrorFmt, on_drop_event::OnDropEvent,
|
||||||
|
|
@ -35,6 +35,7 @@ pub struct PlaceholderNode {
|
||||||
destroyed: Cell<bool>,
|
destroyed: Cell<bool>,
|
||||||
update_textures_scheduled: Cell<bool>,
|
update_textures_scheduled: Cell<bool>,
|
||||||
state: Rc<State>,
|
state: Rc<State>,
|
||||||
|
location: Cell<Option<NodeLocation>>,
|
||||||
pub textures: RefCell<SmallMapMut<Scale, TextTexture, 2>>,
|
pub textures: RefCell<SmallMapMut<Scale, TextTexture, 2>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -63,6 +64,7 @@ impl PlaceholderNode {
|
||||||
destroyed: Default::default(),
|
destroyed: Default::default(),
|
||||||
update_textures_scheduled: Cell::new(false),
|
update_textures_scheduled: Cell::new(false),
|
||||||
state: state.clone(),
|
state: state.clone(),
|
||||||
|
location: Cell::new(node.node_location()),
|
||||||
textures: Default::default(),
|
textures: Default::default(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -82,6 +84,7 @@ impl PlaceholderNode {
|
||||||
destroyed: Default::default(),
|
destroyed: Default::default(),
|
||||||
update_textures_scheduled: Default::default(),
|
update_textures_scheduled: Default::default(),
|
||||||
state: state.clone(),
|
state: state.clone(),
|
||||||
|
location: Default::default(),
|
||||||
textures: Default::default(),
|
textures: Default::default(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -174,6 +177,10 @@ impl Node for PlaceholderNode {
|
||||||
self.toplevel.output_opt()
|
self.toplevel.output_opt()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn node_location(&self) -> Option<NodeLocation> {
|
||||||
|
self.location.get()
|
||||||
|
}
|
||||||
|
|
||||||
fn node_do_focus(self: Rc<Self>, seat: &Rc<WlSeatGlobal>, _direction: Direction) {
|
fn node_do_focus(self: Rc<Self>, seat: &Rc<WlSeatGlobal>, _direction: Direction) {
|
||||||
seat.focus_toplevel(self.clone());
|
seat.focus_toplevel(self.clone());
|
||||||
}
|
}
|
||||||
|
|
@ -223,6 +230,10 @@ impl ToplevelNodeBase for PlaceholderNode {
|
||||||
&self.toplevel
|
&self.toplevel
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn tl_set_workspace_ext(&self, ws: &Rc<WorkspaceNode>) {
|
||||||
|
self.location.set(ws.node_location());
|
||||||
|
}
|
||||||
|
|
||||||
fn tl_change_extents_impl(self: Rc<Self>, rect: &Rect) {
|
fn tl_change_extents_impl(self: Rc<Self>, rect: &Rect) {
|
||||||
self.toplevel.pos.set(*rect);
|
self.toplevel.pos.set(*rect);
|
||||||
if let Some(p) = self.toplevel.parent.get() {
|
if let Some(p) = self.toplevel.parent.get() {
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,8 @@ use {
|
||||||
text::TextTexture,
|
text::TextTexture,
|
||||||
tree::{
|
tree::{
|
||||||
ContainingNode, Direction, FindTreeResult, FindTreeUsecase, FloatNode, FoundNode, Node,
|
ContainingNode, Direction, FindTreeResult, FindTreeUsecase, FloatNode, FoundNode, Node,
|
||||||
NodeId, NodeVisitorBase, OutputNode, PlaceholderNode, StackedNode, ToplevelNode,
|
NodeId, NodeLocation, NodeVisitorBase, OutputNode, OutputNodeId, PlaceholderNode,
|
||||||
container::ContainerNode, walker::NodeVisitor,
|
StackedNode, ToplevelNode, container::ContainerNode, walker::NodeVisitor,
|
||||||
},
|
},
|
||||||
utils::{
|
utils::{
|
||||||
clonecell::CloneCell,
|
clonecell::CloneCell,
|
||||||
|
|
@ -49,6 +49,7 @@ pub struct WorkspaceNode {
|
||||||
pub state: Rc<State>,
|
pub state: Rc<State>,
|
||||||
pub is_dummy: bool,
|
pub is_dummy: bool,
|
||||||
pub output: CloneCell<Rc<OutputNode>>,
|
pub output: CloneCell<Rc<OutputNode>>,
|
||||||
|
pub output_id: Cell<OutputNodeId>,
|
||||||
pub position: Cell<Rect>,
|
pub position: Cell<Rect>,
|
||||||
pub container: CloneCell<Option<Rc<ContainerNode>>>,
|
pub container: CloneCell<Option<Rc<ContainerNode>>>,
|
||||||
pub stacked: LinkedList<Rc<dyn StackedNode>>,
|
pub stacked: LinkedList<Rc<dyn StackedNode>>,
|
||||||
|
|
@ -104,6 +105,7 @@ impl WorkspaceNode {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_output(&self, output: &Rc<OutputNode>) {
|
pub fn set_output(&self, output: &Rc<OutputNode>) {
|
||||||
|
self.output_id.set(output.id);
|
||||||
let old = self.output.set(output.clone());
|
let old = self.output.set(output.clone());
|
||||||
for wh in self.ext_workspaces.lock().values() {
|
for wh in self.ext_workspaces.lock().values() {
|
||||||
wh.handle_new_output(output);
|
wh.handle_new_output(output);
|
||||||
|
|
@ -113,12 +115,13 @@ impl WorkspaceNode {
|
||||||
}
|
}
|
||||||
self.update_has_captures();
|
self.update_has_captures();
|
||||||
struct OutputSetter<'a> {
|
struct OutputSetter<'a> {
|
||||||
|
ws: &'a WorkspaceNode,
|
||||||
old: &'a Rc<OutputNode>,
|
old: &'a Rc<OutputNode>,
|
||||||
new: &'a Rc<OutputNode>,
|
new: &'a Rc<OutputNode>,
|
||||||
}
|
}
|
||||||
impl NodeVisitorBase for OutputSetter<'_> {
|
impl NodeVisitorBase for OutputSetter<'_> {
|
||||||
fn visit_surface(&mut self, node: &Rc<WlSurface>) {
|
fn visit_surface(&mut self, node: &Rc<WlSurface>) {
|
||||||
node.set_output(self.new);
|
node.set_output(self.new, self.ws.location());
|
||||||
}
|
}
|
||||||
|
|
||||||
fn visit_container(&mut self, node: &Rc<ContainerNode>) {
|
fn visit_container(&mut self, node: &Rc<ContainerNode>) {
|
||||||
|
|
@ -147,6 +150,7 @@ impl WorkspaceNode {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let mut visitor = OutputSetter {
|
let mut visitor = OutputSetter {
|
||||||
|
ws: self,
|
||||||
old: &old,
|
old: &old,
|
||||||
new: output,
|
new: output,
|
||||||
};
|
};
|
||||||
|
|
@ -273,6 +277,10 @@ impl WorkspaceNode {
|
||||||
self.output.get().schedule_update_render_data();
|
self.output.get().schedule_update_render_data();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn location(&self) -> NodeLocation {
|
||||||
|
NodeLocation::Workspace(self.output_id.get(), self.id)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Node for WorkspaceNode {
|
impl Node for WorkspaceNode {
|
||||||
|
|
@ -309,6 +317,10 @@ impl Node for WorkspaceNode {
|
||||||
Some(self.output.get())
|
Some(self.output.get())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn node_location(&self) -> Option<NodeLocation> {
|
||||||
|
Some(self.location())
|
||||||
|
}
|
||||||
|
|
||||||
fn node_do_focus(self: Rc<Self>, seat: &Rc<WlSeatGlobal>, direction: Direction) {
|
fn node_do_focus(self: Rc<Self>, seat: &Rc<WlSeatGlobal>, direction: Direction) {
|
||||||
if let Some(fs) = self.fullscreen.get() {
|
if let Some(fs) = self.fullscreen.get() {
|
||||||
fs.node_do_focus(seat, direction);
|
fs.node_do_focus(seat, direction);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue