all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Stephen Berman <stephen.berman@gmx.net>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: A GTK-only  problem when making frames invisible
Date: Sun, 05 Feb 2017 10:16:17 +0100	[thread overview]
Message-ID: <5896ED61.9050607@gmx.at> (raw)
In-Reply-To: <87o9yhfv5j.fsf@rosalinde>

 > 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



      reply	other threads:[~2017-02-05  9:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-04 17:02 A GTK-only problem when making frames invisible martin rudalics
2017-02-04 20:12 ` Stephen Berman
2017-02-04 21:47   ` martin rudalics
2017-02-04 22:28     ` Stephen Berman
2017-02-05  9:16       ` martin rudalics [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5896ED61.9050607@gmx.at \
    --to=rudalics@gmx.at \
    --cc=emacs-devel@gnu.org \
    --cc=stephen.berman@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.