diff options
author | Tony Crisci <tony@dubstepdish.com> | 2017-12-05 11:02:31 -0500 |
---|---|---|
committer | Tony Crisci <tony@dubstepdish.com> | 2017-12-05 11:02:31 -0500 |
commit | 8bdf3b1b0275d53cee8538777f12461603b0a751 (patch) | |
tree | 7f93aba35ba5c022d3d825bd6720aa4916adba49 /sway/desktop/wl_shell.c | |
parent | Merge pull request #1497 from emersion/cmd-exec (diff) | |
download | sway-8bdf3b1b0275d53cee8538777f12461603b0a751.tar.gz sway-8bdf3b1b0275d53cee8538777f12461603b0a751.tar.zst sway-8bdf3b1b0275d53cee8538777f12461603b0a751.zip |
view set position
Diffstat (limited to 'sway/desktop/wl_shell.c')
-rw-r--r-- | sway/desktop/wl_shell.c | 9 |
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) { | |||
37 | wlr_wl_shell_surface_configure(view->wlr_wl_shell_surface, 0, width, height); | 37 | wlr_wl_shell_surface_configure(view->wlr_wl_shell_surface, 0, width, height); |
38 | } | 38 | } |
39 | 39 | ||
40 | static void set_position(struct sway_view *view, double ox, double oy) { | ||
41 | if (!assert_wl_shell(view)) { | ||
42 | return; | ||
43 | } | ||
44 | view->swayc->x = ox; | ||
45 | view->swayc->y = oy; | ||
46 | } | ||
47 | |||
40 | static void handle_commit(struct wl_listener *listener, void *data) { | 48 | static void handle_commit(struct wl_listener *listener, void *data) { |
41 | struct sway_wl_shell_surface *sway_surface = | 49 | struct sway_wl_shell_surface *sway_surface = |
42 | wl_container_of(listener, sway_surface, commit); | 50 | wl_container_of(listener, sway_surface, commit); |
@@ -87,6 +95,7 @@ void handle_wl_shell_surface(struct wl_listener *listener, void *data) { | |||
87 | sway_view->type = SWAY_WL_SHELL_VIEW; | 95 | sway_view->type = SWAY_WL_SHELL_VIEW; |
88 | sway_view->iface.get_prop = get_prop; | 96 | sway_view->iface.get_prop = get_prop; |
89 | sway_view->iface.set_size = set_size; | 97 | sway_view->iface.set_size = set_size; |
98 | sway_view->iface.set_position = set_position; | ||
90 | sway_view->wlr_wl_shell_surface = shell_surface; | 99 | sway_view->wlr_wl_shell_surface = shell_surface; |
91 | sway_view->sway_wl_shell_surface = sway_surface; | 100 | sway_view->sway_wl_shell_surface = sway_surface; |
92 | sway_view->surface = shell_surface->surface; | 101 | sway_view->surface = shell_surface->surface; |