summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/sway/tree/view.h2
-rw-r--r--sway/tree/view.c13
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
198void view_unmap(struct sway_view *view); 198void view_unmap(struct sway_view *view);
199 199
200void view_update_position(struct sway_view *view, double ox, double oy);
201
200void view_update_size(struct sway_view *view, int width, int height); 202void view_update_size(struct sway_view *view, int width, int height);
201 203
202void view_child_init(struct sway_view_child *child, 204void view_child_init(struct sway_view_child *child,
diff --git a/sway/tree/view.c b/sway/tree/view.c
index 7d493af9..80949c89 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -349,6 +349,19 @@ void view_unmap(struct sway_view *view) {
349 arrange_children_of(parent); 349 arrange_children_of(parent);
350} 350}
351 351
352void view_update_position(struct sway_view *view, double ox, double oy) {
353 if (view->swayc->x == ox && view->swayc->y == oy) {
354 return;
355 }
356
357 // TODO: Only allow this if the view is floating (this function will only be
358 // called in response to wayland clients wanting to reposition themselves).
359 view_damage(view, true);
360 view->swayc->x = ox;
361 view->swayc->y = oy;
362 view_damage(view, true);
363}
364
352void view_update_size(struct sway_view *view, int width, int height) { 365void view_update_size(struct sway_view *view, int width, int height) {
353 if (view->width == width && view->height == height) { 366 if (view->width == width && view->height == height) {
354 return; 367 return;