all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: martin rudalics <rudalics@gmx.at>
Cc: 24642@debbugs.gnu.org
Subject: bug#24642: 26.0.50; Missing mode-line on initial frame
Date: Sun, 20 Nov 2016 18:23:13 +0200	[thread overview]
Message-ID: <83k2by9l3i.fsf@gnu.org> (raw)
In-Reply-To: <57F91C19.1080204@gmx.at> (message from martin rudalics on Sat, 08 Oct 2016 18:17:29 +0200)

> Date: Sat, 08 Oct 2016 18:17:29 +0200
> From: martin rudalics <rudalics@gmx.at>
> 
> With the following file missing-mode-line.el
> 
> 
> (defvar old (selected-frame))
> (defvar new (make-frame '((minibuffer . nil))))
> 
> (set-frame-width new 1640 nil t)
> (set-frame-width old 400 nil t)
> (set-frame-position new 0 0)
> (set-frame-position old -1 -40)
> 
> 
> and
> 
> emacs -Q -load "~/missing-mode-line.el"
> 
> I get on Windows XP two frames where the root window of the smaller one
> has a missing mode-line.  The mode-line reappears when that frame gets
> focus.  It's a minor issue but cannot be reproduced here with Emacs 25.
> 
> It's easily possible that I introduced the bug myself but I don't recall
> changing anything in this area.  So if this rings a bell ...

Sorry for a late response.

In fact, not just the mode line was missing, but the entire frame
contents was not displayed, just an empty frame.

No bells rang here, but the patch below solves this for me.  Does it
make sense?  (Don't ask me how it works on emacs-25, it looks like
some lucky coincidence with timing of the WM_PAINT message and the way
we set windows_or_buffers_changed.)

diff --git a/src/w32term.c b/src/w32term.c
index e8d66c9..ae0f741 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -4628,11 +4628,18 @@ w32_read_socket (struct terminal *terminal,
 		}
 	      else
 		{
-		  HDC hdc = get_frame_dc (f);
+		  /* Erase background again for safety.  But don't do
+		     that if the frame's 'garbaged' flag is set, since
+		     in that case expose_frame will do nothing, and if
+		     the various redisplay flags happen to be unset,
+		     we are left with a blank frame.  */
+		  if (!FRAME_GARBAGED_P (f))
+		    {
+		      HDC hdc = get_frame_dc (f);
 
-		  /* Erase background again for safety.  */
-		  w32_clear_rect (f, hdc, &msg.rect);
-		  release_frame_dc (f, hdc);
+		      w32_clear_rect (f, hdc, &msg.rect);
+		      release_frame_dc (f, hdc);
+		    }
 		  expose_frame (f,
 				msg.rect.left,
 				msg.rect.top,
diff --git a/src/xdisp.c b/src/xdisp.c
index c045ced..1420a4a 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -14116,6 +14116,7 @@ redisplay_internal (void)
               if (f->updated_p)
                 {
 		  f->redisplay = false;
+		  f->garbaged = false;
                   mark_window_display_accurate (f->root_window, true);
                   if (FRAME_TERMINAL (f)->frame_up_to_date_hook)
                     FRAME_TERMINAL (f)->frame_up_to_date_hook (f);





  reply	other threads:[~2016-11-20 16:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-08 16:17 bug#24642: 26.0.50; Missing mode-line on initial frame martin rudalics
2016-11-20 16:23 ` Eli Zaretskii [this message]
2016-11-20 17:10   ` martin rudalics
2016-11-20 17:29     ` 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

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

  git send-email \
    --in-reply-to=83k2by9l3i.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=24642@debbugs.gnu.org \
    --cc=rudalics@gmx.at \
    /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 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.