Limit inner gaps to sensible values

Large inner gaps can lead to broken rendering with width/height going
negative. Limit the gaps so that they never make the windows smaller
than a minimum sensible size (the same used for the resize command).

Fixes #4294
This commit is contained in:
Pedro Côrte-Real 2019-07-01 00:20:47 +01:00
parent 5c0396b3f1
commit b589767e9c
6 changed files with 33 additions and 16 deletions

View file

@ -3,6 +3,9 @@
#include <stdbool.h>
#include "list.h"
#define MIN_SANE_W 100
#define MIN_SANE_H 60
struct sway_root;
struct sway_output;
struct sway_workspace;

View file

@ -34,4 +34,9 @@ const char *sway_wl_output_subpixel_to_string(enum wl_output_subpixel subpixel);
bool set_cloexec(int fd, bool cloexec);
#undef MAX
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
#undef MIN
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#endif