X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=otk%2Fwidget.cc;h=0675bf6ac290f709ad8ae3d9f107c6fa1871699b;hb=f92804ec20cb51d8656887ea9a78d68a06b1f02a;hp=ca8c527aaa3a8abfe7dc91fcef98252c1a2fa1e6;hpb=1eb12ca4ad83229b0c65819a4562bb489ab74163;p=chaz%2Fopenbox diff --git a/otk/widget.cc b/otk/widget.cc index ca8c527a..0675bf6a 100644 --- a/otk/widget.cc +++ b/otk/widget.cc @@ -154,6 +154,13 @@ void Widget::setGeometry(int x, int y, int width, int height) _rect = Rect(x, y, width, height); _dirty = true; + // make all parents dirty too + Widget *p = _parent; + while (p) { + p->_dirty = true; + p = p->_parent; + } + // don't use an XMoveResizeWindow here, because it doesn't seem to move // windows with StaticGravity? This works, that didn't. XResizeWindow(**display, _window, width, height); @@ -331,7 +338,6 @@ void Widget::adjustHorz(void) prev_widget = tmp; } - internalResize(width, tallest + _bevel_width * 2); } @@ -392,7 +398,7 @@ void Widget::adjustVert(void) internalResize(widest + _bevel_width * 2, height); } -void Widget::update(void) +void Widget::update() { if (_dirty) { adjust(); @@ -411,12 +417,17 @@ void Widget::internalResize(int w, int h) { assert(w > 0 && h > 0); - if (! _fixed_width && ! _fixed_height) + bool fw = _fixed_width, fh = _fixed_height; + + if (! fw && ! fh) resize(w, h); - else if (! _fixed_width) + else if (! fw) resize(w, _rect.height()); - else if (! _fixed_height) + else if (! fh) resize(_rect.width(), h); + + _fixed_width = fw; + _fixed_height = fh; } void Widget::addChild(Widget *child, bool front)