Add comments to functions that iterate over surfaces

These should be kept in sync with `render_input_order_internal`.
This commit is contained in:
Ian Douglas Scott 2026-09-08 15:20:10 -07:00 • committed by Jeremy Soller
parent a55785993e
commit f9e02f4321
3 changed files with 10 additions and 0 deletions

View file

@ -77,6 +77,8 @@ fn render_input_order_internal<R: 'static>(
element_filter: ElementFilter, element_filter: ElementFilter,
mut callback: impl FnMut(Stage) -> ControlFlow<Result<R, OutputNoMode>, ()>, mut callback: impl FnMut(Stage) -> ControlFlow<Result<R, OutputNoMode>, ()>,
) -> ControlFlow<Result<R, OutputNoMode>, ()> { ) -> ControlFlow<Result<R, OutputNoMode>, ()> {
// NOTE: Keep in sync with other surface iteration functions
if shell if shell
.zoom_state .zoom_state
.as_ref() .as_ref()

View file

@ -2046,6 +2046,8 @@ impl Shell {
} }
pub fn visible_output_for_surface(&self, surface: &WlSurface) -> Option<&Output> { pub fn visible_output_for_surface(&self, surface: &WlSurface) -> Option<&Output> {
// NOTE: Keep in sync with surface iteration in `render_input_order_internal`
if let Some(session_lock) = &self.session_lock { if let Some(session_lock) = &self.session_lock {
return session_lock return session_lock
.surfaces .surfaces

View file

@ -968,6 +968,8 @@ impl Common {
output: &Output, output: &Output,
render_element_states: &RenderElementStates, render_element_states: &RenderElementStates,
) { ) {
// NOTE: Keep in sync with surface iteration in `render_input_order_internal`
let shell = self.shell.read(); let shell = self.shell.read();
let processor = |namespace: Option<usize>| { let processor = |namespace: Option<usize>| {
move |surface: &WlSurface, states: &SurfaceData| { move |surface: &WlSurface, states: &SurfaceData| {
@ -1074,6 +1076,8 @@ impl Common {
render_element_states: &RenderElementStates, render_element_states: &RenderElementStates,
mut dmabuf_feedback: impl FnMut(DrmNode) -> Option<SurfaceDmabufFeedback>, mut dmabuf_feedback: impl FnMut(DrmNode) -> Option<SurfaceDmabufFeedback>,
) { ) {
// NOTE: Keep in sync with surface iteration in `render_input_order_internal`
let shell = self.shell.read(); let shell = self.shell.read();
if let Some(session_lock) = shell.session_lock.as_ref() if let Some(session_lock) = shell.session_lock.as_ref()
@ -1287,6 +1291,8 @@ impl Common {
#[profiling::function] #[profiling::function]
pub fn send_frames(&self, output: &Output, sequence: Option<usize>) { pub fn send_frames(&self, output: &Output, sequence: Option<usize>) {
// NOTE: Keep in sync with surface iteration in `render_input_order_internal`
let time = self.clock.now(); let time = self.clock.now();
let should_send = |surface: &WlSurface, states: &SurfaceData| { let should_send = |surface: &WlSurface, states: &SurfaceData| {
// Do the standard primary scanout output check. For pointer surfaces it deduplicates // Do the standard primary scanout output check. For pointer surfaces it deduplicates