From: Mikael Magnusson Date: Sun, 11 Aug 2013 12:09:41 +0000 (+0200) Subject: Only enforce resize incr for user resizes X-Git-Tag: mikabox-3.5-7~22 X-Git-Url: http://git.openbox.org/?p=mikachu%2Fopenbox.git;a=commitdiff_plain;h=cf06a0c7beb12b58f9dd53ee5d58ed0862b59d5c Only enforce resize incr for user resizes When you toggle the scrollbar in urxvt, it resizes itself and may race with the hint that updates the base size, resulting in the terminal area shrinking. --- diff --git a/openbox/client.c b/openbox/client.c index d0feb7c..3d34556 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -3058,7 +3058,9 @@ void client_try_configure(ObClient *self, gint *x, gint *y, gint *w, gint *h, through this code */ { gint basew, baseh, minw, minh; - gint incw, inch, maxw, maxh; + gint incw, inch; + gint logw, logh; + gint maxw, maxh; gfloat minratio, maxratio; incw = self->size_inc.width; @@ -3102,20 +3104,22 @@ void client_try_configure(ObClient *self, gint *x, gint *y, gint *w, gint *h, maxw = *w; maxh = *h; - /* keep to the increments */ - *w /= incw; - *h /= inch; + /* keep to the increments, but only use this if the user did it */ + logw = *w / incw; + logh = *h / inch; /* you cannot resize to nothing */ - if (basew + *w < 1) *w = 1 - basew; - if (baseh + *h < 1) *h = 1 - baseh; + if (basew + logw < 1) *w = 1 - basew; + if (baseh + logh < 1) *h = 1 - baseh; /* save the logical size */ - *logicalw = incw > 1 ? *w : *w + basew; - *logicalh = inch > 1 ? *h : *h + baseh; + *logicalw = incw > 1 ? logw : logw + basew; + *logicalh = inch > 1 ? logh : logh + baseh; - *w *= incw; - *h *= inch; + if (user) { + *w = logw * incw; + *h = logh * inch; + } /* if maximized/fs then don't use the size increments */ if (self->fullscreen || self->max_horz) *w = maxw;