From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#24642: 26.0.50; Missing mode-line on initial frame Date: Sun, 20 Nov 2016 18:23:13 +0200 Message-ID: <83k2by9l3i.fsf@gnu.org> References: <57F91C19.1080204@gmx.at> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1479659055 15269 195.159.176.226 (20 Nov 2016 16:24:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 20 Nov 2016 16:24:15 +0000 (UTC) Cc: 24642@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Nov 20 17:24:11 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c8UuY-0002u1-IV for geb-bug-gnu-emacs@m.gmane.org; Sun, 20 Nov 2016 17:24:10 +0100 Original-Received: from localhost ([::1]:45416 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c8Uuc-0008Km-5L for geb-bug-gnu-emacs@m.gmane.org; Sun, 20 Nov 2016 11:24:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44544) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c8UuV-0008JY-RS for bug-gnu-emacs@gnu.org; Sun, 20 Nov 2016 11:24:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c8UuQ-0006Gr-OW for bug-gnu-emacs@gnu.org; Sun, 20 Nov 2016 11:24:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:49112) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c8UuQ-0006Gj-KX for bug-gnu-emacs@gnu.org; Sun, 20 Nov 2016 11:24:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1c8UuQ-0007Ax-Ab for bug-gnu-emacs@gnu.org; Sun, 20 Nov 2016 11:24:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 20 Nov 2016 16:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24642 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24642-submit@debbugs.gnu.org id=B24642.147965899427509 (code B ref 24642); Sun, 20 Nov 2016 16:24:02 +0000 Original-Received: (at 24642) by debbugs.gnu.org; 20 Nov 2016 16:23:14 +0000 Original-Received: from localhost ([127.0.0.1]:36278 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c8Utd-00079d-Vd for submit@debbugs.gnu.org; Sun, 20 Nov 2016 11:23:14 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:53404) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c8Utc-00079M-LC for 24642@debbugs.gnu.org; Sun, 20 Nov 2016 11:23:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c8UtU-00066N-CL for 24642@debbugs.gnu.org; Sun, 20 Nov 2016 11:23:07 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:32883) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c8UtU-00066J-93; Sun, 20 Nov 2016 11:23:04 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1709 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1c8UtT-0001Zh-MF; Sun, 20 Nov 2016 11:23:03 -0500 In-reply-to: <57F91C19.1080204@gmx.at> (message from martin rudalics on Sat, 08 Oct 2016 18:17:29 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:125904 Archived-At: > Date: Sat, 08 Oct 2016 18:17:29 +0200 > From: martin rudalics > > 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);