]> git.eshelyaron.com Git - emacs.git/commitdiff
* src/pgtkfns.c (Fx_create_frame): Set `was_invisible' flag.
authorPo Lu <luangruo@yahoo.com>
Sun, 13 Feb 2022 02:05:30 +0000 (10:05 +0800)
committerPo Lu <luangruo@yahoo.com>
Sun, 13 Feb 2022 02:05:30 +0000 (10:05 +0800)
src/pgtkfns.c

index 1a6fd941dee37aae302fbd65338cc8697e4fc333..dd2e305965aaf888a9b16a20e98ebda32e1773a8 100644 (file)
@@ -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);
     }