aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Kenny Levinsen <kl@kl.wtf>2021-04-25 23:19:51 +0200
committerLibravatar Simon Ser <contact@emersion.fr>2021-06-24 18:21:29 +0200
commitee4e4bb50fbb053d838844caafd87f9ee2ef6dd1 (patch)
tree6b8f894b0cbf5ae2ac7b5c7e6da6e51cbbb60f51
parenttree/view: don't give focus to views mapped under fullscreen views (diff)
downloadsway-ee4e4bb50fbb053d838844caafd87f9ee2ef6dd1.tar.gz
sway-ee4e4bb50fbb053d838844caafd87f9ee2ef6dd1.tar.zst
sway-ee4e4bb50fbb053d838844caafd87f9ee2ef6dd1.zip
Remove usage of surface->sx|sy
These coordinates contain the all-time accumulated buffer attach point, which is a way to perform incremental client-side initiated movement of windows, intended as a way to maintain logical window positioning while compensating for layout changes such as folding in a left side panel. This value is not useful for implementing this feature, and break things if they ever become non-zero. Their inclusion in calculations also tend to cause confusion. Remove usage of these coordinates, removing the ability for clients to move themselves. This may again be supported if a better API is made available from wlroots. (cherry picked from commit 7ec9d07fc597c739760df5223469e9f15340db78)
-rw-r--r--sway/desktop/output.c4
-rw-r--r--sway/desktop/render.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c
index 6d4f5342..ab8fd7e8 100644
--- a/sway/desktop/output.c
+++ b/sway/desktop/output.c
@@ -99,8 +99,8 @@ static bool get_surface_box(struct surface_iterator_data *data,
99 int sw = surface->current.width; 99 int sw = surface->current.width;
100 int sh = surface->current.height; 100 int sh = surface->current.height;
101 101
102 double _sx = sx + surface->sx; 102 double _sx = sx;
103 double _sy = sy + surface->sy; 103 double _sy = sy;
104 rotate_child_position(&_sx, &_sy, sw, sh, data->width, data->height, 104 rotate_child_position(&_sx, &_sy, sw, sh, data->width, data->height,
105 data->rotation); 105 data->rotation);
106 106
diff --git a/sway/desktop/render.c b/sway/desktop/render.c
index a105ffba..608f3ee9 100644
--- a/sway/desktop/render.c
+++ b/sway/desktop/render.c
@@ -162,8 +162,8 @@ static void render_surface_iterator(struct sway_output *output, struct sway_view
162 struct wlr_box dst_box = *_box; 162 struct wlr_box dst_box = *_box;
163 struct sway_container *container = data->container; 163 struct sway_container *container = data->container;
164 if (container != NULL) { 164 if (container != NULL) {
165 dst_box.width = fmin(dst_box.width, container->current.content_width - surface->sx); 165 dst_box.width = fmin(dst_box.width, container->current.content_width);
166 dst_box.height = fmin(dst_box.height, container->current.content_height - surface->sy); 166 dst_box.height = fmin(dst_box.height, container->current.content_height);
167 } 167 }
168 scale_box(&dst_box, wlr_output->scale); 168 scale_box(&dst_box, wlr_output->scale);
169 169