aboutsummaryrefslogtreecommitdiff
path: root/src/window
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2025-02-05 10:08:56 +0300
committerIvan Molodetskikh <yalterz@gmail.com>2025-02-10 07:29:33 -0800
commitbfd81fc2904ba35ae7ccb979e8cb4b2d244fb2dd (patch)
treec455520f14e7e852aeff06778ec35cc68a93b541 /src/window
parent0dd8e883b092d4bcd735bec45c8cff3d86a4f991 (diff)
downloadniri-bfd81fc2904ba35ae7ccb979e8cb4b2d244fb2dd.tar.gz
niri-bfd81fc2904ba35ae7ccb979e8cb4b2d244fb2dd.tar.bz2
niri-bfd81fc2904ba35ae7ccb979e8cb4b2d244fb2dd.zip
Make send_frame() a function on Mapped
We'll add some extra logic there.
Diffstat (limited to 'src/window')
-rw-r--r--src/window/mapped.rs15
1 files changed, 14 insertions, 1 deletions
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<T, F>(
+ &mut self,
+ output: &Output,
+ time: T,
+ throttle: Option<Duration>,
+ primary_scan_out_output: F,
+ ) where
+ T: Into<Duration>,
+ F: FnMut(&WlSurface, &SurfaceData) -> Option<Output> + Copy,
+ {
+ self.window.send_frame(output, time, throttle, primary_scan_out_output);
+ }
}
impl Drop for Mapped {