From c975cfc5b7e458355f572ad84713dfe9b46cf535 Mon Sep 17 00:00:00 2001 From: Alexander Orzechowski Date: Mon, 21 Feb 2022 17:06:18 -0500 Subject: [PATCH] view: Make view_for_each_surface private It's no longer used outside of the view. --- include/sway/tree/view.h | 6 ------ sway/tree/view.c | 24 ++++++++++++------------ 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h index ed5a09716b..b786fbd2d0 100644 --- a/include/sway/tree/view.h +++ b/include/sway/tree/view.h @@ -262,12 +262,6 @@ void view_close(struct sway_view *view); void view_close_popups(struct sway_view *view); -/** - * Iterate all surfaces of a view (toplevels + popups). - */ -void view_for_each_surface(struct sway_view *view, - wlr_surface_iterator_func_t iterator, void *user_data); - /** * Iterate all popup surfaces of a view. */ diff --git a/sway/tree/view.c b/sway/tree/view.c index 49bd90bd03..170e618d20 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c @@ -430,18 +430,6 @@ void view_close_popups(struct sway_view *view) { } } -void view_for_each_surface(struct sway_view *view, - wlr_surface_iterator_func_t iterator, void *user_data) { - if (!view->surface) { - return; - } - if (view->impl->for_each_surface) { - view->impl->for_each_surface(view, iterator, user_data); - } else { - wlr_surface_for_each_surface(view->surface, iterator, user_data); - } -} - static bool view_has_executed_criteria(struct sway_view *view, struct criteria *criteria) { for (int i = 0; i < view->executed_criteria->length; ++i) { @@ -1163,6 +1151,18 @@ static void view_save_buffer_iterator(struct wlr_surface *surface, } } +static void view_for_each_surface(struct sway_view *view, + wlr_surface_iterator_func_t iterator, void *user_data) { + if (!view->surface) { + return; + } + if (view->impl->for_each_surface) { + view->impl->for_each_surface(view, iterator, user_data); + } else { + wlr_surface_for_each_surface(view->surface, iterator, user_data); + } +} + void view_save_buffer(struct sway_view *view) { if (!sway_assert(!view->saved_surface_node, "Didn't expect saved buffer")) { view_remove_saved_buffer(view);