about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authoranselm@garbe.us <unknown>2011-11-04 20:02:35 +0100
committeranselm@garbe.us <unknown>2011-11-04 20:02:35 +0100
commite5a1e77351bb4538a1a475739a00dcb41aa35701 (patch)
tree41389e92695fb7593aa8a2cbcc5a26ac67705a7b
parent8262d9e663a98ab74b938bb5cdf0ddfd733bc5df (diff)
downloaddwm-e5a1e77351bb4538a1a475739a00dcb41aa35701.tar.gz
testing Brians multiscreen issue fix
-rw-r--r--dwm.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/dwm.c b/dwm.c
index f753bfe..58a5746 100644
--- a/dwm.c
+++ b/dwm.c
@@ -340,14 +340,14 @@ applysizehints(Client *c, int *x, int *y, int *w, int *h, Bool interact) {
 			*y = 0;
 	}
 	else {
-		if(*x > m->mx + m->mw)
-			*x = m->mx + m->mw - WIDTH(c);
-		if(*y > m->my + m->mh)
-			*y = m->my + m->mh - HEIGHT(c);
-		if(*x + *w + 2 * c->bw < m->mx)
-			*x = m->mx;
-		if(*y + *h + 2 * c->bw < m->my)
-			*y = m->my;
+		if(*x >= m->wx + m->ww)
+			*x = m->wx + m->ww - WIDTH(c);
+		if(*y >= m->wy + m->wh)
+			*y = m->wy + m->wh - HEIGHT(c);
+		if(*x + *w + 2 * c->bw <= m->wx)
+			*x = m->wx;
+		if(*y + *h + 2 * c->bw <= m->wy)
+			*y = m->wy;
 	}
 	if(*h < bh)
 		*h = bh;
@@ -1146,7 +1146,7 @@ manage(Window w, XWindowAttributes *wa) {
 			c->y = c->mon->my + c->mon->mh - HEIGHT(c);
 		c->x = MAX(c->x, c->mon->mx);
 		/* only fix client y-offset, if the client center might cover the bar */
-		c->y = MAX(c->y, ((c->mon->by == 0) && (c->x + (c->w / 2) >= c->mon->wx)
+		c->y = MAX(c->y, ((c->mon->by == c->mon->my) && (c->x + (c->w / 2) >= c->mon->wx)
 		           && (c->x + (c->w / 2) < c->mon->wx + c->mon->ww)) ? bh : c->mon->my);
 		c->bw = borderpx;
 	}
'Blame the previous revision' href='/akkartik/mu/blame/generic.mu?h=main&id=711dd36f9eb81fcd51a5fd891b7dae7e7aa53de4'>^
d4b4d018 ^


f184c95e ^


0ca35d02 ^
d4b4d018 ^
cbecfe10 ^
4b62edd8 ^
cbecfe10 ^
f184c95e ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
                                                                             
                                                            
 

                                
                                                               
                                



                                                          

  
                 


                                                               
         


                                                


   
                
                                    
                                                  
                                                
                                            
  
; To demonstrate generic functions, we'll construct a factorial function with
; separate base and recursive clauses. Compare factorial.mu.

; factorial n = n*factorial(n-1)
(function factorial [
  (default-space:space-address <- new space:literal 30:literal)
  (n:integer <- input 0:literal)
  (x:integer <- subtract n:integer 1:literal)
  (subresult:integer <- factorial x:integer)
  (result:integer <- multiply subresult:integer n:integer)
  (reply result:integer)
])

; factorial 0 = 1
(function factorial [
  (default-space:space-address <- new space:literal 30:literal)
  (n:integer <- input 0:literal)
  { begin
    (zero?:boolean <- equal n:integer 0:literal)
    (break-unless zero?:boolean)
    (reply 1:literal)
  }
])

(function main [
  (1:integer <- factorial 5:literal)
  (print-primitive-to-host (("result: " literal)))
  (print-integer nil:literal/terminal 1:integer)
  (print-primitive-to-host (("\n" literal)))
])