X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=util%2Fepist%2Fwindow.cc;h=31787e6dcf6dbc52ea91c44b77976321533f808f;hb=2d5e1c55f132a0a834eb28146fe60c8e2ca8e665;hp=ba952073942b23ae77e3c6ec48bd0f3b7e51e8dd;hpb=ca316865793bc9b4f1833cb7ab90c7dfc5dd9891;p=chaz%2Fopenbox diff --git a/util/epist/window.cc b/util/epist/window.cc index ba952073..31787e6d 100644 --- a/util/epist/window.cc +++ b/util/epist/window.cc @@ -336,7 +336,18 @@ void XWindow::move(int x, int y) const { } -void XWindow::resize(unsigned int width, unsigned int height) const { +void XWindow::resizeRel(int dwidth, int dheight) const { + // resize in increments if requested by the window + unsigned int width = _rect.width(), height = _rect.height(); + + unsigned int wdest = width + (dwidth * _inc_x) / _inc_x * _inc_x + _base_x; + unsigned int hdest = height + (dheight * _inc_y) / _inc_y * _inc_y + _base_y; + + XResizeWindow(_epist->getXDisplay(), _window, wdest, hdest); +} + + +void XWindow::resizeAbs(unsigned int width, unsigned int height) const { // resize in increments if requested by the window unsigned int wdest = width / _inc_x * _inc_x + _base_x;