aboutsummaryrefslogtreecommitdiff
path: root/sway/desktop/xdg_shell_v6.c
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-03-31 18:07:44 -0400
committeremersion <contact@emersion.fr>2018-03-31 18:07:44 -0400
commit1d68f9ecca8870f2f2a6823072c77657436b123a (patch)
treed66fbfa54f5c20f77c640bb695e43c02f2364bc3 /sway/desktop/xdg_shell_v6.c
parentb2c2ee693b6f1cdaeb204a1469c0fa1b775a498c (diff)
Add sway_view_impl
Diffstat (limited to 'sway/desktop/xdg_shell_v6.c')
-rw-r--r--sway/desktop/xdg_shell_v6.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/sway/desktop/xdg_shell_v6.c b/sway/desktop/xdg_shell_v6.c
index 77a35b13..c1adc7fe 100644
--- a/sway/desktop/xdg_shell_v6.c
+++ b/sway/desktop/xdg_shell_v6.c
@@ -67,6 +67,14 @@ static void close(struct sway_view *view) {
}
}
+static const struct sway_view_impl view_impl = {
+ .get_prop = get_prop,
+ .set_size = set_size,
+ .set_position = set_position,
+ .set_activated = set_activated,
+ .close = close,
+};
+
static void handle_commit(struct wl_listener *listener, void *data) {
struct sway_xdg_surface_v6 *sway_surface =
wl_container_of(listener, sway_surface, commit);
@@ -124,15 +132,10 @@ void handle_xdg_shell_v6_surface(struct wl_listener *listener, void *data) {
return;
}
- struct sway_view *view = view_create(SWAY_XDG_SHELL_V6_VIEW);
+ struct sway_view *view = view_create(SWAY_XDG_SHELL_V6_VIEW, &view_impl);
if (!sway_assert(view, "Failed to allocate view")) {
return;
}
- view->iface.get_prop = get_prop;
- view->iface.set_size = set_size;
- view->iface.set_position = set_position;
- view->iface.set_activated = set_activated;
- view->iface.close = close;
view->wlr_xdg_surface_v6 = xdg_surface;
view->sway_xdg_surface_v6 = sway_surface;
sway_surface->view = view;