aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorokan2015-06-08 15:11:29 +0000
committerokan2015-06-08 15:11:29 +0000
commita9121c4a3d2d0952061f7cf9d9f32460be6f0601 (patch)
treec1491e4efd0712eb56c6738a91f9c503ddc820b3
parent8f9657c7874a16c6c163260692f13b8105cc3c2d (diff)
downloadcwm-a9121c4a3d2d0952061f7cf9d9f32460be6f0601.tar.gz
stash window dimensions
-rw-r--r--calmwm.h6
-rw-r--r--client.c5
-rw-r--r--mousefunc.c6
3 files changed, 11 insertions, 6 deletions
diff --git a/calmwm.h b/calmwm.h
index cde8678..543254c 100644
--- a/calmwm.h
+++ b/calmwm.h
@@ -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.
*
- * $OpenBSD: calmwm.h,v 1.290 2015/06/05 15:01:51 okan Exp $
+ * $OpenBSD: calmwm.h,v 1.291 2015/06/08 15:11:29 okan Exp $
*/
#ifndef _CALMWM_H_
@@ -169,6 +169,10 @@ struct client_ctx {
int x; /* x position */
int y; /* y position */
} ptr;
+ struct {
+ int h; /* hieght */
+ int w; /* width */
+ } dim;
#define CLIENT_HIDDEN 0x0001
#define CLIENT_IGNORE 0x0002
#define CLIENT_VMAXIMIZED 0x0004
diff --git a/client.c b/client.c
index 10f1046..fa4d8a5 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.
*
- * $OpenBSD: client.c,v 1.192 2015/05/20 23:54:39 okan Exp $
+ * $OpenBSD: client.c,v 1.193 2015/06/08 15:11:29 okan Exp $
*/
#include <sys/types.h>
@@ -874,6 +874,9 @@ client_applysizehints(struct client_ctx *cc)
cc->geom.w = MAX(cc->geom.w, 1);
cc->geom.h = MAX(cc->geom.h, 1);
+
+ cc->dim.w = (cc->geom.w - cc->hint.basew) / cc->hint.incw;
+ cc->dim.h = (cc->geom.h - cc->hint.baseh) / cc->hint.inch;
}
static void
diff --git a/mousefunc.c b/mousefunc.c
index 84a2fb4..814c6f4 100644
--- a/mousefunc.c
+++ b/mousefunc.c
@@ -16,7 +16,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: mousefunc.c,v 1.89 2015/06/07 19:10:00 okan Exp $
+ * $OpenBSD: mousefunc.c,v 1.90 2015/06/08 15:11:29 okan Exp $
*/
#include <sys/types.h>
@@ -53,9 +53,7 @@ mousefunc_sweep_draw(struct client_ctx *cc)
struct screen_ctx *sc = cc->sc;
char s[14]; /* fits " nnnn x nnnn \0" */
- (void)snprintf(s, sizeof(s), " %4d x %-4d ",
- (cc->geom.w - cc->hint.basew) / cc->hint.incw,
- (cc->geom.h - cc->hint.baseh) / cc->hint.inch);
+ (void)snprintf(s, sizeof(s), " %4d x %-4d ", cc->dim.w, cc->dim.h);
XReparentWindow(X_Dpy, sc->menuwin, cc->win, 0, 0);
XMoveResizeWindow(X_Dpy, sc->menuwin, 0, 0,