diff options
| author | Furkan Sahin <furkan-dev@proton.me> | 2024-06-24 09:29:59 +0200 |
|---|---|---|
| committer | Furkan Sahin <furkan-dev@proton.me> | 2024-06-24 09:29:59 +0200 |
| commit | 2a772f8c55d5b2117f0540d1d6e0eef78a26a4c2 (patch) | |
| tree | debe4c92b73f5c9d3a24ad57f0ffcb7f0debbab0 | |
| parent | a1aaaf1feaf22bbdd942b8fb708766a5065bd7e2 (diff) | |
tree/view: ensure content_{width,height} is positive
The size computations may result in a zero or negative size, which
are not valid wl_surface sizes.
| -rw-r--r-- | sway/tree/view.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c index 884beec8..e9624094 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c @@ -365,8 +365,8 @@ void view_autoconfigure(struct sway_view *view) { con->pending.content_x = x; con->pending.content_y = y; - con->pending.content_width = width; - con->pending.content_height = height; + con->pending.content_width = fmax(width, 1); + con->pending.content_height = fmax(height, 1); } void view_set_activated(struct sway_view *view, bool activated) { |
