summaryrefslogtreecommitdiff
path: root/x11-wm/afterstep-stable/files/patch-Arrange.c
blob: 9983898f945bc25ce07d0a6ef4c03587c0261773 (plain) (blame)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
$FreeBSD$

--- src/Arrange/Arrange.c.orig	Wed May 18 10:38:10 2005
+++ src/Arrange/Arrange.c	Wed May 18 10:39:48 2005
@@ -488,15 +488,14 @@
 {
 	int buf_size = 256;
 	char buf[buf_size];
-	
-	ASWindowData *wd = fetch_window_by_id( ((client_item *) data)->cl );
-	if(!wd)
-		return True;
-
 	/* used by SendNumCommand */
 	send_signed_data_type vals[2] ;	
 	send_signed_data_type units[2] ;
 
+	ASWindowData *wd = fetch_window_by_id( ((client_item *) data)->cl );
+	if(!wd)
+		return True;
+
 	if(! window_is_suitable( wd ))
 	  return True; /* Next window please */
 
@@ -550,6 +549,7 @@
 void 
 tile_windows()
 {
+	int n_groups;
 	int n_windows = 0;
 	iterate_asbidirlist( ArrangeState.clients_order,
 			     count_managed_windows, &n_windows, NULL, False);
@@ -561,7 +561,7 @@
 	if(ArrangeState.count == 0)
 	  ArrangeState.count = n_windows; /*Put all elements in one group*/
 	
-	int n_groups = n_windows / ArrangeState.count;
+	n_groups = n_windows / ArrangeState.count;
 	/* If not all windows fit in n_groups groups, an
 	 * extra group for remaining windows is needed.*/
 	if(n_windows % ArrangeState.count)
@@ -614,13 +614,12 @@
 {
 	int buf_size = 256;
 	char buf[buf_size];
+	send_signed_data_type vals[2] ;	
+	send_signed_data_type units[2] ;	
 	
 	ASWindowData *wd = fetch_window_by_id( ((client_item *) data)->cl );
 	if(!wd)
 		return True;
-
-	send_signed_data_type vals[2] ;	
-	send_signed_data_type units[2] ;	
 
 	if(! window_is_suitable( wd ))
 	  return True; /* Next window please */