[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: A GTK-only problem when making frames invisible
From: |
martin rudalics |
Subject: |
Re: A GTK-only problem when making frames invisible |
Date: |
Sun, 05 Feb 2017 10:16:17 +0100 |
> 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