2013-06-03 Eli Zaretskii <eliz@gnu.org>
+ * w32console.c (initialize_w32_display): Return the dimensions of
+ the console window via 2 additional arguments, not via the current
+ frame. This avoids crashes due to overrunning the bounds of
+ frame's decode_mode_spec_buffer, which is not resized following
+ the change of the frame dimensions from the initial 10x10.
+
+ * w32term.h (w32_initialize_display_info): Adjust prototype.
+
+ * term.c (init_tty): Take dimensions of the frame from the values
+ returned by initialize_w32_display.
+
* Makefile.in (GFILENOTIFY_CFLAGS, GFILENOTIFY_LIBS): New variables.
(ALL_CFLAGS): Add $(GFILENOTIFY_CFLAGS).
(LIBES): Add $(GFILENOTIFY_LIBS).
#ifdef WINDOWSNT
{
struct frame *f = XFRAME (selected_frame);
+ int height, width;
- initialize_w32_display (terminal);
+ initialize_w32_display (terminal, &width, &height);
- FrameRows (tty) = FRAME_LINES (f);
- FrameCols (tty) = FRAME_COLS (f);
- tty->specified_window = FRAME_LINES (f);
+ FrameRows (tty) = height;
+ FrameCols (tty) = width;
+ tty->specified_window = height;
FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_none;
terminal->char_ins_del_ok = 1;
}
void
-initialize_w32_display (struct terminal *term)
+initialize_w32_display (struct terminal *term, int *width, int *height)
{
CONSOLE_SCREEN_BUFFER_INFO info;
Mouse_HLInfo *hlinfo;
|| info.srWindow.Right - info.srWindow.Left < 40
|| info.srWindow.Right - info.srWindow.Left > 100)))
{
- FRAME_LINES (SELECTED_FRAME ()) = 25;
- SET_FRAME_COLS (SELECTED_FRAME (), 80);
+ *height = 25;
+ *width = 80;
}
else if (w32_use_full_screen_buffer)
{
- FRAME_LINES (SELECTED_FRAME ()) = info.dwSize.Y; /* lines per page */
- SET_FRAME_COLS (SELECTED_FRAME (), info.dwSize.X); /* characters per line */
+ *height = info.dwSize.Y; /* lines per page */
+ *width = info.dwSize.X; /* characters per line */
}
else
{
/* Lines per page. Use buffer coords instead of buffer size. */
- FRAME_LINES (SELECTED_FRAME ()) = 1 + info.srWindow.Bottom -
- info.srWindow.Top;
+ *height = 1 + info.srWindow.Bottom - info.srWindow.Top;
/* Characters per line. Use buffer coords instead of buffer size. */
- SET_FRAME_COLS (SELECTED_FRAME (), 1 + info.srWindow.Right -
- info.srWindow.Left);
+ *width = 1 + info.srWindow.Right - info.srWindow.Left;
}
if (os_subtype == OS_NT)
extern Lisp_Object lispy_file_action (DWORD);
extern void w32_initialize_display_info (Lisp_Object);
-extern void initialize_w32_display (struct terminal *);
+extern void initialize_w32_display (struct terminal *, int *, int *);
/* Keypad command key support. W32 doesn't have virtual keys defined
for the function keys on the keypad (they are mapped to the standard