1
0
Fork 0
forked from wry/wry

autocommit 2022-04-02 00:31:30 CEST

This commit is contained in:
Julian Orth 2022-04-02 00:31:30 +02:00
parent 2dd433aa04
commit 6ad6d83b7e
34 changed files with 446 additions and 161 deletions

View file

@ -289,6 +289,10 @@ impl SurfaceExt for WlSubsurface {
fn into_subsurface(self: Rc<Self>) -> Option<Rc<WlSubsurface>> {
Some(self)
}
fn accepts_kb_focus(&self) -> bool {
self.parent.accepts_kb_focus()
}
}
#[derive(Debug, Error)]

View file

@ -356,6 +356,10 @@ impl SurfaceExt for XdgSurface {
fn extents_changed(&self) {
self.update_extents();
}
fn accepts_kb_focus(&self) -> bool {
self.role.get() == XdgSurfaceRole::XdgToplevel
}
}
#[derive(Debug, Error)]

View file

@ -1,7 +1,7 @@
use crate::client::{Client, ClientError};
use crate::cursor::KnownCursor;
use crate::fixed::Fixed;
use crate::ifs::wl_seat::{NodeSeatState, WlSeatGlobal};
use crate::ifs::wl_seat::{ NodeSeatState, WlSeatGlobal};
use crate::ifs::wl_surface::xdg_surface::{XdgSurface, XdgSurfaceError, XdgSurfaceExt};
use crate::ifs::xdg_positioner::{XdgPositioned, XdgPositioner, CA};
use crate::leaks::Tracker;
@ -281,6 +281,10 @@ impl Node for XdgPopup {
visitor.visit_surface(&self.xdg.surface);
}
fn get_workspace(&self) -> Option<Rc<WorkspaceNode>> {
self.xdg.workspace.get()
}
fn absolute_position(&self) -> Rect {
self.xdg.absolute_desired_extents.get()
}

View file

@ -12,7 +12,7 @@ use crate::rect::Rect;
use crate::render::Renderer;
use crate::tree::toplevel::{ToplevelData, ToplevelNode};
use crate::tree::walker::NodeVisitor;
use crate::tree::FindTreeResult;
use crate::tree::{FindTreeResult};
use crate::tree::{FoundNode, Node, NodeId, ToplevelNodeId, WorkspaceNode};
use crate::utils::buffd::MsgParser;
use crate::utils::buffd::MsgParserError;
@ -374,6 +374,10 @@ impl Node for XdgToplevel {
visitor.visit_surface(&self.xdg.surface);
}
fn get_workspace(&self) -> Option<Rc<WorkspaceNode>> {
self.xdg.workspace.get()
}
fn is_contained_in(&self, other: NodeId) -> bool {
if let Some(parent) = self.parent_node.get() {
if parent.id() == other {
@ -443,10 +447,6 @@ impl ToplevelNode for XdgToplevel {
self.parent_node.get()
}
fn workspace(&self) -> Option<Rc<WorkspaceNode>> {
self.xdg.workspace.get()
}
fn as_node(&self) -> &dyn Node {
self
}

View file

@ -1,4 +1,4 @@
use crate::client::Client;
use crate::client::{Client};
use crate::cursor::KnownCursor;
use crate::fixed::Fixed;
use crate::ifs::wl_seat::{NodeSeatState, SeatId, WlSeatGlobal};
@ -353,6 +353,10 @@ impl Node for Xwindow {
visitor.visit_surface(&self.surface);
}
fn get_workspace(&self) -> Option<Rc<WorkspaceNode>> {
self.workspace.get()
}
fn is_contained_in(&self, other: NodeId) -> bool {
if let Some(parent) = self.parent_node.get() {
if parent.id() == other {
@ -429,10 +433,6 @@ impl ToplevelNode for Xwindow {
self.parent_node.get()
}
fn workspace(&self) -> Option<Rc<WorkspaceNode>> {
self.workspace.get()
}
fn as_node(&self) -> &dyn Node {
self
}

View file

@ -1,5 +1,5 @@
use crate::client::{Client, ClientError};
use crate::ifs::wl_seat::NodeSeatState;
use crate::ifs::wl_seat::{NodeSeatState};
use crate::ifs::wl_surface::{
CommitAction, CommitContext, SurfaceExt, SurfaceRole, WlSurface, WlSurfaceError,
};
@ -359,10 +359,6 @@ impl Node for ZwlrLayerSurfaceV1 {
self.surface.clone().visit(visitor);
}
fn render(&self, renderer: &mut Renderer, x: i32, y: i32) {
renderer.render_layer_surface(self, x, y);
}
fn absolute_position(&self) -> Rect {
self.pos.get()
}
@ -376,6 +372,10 @@ impl Node for ZwlrLayerSurfaceV1 {
self.surface.find_tree_at(x, y, tree)
}
fn render(&self, renderer: &mut Renderer, x: i32, y: i32) {
renderer.render_layer_surface(self, x, y);
}
fn change_extents(self: Rc<Self>, _rect: &Rect) {
self.compute_position();
}