wl_subsurface: remove size from position
This commit is contained in:
parent
6998e735e0
commit
138b84032a
3 changed files with 7 additions and 10 deletions
|
|
@ -742,8 +742,7 @@ impl WlSurface {
|
||||||
if let Some(children) = self.children.borrow_mut().deref_mut() {
|
if let Some(children) = self.children.borrow_mut().deref_mut() {
|
||||||
for ss in children.subsurfaces.values() {
|
for ss in children.subsurfaces.values() {
|
||||||
let pos = ss.position.get();
|
let pos = ss.position.get();
|
||||||
ss.surface
|
ss.surface.set_absolute_position(x1 + pos.0, y1 + pos.1);
|
||||||
.set_absolute_position(x1 + pos.x1(), y1 + pos.y1());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (_, con) in &self.text_input_connections {
|
for (_, con) in &self.text_input_connections {
|
||||||
|
|
@ -878,7 +877,7 @@ impl WlSurface {
|
||||||
let ce = ss.surface.extents.get();
|
let ce = ss.surface.extents.get();
|
||||||
if !ce.is_empty() {
|
if !ce.is_empty() {
|
||||||
let cp = ss.position.get();
|
let cp = ss.position.get();
|
||||||
let ce = ce.move_(cp.x1(), cp.y1());
|
let ce = ce.move_(cp.0, cp.1);
|
||||||
extents = if extents.is_empty() {
|
extents = if extents.is_empty() {
|
||||||
ce
|
ce
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -1517,7 +1516,7 @@ impl WlSurface {
|
||||||
}
|
}
|
||||||
let pos = child.sub_surface.position.get();
|
let pos = child.sub_surface.position.get();
|
||||||
let ext = child.sub_surface.surface.extents.get();
|
let ext = child.sub_surface.surface.extents.get();
|
||||||
let ext = ext.move_(pos.x1(), pos.y1());
|
let ext = ext.move_(pos.0, pos.1);
|
||||||
if ext.contains(x, y) {
|
if ext.contains(x, y) {
|
||||||
let (x, y) = ext.translate(x, y);
|
let (x, y) = ext.translate(x, y);
|
||||||
if let Some(res) = child.sub_surface.surface.find_surface_at(x, y) {
|
if let Some(res) = child.sub_surface.surface.find_surface_at(x, y) {
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ use {
|
||||||
},
|
},
|
||||||
leaks::Tracker,
|
leaks::Tracker,
|
||||||
object::{Object, Version},
|
object::{Object, Version},
|
||||||
rect::Rect,
|
|
||||||
utils::{
|
utils::{
|
||||||
clonecell::CloneCell,
|
clonecell::CloneCell,
|
||||||
linkedlist::{LinkedNode, NodeRef},
|
linkedlist::{LinkedNode, NodeRef},
|
||||||
|
|
@ -36,7 +35,7 @@ pub struct WlSubsurface {
|
||||||
unique_id: SubsurfaceId,
|
unique_id: SubsurfaceId,
|
||||||
pub surface: Rc<WlSurface>,
|
pub surface: Rc<WlSurface>,
|
||||||
pub(super) parent: Rc<WlSurface>,
|
pub(super) parent: Rc<WlSurface>,
|
||||||
pub position: Cell<Rect>,
|
pub position: Cell<(i32, i32)>,
|
||||||
sync_requested: Cell<bool>,
|
sync_requested: Cell<bool>,
|
||||||
sync_ancestor: Cell<bool>,
|
sync_ancestor: Cell<bool>,
|
||||||
node: RefCell<Option<LinkedNode<StackElement>>>,
|
node: RefCell<Option<LinkedNode<StackElement>>>,
|
||||||
|
|
@ -137,8 +136,7 @@ impl WlSubsurface {
|
||||||
}
|
}
|
||||||
if let Some((mut x, mut y)) = pending.position.take() {
|
if let Some((mut x, mut y)) = pending.position.take() {
|
||||||
client_wire_scale_to_logical!(self.surface.client, x, y);
|
client_wire_scale_to_logical!(self.surface.client, x, y);
|
||||||
self.position
|
self.position.set((x, y));
|
||||||
.set(self.surface.buffer_abs_pos.get().at_point(x, y));
|
|
||||||
let (parent_x, parent_y) = self.parent.buffer_abs_pos.get().position();
|
let (parent_x, parent_y) = self.parent.buffer_abs_pos.get().position();
|
||||||
self.surface
|
self.surface
|
||||||
.set_absolute_position(parent_x + x, parent_y + y);
|
.set_absolute_position(parent_x + x, parent_y + y);
|
||||||
|
|
|
||||||
|
|
@ -389,12 +389,12 @@ impl Renderer<'_> {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
let pos = child.sub_surface.position.get();
|
let pos = child.sub_surface.position.get();
|
||||||
let (x1, y1) = self.base.scale_point(pos.x1(), pos.y1());
|
let (x1, y1) = self.base.scale_point(pos.0, pos.1);
|
||||||
self.render_surface_scaled(
|
self.render_surface_scaled(
|
||||||
&child.sub_surface.surface,
|
&child.sub_surface.surface,
|
||||||
x + x1,
|
x + x1,
|
||||||
y + y1,
|
y + y1,
|
||||||
Some((pos.x1(), pos.y1())),
|
Some(pos),
|
||||||
bounds,
|
bounds,
|
||||||
true,
|
true,
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue