From 8bdf3b1b0275d53cee8538777f12461603b0a751 Mon Sep 17 00:00:00 2001 From: Tony Crisci Date: Tue, 5 Dec 2017 11:02:31 -0500 Subject: view set position --- sway/desktop/wl_shell.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'sway/desktop/wl_shell.c') diff --git a/sway/desktop/wl_shell.c b/sway/desktop/wl_shell.c index 9641b911..b2e026ef 100644 --- a/sway/desktop/wl_shell.c +++ b/sway/desktop/wl_shell.c @@ -37,6 +37,14 @@ static void set_size(struct sway_view *view, int width, int height) { wlr_wl_shell_surface_configure(view->wlr_wl_shell_surface, 0, width, height); } +static void set_position(struct sway_view *view, double ox, double oy) { + if (!assert_wl_shell(view)) { + return; + } + view->swayc->x = ox; + view->swayc->y = oy; +} + static void handle_commit(struct wl_listener *listener, void *data) { struct sway_wl_shell_surface *sway_surface = wl_container_of(listener, sway_surface, commit); @@ -87,6 +95,7 @@ void handle_wl_shell_surface(struct wl_listener *listener, void *data) { sway_view->type = SWAY_WL_SHELL_VIEW; sway_view->iface.get_prop = get_prop; sway_view->iface.set_size = set_size; + sway_view->iface.set_position = set_position; sway_view->wlr_wl_shell_surface = shell_surface; sway_view->sway_wl_shell_surface = sway_surface; sway_view->surface = shell_surface->surface; -- cgit v1.2.3