all repos — openbox @ a7c7ae09aa53c90d5dd58eb4246debb3437b86dd

openbox fork - make it a bit more like ryudo

dont let a resize get moved into a new increment by our little tricks
Dana Jansens danakj@orodu.net
commit

a7c7ae09aa53c90d5dd58eb4246debb3437b86dd

parent

6d1c4110b6b2d8ab521a1a004f5fc959948dfb04

1 files changed, 12 insertions(+), 7 deletions(-)

jump to
M src/client.ccsrc/client.cc

@@ -1071,12 +1071,19 @@ {

w -= _base_size.x(); h -= _base_size.y(); - // for interactive resizing. have to move half an increment in each - // direction. - w += _size_inc.x() / 2; - h += _size_inc.y() / 2; - if (user) { + // for interactive resizing. have to move half an increment in each + // direction. + int mw = w % _size_inc.x(); // how far we are towards the next size inc + int mh = h % _size_inc.y(); + int aw = _size_inc.x() / 2; // amount to add + int ah = _size_inc.y() / 2; + // don't let us move into a new size increment + if (mw + aw >= _size_inc.x()) aw = _size_inc.x() - mw - 1; + if (mh + ah >= _size_inc.y()) ah = _size_inc.y() - mh - 1; + w += aw; + h += ah; + // if this is a user-requested resize, then check against min/max sizes // and aspect ratios

@@ -1405,8 +1412,6 @@ if (dir == 0 || dir == 2) { // vert

y = a.y() + frame->size().top; h = a.height() - frame->size().top - frame->size().bottom; } - - printf("dir %d x %d y %d w %d h %d\n", dir, x, y, w, h); } else { long *dimensions; long unsigned n = 4;