emacs-diffs
[Top][All Lists]
Advanced

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

master ac02d53f6d: * src/pgtkfns.c (Fx_create_frame): Set `was_invisible


From: Po Lu
Subject: master ac02d53f6d: * src/pgtkfns.c (Fx_create_frame): Set `was_invisible' flag.
Date: Sat, 12 Feb 2022 21:05:53 -0500 (EST)

branch: master
commit ac02d53f6d6cf5bd11d9ffe64fb8f87f81234e9a
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    * src/pgtkfns.c (Fx_create_frame): Set `was_invisible' flag.
---
 src/pgtkfns.c | 25 +++++++++++++++++++++----
 1 file changed, 21 insertions(+), 4 deletions(-)

diff --git a/src/pgtkfns.c b/src/pgtkfns.c
index 1a6fd941de..dd2e305965 100644
--- a/src/pgtkfns.c
+++ b/src/pgtkfns.c
@@ -1717,13 +1717,21 @@ This function is an internal primitive--use 
`make-frame' instead.  */ )
      cannot control visibility, so don't try.  */
   if (!FRAME_X_OUTPUT (f)->explicit_parent)
     {
+      /* When called from `x-create-frame-with-faces' visibility is
+        always explicitly nil.  */
       Lisp_Object visibility
-       =
-       gui_display_get_arg (dpyinfo, parms, Qvisibility, 0, 0,
-                            RES_TYPE_SYMBOL);
+       = gui_display_get_arg (dpyinfo, parms, Qvisibility, 0, 0,
+                               RES_TYPE_SYMBOL);
+      Lisp_Object height
+       = gui_display_get_arg (dpyinfo, parms, Qheight, 0, 0, RES_TYPE_NUMBER);
+      Lisp_Object width
+       = gui_display_get_arg (dpyinfo, parms, Qwidth, 0, 0, RES_TYPE_NUMBER);
 
       if (EQ (visibility, Qicon))
-       pgtk_iconify_frame (f);
+       {
+         f->was_invisible = true;
+         pgtk_iconify_frame (f);
+       }
       else
        {
          if (EQ (visibility, Qunbound))
@@ -1731,8 +1739,17 @@ This function is an internal primitive--use `make-frame' 
instead.  */ )
 
          if (!NILP (visibility))
            pgtk_make_frame_visible (f);
+         else
+           f->was_invisible = true;
        }
 
+      /* Leave f->was_invisible true only if height or width were
+        specified too.  This takes effect only when we are not called
+        from `x-create-frame-with-faces' (see above comment).  */
+      f->was_invisible
+       = (f->was_invisible
+          && (!EQ (height, Qunbound) || !EQ (width, Qunbound)));
+
       store_frame_param (f, Qvisibility, visibility);
     }
 



reply via email to

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