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

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

bug#14841: Frames created invisible have their visibility parameter set


From: Eli Zaretskii
Subject: bug#14841: Frames created invisible have their visibility parameter set to t
Date: Sat, 20 Jul 2013 15:53:50 +0300

> From: Juanma Barranquero <address@hidden>
> Date: Sun, 14 Jul 2013 19:02:27 +0200
> Cc: address@hidden
> 
> On Sun, Jul 14, 2013 at 6:52 PM, Eli Zaretskii <address@hidden> wrote:
> 
> > I'm confused: what did you expect to happen instead?
> 
> After this, (nil t) instead of (t  t)
> 
> >>   emacs -Q
> >>   M-: (make-frame '((visibility))) <RET>
> >>   M-: (mapcar #'frame-visible-p (frame-list)) <RET>
> >>   => (t t)
> 
> because:
> 
>  1) (make-frame '((visibility))) == (make-frame '((visibility . nil)))
>  2) The frame *is* invisible
>  3) If you do this instead:  M-: (progn (make-frame '((visibility)))
> (mapcar #'frame-visible-p (frame-list))) <RET>, you get (nil t)

This happens because we get a WM_SIZE message, in response to which we
unconditionally set the frame as visible:

        case WM_SIZE:
          f = x_window_to_frame (dpyinfo, msg.msg.hwnd);

          /* Inform lisp of whether frame has been iconified etc. */
          if (f)
            {
              switch (msg.msg.wParam)
                {
                ....
                case SIZE_MAXIMIZED:
                case SIZE_RESTORED:
                  {
                    bool iconified = FRAME_ICONIFIED_P (f);

                    SET_FRAME_VISIBLE (f, 1);   <<<<<<<<<<<<<<<<<<<<<
                    SET_FRAME_ICONIFIED (f, 0);

I'm out of my depth here, as I know close to nothing about the details
of these messages, and why are they sent to us, even though the frame
is created invisible.  But try the changes below for a few days, and
if they don't have any adverse effects, I will install them.

=== modified file 'src/w32term.c'
--- src/w32term.c       2013-07-18 16:50:05 +0000
+++ src/w32term.c       2013-07-20 12:41:06 +0000
@@ -4360,8 +4360,9 @@ w32_read_socket (struct terminal *termin
                  SET_FRAME_VISIBLE (f, 1);
                  SET_FRAME_ICONIFIED (f, 0);
                  SET_FRAME_GARBAGED (f);
-                 DebPrint (("frame %p (%s) reexposed by WM_PAINT\n", f,
-                            SDATA (f->name)));
+                 if (!f->output_data.w32->asked_for_visible)
+                   DebPrint (("frame %p (%s) reexposed by WM_PAINT\n", f,
+                              SDATA (f->name)));
 
                  /* WM_PAINT serves as MapNotify as well, so report
                     visibility changes properly.  */
@@ -4819,7 +4820,8 @@ w32_read_socket (struct terminal *termin
                  {
                    bool iconified = FRAME_ICONIFIED_P (f);
 
-                   SET_FRAME_VISIBLE (f, 1);
+                   if (iconified)
+                     SET_FRAME_VISIBLE (f, 1);
                    SET_FRAME_ICONIFIED (f, 0);
 
                    /* wait_reading_process_output will notice this






reply via email to

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