]> Dogcows Code - chaz/openbox/blobdiff - util/epist/window.cc
add manpages for epist and for xftlsfonts
[chaz/openbox] / util / epist / window.cc
index c8cdf012a4cca4d5e82b3c82302045a2571a4428..48df206c989b9c9dc18319fe4ae5e643e666e1bc 100644 (file)
@@ -1,5 +1,5 @@
 // -*- mode: C++; indent-tabs-mode: nil; -*-
-// window.cc for Epistophy - a key handler for NETWM/EWMH window managers.
+// window.cc for Epistrophy - a key handler for NETWM/EWMH window managers.
 // Copyright (c) 2002 - 2002 Ben Jansens <ben at orodu.net>
 //
 // Permission is hereby granted, free of charge, to any person obtaining a
@@ -336,34 +336,18 @@ void XWindow::move(int x, int y) const {
 }
 
 
-void XWindow::resize(int dwidth, int dheight) const {
+void XWindow::resizeRel(int dwidth, int dheight) const {
   // resize in increments if requested by the window
-
-  unsigned int wdest = _rect.width() + (dwidth * _inc_x) /
-                       _inc_x * _inc_x + _base_x;
-  unsigned int hdest = _rect.height() + (dheight * _inc_y) /
-                       _inc_y * _inc_y + _base_y;
-
-  if (width > wdest) {
-    while (width > wdest)
-      wdest += _inc_x;
-  } else {
-    while (width < wdest)
-      wdest -= _inc_x;
-  }
-  if (height > hdest) {
-    while (height > hdest)
-      hdest += _inc_y;
-  } else {
-    while (height < hdest)
-      hdest -= _inc_y;
-  }
+  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::resize(unsigned int width, unsigned int height) const {
+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;
This page took 0.023542 seconds and 4 git commands to generate.