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#5482: frame-invisible-p reports nil for iconified frames on w32 Date: Sun, 26 Jun 2016 18:58:30 +0300 Message-ID: <83bn2oymah.fsf@gnu.org> References: <576FABF6.2050800@gmx.at> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1466956767 11139 80.91.229.3 (26 Jun 2016 15:59:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 26 Jun 2016 15:59:27 +0000 (UTC) Cc: ahyatt@gmail.com, lennart.borgman@gmail.com, 5482@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jun 26 17:59:15 2016 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 1bHCSp-0002KT-4n for geb-bug-gnu-emacs@m.gmane.org; Sun, 26 Jun 2016 17:59:15 +0200 Original-Received: from localhost ([::1]:54383 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHCSl-0007hQ-8K for geb-bug-gnu-emacs@m.gmane.org; Sun, 26 Jun 2016 11:59:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47444) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHCSf-0007hJ-D5 for bug-gnu-emacs@gnu.org; Sun, 26 Jun 2016 11:59:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bHCSb-0000Qo-So for bug-gnu-emacs@gnu.org; Sun, 26 Jun 2016 11:59:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:44568) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHCSb-0000Qe-Q1 for bug-gnu-emacs@gnu.org; Sun, 26 Jun 2016 11:59:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bHCSb-0004JF-LO for bug-gnu-emacs@gnu.org; Sun, 26 Jun 2016 11:59:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 26 Jun 2016 15:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 5482 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 5482-submit@debbugs.gnu.org id=B5482.146695673216547 (code B ref 5482); Sun, 26 Jun 2016 15:59:01 +0000 Original-Received: (at 5482) by debbugs.gnu.org; 26 Jun 2016 15:58:52 +0000 Original-Received: from localhost ([127.0.0.1]:56905 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bHCSS-0004Ip-JF for submit@debbugs.gnu.org; Sun, 26 Jun 2016 11:58:52 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:56330) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bHCSQ-0004IS-PG for 5482@debbugs.gnu.org; Sun, 26 Jun 2016 11:58:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bHCSI-0000NN-83 for 5482@debbugs.gnu.org; Sun, 26 Jun 2016 11:58:45 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39963) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHCSI-0000ND-4q; Sun, 26 Jun 2016 11:58:42 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2580 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bHCSF-0004CG-Ic; Sun, 26 Jun 2016 11:58:40 -0400 In-reply-to: <576FABF6.2050800@gmx.at> (message from martin rudalics on Sun, 26 Jun 2016 12:18:30 +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:120100 Archived-At: > Date: Sun, 26 Jun 2016 12:18:30 +0200 > From: martin rudalics > Cc: 5482@debbugs.gnu.org > > >> Create a frame > >> > >> (setq my-frame (make-frame)) > >> > >> Iconify it. Then make it first invisible and then visible again: > >> > >> (make-frame-invisible my-frame) > >> (make-frame-visible my-frame) > >> > >> The result of checking if it is visible is now nil (should be `iconified'): > >> > >> (frame-visible-p my-frame) > >> > >> This is with a fresh checkout from yesterday. > >> > >> > >> BTW the implementation of frame-visible-p seems a bit strange to me on > >> w32. It is easy to check visibility using GetWindowPlacement, but is > >> this used? > > > > Sorry for the late reply here. In Emacs 25, the behavior is different, > > at least for me in Mac OS X. Now, when I do (make-frame-visible > > my-frame), the frame uniconifies and becomes a normal window again. > > And that's wrong according to the OP. The frame should stay iconified. AFAIU, there are actually 2 issues here: the nil value returned by frame-visible-p, which is what I see here if frame-visible-p is invoked immediately after make-frame-visible, i.e. without letting Emacs enter redisplay; and the fact that the frame becomes a normal window. The first issue is expected, since we ask the UI thread to update the frame's display, and that takes some short time. In general, one shouldn't expect the effect of changing frame visibility to be reflected to Lisp immediately; a call to sit-for is a good idea. As for the second issue, I disagree that this behavior is wrong, because it matches the documentation: A frame on a graphical display may be “visible”, “invisible”, or “iconified”. If it is visible, its contents are displayed in the usual ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ manner. If it is iconified, its contents are not displayed, but there ^^^^^^ is a little icon somewhere to bring the frame back into view (some window managers refer to this state as “minimized” rather than “iconified”, but from Emacs’ point of view they are the same thing). If a frame is invisible, it is not displayed at all. -- Command: make-frame-visible &optional frame This function makes frame FRAME visible. So I see no reason to fix anything in what make-frame-visible does in this case. I could perhaps agree that iconify-frame should have undone the effect of make-frame-invisible in this use case, though.