From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#16967: frame related race condition Date: Wed, 12 Mar 2014 10:06:18 -0400 Message-ID: References: <531D8028.8020807@gmx.at> <531D94CB.7020704@gmx.at> <531DA5ED.6090601@gmx.at> <531DB9F3.2030508@gmx.at> <531E0CB2.3070609@gmx.at> <531EC439.7050803@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1394633233 3173 80.91.229.3 (12 Mar 2014 14:07:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 12 Mar 2014 14:07:13 +0000 (UTC) Cc: Juanma Barranquero , 16967@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Mar 12 15:07:21 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WNjoV-00065o-OR for geb-bug-gnu-emacs@m.gmane.org; Wed, 12 Mar 2014 15:07:19 +0100 Original-Received: from localhost ([::1]:60824 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNjoV-0005sF-2N for geb-bug-gnu-emacs@m.gmane.org; Wed, 12 Mar 2014 10:07:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40398) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNjoL-0005pR-Qh for bug-gnu-emacs@gnu.org; Wed, 12 Mar 2014 10:07:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WNjoE-0002PI-HC for bug-gnu-emacs@gnu.org; Wed, 12 Mar 2014 10:07:09 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:33513) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNjoE-0002PD-ED for bug-gnu-emacs@gnu.org; Wed, 12 Mar 2014 10:07:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WNjoE-00089J-0V for bug-gnu-emacs@gnu.org; Wed, 12 Mar 2014 10:07:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 12 Mar 2014 14:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16967 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 16967-submit@debbugs.gnu.org id=B16967.139463318131258 (code B ref 16967); Wed, 12 Mar 2014 14:07:01 +0000 Original-Received: (at 16967) by debbugs.gnu.org; 12 Mar 2014 14:06:21 +0000 Original-Received: from localhost ([127.0.0.1]:34695 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WNjnY-000885-VH for submit@debbugs.gnu.org; Wed, 12 Mar 2014 10:06:21 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:35250) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WNjnX-00087y-Cy for 16967@debbugs.gnu.org; Wed, 12 Mar 2014 10:06:19 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EABK/CFFMCppy/2dsb2JhbABEvw4Xc4IeAQEEAScvIwULCzQSFBgNEAETiB4GwS2RCgOkeoFegxM X-IPAS-Result: Av8EABK/CFFMCppy/2dsb2JhbABEvw4Xc4IeAQEEAScvIwULCzQSFBgNEAETiB4GwS2RCgOkeoFegxM X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="51455613" Original-Received: from 76-10-154-114.dsl.teksavvy.com (HELO pastel.home) ([76.10.154.114]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 12 Mar 2014 10:06:18 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 7B6A86057F; Wed, 12 Mar 2014 10:06:18 -0400 (EDT) In-Reply-To: <531EC439.7050803@gmx.at> (martin rudalics's message of "Tue, 11 Mar 2014 09:07:21 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:86765 Archived-At: > /* Nonzero if the frame is currently displayed; we check > it to see if we should bother updating the frame's contents. > On ttys and on Windows NT/9X, to avoid wasting effort updating > visible frames that are actually completely obscured by other > windows on the display, we bend the meaning of visible slightly: > if equal to 2, then the frame is obscured - we still consider > it to be "visible" as seen from lisp, but we don't bother > updating it. */ > unsigned visible : 2; Hmm... I didn't realize this "visible=2" is also used in the Windows GUI. So maybe the "visible=2" case under Windows is indeed mishandled by the "redisplay bit" code. Or by some other part of the code. At least frame.h does: SET_FRAME_VISIBLE (struct frame *f, int v) { eassert (0 <= v && v <= 2); if (v == 1 && f->visible != 1) redisplay_other_windows (); f->visible = v; } so it should handle the w32 case correctly. > is likely responsible for the fact that Emacs doesn't always redisplay a > frame when I remove the window of another application obscuring it. I'm > still convinced that we should call SET_FRAME_VISIBLE, at least when > f->visible equals 2, in SIZE_RESTORED. I'm not sure what SIZE_RESTORED is for, but indeed when we receive a size-change notification, the "visible=2" optimization might not be valid any more so we should set it back to 1. And we should probably also set it back to 1 when we receive expose events on that frame. But I'm generally clueless about GUI code, and even more clueless about w32, so please don't take my word for it. > BTW: The more I look into this, the more I'm convinced that implementing > frame parameters on top of the old frame infrastructure was one of the > worst design ideas ever. I have no idea what this is referring to. Stefan