aboutsummaryrefslogtreecommitdiff
path: root/rootston/wl_shell.c
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2019-02-23 12:15:37 +0100
committeremersion <contact@emersion.fr>2019-02-23 12:15:37 +0100
commite86c7a3dd67f14d738b058c4aa3698e9e74958c9 (patch)
tree3b29e9ee934afcaeb5f848cc95bc6516612939c3 /rootston/wl_shell.c
parent4f66565606c8958684c00f28d0b4996904c041bc (diff)
rootston: move part of desktop.c to view.c, use an interface for views
Diffstat (limited to 'rootston/wl_shell.c')
-rw-r--r--rootston/wl_shell.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/rootston/wl_shell.c b/rootston/wl_shell.c
index 2bf4f4c2..97067937 100644
--- a/rootston/wl_shell.c
+++ b/rootston/wl_shell.c
@@ -93,6 +93,12 @@ static void destroy(struct roots_view *view) {
free(roots_surface);
}
+static const struct roots_view_interface view_impl = {
+ .resize = resize,
+ .close = close,
+ .destroy = destroy,
+};
+
static void handle_request_move(struct wl_listener *listener, void *data) {
struct roots_wl_shell_surface *roots_surface =
wl_container_of(listener, roots_surface, request_move);
@@ -251,7 +257,7 @@ void handle_wl_shell_surface(struct wl_listener *listener, void *data) {
roots_surface->surface_commit.notify = handle_surface_commit;
wl_signal_add(&surface->surface->events.commit, &roots_surface->surface_commit);
- struct roots_view *view = view_create(desktop);
+ struct roots_view *view = view_create(desktop, &view_impl);
if (!view) {
free(roots_surface);
return;
@@ -262,9 +268,6 @@ void handle_wl_shell_surface(struct wl_listener *listener, void *data) {
view->wl_shell_surface = surface;
view->roots_wl_shell_surface = roots_surface;
- view->resize = resize;
- view->close = close;
- view->destroy = destroy;
roots_surface->view = view;
view_map(view, surface->surface);