bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#5482: frame-invisible-p reports nil for iconified frames on w32


From: Eli Zaretskii
Subject: bug#5482: frame-invisible-p reports nil for iconified frames on w32
Date: Sun, 26 Jun 2016 18:58:30 +0300

> Date: Sun, 26 Jun 2016 12:18:30 +0200
> From: martin rudalics <rudalics@gmx.at>
> 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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]