summary refs log tree commit diff
path: root/client.c
diff options
context:
space:
mode:
authorokan <okan>2008-07-15 22:06:48 +0000
committerokan <okan>2008-07-15 22:06:48 +0000
commit8afabd6c552f16cbf487eb791e6cc480032d3b9c (patch)
tree1b0dba3b3fbc0ccda58ad5993aeff8d8a36c4809 /client.c
parent96f03c8cbc22e9df92880aa0d7a2a7cff92701b2 (diff)
downloadcwm-8afabd6c552f16cbf487eb791e6cc480032d3b9c.tar.gz
cwm-8afabd6c552f16cbf487eb791e6cc480032d3b9c.tar.xz
cwm-8afabd6c552f16cbf487eb791e6cc480032d3b9c.zip
save an X call and use what we already have stored.
ok oga@
Diffstat (limited to 'client.c')
-rw-r--r--client.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/client.c b/client.c
index c67f650..71a4a9a 100644
--- a/client.c
+++ b/client.c
@@ -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;
 	}