struct ssd_sub_tree active;
struct ssd_sub_tree inactive;
} border;
+
+ /*
+ * Space between the extremities of the view's wlr_surface
+ * and the max extents of the server-side decorations.
+ * For xdg-shell views with CSD, this margin is zero.
+ */
+ struct border margin;
};
struct ssd_part {
/* user defined geometry before maximize / tiling / fullscreen */
struct wlr_box natural_geometry;
- /*
- * margin refers to the space between the extremities of the
- * wlr_surface and the max extents of the server-side decorations.
- * For xdg-shell views with CSD, this margin is zero.
- */
- struct border margin;
-
struct view_pending_move_resize {
bool update_x, update_y;
int x, y;
struct wlr_box tgeom = {.x = *x, .y = *y, .width = view->w,
.height = view->h};
struct output *output;
- struct border border = view->margin;
+ struct border border = view->ssd.margin;
struct edges view_edges; /* The edges of the current view */
struct edges target_edges; /* The desired edges */
struct edges other_edges; /* The edges of the monitor/other view */
.height = view->h};
struct wlr_box tgeom = {.x = new_view_geo->x, .y = new_view_geo->y,
.width = new_view_geo->width, .height = new_view_geo->height};
- struct border border = view->margin;
+ struct border border = view->ssd.margin;
struct edges view_edges; /* The edges of the current view */
struct edges target_edges; /* The desired edges */
struct edges other_edges; /* The edges of the monitor/other view */
ssd_extents_create(view);
ssd_border_create(view);
ssd_titlebar_create(view);
- view->margin = ssd_thickness(view);
+ view->ssd.margin = ssd_thickness(view);
ssd_set_active(view, is_active);
}
if (!view->ssd.enabled) {
if (view->ssd.tree && view->ssd.tree->node.enabled) {
wlr_scene_node_set_enabled(&view->ssd.tree->node, false);
- view->margin = ssd_thickness(view);
+ view->ssd.margin = ssd_thickness(view);
}
return;
} else if (!view->ssd.tree) {
ssd_create(view);
} else if (!view->ssd.tree->node.enabled) {
wlr_scene_node_set_enabled(&view->ssd.tree->node, true);
- view->margin = ssd_thickness(view);
+ view->ssd.margin = ssd_thickness(view);
}
int width = view->w;
break;
}
struct wlr_box dst = {
- .x = x_offset + usable.x + view->margin.left,
- .y = y_offset + usable.y + view->margin.top,
- .width = base_width - view->margin.left - view->margin.right,
- .height = base_height - view->margin.top - view->margin.bottom,
+ .x = x_offset + usable.x + view->ssd.margin.left,
+ .y = y_offset + usable.y + view->ssd.margin.top,
+ .width = base_width - view->ssd.margin.left - view->ssd.margin.right,
+ .height = base_height - view->ssd.margin.top - view->ssd.margin.bottom,
};
return dst;
}
struct wlr_box usable = output_usable_area_in_layout_coords(output);
- int width = w + view->margin.left + view->margin.right;
- int height = h + view->margin.top + view->margin.bottom;
+ int width = w + view->ssd.margin.left + view->ssd.margin.right;
+ int height = h + view->ssd.margin.top + view->ssd.margin.bottom;
*x = usable.x + (usable.width - width) / 2;
*y = usable.y + (usable.height - height) / 2;
#if HAVE_XWAYLAND
/* TODO: refactor xwayland.c functions to get rid of this */
if (view->type == LAB_XWAYLAND_VIEW) {
- *x += view->margin.left;
- *y += view->margin.top;
+ *x += view->ssd.margin.left;
+ *y += view->ssd.margin.top;
}
#endif
int x = 0, y = 0;
if (!strcasecmp(direction, "left")) {
- x = usable.x + view->margin.left + rc.gap;
+ x = usable.x + view->ssd.margin.left + rc.gap;
y = view->y;
} else if (!strcasecmp(direction, "up")) {
x = view->x;
- y = usable.y + view->margin.top + rc.gap;
+ y = usable.y + view->ssd.margin.top + rc.gap;
} else if (!strcasecmp(direction, "right")) {
- x = usable.x + usable.width - view->w - view->margin.right
+ x = usable.x + usable.width - view->w - view->ssd.margin.right
- rc.gap;
y = view->y;
} else if (!strcasecmp(direction, "down")) {
x = view->x;
- y = usable.y + usable.height - view->h - view->margin.bottom
+ y = usable.y + usable.height - view->h - view->ssd.margin.bottom
- rc.gap;
} else {
wlr_log(WLR_ERROR, "invalid edge");
view->x = center_x - view->xdg_surface->current.geometry.width / 2;
view->y = center_y - view->xdg_surface->current.geometry.height / 2;
}
- view->x += view->margin.left;
- view->y += view->margin.top;
+ view->x += view->ssd.margin.left;
+ view->y += view->ssd.margin.top;
}
static const char *