From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#14841: Frames created invisible have their visibility parameter set to t Date: Sat, 20 Jul 2013 15:53:50 +0300 Message-ID: <83vc45xuht.fsf@gnu.org> References: <83a9ltun54.fsf@gnu.org> <837ggxukjt.fsf@gnu.org> <83hafx3wzz.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1374324848 11069 80.91.229.3 (20 Jul 2013 12:54:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 20 Jul 2013 12:54:08 +0000 (UTC) Cc: 14841@debbugs.gnu.org To: Juanma Barranquero Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jul 20 14:54:09 2013 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 1V0Wfo-0005tw-NQ for geb-bug-gnu-emacs@m.gmane.org; Sat, 20 Jul 2013 14:54:08 +0200 Original-Received: from localhost ([::1]:47451 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0Wfo-0000Il-B4 for geb-bug-gnu-emacs@m.gmane.org; Sat, 20 Jul 2013 08:54:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57160) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0Wfl-0000Ie-5l for bug-gnu-emacs@gnu.org; Sat, 20 Jul 2013 08:54:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V0Wfi-00074L-V2 for bug-gnu-emacs@gnu.org; Sat, 20 Jul 2013 08:54:05 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44893) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0Wfi-00074G-RS for bug-gnu-emacs@gnu.org; Sat, 20 Jul 2013 08:54:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1V0Wfi-0000ei-AL for bug-gnu-emacs@gnu.org; Sat, 20 Jul 2013 08:54:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 20 Jul 2013 12:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14841 X-GNU-PR-Package: emacs,w32 X-GNU-PR-Keywords: Original-Received: via spool by 14841-submit@debbugs.gnu.org id=B14841.13743248292490 (code B ref 14841); Sat, 20 Jul 2013 12:54:02 +0000 Original-Received: (at 14841) by debbugs.gnu.org; 20 Jul 2013 12:53:49 +0000 Original-Received: from localhost ([127.0.0.1]:39209 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1V0WfT-0000e0-Ma for submit@debbugs.gnu.org; Sat, 20 Jul 2013 08:53:48 -0400 Original-Received: from mtaout21.012.net.il ([80.179.55.169]:51471) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1V0WfP-0000d1-SD for 14841@debbugs.gnu.org; Sat, 20 Jul 2013 08:53:45 -0400 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0MQ800400JSOPM00@a-mtaout21.012.net.il> for 14841@debbugs.gnu.org; Sat, 20 Jul 2013 15:53:36 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MQ8004J2JTCO040@a-mtaout21.012.net.il>; Sat, 20 Jul 2013 15:53:36 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il 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:76526 Archived-At: > From: Juanma Barranquero > Date: Sun, 14 Jul 2013 19:02:27 +0200 > Cc: 14841@debbugs.gnu.org > > On Sun, Jul 14, 2013 at 6:52 PM, Eli Zaretskii wrote: > > > I'm confused: what did you expect to happen instead? > > After this, (nil t) instead of (t t) > > >> emacs -Q > >> M-: (make-frame '((visibility))) > >> M-: (mapcar #'frame-visible-p (frame-list)) > >> => (t t) > > because: > > 1) (make-frame '((visibility))) == (make-frame '((visibility . nil))) > 2) The frame *is* invisible > 3) If you do this instead: M-: (progn (make-frame '((visibility))) > (mapcar #'frame-visible-p (frame-list))) , you get (nil t) This happens because we get a WM_SIZE message, in response to which we unconditionally set the frame as visible: case WM_SIZE: f = x_window_to_frame (dpyinfo, msg.msg.hwnd); /* Inform lisp of whether frame has been iconified etc. */ if (f) { switch (msg.msg.wParam) { .... case SIZE_MAXIMIZED: case SIZE_RESTORED: { bool iconified = FRAME_ICONIFIED_P (f); SET_FRAME_VISIBLE (f, 1); <<<<<<<<<<<<<<<<<<<<< SET_FRAME_ICONIFIED (f, 0); I'm out of my depth here, as I know close to nothing about the details of these messages, and why are they sent to us, even though the frame is created invisible. But try the changes below for a few days, and if they don't have any adverse effects, I will install them. === modified file 'src/w32term.c' --- src/w32term.c 2013-07-18 16:50:05 +0000 +++ src/w32term.c 2013-07-20 12:41:06 +0000 @@ -4360,8 +4360,9 @@ w32_read_socket (struct terminal *termin SET_FRAME_VISIBLE (f, 1); SET_FRAME_ICONIFIED (f, 0); SET_FRAME_GARBAGED (f); - DebPrint (("frame %p (%s) reexposed by WM_PAINT\n", f, - SDATA (f->name))); + if (!f->output_data.w32->asked_for_visible) + DebPrint (("frame %p (%s) reexposed by WM_PAINT\n", f, + SDATA (f->name))); /* WM_PAINT serves as MapNotify as well, so report visibility changes properly. */ @@ -4819,7 +4820,8 @@ w32_read_socket (struct terminal *termin { bool iconified = FRAME_ICONIFIED_P (f); - SET_FRAME_VISIBLE (f, 1); + if (iconified) + SET_FRAME_VISIBLE (f, 1); SET_FRAME_ICONIFIED (f, 0); /* wait_reading_process_output will notice this