Rename view's free callback to destroy

This commit is contained in:
Ryan Dwyer 2018-06-26 13:18:33 +10:00
parent 7a922c65aa
commit 50190bc760
5 changed files with 9 additions and 9 deletions

View file

@ -37,7 +37,7 @@ struct sway_view_impl {
void (*for_each_surface)(struct sway_view *view, void (*for_each_surface)(struct sway_view *view,
wlr_surface_iterator_func_t iterator, void *user_data); wlr_surface_iterator_func_t iterator, void *user_data);
void (*close)(struct sway_view *view); void (*close)(struct sway_view *view);
void (*free)(struct sway_view *view); void (*destroy)(struct sway_view *view);
}; };
struct sway_view { struct sway_view {

View file

@ -143,7 +143,7 @@ static void _close(struct sway_view *view) {
} }
} }
static void _free(struct sway_view *view) { static void destroy(struct sway_view *view) {
struct sway_xdg_shell_view *xdg_shell_view = struct sway_xdg_shell_view *xdg_shell_view =
xdg_shell_view_from_view(view); xdg_shell_view_from_view(view);
if (xdg_shell_view == NULL) { if (xdg_shell_view == NULL) {
@ -160,7 +160,7 @@ static const struct sway_view_impl view_impl = {
.wants_floating = wants_floating, .wants_floating = wants_floating,
.for_each_surface = for_each_surface, .for_each_surface = for_each_surface,
.close = _close, .close = _close,
.free = _free, .destroy = destroy,
}; };
static void handle_commit(struct wl_listener *listener, void *data) { static void handle_commit(struct wl_listener *listener, void *data) {

View file

@ -143,7 +143,7 @@ static void _close(struct sway_view *view) {
} }
} }
static void _free(struct sway_view *view) { static void destroy(struct sway_view *view) {
struct sway_xdg_shell_v6_view *xdg_shell_v6_view = struct sway_xdg_shell_v6_view *xdg_shell_v6_view =
xdg_shell_v6_view_from_view(view); xdg_shell_v6_view_from_view(view);
if (xdg_shell_v6_view == NULL) { if (xdg_shell_v6_view == NULL) {
@ -160,7 +160,7 @@ static const struct sway_view_impl view_impl = {
.wants_floating = wants_floating, .wants_floating = wants_floating,
.for_each_surface = for_each_surface, .for_each_surface = for_each_surface,
.close = _close, .close = _close,
.free = _free, .destroy = destroy,
}; };
static void handle_commit(struct wl_listener *listener, void *data) { static void handle_commit(struct wl_listener *listener, void *data) {

View file

@ -219,7 +219,7 @@ static void _close(struct sway_view *view) {
wlr_xwayland_surface_close(view->wlr_xwayland_surface); wlr_xwayland_surface_close(view->wlr_xwayland_surface);
} }
static void _free(struct sway_view *view) { static void destroy(struct sway_view *view) {
struct sway_xwayland_view *xwayland_view = xwayland_view_from_view(view); struct sway_xwayland_view *xwayland_view = xwayland_view_from_view(view);
if (xwayland_view == NULL) { if (xwayland_view == NULL) {
return; return;
@ -235,7 +235,7 @@ static const struct sway_view_impl view_impl = {
.set_fullscreen = set_fullscreen, .set_fullscreen = set_fullscreen,
.wants_floating = wants_floating, .wants_floating = wants_floating,
.close = _close, .close = _close,
.free = _free, .destroy = destroy,
}; };
static void handle_commit(struct wl_listener *listener, void *data) { static void handle_commit(struct wl_listener *listener, void *data) {

View file

@ -51,8 +51,8 @@ void view_free(struct sway_view *view) {
wlr_texture_destroy(view->marks_unfocused); wlr_texture_destroy(view->marks_unfocused);
wlr_texture_destroy(view->marks_urgent); wlr_texture_destroy(view->marks_urgent);
if (view->impl->free) { if (view->impl->destroy) {
view->impl->free(view); view->impl->destroy(view);
} else { } else {
free(view); free(view);
} }