X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=util%2Fepist%2Fwindow.cc;h=31787e6dcf6dbc52ea91c44b77976321533f808f;hb=027dbd1c2032ea29f291d2e710f5743cf6fda22a;hp=695322729ad0288f20772f97b2cc16ebdfc1ff72;hpb=fa34ea5250511e37180ea2ddd85919516f25248d;p=chaz%2Fopenbox diff --git a/util/epist/window.cc b/util/epist/window.cc index 69532272..31787e6d 100644 --- a/util/epist/window.cc +++ b/util/epist/window.cc @@ -235,7 +235,6 @@ void XWindow::iconify() const { void XWindow::focus() const { - cout << "Focusing window: 0x" << hex << _window << dec << endl; // this will cause the window to be uniconified also _xatom->sendClientMessage(_screen->rootWindow(), XAtom::net_active_window, _window); @@ -337,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;