From: Po Lu Date: Sun, 13 Feb 2022 02:05:30 +0000 (+0800) Subject: * src/pgtkfns.c (Fx_create_frame): Set `was_invisible' flag. X-Git-Tag: emacs-29.0.90~2349 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ac02d53f6d6cf5bd11d9ffe64fb8f87f81234e9a;p=emacs.git * src/pgtkfns.c (Fx_create_frame): Set `was_invisible' flag. --- diff --git a/src/pgtkfns.c b/src/pgtkfns.c index 1a6fd941dee..dd2e305965a 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); }