1
0
Fork 0
forked from wry/wry

tree: access outputs via root node

This commit is contained in:
Julian Orth 2024-04-25 15:13:29 +02:00
parent b5f1166360
commit fa3d870935
9 changed files with 31 additions and 30 deletions

View file

@ -90,8 +90,8 @@ impl ExtSessionLockV1RequestHandler for ExtSessionLockV1 {
let state = &self.client.state;
state.lock.locked.set(false);
state.lock.lock.take();
for output in state.outputs.lock().values() {
if let Some(surface) = output.node.set_lock_surface(None) {
for output in state.root.outputs.lock().values() {
if let Some(surface) = output.set_lock_surface(None) {
surface.destroy_node();
}
}

View file

@ -220,8 +220,8 @@ impl JayCompositorRequestHandler for JayCompositor {
if let Some(lock) = state.lock.lock.take() {
lock.finish();
}
for output in state.outputs.lock().values() {
if let Some(surface) = output.node.set_lock_surface(None) {
for output in state.root.outputs.lock().values() {
if let Some(surface) = output.set_lock_surface(None) {
surface.destroy_node();
}
}

View file

@ -596,10 +596,10 @@ impl WlSeatGlobal {
self.update_hardware_cursor_position();
self.trigger_tree_changed();
let output = 'set_output: {
let outputs = self.state.outputs.lock();
let outputs = self.state.root.outputs.lock();
for output in outputs.values() {
if output.node.global.pos.get().contains(x, y) {
break 'set_output output.node.clone();
if output.global.pos.get().contains(x, y) {
break 'set_output output.clone();
}
}
self.state.dummy_output.get().unwrap()

View file

@ -241,12 +241,12 @@ impl WlSeatGlobal {
mut x: Fixed,
mut y: Fixed,
) {
let output = match self.state.outputs.get(&connector) {
let output = match self.state.root.outputs.get(&connector) {
Some(o) => o,
_ => return,
};
self.set_output(&output.node);
let pos = output.node.global.pos.get();
self.set_output(&output);
let pos = output.global.pos.get();
x += Fixed::from_int(pos.x1());
y += Fixed::from_int(pos.y1());
if let Some(c) = self.constraint.get() {
@ -314,10 +314,10 @@ impl WlSeatGlobal {
let mut y_int = y.round_down();
if !pos.contains(x_int, y_int) {
'warp: {
let outputs = self.state.outputs.lock();
let outputs = self.state.root.outputs.lock();
for output in outputs.values() {
if output.node.global.pos.get().contains(x_int, y_int) {
self.set_output(&output.node);
if output.global.pos.get().contains(x_int, y_int) {
self.set_output(output);
break 'warp;
}
}

View file

@ -65,9 +65,9 @@ impl ZwlrLayerShellV1RequestHandler for ZwlrLayerShellV1 {
break 'get_output output.global.opt.clone();
}
}
let outputs = self.client.state.outputs.lock();
let outputs = self.client.state.root.outputs.lock();
if let Some(output) = outputs.values().next() {
break 'get_output output.node.global.opt.clone();
break 'get_output output.global.opt.clone();
}
return Err(ZwlrLayerShellV1Error::NoOutputs);
}