diff options
-rw-r--r-- | include/sway/tree/view.h | 2 | ||||
-rw-r--r-- | sway/tree/view.c | 13 |
2 files changed, 15 insertions, 0 deletions
diff --git a/include/sway/tree/view.h b/include/sway/tree/view.h index 4395e94a..21127ab1 100644 --- a/include/sway/tree/view.h +++ b/include/sway/tree/view.h | |||
@@ -197,6 +197,8 @@ void view_map(struct sway_view *view, struct wlr_surface *wlr_surface); | |||
197 | 197 | ||
198 | void view_unmap(struct sway_view *view); | 198 | void view_unmap(struct sway_view *view); |
199 | 199 | ||
200 | void view_update_position(struct sway_view *view, double ox, double oy); | ||
201 | |||
200 | void view_update_size(struct sway_view *view, int width, int height); | 202 | void view_update_size(struct sway_view *view, int width, int height); |
201 | 203 | ||
202 | void view_child_init(struct sway_view_child *child, | 204 | void view_child_init(struct sway_view_child *child, |
diff --git a/sway/tree/view.c b/sway/tree/view.c index 4903b3a4..05a9b277 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c | |||
@@ -353,6 +353,19 @@ void view_unmap(struct sway_view *view) { | |||
353 | } | 353 | } |
354 | } | 354 | } |
355 | 355 | ||
356 | void view_update_position(struct sway_view *view, double ox, double oy) { | ||
357 | if (view->swayc->x == ox && view->swayc->y == oy) { | ||
358 | return; | ||
359 | } | ||
360 | |||
361 | // TODO: Only allow this if the view is floating (this function will only be | ||
362 | // called in response to wayland clients wanting to reposition themselves). | ||
363 | view_damage(view, true); | ||
364 | view->swayc->x = ox; | ||
365 | view->swayc->y = oy; | ||
366 | view_damage(view, true); | ||
367 | } | ||
368 | |||
356 | void view_update_size(struct sway_view *view, int width, int height) { | 369 | void view_update_size(struct sway_view *view, int width, int height) { |
357 | if (view->width == width && view->height == height) { | 370 | if (view->width == width && view->height == height) { |
358 | return; | 371 | return; |