From 8ba2ab913539e7a0111dbf1953daf3531152d10b Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Tue, 4 Nov 2008 17:30:11 +0100 Subject: [PATCH] We shouldn't enforce incr when the app resizes itself. But it's so confusing. --- openbox/client.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/openbox/client.c b/openbox/client.c index fa5a979d..9e3f6fd2 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -2833,6 +2833,7 @@ void client_try_configure(ObClient *self, gint *x, gint *y, gint *w, gint *h, { gint basew, baseh, minw, minh; gint incw, inch; + gint log_w, log_h; gfloat minratio, maxratio; incw = self->fullscreen || self->max_horz ? 1 : self->size_inc.width; @@ -2873,19 +2874,22 @@ void client_try_configure(ObClient *self, gint *x, gint *y, gint *w, gint *h, *h -= baseh; /* keep to the increments */ - *w /= incw; - *h /= inch; + log_w = w / incw; + log_h = h / inch; + /* XXX this bit */ /* you cannot resize to nothing */ - if (basew + *w < 1) *w = 1 - basew; - if (baseh + *h < 1) *h = 1 - baseh; + if (basew + log_w < 1) *w = 1 - basew; + if (baseh + log_h < 1) *h = 1 - baseh; /* save the logical size */ - *logicalw = incw > 1 ? *w : *w + basew; - *logicalh = inch > 1 ? *h : *h + baseh; + *logicalw = incw > 1 ? log_w : log_w + basew; + *logicalh = inch > 1 ? log_h : log_h + baseh; - *w *= incw; - *h *= inch; + if (user) { + *w = log_w * incw; + *h = log_h * inch; + } *w += basew; *h += baseh; -- 2.34.1