unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Cc: 8020@debbugs.gnu.org
Subject: bug#8020: 23.2.93; assertion failure on fast frame resize
Date: Sat, 12 Feb 2011 10:50:49 +0200	[thread overview]
Message-ID: <837hd5r5zq.fsf@gnu.org> (raw)
In-Reply-To: <wl7hd63ry3.wl%mituharu@math.s.chiba-u.ac.jp>

> Date: Sat, 12 Feb 2011 11:30:28 +0900
> From: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
> Cc: 
> 
> This is forked from Bug#7348, and some analysis can be found there.
> (http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7348)
> 
> Steps to reproduce:
> 
>   1. Build emacs with --enable-checking
>   2. emacs -Q
>   3. C-x 2
>   4. Move your mouse to the corner of the frame, grab it, drag up,
>      rescaling the vertically to minimum size
> 
> Result:
> 
>  ../src/xdisp.c:11515: Emacs fatal error: assertion failed: BUFFERP(w->buffer)
> 
> The value of w->buffer was nil when the assertion failure occurred.

Please try the patch below, which is based on the discussions in bug
#7348.  The patch seems to solve the bug on MS-Windows.  If it works
for you on another platform, and doesn't cause problems elsewhere, I
will install it on the emacs-23 branch.

Thanks.


--- src/xdisp.c.orig	2011-01-26 20:15:42.000000000 +0200
+++ src/xdisp.c	2011-02-12 10:48:56.296875000 +0200
@@ -11261,6 +11261,7 @@
      int preserve_echo_area;
 {
   struct window *w = XWINDOW (selected_window);
+  struct window *sw;
   struct frame *f;
   int pause;
   int must_finish = 0;
@@ -11331,6 +11332,9 @@
   }
 
  retry:
+  /* Remember the currently selected window.  */
+  sw = w;
+
   if (!EQ (old_frame, selected_frame)
       && FRAME_LIVE_P (XFRAME (old_frame)))
     /* When running redisplay, we play a bit fast-and-loose and allow e.g.
@@ -11396,6 +11400,14 @@
   /* Notice any pending interrupt request to change frame size.  */
   do_pending_window_change (1);
 
+  /* do_pending_window_change could change the selected_window due to
+     frame resizing which makes the selected window too small.  */
+  if (WINDOWP (selected_window) && (w = XWINDOW (selected_window)) != sw)
+    {
+      sw = w;
+      reconsider_clip_changes (w, current_buffer);
+    }
+
   /* Clear frames marked as garbaged.  */
   if (frame_garbaged)
     clear_garbaged_frames ();
@@ -11665,6 +11677,10 @@
 	  if (!must_finish)
 	    {
 	      do_pending_window_change (1);
+	      /* If selected_window changed, redisplay again.  */
+	      if (WINDOWP (selected_window)
+		  && (w = XWINDOW (selected_window)) != sw)
+		goto retry;
 
 	      /* We used to always goto end_of_redisplay here, but this
 		 isn't enough if we have a blinking cursor.  */
@@ -11959,8 +11975,9 @@
   do_pending_window_change (1);
 
   /* If we just did a pending size change, or have additional
-     visible frames, redisplay again.  */
-  if (windows_or_buffers_changed && !pause)
+     visible frames, or selected_window changed, redisplay again.  */
+  if ((windows_or_buffers_changed && !pause)
+      || (WINDOWP (selected_window) && (w = XWINDOW (selected_window)) != sw))
     goto retry;
 
   /* Clear the face cache eventually.  */





  reply	other threads:[~2011-02-12  8:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-12  2:30 bug#8020: 23.2.93; assertion failure on fast frame resize YAMAMOTO Mitsuharu
2011-02-12  8:50 ` Eli Zaretskii [this message]
2011-02-13  4:41   ` YAMAMOTO Mitsuharu
2011-02-13 18:56     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=837hd5r5zq.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=8020@debbugs.gnu.org \
    --cc=mituharu@math.s.chiba-u.ac.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).