int x, y, w, h;
/*
- * margin refers to the space between the extremities of the view and
- * wlr_surface - typically made up of decoration.
- * For xdg-shell views, the margin is typically negative.
+ * 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;
+ /*
+ * padding refers to the space between the extremities of the
+ * wlr_surface and the parts of the surface that is considered the
+ * window.
+ * This is only used for xdg-shell views with CSD where the padding
+ * area is typically invisible except for client-side drop-shawdows.
+ */
+ struct border padding;
+
struct {
bool update_x, update_y;
double x, y;
uint32_t configure_serial;
} pending_move_resize;
- int xdg_grab_offset;
-
bool server_side_deco;
struct wl_listener map;
return;
}
- new_view_geo.width -= 2 * view->xdg_grab_offset;
- new_view_geo.height -= 2 * view->xdg_grab_offset;
view_move_resize(view, new_view_geo);
}
wlr_xdg_surface_for_each_surface(view->xdg_surface, iterator, data);
}
+/* Return area between surface extremities and window */
static struct border
-xdg_shell_border(struct view *view)
+xdg_shell_padding(struct view *view)
{
struct wlr_box box;
wlr_xdg_surface_get_geometry(view->xdg_surface, &box);
if (view->server_side_deco) {
view->margin = deco_thickness(view);
} else {
- view->margin = xdg_shell_border(view);
- view->xdg_grab_offset = -view->margin.left;
+ view->padding = xdg_shell_padding(view);
}
if (istopmost(view)) {
/* align to edge of screen */
view->x += view->margin.left;
view->y += view->margin.top;
+ view->x += view->padding.left;
+ view->y += view->padding.top;
}
}
view->been_mapped = true;