From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: A GTK-only problem when making frames invisible Date: Sun, 05 Feb 2017 10:16:17 +0100 Message-ID: <5896ED61.9050607@gmx.at> References: <58960943.7090805@gmx.at> <87shntg1gk.fsf@rosalinde> <58964BE4.2090404@gmx.at> <87o9yhfv5j.fsf@rosalinde> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1486286805 30830 195.159.176.226 (5 Feb 2017 09:26:45 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 5 Feb 2017 09:26:45 +0000 (UTC) Cc: emacs-devel To: Stephen Berman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 05 10:26:42 2017 Return-path: Envelope-to: ged-emacs-devel@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 1caJ5l-0007r1-NF for ged-emacs-devel@m.gmane.org; Sun, 05 Feb 2017 10:26:41 +0100 Original-Received: from localhost ([::1]:42405 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1caJ5r-00055s-4k for ged-emacs-devel@m.gmane.org; Sun, 05 Feb 2017 04:26:47 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59957) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1caIvs-0005en-7z for emacs-devel@gnu.org; Sun, 05 Feb 2017 04:16:29 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1caIvp-0002nB-1x for emacs-devel@gnu.org; Sun, 05 Feb 2017 04:16:28 -0500 Original-Received: from mout.gmx.net ([212.227.15.19]:56078) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1caIvo-0002mK-NC for emacs-devel@gnu.org; Sun, 05 Feb 2017 04:16:24 -0500 Original-Received: from [192.168.1.100] ([213.162.68.12]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MPlY2-1cVNFk1hlC-0055MH; Sun, 05 Feb 2017 10:16:22 +0100 In-Reply-To: <87o9yhfv5j.fsf@rosalinde> X-Provags-ID: V03:K0:DicF8EYZYUULZqeQJzuC7OhGu0A3sk8iMh4vOCy2bZ9vX6FSAuE /r7HKcn3p3v8pHPNCvsGCO6gT2xIWVrB4s6HWsMIJawQ4FiMZOQt7F8ZypaFqyRqBIzJ4lE Uwal2jrisr9fZS9Sw6EvL4KpLjHGa4kLySN1HYqcCJaKYb/9FlJiN8lqxIsVRQE0an4jpOu mmYrwny/eRNXc+82iv9Aw== X-UI-Out-Filterresults: notjunk:1;V01:K0:3MH2eVA1JK8=:+vdPe5JeS3AQ/pNsuf9yi8 8Ej+ut1uI9VAze7/oIPNrRQm7nO+zsbFVC1VX9VnJznzDNfQD4HkuMTs7xAILd8eL4STw6O6O u52rKe+dgVRR8mk7TjRZJaXsGBIa2PflG4EV9/GVIV9H3uc/zD4B2eRJf3eRev60kckvIcDj8 wEIK8OELssooqHJM4VCXq3B4IzWpSaEGYNfp9M8ljOLMfrFBLu9pUIHu6cRX+xXuW0SGWsqqo DLcfxYrpM+jMFw1GGwN1mon2QbMikFPIF20cFm0DDBbMOH9zwPbwcjkz4iU8zuuYuYmVuUtoE B26DO5zq9njr9X4fqSxzG2CA3EfrcoYPl16QfzuskCyJqGnYNSj+urDsqHQAjb4HNeTk18fGm gjv6zUXHxtpLhBTqJNKxKAwUOJaPeu3IZUg0ZClqULNaDdxr2wOx3gI+ZXcUBKLMnRlrW01Pw j9647kJtNIZEpz2ybP8gVV/ljccRduUEnpYWyokM2GxRymF2CwB4wJihbrJR9UsdHoiJ0ZsxC gqNmlUY8ruK8zCjmQ3dsKQ0vGVy35CkqzdKTNVMz8YXELCmgw5b1be8gugxFJp+ZhaVQFTJSx CNWsgTh6LQpZRx4JQOdTIrFNO0Xf+CvHNggERf56RyWj/D0fA2VvhEcQUzqewoK6sIY8KRnly Y2vx66LC2Z72bHGAGv1PYTN1Qr7Hv2EP1g/hHBaw+I47XlaOccxZWsjN3RPPVosPP3tfB+vVB +BrwBapYLB6NIVf99gLtlGWZukAAr/8KsM9rje+wsVEAPh86xUwbPh0GNpfQVJdNbg2Iqede X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.15.19 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:211992 Archived-At: > However, frame-visible-p still returns t (not > `icon'). So we have at least two different behaviors though I'm unsure how yours may happen. Here I trapped it as follows: Making the frame invisible via x_make_frame_invisible does /* We can't distinguish this from iconification just by the event that we get from the server. So we can't win using the usual strategy of letting FRAME_SAMPLE_VISIBILITY set this. So do it by hand, and synchronize with the server to make sure we agree. */ SET_FRAME_VISIBLE (f, 0); SET_FRAME_ICONIFIED (f, false); x_sync (f); so f->visible is zero from now on and f->iconified is false. Next I get an Expose event (which is a mystery to me because why should making a frame invisible expose it) causing the execution of if (!FRAME_VISIBLE_P (f)) { block_input (); SET_FRAME_VISIBLE (f, 1); SET_FRAME_ICONIFIED (f, false); because "expose events must be treated like map events" as ISTR having read somewhere. Hence, f->visible is one from now on and f->iconified still false. Finally, I get the UnmapNotify event which does bool visible = FRAME_VISIBLE_P (f); /* While a frame is unmapped, display generation is disabled; you don't want to spend time updating a display that won't ever be seen. */ SET_FRAME_VISIBLE (f, 0); /* We can't distinguish, from the event, whether the window has become iconified or invisible. So assume, if it was previously visible, than now it is iconified. But x_make_frame_invisible clears both the visible flag and the iconified flag; and that way, we know the window is not iconified now. */ if (visible || FRAME_ICONIFIED_P (f)) { SET_FRAME_ICONIFIED (f, true); inev.ie.kind = ICONIFY_EVENT; XSETFRAME (inev.ie.frame_or_window, f); so while f->visible is zero ,`visible' is true and SET_FRAME_ICONIFIED will succeed in setting f->iconified to true. > I don't have an earlier build from master than from 2017-01-25, which > behaves the same. However, with my build from emacs-25 from 2016-11-16, > frame-visible-p returns nil. Same here. >> And is there any difference if, as >> a second step, you do (iconify-frame frame) instead? > > This does minimize the frame to the taskbar, and frame-visible-p returns > `icon' instead of t. As expected. Thank your very much for testing. Anyone else's experiences with this would be highly interesting. Something is fishy here. martin