From bfd81fc2904ba35ae7ccb979e8cb4b2d244fb2dd Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Wed, 5 Feb 2025 10:08:56 +0300 Subject: Make send_frame() a function on Mapped We'll add some extra logic there. --- src/window/mapped.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/window') diff --git a/src/window/mapped.rs b/src/window/mapped.rs index 2a1764f8..75bb5a06 100644 --- a/src/window/mapped.rs +++ b/src/window/mapped.rs @@ -13,7 +13,7 @@ use smithay::reexports::wayland_protocols::xdg::shell::server::xdg_toplevel; use smithay::reexports::wayland_server::protocol::wl_surface::WlSurface; use smithay::reexports::wayland_server::Resource as _; use smithay::utils::{Logical, Point, Rectangle, Scale, Serial, Size, Transform}; -use smithay::wayland::compositor::{remove_pre_commit_hook, with_states, HookId}; +use smithay::wayland::compositor::{remove_pre_commit_hook, with_states, HookId, SurfaceData}; use smithay::wayland::seat::WaylandFocus; use smithay::wayland::shell::xdg::{SurfaceCachedState, ToplevelSurface}; use wayland_backend::server::Credentials; @@ -413,6 +413,19 @@ impl Mapped { WindowCastRenderElements::from(elem) }) } + + pub fn send_frame( + &mut self, + output: &Output, + time: T, + throttle: Option, + primary_scan_out_output: F, + ) where + T: Into, + F: FnMut(&WlSurface, &SurfaceData) -> Option + Copy, + { + self.window.send_frame(output, time, throttle, primary_scan_out_output); + } } impl Drop for Mapped { -- cgit