# ------------------------------------------------------------------------------
# charproc.c | 52 ++++++++++++++++++++++++++++++++++++++++------------
# ptyx.h | 1 +
# version.h | 2 +-
# xterm.h | 10 ++++++----
# xterm.log.html | 10 ++++++++++
# xterm.man | 5 +++++
# 6 files changed, 63 insertions, 17 deletions
# ------------------------------------------------------------------------------
Index: charproc.c
--- xterm-135+/charproc.c Mon May 29 11:57:49 2000
+++ xterm-136/charproc.c Sat Jun 3 13:43:13 2000
@@ -426,6 +426,7 @@
Bres(XtNautoWrap, XtCAutoWrap, misc.autoWrap, TRUE),
Ires(XtNsaveLines, XtCSaveLines, screen.savelines, SAVELINES),
Bres(XtNscrollBar, XtCScrollBar, misc.scrollbar, FALSE),
+Ires(XtNlimitResize, XtCLimitResize, misc.limit_resize, 1),
#ifdef SCROLLBAR_RIGHT
Bres(XtNrightScrollBar, XtCRightScrollBar, misc.useRight, FALSE),
#endif
@@ -3829,13 +3830,16 @@
}
+#define okDimension(src,dst) ((src <= 32767) && ((dst = src) == src))
+
static void RequestResize(
XtermWidget termw,
int rows,
int cols,
int text)
{
- register TScreen *screen = &termw->screen;
+ TScreen *screen = &termw->screen;
+ unsigned long value;
Dimension replyWidth, replyHeight;
Dimension askedWidth, askedHeight;
XtGeometryResult status;
@@ -3843,28 +3847,34 @@
TRACE(("RequestResize(rows=%d, cols=%d, text=%d)\n", rows, cols, text));
- askedWidth = cols;
- askedHeight = rows;
+ if ((askedWidth = cols) < cols
+ || (askedHeight = rows) < rows)
+ return;
if (askedHeight == 0
- || askedWidth == 0) {
+ || askedWidth == 0
+ || term->misc.limit_resize > 0) {
XGetWindowAttributes(XtDisplay(termw),
RootWindowOfScreen(XtScreen(termw)), &attrs);
}
if (text) {
- if (rows != 0) {
+ if ((value = rows) != 0) {
if (rows < 0)
- askedHeight = screen->max_row + 1;
- askedHeight *= FontHeight(screen);
- askedHeight += (2 * screen->border);
+ value = screen->max_row + 1;
+ value *= FontHeight(screen);
+ value += (2 * screen->border);
+ if (!okDimension(value, askedHeight))
+ return;
}
- if (cols != 0) {
+ if ((value = cols) != 0) {
if (cols < 0)
- askedWidth = screen->max_col + 1;
- askedWidth *= FontWidth(screen);
- askedWidth += (2 * screen->border) + Scrollbar(screen);
+ value = screen->max_col + 1;
+ value *= FontWidth(screen);
+ value += (2 * screen->border) + Scrollbar(screen);
+ if (!okDimension(value, askedWidth))
+ return;
}
} else {
@@ -3879,10 +3889,27 @@
if (cols == 0)
askedWidth = attrs.width;
+ if (term->misc.limit_resize > 0) {
+ Dimension high = term->misc.limit_resize * attrs.height;
+ Dimension wide = term->misc.limit_resize * attrs.width;
+ if (high < attrs.height)
+ high = attrs.height;
+ if (askedHeight > high)
+ askedHeight = high;
+ if (wide < attrs.width)
+ wide = attrs.width;
+ if (askedWidth > wide)
+ askedWidth = wide;
+ }
+
status = XtMakeResizeRequest (
(Widget) termw,
askedWidth, askedHeight,
&replyWidth, &replyHeight);
+ TRACE(("charproc.c XtMakeResizeRequest %dx%d -> %dx%d (status %d)\n",
+ askedHeight, askedWidth,
+ replyHeight, replyWidth,
+ status));
if (status == XtGeometryYes ||
status == XtGeometryDone) {
@@ -4052,6 +4079,7 @@
wnew->screen.ansi_level = (wnew->screen.terminal_id / 100);
wnew->screen.visualbell = request->screen.visualbell;
+ wnew->misc.limit_resize = request->misc.limit_resize;
#if OPT_NUM_LOCK
wnew->misc.real_NumLock = request->misc.real_NumLock;
wnew->misc.alwaysUseMods = request->misc.alwaysUseMods;
Index: ptyx.h
--- xterm-135+/ptyx.h Sun May 28 16:28:54 2000
+++ xterm-136/ptyx.h Sat Jun 3 12:25:32 2000
@@ -1187,6 +1187,7 @@
char *T_geometry;
char *f_n;
char *f_b;
+ int limit_resize;
#ifdef ALLOWLOGGING
Boolean log_on;
#endif
Index: version.h
--- xterm-135+/version.h Mon May 29 12:21:59 2000
+++ xterm-136/version.h Sat Jun 3 12:40:22 2000
@@ -6,5 +6,5 @@
* XFree86 to which this version of xterm has been built. The number in
* parentheses is my patch number (T.Dickey).
*/
-#define XTERM_PATCH 135
+#define XTERM_PATCH 136
#define XFREE86_VERSION "XFree86 4.0b"
Index: xterm.h
--- xterm-135+/xterm.h Sun May 28 19:49:13 2000
+++ xterm-136/xterm.h Sat Jun 3 12:49:35 2000
@@ -216,6 +216,7 @@
#define XtNallowSendEvents "allowSendEvents"
#define XtNalwaysHighlight "alwaysHighlight"
+#define XtNalwaysUseMods "alwaysUseMods"
#define XtNanswerbackString "answerbackString"
#define XtNappcursorDefault "appcursorDefault"
#define XtNappkeypadDefault "appkeypadDefault"
@@ -251,10 +252,10 @@
#define XtNcolorBL "colorBL"
#define XtNcolorBLMode "colorBLMode"
#define XtNcolorMode "colorMode"
-#define XtNcolorUL "colorUL"
-#define XtNcolorULMode "colorULMode"
#define XtNcolorRV "colorRV"
#define XtNcolorRVMode "colorRVMode"
+#define XtNcolorUL "colorUL"
+#define XtNcolorULMode "colorULMode"
#define XtNctrlFKeys "ctrlFKeys"
#define XtNcurses "curses"
#define XtNcursorBlink "cursorBlink"
@@ -276,6 +277,7 @@
#define XtNinternalBorder "internalBorder"
#define XtNjumpScroll "jumpScroll"
#define XtNkeyboardDialect "keyboardDialect"
+#define XtNlimitResize "limitResize"
#define XtNlogFile "logFile"
#define XtNlogInhibit "logInhibit"
#define XtNlogging "logging"
@@ -288,7 +290,6 @@
#define XtNmultiScroll "multiScroll"
#define XtNnMarginBell "nMarginBell"
#define XtNnumLock "numLock"
-#define XtNalwaysUseMods "alwaysUseMods"
#define XtNoldXtermFKeys "oldXtermFKeys"
#define XtNpointerColor "pointerColor"
#define XtNpointerColorBackground "pointerColorBackground"
@@ -327,6 +328,7 @@
#define XtCAllowSendEvents "AllowSendEvents"
#define XtCAlwaysHighlight "AlwaysHighlight"
+#define XtCAlwaysUseMods "AlwaysUseMods"
#define XtCAnswerbackString "AnswerbackString"
#define XtCAppcursorDefault "AppcursorDefault"
#define XtCAppkeypadDefault "AppkeypadDefault"
@@ -359,6 +361,7 @@
#define XtCHpLowerleftBugCompat "HpLowerleftBugCompat"
#define XtCJumpScroll "JumpScroll"
#define XtCKeyboardDialect "KeyboardDialect"
+#define XtCLimitResize "LimitResize"
#define XtCLogInhibit "LogInhibit"
#define XtCLogfile "Logfile"
#define XtCLogging "Logging"
@@ -370,7 +373,6 @@
#define XtCMultiClickTime "MultiClickTime"
#define XtCMultiScroll "MultiScroll"
#define XtCNumLock "NumLock"
-#define XtCAlwaysUseMods "AlwaysUseMods"
#define XtCOldXtermFKeys "OldXtermFKeys"
#define XtCPrintAttributes "PrintAttributes"
#define XtCPrinterAutoClose "PrinterAutoClose"
Index: xterm.log.html
--- xterm-135+/xterm.log.html Mon May 29 21:48:57 2000
+++ xterm-136/xterm.log.html Sat Jun 3 14:32:29 2000
@@ -42,6 +42,7 @@
xc/programs/Xserver/hw/xfree86).
<UL>
+<LI><A HREF="#xterm_136">Patch #136 - 2000/6/3 - XFree86 4.0b</A>
<LI><A HREF="#xterm_135">Patch #135 - 2000/5/29 - XFree86 4.0b</A>
<LI><A HREF="#xterm_134">Patch #134 - 2000/5/28 - XFree86 4.0b</A>
<LI><A HREF="#xterm_133">Patch #133 - 2000/5/2 - XFree86 4.0a</A>
@@ -179,6 +180,15 @@
<LI><A HREF="#xterm_02">Patch #2 - 1996/1/7</A>
<LI><A HREF="#xterm_01">Patch #1 - 1996/1/6</A>
</UL>
+
+<H1><A NAME="xterm_136">Patch #136 - 2000/6/3 - XFree86 4.0b</A></H1>
+<ul>
+ <li>Add a resource (<code>limitResize</code>)
+ limiting resizing via the CSI 4 t and CSI 8 t sequences.
+
+ <li>Ignore out-of-bounds resize requests, i.e., where sign-extension
+ or truncation of the parameters would occur.
+</ul>
<H1><A NAME="xterm_135">Patch #135 - 2000/5/29 - XFree86 4.0b</A></H1>
<ul>
Index: xterm.man
--- xterm-135+/xterm.man Sun May 28 21:45:57 2000
+++ xterm-136/xterm.man Sat Jun 3 12:46:26 2000
@@ -1225,6 +1225,11 @@
which change character sets.
The default is ``B'', which corresponds to US ASCII.
.TP 8
+.B "limitResize (\fPclass\fB LimitResize)"
+Limits resizing of the screen via control sequence to a given multiple of
+the display dimensions.
+The default is ``1''.
+.TP 8
.B "loginShell (\fPclass\fB LoginShell)"
Specifies whether or not the shell to be run in the window should be started
as a login shell. The default is ``false.''