Skip to content

Commit

Permalink
view: Make view_for_each_surface private
Browse files Browse the repository at this point in the history
It's no longer used outside of the view.
  • Loading branch information
Nefsen402 committed Feb 22, 2022
1 parent 0cb4206 commit c975cfc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
6 changes: 0 additions & 6 deletions include/sway/tree/view.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
24 changes: 12 additions & 12 deletions sway/tree/view.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit c975cfc

Please sign in to comment.