diff options
Diffstat (limited to 'dwm.c')
| -rw-r--r-- | dwm.c | 11 |
1 files changed, 5 insertions, 6 deletions
| @@ -24,6 +24,7 @@ | |||
| 24 | * To understand everything else, start reading main(). | 24 | * To understand everything else, start reading main(). |
| 25 | */ | 25 | */ |
| 26 | #include <errno.h> | 26 | #include <errno.h> |
| 27 | #include <locale.h> | ||
| 27 | #include <stdarg.h> | 28 | #include <stdarg.h> |
| 28 | #include <stdio.h> | 29 | #include <stdio.h> |
| 29 | #include <stdlib.h> | 30 | #include <stdlib.h> |
| @@ -1046,7 +1047,6 @@ quit(const Arg *arg) { | |||
| 1046 | 1047 | ||
| 1047 | void | 1048 | void |
| 1048 | resize(Client *c, int x, int y, int w, int h, Bool sizehints) { | 1049 | resize(Client *c, int x, int y, int w, int h, Bool sizehints) { |
| 1049 | float a; | ||
| 1050 | XWindowChanges wc; | 1050 | XWindowChanges wc; |
| 1051 | 1051 | ||
| 1052 | if(sizehints) { | 1052 | if(sizehints) { |
| @@ -1064,11 +1064,10 @@ resize(Client *c, int x, int y, int w, int h, Bool sizehints) { | |||
| 1064 | 1064 | ||
| 1065 | /* adjust for aspect limits */ | 1065 | /* adjust for aspect limits */ |
| 1066 | if(c->mina > 0 && c->maxa > 0) { | 1066 | if(c->mina > 0 && c->maxa > 0) { |
| 1067 | a = (float) w/h; | 1067 | if(c->maxa < (float)(w / h)) |
| 1068 | if(a > c->maxa) | ||
| 1069 | w = h * c->maxa; | 1068 | w = h * c->maxa; |
| 1070 | else if(a < c->mina) | 1069 | else if(c->mina < (float)(h / w)) |
| 1071 | h = w / c->mina; | 1070 | h = w * c->mina; |
| 1072 | } | 1071 | } |
| 1073 | 1072 | ||
| 1074 | if(baseismin) { /* increment calculation requires this */ | 1073 | if(baseismin) { /* increment calculation requires this */ |
| @@ -1712,7 +1711,7 @@ main(int argc, char *argv[]) { | |||
| 1712 | else if(argc != 1) | 1711 | else if(argc != 1) |
| 1713 | die("usage: dwm [-v]\n"); | 1712 | die("usage: dwm [-v]\n"); |
| 1714 | 1713 | ||
| 1715 | if(!XSupportsLocale()) | 1714 | if(!setlocale(LC_CTYPE, "") || !XSupportsLocale()) |
| 1716 | fprintf(stderr, "warning: no locale support\n"); | 1715 | fprintf(stderr, "warning: no locale support\n"); |
| 1717 | 1716 | ||
| 1718 | if(!(dpy = XOpenDisplay(0))) | 1717 | if(!(dpy = XOpenDisplay(0))) |
