all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* segfault when resizing terminal window
@ 2009-01-30  8:49 Dan Nicolaescu
  2009-01-30 18:21 ` Chong Yidong
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Nicolaescu @ 2009-01-30  8:49 UTC (permalink / raw)
  To: emacs-devel


emacs -Q -f server-start &

emacsclient -t
C-z
emacsclient -t

now resize the terminal window.... segfault...

The dispnew.c part of the patch below takes care of the segfault.

The other part of the patch takes care of resizing when resuming the
suspended terminal frame. 

Given that the pretest is so close, I'd rather not just check in this
before without asking for a second opinion.

BTW does anyone know what is the reason to have have MSDOS and subprocesses
#ifdefs in `resume-tty'? `resume-tty' can't really be executed on MSDOS... 

Index: dispnew.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/dispnew.c,v
retrieving revision 1.426
diff -u -3 -p -r1.426 dispnew.c
--- dispnew.c	25 Jan 2009 17:00:55 -0000	1.426
+++ dispnew.c	30 Jan 2009 08:37:31 -0000
@@ -6218,6 +6218,10 @@ window_change_signal (signalnum) /* If w
     if (! tty->term_initted)
       continue;
 
+    /* Suspended tty frames have tty->input == NULL, avoid accessing it.  */
+    if (!tty->input)
+      continue;
+    
     get_tty_size (fileno (tty->input), &width, &height);
 
     if (width > 5 && height > 2) {

Index: term.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/term.c,v
retrieving revision 1.234
diff -u -3 -p -r1.234 term.c
--- term.c	8 Jan 2009 03:15:58 -0000	1.234
+++ term.c	30 Jan 2009 08:37:31 -0000
@@ -2470,7 +2470,17 @@ the currently selected frame. */)
 #endif
 
       if (FRAMEP (t->display_info.tty->top_frame))
-        FRAME_SET_VISIBLE (XFRAME (t->display_info.tty->top_frame), 1);
+	{
+	  struct frame *f = XFRAME (t->display_info.tty->top_frame);
+	  int width, height;
+	  int old_height = FRAME_COLS (f);
+	  int old_width = FRAME_LINES (f);
+	  /* Check if terminal/window size has changed.  */
+	  get_tty_size (fileno (t->display_info.tty->input), &width, &height);
+	  if (width != old_width || height != old_height)
+	    change_frame_size (f, height, width, 0, 0, 0);
+	  FRAME_SET_VISIBLE (XFRAME (t->display_info.tty->top_frame), 1);
+	}
 
       init_sys_modes (t->display_info.tty);
 




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: segfault when resizing terminal window
  2009-01-30  8:49 segfault when resizing terminal window Dan Nicolaescu
@ 2009-01-30 18:21 ` Chong Yidong
  0 siblings, 0 replies; 2+ messages in thread
From: Chong Yidong @ 2009-01-30 18:21 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: emacs-devel

Dan Nicolaescu <dann@ics.uci.edu> writes:

> Given that the pretest is so close, I'd rather not just check in this
> before without asking for a second opinion.

I have checked the patch, and see no problems.  If your personal testing
has turned up no further issues, please check it in.




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-01-30 18:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-30  8:49 segfault when resizing terminal window Dan Nicolaescu
2009-01-30 18:21 ` Chong Yidong

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.