shell: Send frame callbacks to grabbed windows

This commit is contained in:
Victoria Brekenfeld 2023-02-13 17:56:13 +01:00
parent 4a9dfcead0
commit f93258bd98
2 changed files with 27 additions and 2 deletions

View file

@ -23,9 +23,11 @@ use smithay::{
Seat,
},
output::Output,
reexports::wayland_server::protocol::wl_surface::WlSurface,
utils::{IsAlive, Logical, Point, Rectangle, Serial},
wayland::compositor::SurfaceData,
};
use std::cell::RefCell;
use std::{cell::RefCell, time::Duration};
pub type SeatMoveGrabState = RefCell<Option<MoveGrabState>>;
@ -62,6 +64,18 @@ impl MoveGrabState {
scale,
)
}
pub fn send_frames(
&self,
output: &Output,
time: impl Into<Duration>,
throttle: Option<Duration>,
primary_scan_out_output: impl FnMut(&WlSurface, &SurfaceData) -> Option<Output> + Copy,
) {
self.window
.active_window()
.send_frame(output, time, throttle, primary_scan_out_output)
}
}
pub struct MoveSurfaceGrab {