view: add/improve some comments

This commit is contained in:
John Lindgren 2026-02-24 11:29:00 -05:00 committed by Hiroaki Yamamoto
parent 3f223fe5b0
commit df73a97efa
4 changed files with 31 additions and 7 deletions

View file

@ -652,7 +652,11 @@ view_compute_near_cursor_position(struct view *view, struct wlr_box *geom)
int x = (int)seat->cursor->x - (total_width / 2);
int y = (int)seat->cursor->y - (total_height / 2);
/* Order of MIN/MAX is significant here */
/*
* Order of MIN/MAX is significant here (so that the top-left
* corner of the view remains visible even if the view is larger
* than the usable output area)
*/
x = MIN(x, usable.x + usable.width - total_width);
geom->x = MAX(x, usable.x) + margin.left;
y = MIN(y, usable.y + usable.height - total_height);