1
0
Fork 0
forked from wry/wry

tree: refactor latch event dispatch

This commit is contained in:
Julian Orth 2024-09-11 17:46:31 +02:00
parent ada4e5a5f0
commit 01331afc6d
3 changed files with 9 additions and 4 deletions

View file

@ -174,7 +174,7 @@ impl MetalConnector {
self.latch_cursor(&node)?; self.latch_cursor(&node)?;
let cursor_programming = self.compute_cursor_programming(); let cursor_programming = self.compute_cursor_programming();
let latched = self.latch(&node); let latched = self.latch(&node);
node.schedule.latched(); node.latched();
if cursor_programming.is_none() && latched.is_none() { if cursor_programming.is_none() && latched.is_none() {
return Ok(()); return Ok(());

View file

@ -912,6 +912,7 @@ impl State {
output.global.persistent.scale.get(), output.global.persistent.scale.get(),
render_hw_cursor, render_hw_cursor,
)?; )?;
output.latched();
output.perform_screencopies(tex, !render_hw_cursor, 0, 0, None); output.perform_screencopies(tex, !render_hw_cursor, 0, 0, None);
rr.dispatch_frame_requests(self.now_msec()); rr.dispatch_frame_requests(self.now_msec());
Ok(sync_file) Ok(sync_file)

View file

@ -106,6 +106,13 @@ pub async fn output_render_data(state: Rc<State>) {
} }
impl OutputNode { impl OutputNode {
pub fn latched(&self) {
self.schedule.latched();
for listener in self.latch_event.iter() {
listener.after_latch();
}
}
pub fn update_exclusive_zones(self: &Rc<Self>) { pub fn update_exclusive_zones(self: &Rc<Self>) {
let mut exclusive = ExclusiveSize::default(); let mut exclusive = ExclusiveSize::default();
for layer in &self.layers { for layer in &self.layers {
@ -153,9 +160,6 @@ impl OutputNode {
y_off: i32, y_off: i32,
size: Option<(i32, i32)>, size: Option<(i32, i32)>,
) { ) {
for listener in self.latch_event.iter() {
listener.after_latch();
}
if let Some(workspace) = self.workspace.get() { if let Some(workspace) = self.workspace.get() {
if !workspace.may_capture.get() { if !workspace.may_capture.get() {
return; return;