From 6411aa921baabd11bfa55eb708bb804dfc6b1375 Mon Sep 17 00:00:00 2001 From: Anselm R Garbe Date: Mon, 25 Aug 2008 09:37:39 +0100 Subject: reverted some resize() changes, reverted setlocale removal --- dwm.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'dwm.c') diff --git a/dwm.c b/dwm.c index ae2952b..4ea16e0 100644 --- a/dwm.c +++ b/dwm.c @@ -24,6 +24,7 @@ * To understand everything else, start reading main(). */ #include +#include #include #include #include @@ -1046,7 +1047,6 @@ quit(const Arg *arg) { void resize(Client *c, int x, int y, int w, int h, Bool sizehints) { - float a; XWindowChanges wc; if(sizehints) { @@ -1064,11 +1064,10 @@ resize(Client *c, int x, int y, int w, int h, Bool sizehints) { /* adjust for aspect limits */ if(c->mina > 0 && c->maxa > 0) { - a = (float) w/h; - if(a > c->maxa) + if(c->maxa < (float)(w / h)) w = h * c->maxa; - else if(a < c->mina) - h = w / c->mina; + else if(c->mina < (float)(h / w)) + h = w * c->mina; } if(baseismin) { /* increment calculation requires this */ @@ -1712,7 +1711,7 @@ main(int argc, char *argv[]) { else if(argc != 1) die("usage: dwm [-v]\n"); - if(!XSupportsLocale()) + if(!setlocale(LC_CTYPE, "") || !XSupportsLocale()) fprintf(stderr, "warning: no locale support\n"); if(!(dpy = XOpenDisplay(0))) -- cgit 1.4.1-2-gfad0 ef='/akkartik/mu/log/400.mu?h=main'>log tree commit diff stats
path: root/400.mu
blob: 9fc896895c0576a02636798bce2b58f69d799ca6 (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99