From ec726078c09a7f148bf02af948e7e5170ccab967 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Sun, 22 Mar 2015 14:00:25 +0100 Subject: [PATCH] Forgot to check base size is set before using for ratio check This resulted in ratio checks for mplayer2 and mpv being off by one. --- openbox/client.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/openbox/client.c b/openbox/client.c index 1e70398..f7798a8 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -3134,8 +3134,10 @@ void client_try_configure(ObClient *self, gint *x, gint *y, gint *w, gint *h, /* adjust the height to match the width for the aspect ratios. for this, min size is not substituted for base size ever. */ - *w -= self->base_size.width; - *h -= self->base_size.height; + if (self->base_size.width >= 0 && self->base_size.height >= 0) { + *w -= self->base_size.width; + *h -= self->base_size.height; + } if (minratio) if (*h * minratio > *w) { @@ -3158,8 +3160,10 @@ void client_try_configure(ObClient *self, gint *x, gint *y, gint *w, gint *h, } } - *w += self->base_size.width; - *h += self->base_size.height; + if (self->base_size.width >= 0 && self->base_size.height >= 0) { + *w += self->base_size.width; + *h += self->base_size.height; + } } /* these override the above states! if you cant move you can't move! */ -- 1.9.1