aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/render.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-11-17 18:32:03 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-11-17 21:29:42 +1000
commitbe9348d25c9556bdabb83d964a8761f920fc4a11 (patch)
treec06bde3d10e9bfea04acdd9b055cd596f13d4522 /sway/desktop/render.c
parentMerge pull request #3132 from emersion/dispatch-cursor-btn-segfault (diff)
downloadsway-be9348d25c9556bdabb83d964a8761f920fc4a11.tar.gz
sway-be9348d25c9556bdabb83d964a8761f920fc4a11.tar.zst
sway-be9348d25c9556bdabb83d964a8761f920fc4a11.zip
Move view {x,y,width,height} into container struct
This renames/moves the following properties: * sway_view.{x,y,width,height} -> sway_container.content_{x,y,width,height} * This is required to support placeholder containers as they don't have a view. * sway_container_state.view_{x,y,width,height} -> sway_container_state.content_{x,y,width,height} * To remain consistent with the above. * sway_container_state.con_{x,y,width,height} -> sway_container_state.{x,y,width,height} * The con prefix was there to give it contrast from the view properties, and is no longer useful. The function container_set_geometry_from_floating_view has also been renamed to container_set_geometry_from_content.
Diffstat (limited to 'sway/desktop/render.c')
-rw-r--r--sway/desktop/render.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/sway/desktop/render.c b/sway/desktop/render.c
index 1b3b29e7..93e196bb 100644
--- a/sway/desktop/render.c
+++ b/sway/desktop/render.c
@@ -211,9 +211,9 @@ static void render_view_toplevels(struct sway_view *view,
211 .alpha = alpha, 211 .alpha = alpha,
212 }; 212 };
213 // Render all toplevels without descending into popups 213 // Render all toplevels without descending into popups
214 double ox = view->container->current.view_x - 214 double ox = view->container->current.content_x -
215 output->wlr_output->lx - view->geometry.x; 215 output->wlr_output->lx - view->geometry.x;
216 double oy = view->container->current.view_y - 216 double oy = view->container->current.content_y -
217 output->wlr_output->ly - view->geometry.y; 217 output->wlr_output->ly - view->geometry.y;
218 output_surface_for_each_surface(output, view->surface, ox, oy, 218 output_surface_for_each_surface(output, view->surface, ox, oy,
219 render_surface_iterator, &data); 219 render_surface_iterator, &data);
@@ -247,9 +247,9 @@ static void render_saved_view(struct sway_view *view,
247 return; 247 return;
248 } 248 }
249 struct wlr_box box = { 249 struct wlr_box box = {
250 .x = view->container->current.view_x - output->wlr_output->lx - 250 .x = view->container->current.content_x - output->wlr_output->lx -
251 view->saved_geometry.x, 251 view->saved_geometry.x,
252 .y = view->container->current.view_y - output->wlr_output->ly - 252 .y = view->container->current.content_y - output->wlr_output->ly -
253 view->saved_geometry.y, 253 view->saved_geometry.y,
254 .width = view->saved_buffer_width, 254 .width = view->saved_buffer_width,
255 .height = view->saved_buffer_height, 255 .height = view->saved_buffer_height,
@@ -300,10 +300,10 @@ static void render_view(struct sway_output *output, pixman_region32_t *damage,
300 if (state->border_left) { 300 if (state->border_left) {
301 memcpy(&color, colors->child_border, sizeof(float) * 4); 301 memcpy(&color, colors->child_border, sizeof(float) * 4);
302 premultiply_alpha(color, con->alpha); 302 premultiply_alpha(color, con->alpha);
303 box.x = state->con_x; 303 box.x = state->x;
304 box.y = state->view_y; 304 box.y = state->content_y;
305 box.width = state->border_thickness; 305 box.width = state->border_thickness;
306 box.height = state->view_height; 306 box.height = state->content_height;
307 scale_box(&box, output_scale); 307 scale_box(&box, output_scale);
308 render_rect(output->wlr_output, damage, &box, color); 308 render_rect(output->wlr_output, damage, &box, color);
309 } 309 }
@@ -319,10 +319,10 @@ static void render_view(struct sway_output *output, pixman_region32_t *damage,
319 memcpy(&color, colors->child_border, sizeof(float) * 4); 319 memcpy(&color, colors->child_border, sizeof(float) * 4);
320 } 320 }
321 premultiply_alpha(color, con->alpha); 321 premultiply_alpha(color, con->alpha);
322 box.x = state->view_x + state->view_width; 322 box.x = state->content_x + state->content_width;
323 box.y = state->view_y; 323 box.y = state->content_y;
324 box.width = state->border_thickness; 324 box.width = state->border_thickness;
325 box.height = state->view_height; 325 box.height = state->content_height;
326 scale_box(&box, output_scale); 326 scale_box(&box, output_scale);
327 render_rect(output->wlr_output, damage, &box, color); 327 render_rect(output->wlr_output, damage, &box, color);
328 } 328 }
@@ -334,9 +334,9 @@ static void render_view(struct sway_output *output, pixman_region32_t *damage,
334 memcpy(&color, colors->child_border, sizeof(float) * 4); 334 memcpy(&color, colors->child_border, sizeof(float) * 4);
335 } 335 }
336 premultiply_alpha(color, con->alpha); 336 premultiply_alpha(color, con->alpha);
337 box.x = state->con_x; 337 box.x = state->x;
338 box.y = state->view_y + state->view_height; 338 box.y = state->content_y + state->content_height;
339 box.width = state->con_width; 339 box.width = state->width;
340 box.height = state->border_thickness; 340 box.height = state->border_thickness;
341 scale_box(&box, output_scale); 341 scale_box(&box, output_scale);
342 render_rect(output->wlr_output, damage, &box, color); 342 render_rect(output->wlr_output, damage, &box, color);
@@ -585,9 +585,9 @@ static void render_top_border(struct sway_output *output,
585 // Child border - top edge 585 // Child border - top edge
586 memcpy(&color, colors->child_border, sizeof(float) * 4); 586 memcpy(&color, colors->child_border, sizeof(float) * 4);
587 premultiply_alpha(color, con->alpha); 587 premultiply_alpha(color, con->alpha);
588 box.x = state->con_x; 588 box.x = state->x;
589 box.y = state->con_y; 589 box.y = state->y;
590 box.width = state->con_width; 590 box.width = state->width;
591 box.height = state->border_thickness; 591 box.height = state->border_thickness;
592 scale_box(&box, output_scale); 592 scale_box(&box, output_scale);
593 render_rect(output->wlr_output, output_damage, &box, color); 593 render_rect(output->wlr_output, output_damage, &box, color);
@@ -641,8 +641,8 @@ static void render_containers_linear(struct sway_output *output,
641 } 641 }
642 642
643 if (state->border == B_NORMAL) { 643 if (state->border == B_NORMAL) {
644 render_titlebar(output, damage, child, state->con_x, 644 render_titlebar(output, damage, child, state->x,
645 state->con_y, state->con_width, colors, 645 state->y, state->width, colors,
646 title_texture, marks_texture); 646 title_texture, marks_texture);
647 } else if (state->border == B_PIXEL) { 647 } else if (state->border == B_PIXEL) {
648 render_top_border(output, damage, child, colors); 648 render_top_border(output, damage, child, colors);
@@ -696,7 +696,7 @@ static void render_containers_tabbed(struct sway_output *output,
696 marks_texture = child->marks_unfocused; 696 marks_texture = child->marks_unfocused;
697 } 697 }
698 698
699 int x = cstate->con_x + tab_width * i; 699 int x = cstate->x + tab_width * i;
700 700
701 // Make last tab use the remaining width of the parent 701 // Make last tab use the remaining width of the parent
702 if (i == parent->children->length - 1) { 702 if (i == parent->children->length - 1) {
@@ -801,10 +801,10 @@ static void render_container(struct sway_output *output,
801 struct parent_data data = { 801 struct parent_data data = {
802 .layout = con->current.layout, 802 .layout = con->current.layout,
803 .box = { 803 .box = {
804 .x = con->current.con_x, 804 .x = con->current.x,
805 .y = con->current.con_y, 805 .y = con->current.y,
806 .width = con->current.con_width, 806 .width = con->current.width,
807 .height = con->current.con_height, 807 .height = con->current.height,
808 }, 808 },
809 .children = con->current.children, 809 .children = con->current.children,
810 .focused = focused, 810 .focused = focused,
@@ -853,8 +853,8 @@ static void render_floating_container(struct sway_output *soutput,
853 } 853 }
854 854
855 if (con->current.border == B_NORMAL) { 855 if (con->current.border == B_NORMAL) {
856 render_titlebar(soutput, damage, con, con->current.con_x, 856 render_titlebar(soutput, damage, con, con->current.x,
857 con->current.con_y, con->current.con_width, colors, 857 con->current.y, con->current.width, colors,
858 title_texture, marks_texture); 858 title_texture, marks_texture);
859 } else if (con->current.border == B_PIXEL) { 859 } else if (con->current.border == B_PIXEL) {
860 render_top_border(soutput, damage, con, colors); 860 render_top_border(soutput, damage, con, colors);