aboutsummaryrefslogtreecommitdiff
path: root/sway/desktop/wl_shell.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2017-12-05 11:13:49 -0500
committerGitHub <noreply@github.com>2017-12-05 11:13:49 -0500
commitf2aa33ae0f6cd91b88a3f24b65e3e915c3960931 (patch)
tree7f93aba35ba5c022d3d825bd6720aa4916adba49 /sway/desktop/wl_shell.c
parent83b4c0648d75932c693b8636242202ea728035da (diff)
parent8bdf3b1b0275d53cee8538777f12461603b0a751 (diff)
Merge pull request #1500 from acrisci/feature/view-set-position
view set position
Diffstat (limited to 'sway/desktop/wl_shell.c')
-rw-r--r--sway/desktop/wl_shell.c9
1 files changed, 9 insertions, 0 deletions
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;