diff options
author | 2024-06-24 09:29:59 +0200 | |
---|---|---|
committer | 2024-06-25 09:32:46 -0400 | |
commit | fce8de0f672e3c205dbbb0eb9a55d4bc05ff66ad (patch) | |
tree | debe4c92b73f5c9d3a24ad57f0ffcb7f0debbab0 | |
parent | tree/view: set default min size to 1×1 (diff) | |
download | sway-fce8de0f672e3c205dbbb0eb9a55d4bc05ff66ad.tar.gz sway-fce8de0f672e3c205dbbb0eb9a55d4bc05ff66ad.tar.zst sway-fce8de0f672e3c205dbbb0eb9a55d4bc05ff66ad.zip |
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) { | |||
365 | 365 | ||
366 | con->pending.content_x = x; | 366 | con->pending.content_x = x; |
367 | con->pending.content_y = y; | 367 | con->pending.content_y = y; |
368 | con->pending.content_width = width; | 368 | con->pending.content_width = fmax(width, 1); |
369 | con->pending.content_height = height; | 369 | con->pending.content_height = fmax(height, 1); |
370 | } | 370 | } |
371 | 371 | ||
372 | void view_set_activated(struct sway_view *view, bool activated) { | 372 | void view_set_activated(struct sway_view *view, bool activated) { |