aboutsummaryrefslogtreecommitdiff
path: root/rootston/xdg_shell_v6.c
diff options
context:
space:
mode:
Diffstat (limited to 'rootston/xdg_shell_v6.c')
-rw-r--r--rootston/xdg_shell_v6.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/rootston/xdg_shell_v6.c b/rootston/xdg_shell_v6.c
index 8d989aef..88608f95 100644
--- a/rootston/xdg_shell_v6.c
+++ b/rootston/xdg_shell_v6.c
@@ -270,6 +270,16 @@ static void destroy(struct roots_view *view) {
free(roots_xdg_surface);
}
+static const struct roots_view_interface view_impl = {
+ .activate = activate,
+ .resize = resize,
+ .move_resize = move_resize,
+ .maximize = maximize,
+ .set_fullscreen = set_fullscreen,
+ .close = close,
+ .destroy = destroy,
+};
+
static void handle_request_move(struct wl_listener *listener, void *data) {
struct roots_xdg_surface_v6 *roots_xdg_surface =
wl_container_of(listener, roots_xdg_surface, request_move);
@@ -461,14 +471,15 @@ void handle_xdg_shell_v6_surface(struct wl_listener *listener, void *data) {
wl_signal_add(&surface->toplevel->events.request_fullscreen,
&roots_surface->request_fullscreen);
roots_surface->set_title.notify = handle_set_title;
- wl_signal_add(&surface->toplevel->events.set_title, &roots_surface->set_title);
+ wl_signal_add(&surface->toplevel->events.set_title,
+ &roots_surface->set_title);
roots_surface->set_app_id.notify = handle_set_app_id;
wl_signal_add(&surface->toplevel->events.set_app_id,
&roots_surface->set_app_id);
roots_surface->new_popup.notify = handle_new_popup;
wl_signal_add(&surface->events.new_popup, &roots_surface->new_popup);
- struct roots_view *view = view_create(desktop);
+ struct roots_view *view = view_create(desktop, &view_impl);
if (!view) {
free(roots_surface);
return;
@@ -477,13 +488,6 @@ void handle_xdg_shell_v6_surface(struct wl_listener *listener, void *data) {
view->xdg_surface_v6 = surface;
view->roots_xdg_surface_v6 = roots_surface;
- view->activate = activate;
- view->resize = resize;
- view->move_resize = move_resize;
- view->maximize = maximize;
- view->set_fullscreen = set_fullscreen;
- view->close = close;
- view->destroy = destroy;
roots_surface->view = view;
if (surface->toplevel->client_pending.maximized) {