aboutsummaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
authorokan2008-07-15 22:06:48 +0000
committerokan2008-07-15 22:06:48 +0000
commitf0173794de194ddd5eaddcd5af8793a3465b3bea (patch)
tree0d77c61c7521d2f960aa239489d55154d5f223b1 /client.c
parent1f287f14b64e942fe30d938a9f18ad035528c765 (diff)
downloadcwm-f0173794de194ddd5eaddcd5af8793a3465b3bea.tar.gz
save an X call and use what we already have stored.
ok oga@
Diffstat (limited to '')
-rw-r--r--client.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/client.c b/client.c
index e0a8a20..de74324 100644
--- a/client.c
+++ b/client.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $Id: client.c,v 1.36 2008/07/15 13:52:02 okan Exp $
+ * $Id: client.c,v 1.37 2008/07/15 22:06:48 okan Exp $
*/
#include "headers.h"
@@ -321,21 +321,17 @@ client_gravitate(struct client_ctx *cc, int yes)
void
client_maximize(struct client_ctx *cc)
{
+ struct screen_ctx *sc = CCTOSC(cc);
+
if (cc->flags & CLIENT_MAXIMIZED) {
cc->geom = cc->savegeom;
} else {
- XWindowAttributes rootwin_geom;
- struct screen_ctx *sc = CCTOSC(cc);
-
- XGetWindowAttributes(X_Dpy, sc->rootwin, &rootwin_geom);
if (!(cc->flags & CLIENT_VMAXIMIZED))
cc->savegeom = cc->geom;
cc->geom.x = Conf.gap_left;
cc->geom.y = Conf.gap_top;
- cc->geom.height = rootwin_geom.height -
- (Conf.gap_top + Conf.gap_bottom);
- cc->geom.width = rootwin_geom.width -
- (Conf.gap_left + Conf.gap_right);
+ cc->geom.height = sc->ymax - (Conf.gap_top + Conf.gap_bottom);
+ cc->geom.width = sc->xmax - (Conf.gap_left + Conf.gap_right);
cc->flags |= CLIENT_DOMAXIMIZE;
}