aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/output.c
diff options
context:
space:
mode:
authorLibravatar emersion <contact@emersion.fr>2019-03-11 11:45:01 +0100
committerLibravatar Brian Ashworth <bosrsf04@gmail.com>2019-03-11 12:43:01 -0400
commit076257a978ce5f93b9b1613e43a067e602b5b041 (patch)
treef87dcb88bee0097cbf741df180f17d06299087cf /sway/desktop/output.c
parentFix size_t temporary underflow in log_loaded_themes (diff)
downloadsway-076257a978ce5f93b9b1613e43a067e602b5b041.tar.gz
sway-076257a978ce5f93b9b1613e43a067e602b5b041.tar.zst
sway-076257a978ce5f93b9b1613e43a067e602b5b041.zip
Stop using wlr_output->{lx,ly}
Also fixes sway_output->{lx,ly,width,height} not being updated. Also fixes output_get_in_direction adding buffer coords to layout coords.
Diffstat (limited to 'sway/desktop/output.c')
-rw-r--r--sway/desktop/output.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c
index 3ff4d726..1d9abbfd 100644
--- a/sway/desktop/output.c
+++ b/sway/desktop/output.c
@@ -150,9 +150,9 @@ void output_view_for_each_surface(struct sway_output *output,
150 .user_iterator = iterator, 150 .user_iterator = iterator,
151 .user_data = user_data, 151 .user_data = user_data,
152 .output = output, 152 .output = output,
153 .ox = view->container->current.content_x - output->wlr_output->lx 153 .ox = view->container->current.content_x - output->lx
154 - view->geometry.x, 154 - view->geometry.x,
155 .oy = view->container->current.content_y - output->wlr_output->ly 155 .oy = view->container->current.content_y - output->ly
156 - view->geometry.y, 156 - view->geometry.y,
157 .width = view->container->current.content_width, 157 .width = view->container->current.content_width,
158 .height = view->container->current.content_height, 158 .height = view->container->current.content_height,
@@ -169,9 +169,9 @@ void output_view_for_each_popup(struct sway_output *output,
169 .user_iterator = iterator, 169 .user_iterator = iterator,
170 .user_data = user_data, 170 .user_data = user_data,
171 .output = output, 171 .output = output,
172 .ox = view->container->current.content_x - output->wlr_output->lx 172 .ox = view->container->current.content_x - output->lx
173 - view->geometry.x, 173 - view->geometry.x,
174 .oy = view->container->current.content_y - output->wlr_output->ly 174 .oy = view->container->current.content_y - output->ly
175 - view->geometry.y, 175 - view->geometry.y,
176 .width = view->container->current.content_width, 176 .width = view->container->current.content_width,
177 .height = view->container->current.content_height, 177 .height = view->container->current.content_height,
@@ -202,8 +202,8 @@ void output_unmanaged_for_each_surface(struct sway_output *output,
202 wl_list_for_each(unmanaged_surface, unmanaged, link) { 202 wl_list_for_each(unmanaged_surface, unmanaged, link) {
203 struct wlr_xwayland_surface *xsurface = 203 struct wlr_xwayland_surface *xsurface =
204 unmanaged_surface->wlr_xwayland_surface; 204 unmanaged_surface->wlr_xwayland_surface;
205 double ox = unmanaged_surface->lx - output->wlr_output->lx; 205 double ox = unmanaged_surface->lx - output->lx;
206 double oy = unmanaged_surface->ly - output->wlr_output->ly; 206 double oy = unmanaged_surface->ly - output->ly;
207 207
208 output_surface_for_each_surface(output, xsurface->surface, ox, oy, 208 output_surface_for_each_surface(output, xsurface->surface, ox, oy,
209 iterator, user_data); 209 iterator, user_data);
@@ -216,8 +216,8 @@ void output_drag_icons_for_each_surface(struct sway_output *output,
216 void *user_data) { 216 void *user_data) {
217 struct sway_drag_icon *drag_icon; 217 struct sway_drag_icon *drag_icon;
218 wl_list_for_each(drag_icon, drag_icons, link) { 218 wl_list_for_each(drag_icon, drag_icons, link) {
219 double ox = drag_icon->x - output->wlr_output->lx; 219 double ox = drag_icon->x - output->lx;
220 double oy = drag_icon->y - output->wlr_output->ly; 220 double oy = drag_icon->y - output->ly;
221 221
222 if (drag_icon->wlr_drag_icon->mapped) { 222 if (drag_icon->wlr_drag_icon->mapped) {
223 output_surface_for_each_surface(output, 223 output_surface_for_each_surface(output,
@@ -463,8 +463,8 @@ void output_damage_from_view(struct sway_output *output,
463void output_damage_box(struct sway_output *output, struct wlr_box *_box) { 463void output_damage_box(struct sway_output *output, struct wlr_box *_box) {
464 struct wlr_box box; 464 struct wlr_box box;
465 memcpy(&box, _box, sizeof(struct wlr_box)); 465 memcpy(&box, _box, sizeof(struct wlr_box));
466 box.x -= output->wlr_output->lx; 466 box.x -= output->lx;
467 box.y -= output->wlr_output->ly; 467 box.y -= output->ly;
468 scale_box(&box, output->wlr_output->scale); 468 scale_box(&box, output->wlr_output->scale);
469 wlr_output_damage_add_box(output->damage, &box); 469 wlr_output_damage_add_box(output->damage, &box);
470} 470}
@@ -484,8 +484,8 @@ void output_damage_whole_container(struct sway_output *output,
484 struct sway_container *con) { 484 struct sway_container *con) {
485 // Pad the box by 1px, because the width is a double and might be a fraction 485 // Pad the box by 1px, because the width is a double and might be a fraction
486 struct wlr_box box = { 486 struct wlr_box box = {
487 .x = con->current.x - output->wlr_output->lx - 1, 487 .x = con->current.x - output->lx - 1,
488 .y = con->current.y - output->wlr_output->ly - 1, 488 .y = con->current.y - output->ly - 1,
489 .width = con->current.width + 2, 489 .width = con->current.width + 2,
490 .height = con->current.height + 2, 490 .height = con->current.height + 2,
491 }; 491 };