summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmadeusz Sławiński <amade@asmblr.net>2014-09-11 17:02:57 +0200
committerAmadeusz Sławiński <amade@asmblr.net>2014-09-11 17:02:57 +0200
commit9dc8d7c2008c3c698c2e018c3ec123e6dd622f5e (patch)
tree77a821fca7d6e41b0aea52cc68ba1cc170c6f4f0
parent370bb3d7152e0f6412674e89676ab9e9d1368f22 (diff)
downloadscreen-9dc8d7c2008c3c698c2e018c3ec123e6dd622f5e.tar.gz
Set maximum width(/height) in one place
Should also fix https://savannah.gnu.org/bugs/?38940 Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
-rw-r--r--src/resize.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/resize.c b/src/resize.c
index 8c107da..ba30b26 100644
--- a/src/resize.c
+++ b/src/resize.c
@@ -42,6 +42,9 @@
#include "screen.h"
#include "extern.h"
+/* maximum window width */
+#define MAXWIDTH 1000
+
static void CheckMaxSize __P((int));
static void FreeMline __P((struct mline *));
static int AllocMline __P((struct mline *ml, int));
@@ -530,7 +533,8 @@ int wi;
int i;
struct mline *ml;
- wi = ((wi + 1) + 255) & ~255;
+ if (wi > MAXWIDTH)
+ wi = MAXWIDTH;
if (wi <= maxwidth)
return;
maxwidth = wi;
@@ -666,16 +670,16 @@ int wi, he, hi;
if (p->w_type == W_TYPE_GROUP)
return 0;
- if (wi > 1000)
+ if (wi > MAXWIDTH)
{
- Msg(0, "Window width too large. Truncated to 1000.");
- wi = 1000;
+ Msg(0, "Window width too large. Truncated to %d.", MAXWIDTH);
+ wi = MAXWIDTH;
}
- if (he > 1000)
+ if (he > MAXWIDTH)
{
- Msg(0, "Window height too large. Truncated to 1000.");
- he = 1000;
+ Msg(0, "Window height too large. Truncated to %d.", MAXWIDTH);
+ he = MAXWIDTH;
}
if (p->w_width == wi && p->w_height == he && p->w_histheight == hi)