1
0
Fork 0
forked from wry/wry

autocommit 2022-02-01 23:33:59 CET

This commit is contained in:
Julian Orth 2022-02-01 23:33:59 +01:00
parent 41c5f8cf89
commit 2dbe3ba732
21 changed files with 814 additions and 86 deletions

View file

@ -1,4 +1,4 @@
use crate::ifs::wl_seat::NodeSeatState;
use crate::ifs::wl_seat::{NodeSeatState, WlSeatGlobal};
use crate::rect::Rect;
use crate::render::Renderer;
use crate::tree::{FindTreeResult, FoundNode, Node, NodeId, WorkspaceNode};
@ -8,6 +8,7 @@ use crate::{NumCell, State};
use ahash::AHashMap;
use std::cell::{Cell, RefCell};
use std::rc::Rc;
use crate::cursor::KnownCursor;
#[allow(dead_code)]
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
@ -354,6 +355,10 @@ impl Node for ContainerNode {
}
}
fn pointer_target(&self, seat: &Rc<WlSeatGlobal>) {
seat.set_known_cursor(KnownCursor::Default);
}
fn render(&self, renderer: &mut Renderer, x: i32, y: i32) {
renderer.render_container(self, x, y);
}

View file

@ -16,6 +16,7 @@ use std::fmt::Display;
use std::ops::Deref;
use std::rc::Rc;
pub use workspace::*;
use crate::cursor::KnownCursor;
mod container;
mod workspace;
@ -126,6 +127,10 @@ pub trait Node {
let _ = y;
}
fn pointer_target(&self, seat: &Rc<WlSeatGlobal>) {
let _ = seat;
}
fn motion(&self, seat: &WlSeatGlobal, x: Fixed, y: Fixed) {
let _ = seat;
let _ = x;
@ -249,6 +254,10 @@ impl Node for DisplayNode {
}
FindTreeResult::AcceptsInput
}
fn pointer_target(&self, seat: &Rc<WlSeatGlobal>) {
seat.set_known_cursor(KnownCursor::Default);
}
}
tree_id!(OutputNodeId);
@ -298,6 +307,10 @@ impl Node for OutputNode {
self.workspace.set(None);
}
fn pointer_target(&self, seat: &Rc<WlSeatGlobal>) {
seat.set_known_cursor(KnownCursor::Default);
}
fn render(&self, renderer: &mut Renderer, x: i32, y: i32) {
renderer.render_output(self, x, y);
}
@ -376,6 +389,10 @@ impl Node for FloatNode {
.set(Rect::new_sized(pos.x1(), pos.x2(), width, height).unwrap());
}
fn pointer_target(&self, seat: &Rc<WlSeatGlobal>) {
seat.set_known_cursor(KnownCursor::Default);
}
fn render(&self, renderer: &mut Renderer, x: i32, y: i32) {
renderer.render_floating(self, x, y)
}

View file

@ -1,4 +1,4 @@
use crate::ifs::wl_seat::NodeSeatState;
use crate::ifs::wl_seat::{NodeSeatState, WlSeatGlobal};
use crate::rect::Rect;
use crate::render::Renderer;
use crate::tree::container::ContainerNode;
@ -6,6 +6,7 @@ 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::cursor::KnownCursor;
tree_id!(WorkspaceNodeId);
@ -61,6 +62,10 @@ impl Node for WorkspaceNode {
self.container.set(None);
}
fn pointer_target(&self, seat: &Rc<WlSeatGlobal>) {
seat.set_known_cursor(KnownCursor::Default);
}
fn render(&self, renderer: &mut Renderer, x: i32, y: i32) {
renderer.render_workspace(self, x, y);
}