about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--client.c11
-rw-r--r--tag.c5
2 files changed, 14 insertions, 2 deletions
diff --git a/client.c b/client.c
index 24d38c3..269bf8c 100644
--- a/client.c
+++ b/client.c
@@ -187,7 +187,7 @@ killclient(Arg *arg)
 void
 manage(Window w, XWindowAttributes *wa)
 {
-	Client *c;
+	Client *c, *tc;
 	Window trans;
 	XSetWindowAttributes twa;
 
@@ -258,6 +258,15 @@ manage(Window w, XWindowAttributes *wa)
 				c->maxw == c->minw && c->maxh == c->minh);
 	settitle(c);
 
+	if(trans && (tc = getclient(trans))) {
+		c->x = (tc->x + tc->w / 2) - (c->w / 2);
+		c->y = (tc->y + tc->h / 2) - (c->h / 2);
+	}
+	else {
+		c->x = (sw / 2) - (c->w / 2);
+		c->y = ((sh - bh) / 2) - (c->h / 2) + bh;
+	}
+
 	if(isvisible(c))
 		sel = c;
 	arrange(NULL);
diff --git a/tag.c b/tag.c
index 4b6d513..841d0fc 100644
--- a/tag.c
+++ b/tag.c
@@ -281,7 +281,10 @@ void
 togglemode(Arg *arg)
 {
 	arrange = arrange == dofloat ? dotile : dofloat;
-	arrange(NULL);
+	if(sel)
+		arrange(NULL);
+	else
+		drawstatus();
 }
 
 void
Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
(define-class (complex real-part imag-part)
  (method (magnitude)
    (sqrt (+ (* real-part real-part)
	     (* imag-part imag-part))))
  (method (angle)
    (atan (/ imag-part real-part))) )

(define-class (counter)
  (instance-vars (count 0))
  (method (next)
    (set! count (+ count 1))
    count) )

(define-class (doubler)
  (method (say stuff) (se stuff stuff)))