summary refs log tree commit diff
path: root/client.c
diff options
context:
space:
mode:
authorokan <okan>2011-05-07 17:15:37 +0000
committerokan <okan>2011-05-07 17:15:37 +0000
commit43450c8fd744b85aaed80da3f6132acfd4dafd8c (patch)
tree1864a34a893025fbdab1db45e6ba5cca50215fda /client.c
parent760c6b5522626145662eb423ec77ccf4d19da584 (diff)
downloadcwm-43450c8fd744b85aaed80da3f6132acfd4dafd8c.tar.gz
cwm-43450c8fd744b85aaed80da3f6132acfd4dafd8c.tar.xz
cwm-43450c8fd744b85aaed80da3f6132acfd4dafd8c.zip
introduce a new 'freeze' flag (CMS-f by default) which may be applied to
any window, after which all move/resize requests will be ignored,
essentially freezing the window in place.

there's a possibility to merge this with the 'ignore' concept, pending
on how ignore+freeze should behave (really more ewmh stuff), but punting
for now since ponies are on the line.

requested and tested by thib at k2k11 with ponies, unicorns and rainbows.

'save the unicorns' todd@, ok oga@
Diffstat (limited to 'client.c')
-rw-r--r--client.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/client.c b/client.c
index 237c0ce..1767f44 100644
--- a/client.c
+++ b/client.c
@@ -265,12 +265,24 @@ client_current(void)
 }
 
 void
+client_freeze(struct client_ctx *cc)
+{
+	if (cc->flags & CLIENT_FREEZE)
+		cc->flags &= ~CLIENT_FREEZE;
+	else
+		cc->flags |= CLIENT_FREEZE;
+}
+
+void
 client_maximize(struct client_ctx *cc)
 {
 	struct screen_ctx	*sc = cc->sc;
 	int			 xmax = sc->xmax, ymax = sc->ymax;
 	int			 x_org = 0, y_org = 0;
 
+	if (cc->flags & CLIENT_FREEZE)
+		return;
+
 	if (cc->flags & CLIENT_MAXIMIZED) {
 		cc->geom = cc->savegeom;
 	} else {
@@ -310,6 +322,9 @@ client_vertmaximize(struct client_ctx *cc)
 	struct screen_ctx	*sc = cc->sc;
 	int			 y_org = 0, ymax = sc->ymax;
 
+	if (cc->flags & CLIENT_FREEZE)
+		return;
+
 	if (cc->flags & CLIENT_VMAXIMIZED) {
 		cc->geom = cc->savegeom;
 	} else {
@@ -341,6 +356,9 @@ client_horizmaximize(struct client_ctx *cc)
 	struct screen_ctx	*sc = cc->sc;
 	int			 x_org = 0, xmax = sc->xmax;
 
+	if (cc->flags & CLIENT_FREEZE)
+		return;
+
 	if (cc->flags & CLIENT_HMAXIMIZED) {
 		cc->geom = cc->savegeom;
 	} else {