aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Rudalics2025-03-22 09:34:53 +0100
committerMartin Rudalics2025-03-22 09:34:53 +0100
commit1ee2a921ad528e18cc68c594f4f2ffcb0599cfe7 (patch)
tree73f6f6202c4dd1ba29c3f1ef6508ea516a530142
parentcf7fdd374ac96ddd53a026bda2aa2b7211e5ee70 (diff)
downloademacs-1ee2a921ad528e18cc68c594f4f2ffcb0599cfe7.tar.gz
emacs-1ee2a921ad528e18cc68c594f4f2ffcb0599cfe7.zip
Fix and document frame parameters for text terminals and child frames
* src/frame.c (Fmake_frame_invisible): In doc-string describe effect on text terminals. Set FRAME correctly when called with nil value. Make frame invisible before calling mru_rooted_frame or next_frame. (Ficonify_frame): Make it work for child frames on text terminals (Fmodify_frame_parameters): Make value 'icon' for 'visibility' work for child frames. * src/dispnew.c (frame_ancestors_visible_p): New function. (frames_with_root): If VISIBLE_ONLY is non-nil, return only frames whose ancestors are all visible to avoid that redisplay draws visibly orphaned child frames. * doc/lispref/frames.texi (Frames): Move descriptions of top frame and 'tty-top-frame' here. (Frame Layout): Mention that on text terminals the outer border can be emulated by setting the 'undecorated' frame parameter. (Frame Position, Frame Parameters, Window Frame Parameters) (Position Parameters, Size Parameters): Rewrite sections dealing with the handling of frame parameters in text terminals. (Layout Parameters): Move description of 'undecorated' parameter here. Clarify semantics of 'menu-bar-lines' parameter. (Frame Interaction Parameters): Move description of 'visibility' parameter here. Mention which parameters are not implemented on text terminals. (Mouse Dragging Parameters): Describe how these work on text terminals. (Visibility of Frames): Rewrite section. (Raising and Lowering): Describe for text terminals. (Child Frames): Fix description of 'iconify-child-frame' option.
-rw-r--r--doc/lispref/frames.texi328
-rw-r--r--src/dispnew.c25
-rw-r--r--src/frame.c68
3 files changed, 254 insertions, 167 deletions
diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi
index 8c843952c29..7eacb790ce7 100644
--- a/doc/lispref/frames.texi
+++ b/doc/lispref/frames.texi
@@ -26,22 +26,28 @@ object that represents a terminal. @xref{Terminal Type}.
26@cindex text terminal 26@cindex text terminal
27@cindex graphical terminal 27@cindex graphical terminal
28@cindex graphical display 28@cindex graphical display
29@cindex top frame
29 There are two classes of terminals: @dfn{text terminals} and 30 There are two classes of terminals: @dfn{text terminals} and
30@dfn{graphical terminals}. Text terminals are non-graphics-capable 31@dfn{graphical terminals}. Text terminals are non-graphics-capable
31displays, including @command{xterm} and other terminal emulators. On 32displays, including @command{xterm} and other terminal emulators. On a
32a text terminal, each Emacs frame occupies the terminal's entire 33text terminal, each Emacs frame occupies the terminal's entire screen;
33screen; although you can create additional frames and switch between 34although you can create additional frames and switch between them, the
34them, the terminal only shows one frame at a time. Graphical 35terminal only shows one non-child frame at a time. This frame is
35terminals, on the other hand, are managed by graphical display systems 36referred to as the @dfn{top frame} of that terminal and can be retrieved
36such as the X Window System, which allow Emacs to show multiple frames 37with the function @code{tty-top-frame} described below. A top frame may
37simultaneously on the same display. 38have child frames (@pxref{Child Frames}) which will be shown together
39with it but cannot be a child frame itself.
40
41Graphical terminals, on the other hand, are managed by graphical display
42systems such as the X Window System, which allow Emacs to show multiple
43frames simultaneously on the same display.
38 44
39 On GNU and Unix systems, you can create additional frames on any 45 On GNU and Unix systems, you can create additional frames on any
40available terminal, within a single Emacs session, regardless of 46available terminal, within a single Emacs session, regardless of whether
41whether Emacs was started on a text or graphical terminal. Emacs can 47Emacs was started on a text or graphical terminal. Emacs can display on
42display on both graphical and text terminals simultaneously. This 48both, graphical and text terminals, simultaneously. This comes in
43comes in handy, for instance, when you connect to the same session 49handy, for instance, when you connect to the same session from several
44from several remote locations. @xref{Multiple Terminals}. 50remote locations. @xref{Multiple Terminals}.
45 51
46@defun framep object 52@defun framep object
47This predicate returns a non-@code{nil} value if @var{object} is a 53This predicate returns a non-@code{nil} value if @var{object} is a
@@ -70,9 +76,9 @@ The frame is displayed on an Android device.
70@end defun 76@end defun
71 77
72@defun frame-terminal &optional frame 78@defun frame-terminal &optional frame
73This function returns the terminal object that displays @var{frame}. 79This function returns the terminal object that displays @var{frame}. If
74If @var{frame} is @code{nil} or unspecified, it defaults to the 80@var{frame} is @code{nil} or unspecified, it defaults to the selected
75selected frame. 81frame (@pxref{Input Focus}).
76@end defun 82@end defun
77 83
78@defun terminal-live-p object 84@defun terminal-live-p object
@@ -90,6 +96,19 @@ of the window-system's root window for that terminal. A child frame is
90a frame whose window-system window is the child of the window-system 96a frame whose window-system window is the child of the window-system
91window of another Emacs frame. @xref{Child Frames}. 97window of another Emacs frame. @xref{Child Frames}.
92 98
99On a text terminal you can get its top frame with the following
100function:
101
102@defun tty-top-frame &optional terminal
103This function returns the top frame on @var{terminal}. @var{terminal}
104should be a terminal object, a frame (meaning that frame's terminal), or
105@code{nil} (meaning the selected frame's terminal). If it does not
106refer to a text terminal, the return value is @code{nil}. A top frame
107must be a root frame, which means it cannot be a child frame itself
108(@pxref{Child Frames}), but may have an arbitrary number of child frames
109descending from it.
110@end defun
111
93@menu 112@menu
94* Creating Frames:: Creating additional frames. 113* Creating Frames:: Creating additional frames.
95* Multiple Terminals:: Displaying on several different devices. 114* Multiple Terminals:: Displaying on several different devices.
@@ -595,8 +614,8 @@ normal, top-level frame these parameters usually represent its absolute
595position (see below) with respect to its display's origin. For a child 614position (see below) with respect to its display's origin. For a child
596frame (@pxref{Child Frames}) these parameters represent its position 615frame (@pxref{Child Frames}) these parameters represent its position
597relative to the native position (see below) of its parent frame. For 616relative to the native position (see below) of its parent frame. For
598frames on text terminals the values of these parameters are meaningless 617root frames (@pxref{Child Frames}) on text terminals the values of these
599and always zero. 618parameters are meaningless and always zero.
600 619
601@item External Border 620@item External Border
602@cindex external border 621@cindex external border
@@ -622,11 +641,14 @@ by the window manager like tooltip frames (@pxref{Tooltips}), child
622frames (@pxref{Child Frames}) and @code{undecorated} or 641frames (@pxref{Child Frames}) and @code{undecorated} or
623@code{override-redirect} frames (@pxref{Management Parameters}). 642@code{override-redirect} frames (@pxref{Management Parameters}).
624 643
625Outer borders are never shown on text terminal frames and on frames 644As a rule, outer borders are never shown on text terminal frames and on
626generated by GTK+ routines. On MS-Windows, the outer border is emulated 645frames generated by GTK+ routines. For a child frame on a text terminal
627with the help of a one pixel wide external border. Non-toolkit builds 646you can emulate the outer border by setting the @code{undecorated}
628on X allow changing the color of the outer border by setting the 647parameter of that frame to @code{nil} (@pxref{Layout Parameters}). On
629@code{border-color} frame parameter (@pxref{Layout Parameters}). 648MS-Windows, the outer border is emulated with the help of a one pixel
649wide external border. Non-toolkit builds on X allow changing the color
650of the outer border by setting the @code{border-color} frame parameter
651(@pxref{Layout Parameters}).
630 652
631@item Title Bar 653@item Title Bar
632@cindex title bar 654@cindex title bar
@@ -1003,7 +1025,8 @@ invisible). However, on systems where the display's origin does not
1003coincide with its top-left corner, the frame may be visible on a 1025coincide with its top-left corner, the frame may be visible on a
1004secondary monitor. 1026secondary monitor.
1005 1027
1006On a text terminal frame both values are zero. 1028On a text terminal frame both values are zero for root frames
1029(@pxref{Child Frames}).
1007@end defun 1030@end defun
1008 1031
1009@defun set-frame-position frame x y 1032@defun set-frame-position frame x y
@@ -1325,18 +1348,10 @@ unaffected by the setting of this option.
1325@cindex frame parameters 1348@cindex frame parameters
1326 1349
1327 A frame has many parameters that control its appearance and behavior. 1350 A frame has many parameters that control its appearance and behavior.
1328Just what parameters a frame has depends on what display mechanism it 1351Just what parameters are meaningful for a frame depends on what display
1329uses. 1352mechanism it uses. Many frame parameters exist mostly for the sake of
1330 1353graphical displays and have no effect when applied to the top frame
1331 Frame parameters exist mostly for the sake of graphical displays. 1354(@pxref{Frames}) of a text terminal.
1332Most frame parameters have no effect when applied to a frame on a text
1333terminal; only the @code{height}, @code{width}, @code{name},
1334@code{title}, @code{menu-bar-lines}, @code{buffer-list} and
1335@code{buffer-predicate} parameters do something special. If the
1336terminal supports colors, the parameters @code{foreground-color},
1337@code{background-color}, @code{background-mode} and
1338@code{display-type} are also meaningful. If the terminal supports
1339frame transparency, the parameter @code{alpha} is also meaningful.
1340 1355
1341 By default, frame parameters are saved and restored by the desktop 1356 By default, frame parameters are saved and restored by the desktop
1342library functions (@pxref{Desktop Save Mode}) when the variable 1357library functions (@pxref{Desktop Save Mode}) when the variable
@@ -1490,11 +1505,7 @@ Arguments for Emacs Invocation, emacs, The GNU Emacs Manual}.
1490 1505
1491 Just what parameters a frame has depends on what display mechanism 1506 Just what parameters a frame has depends on what display mechanism
1492it uses. This section describes the parameters that have special 1507it uses. This section describes the parameters that have special
1493meanings on some or all kinds of terminals. Of these, @code{name}, 1508meanings on some or all kinds of terminals.
1494@code{title}, @code{height}, @code{width}, @code{buffer-list} and
1495@code{buffer-predicate} provide meaningful information in terminal
1496frames, and @code{tty-color-mode} is meaningful only for frames on
1497text terminals.
1498 1509
1499@menu 1510@menu
1500* Basic Parameters:: Parameters that are fundamental. 1511* Basic Parameters:: Parameters that are fundamental.
@@ -1575,8 +1586,8 @@ measured in pixels. For a normal, non-child frame they specify the
1575frame's outer position (@pxref{Frame Geometry}) relative to its 1586frame's outer position (@pxref{Frame Geometry}) relative to its
1576display's origin. For a child frame (@pxref{Child Frames}) they specify 1587display's origin. For a child frame (@pxref{Child Frames}) they specify
1577the frame's outer position relative to the native position of the 1588the frame's outer position relative to the native position of the
1578frame's parent frame. (Note that none of these parameters is meaningful 1589frame's parent frame. On a text terminal these parameters are
1579on TTY frames.) 1590meaningful for child frames only.
1580 1591
1581@table @code 1592@table @code
1582@vindex left@r{, a frame parameter} 1593@vindex left@r{, a frame parameter}
@@ -1628,6 +1639,8 @@ unavailable before a frame has been made visible, it is generally not
1628advisable to use floating-point values when creating decorated frames. 1639advisable to use floating-point values when creating decorated frames.
1629Floating-point values are more suited for ensuring that an (undecorated) 1640Floating-point values are more suited for ensuring that an (undecorated)
1630child frame is positioned nicely within the area of its parent frame. 1641child frame is positioned nicely within the area of its parent frame.
1642
1643Floating-point values are currently not handled on text terminal frames.
1631@end table 1644@end table
1632 1645
1633Some window managers ignore program-specified positions. If you want to 1646Some window managers ignore program-specified positions. If you want to
@@ -1664,15 +1677,17 @@ just like @code{left}, except vertically instead of horizontally.
1664@item icon-left 1677@item icon-left
1665The screen position of the left edge of the frame's icon, in pixels, 1678The screen position of the left edge of the frame's icon, in pixels,
1666counting from the left edge of the screen. This takes effect when the 1679counting from the left edge of the screen. This takes effect when the
1667frame is iconified, if the window manager supports this feature. If 1680frame is iconified, if the window manager supports this feature. If you
1668you specify a value for this parameter, then you must also specify a 1681specify a value for this parameter, then you must also specify a value
1669value for @code{icon-top} and vice versa. 1682for @code{icon-top} and vice versa. This parameter has no meaning on a
1683text terminal.
1670 1684
1671@vindex icon-top@r{, a frame parameter} 1685@vindex icon-top@r{, a frame parameter}
1672@item icon-top 1686@item icon-top
1673The screen position of the top edge of the frame's icon, in pixels, 1687The screen position of the top edge of the frame's icon, in pixels,
1674counting from the top edge of the screen. This takes effect when the 1688counting from the top edge of the screen. This takes effect when the
1675frame is iconified, if the window manager supports this feature. 1689frame is iconified, if the window manager supports this feature. This
1690parameter has no meaning on a text terminal.
1676 1691
1677@vindex user-position@r{, a frame parameter} 1692@vindex user-position@r{, a frame parameter}
1678@item user-position 1693@item user-position
@@ -1680,7 +1695,8 @@ When you create a frame and specify its screen position with the
1680@code{left} and @code{top} parameters, use this parameter to say whether 1695@code{left} and @code{top} parameters, use this parameter to say whether
1681the specified position was user-specified (explicitly requested in some 1696the specified position was user-specified (explicitly requested in some
1682way by a human user) or merely program-specified (chosen by a program). 1697way by a human user) or merely program-specified (chosen by a program).
1683A non-@code{nil} value says the position was user-specified. 1698A non-@code{nil} value says the position was user-specified. This
1699parameter has no meaning on a text terminal.
1684 1700
1685@cindex window positions and window managers 1701@cindex window positions and window managers
1686Window managers generally heed user-specified positions, and some heed 1702Window managers generally heed user-specified positions, and some heed
@@ -1699,6 +1715,7 @@ parameters represent the user's stated preference; otherwise, use
1699@item z-group 1715@item z-group
1700This parameter specifies a relative position of the frame's 1716This parameter specifies a relative position of the frame's
1701window-system window in the stacking (Z-) order of the frame's display. 1717window-system window in the stacking (Z-) order of the frame's display.
1718It has not been implemented yet on text terminals.
1702 1719
1703If this is @code{above}, the window-system will display the window 1720If this is @code{above}, the window-system will display the window
1704that corresponds to the frame above all other window-system windows 1721that corresponds to the frame above all other window-system windows
@@ -1720,7 +1737,8 @@ function @code{frame-restack} (@pxref{Raising and Lowering}).
1720 1737
1721Frame parameters usually specify frame sizes in character units. On 1738Frame parameters usually specify frame sizes in character units. On
1722graphical displays, the @code{default} face determines the actual pixel 1739graphical displays, the @code{default} face determines the actual pixel
1723sizes of these character units (@pxref{Face Attributes}). 1740sizes of these character units (@pxref{Face Attributes}). On text
1741terminals size parameters affect child frames only.
1724 1742
1725@table @code 1743@table @code
1726@vindex width@r{, a frame parameter} 1744@vindex width@r{, a frame parameter}
@@ -1779,7 +1797,7 @@ This parameter specifies the height of the frame. It works just like
1779This does for the size parameters @code{height} and @code{width} what 1797This does for the size parameters @code{height} and @code{width} what
1780the @code{user-position} parameter (@pxref{Position Parameters, 1798the @code{user-position} parameter (@pxref{Position Parameters,
1781user-position}) does for the position parameters @code{top} and 1799user-position}) does for the position parameters @code{top} and
1782@code{left}. 1800@code{left}. This parameter has no meaning on a text terminal.
1783 1801
1784@vindex min-width@r{, a frame parameter} 1802@vindex min-width@r{, a frame parameter}
1785@item min-width 1803@item min-width
@@ -1810,17 +1828,18 @@ fit will be clipped by the window manager.
1810@vindex fullscreen@r{, a frame parameter} 1828@vindex fullscreen@r{, a frame parameter}
1811@item fullscreen 1829@item fullscreen
1812This parameter specifies whether to maximize the frame's width, height 1830This parameter specifies whether to maximize the frame's width, height
1813or both. Its value can be @code{fullwidth}, @code{fullheight}, 1831or both. It has no meaning on a text terminal. Its value can be
1814@code{fullboth}, or @code{maximized}.@footnote{On PGTK frames, setting 1832@code{fullwidth}, @code{fullheight}, @code{fullboth}, or
1815the values @code{fullheight} and @code{fullwidth} has no effect.} A 1833@code{maximized}.@footnote{On PGTK frames, setting the values
1834@code{fullheight} and @code{fullwidth} has no effect.} A
1816@dfn{fullwidth} frame is as wide as possible, a @dfn{fullheight} frame 1835@dfn{fullwidth} frame is as wide as possible, a @dfn{fullheight} frame
1817is as tall as possible, and a @dfn{fullboth} frame is both as wide and 1836is as tall as possible, and a @dfn{fullboth} frame is both as wide and
1818as tall as possible. A @dfn{maximized} frame is like a ``fullboth'' 1837as tall as possible. A @dfn{maximized} frame is like a ``fullboth''
1819frame, except that it usually keeps its title bar and the buttons for 1838frame, except that it usually keeps its title bar and the buttons for
1820resizing and closing the frame. Also, maximized frames typically 1839resizing and closing the frame. Also, maximized frames typically avoid
1821avoid hiding any task bar or panels displayed on the desktop. A 1840hiding any task bar or panels displayed on the desktop. A ``fullboth''
1822``fullboth'' frame, on the other hand, usually omits the title bar and 1841frame, on the other hand, usually omits the title bar and occupies the
1823occupies the entire available screen space. 1842entire available screen space.
1824 1843
1825Full-height and full-width frames are more similar to maximized 1844Full-height and full-width frames are more similar to maximized
1826frames in this regard. However, these typically display an external 1845frames in this regard. However, these typically display an external
@@ -1856,7 +1875,7 @@ file as, for example
1856@end example 1875@end example
1857 1876
1858This will give a new frame full height after typing in it @key{F11} for 1877This will give a new frame full height after typing in it @key{F11} for
1859the first time. 1878the first time. This parameter has no meaning on a text terminal.
1860 1879
1861@vindex fit-frame-to-buffer-margins@r{, a frame parameter} 1880@vindex fit-frame-to-buffer-margins@r{, a frame parameter}
1862@item fit-frame-to-buffer-margins 1881@item fit-frame-to-buffer-margins
@@ -1879,10 +1898,31 @@ Windows}).
1879@cindex layout parameters of frames 1898@cindex layout parameters of frames
1880@cindex frame layout parameters 1899@cindex frame layout parameters
1881 1900
1882 These frame parameters enable or disable various parts of the 1901 These frame parameters enable or disable various parts of the frame,
1883frame, or control their sizes. 1902or control their sizes. Unless stated otherwise, these parameters have
1903no meaning on text terminals.
1884 1904
1885@table @code 1905@table @code
1906@vindex undecorated@r{, a frame parameter}
1907@item undecorated
1908If non-@code{nil}, then on a graphical system this frame's window-system
1909window is drawn without decorations, like the title, minimize/maximize
1910boxes and external borders. This usually means that the window cannot
1911be dragged, resized, iconified, maximized or deleted with the mouse. If
1912@code{nil}, the frame's window is usually drawn with all the elements
1913listed above unless their display has been suspended via window manager
1914settings.
1915
1916Under X, Emacs uses the Motif window manager hints to turn off
1917decorations. Some window managers may not honor these hints.
1918
1919NS builds consider the tool bar to be a decoration, and therefore hide
1920it on an undecorated frame.
1921
1922On a text terminal, this parameter, if non-@code{nil}, will make a child
1923frame show an outer border, which allows to resize that frame via mouse
1924dragging (@pxref{Mouse Dragging Parameters}).
1925
1886@vindex border-width@r{, a frame parameter} 1926@vindex border-width@r{, a frame parameter}
1887@item border-width 1927@item border-width
1888The width in pixels of the frame's outer border (@pxref{Frame Geometry}). 1928The width in pixels of the frame's outer border (@pxref{Frame Geometry}).
@@ -1948,13 +1988,15 @@ to not draw bottom dividers.
1948@vindex menu-bar-lines@r{, a frame parameter} 1988@vindex menu-bar-lines@r{, a frame parameter}
1949@item menu-bar-lines 1989@item menu-bar-lines
1950The number of lines to allocate at the top of the frame for a menu bar 1990The number of lines to allocate at the top of the frame for a menu bar
1951(@pxref{Menu Bar}). The default is one if Menu Bar mode is enabled 1991(@pxref{Menu Bar}). The default is 1 if Menu Bar mode is enabled and 0
1952and zero otherwise. @xref{Menu Bars,,,emacs, The GNU Emacs Manual}. 1992otherwise. @xref{Menu Bars,,,emacs, The GNU Emacs Manual}. For an
1953For an external menu bar (@pxref{Frame Layout}), this value remains 1993external menu bar (@pxref{Frame Layout}), this value remains unchanged
1954unchanged even when the menu bar wraps to two or more lines. In that 1994even when the menu bar wraps to two or more lines. In that case, the
1955case, the @code{menu-bar-size} value returned by @code{frame-geometry} 1995@code{menu-bar-size} value returned by @code{frame-geometry}
1956(@pxref{Frame Geometry}) enables you to establish whether the menu bar 1996(@pxref{Frame Geometry}) can be used to establish whether the menu bar
1957actually occupies one or more lines. 1997actually occupies one or more lines. This parameter affects the
1998presence of a menu bar on the root frame (@pxref{Child Frames}) of a
1999text terminal too. On a text terminal the value may be only 0 or 1.
1958 2000
1959@vindex tool-bar-lines@r{, a frame parameter} 2001@vindex tool-bar-lines@r{, a frame parameter}
1960@item tool-bar-lines 2002@item tool-bar-lines
@@ -1976,7 +2018,8 @@ than Nextstep, and @code{left} or @code{right} on builds using GTK+.
1976The number of lines to use for the tab bar (@pxref{Tab Bars,,,emacs, The 2018The number of lines to use for the tab bar (@pxref{Tab Bars,,,emacs, The
1977GNU Emacs Manual}). The default is one if Tab Bar mode is enabled and 2019GNU Emacs Manual}). The default is one if Tab Bar mode is enabled and
1978zero otherwise. This value may change whenever the tab bar wraps 2020zero otherwise. This value may change whenever the tab bar wraps
1979(@pxref{Frame Layout}). 2021(@pxref{Frame Layout}). This parameter affects the presence of a tab
2022bar on the root frame (@pxref{Child Frames}) of a text terminal too.
1980 2023
1981@vindex line-spacing@r{, a frame parameter} 2024@vindex line-spacing@r{, a frame parameter}
1982@item line-spacing 2025@item line-spacing
@@ -1991,11 +2034,11 @@ displayed by this frame. This is useful to eliminate such glyphs when
1991fitting a frame to its buffer via @code{fit-frame-to-buffer} 2034fitting a frame to its buffer via @code{fit-frame-to-buffer}
1992(@pxref{Resizing Windows}). This frame parameter has effect only for 2035(@pxref{Resizing Windows}). This frame parameter has effect only for
1993GUI frames shown on graphical displays, and only if the fringes are 2036GUI frames shown on graphical displays, and only if the fringes are
1994disabled. This parameter is intended as a purely-presentation 2037disabled. This parameter is intended as a purely-presentation feature,
1995feature, and in particular should not be used for frames where the 2038and in particular should not be used for frames where the user can
1996user can interactively insert text, or more generally where the cursor 2039interactively insert text, or more generally where the cursor is shown.
1997is shown. A notable example of frames where this is used is tooltip 2040A notable example of frames where this is used is tooltip frames
1998frames (@pxref{Tooltips}). 2041(@pxref{Tooltips}). This parameter affects text terminals as well.
1999@end table 2042@end table
2000 2043
2001 2044
@@ -2058,6 +2101,12 @@ If non-@code{nil}, this frame's window is never split automatically.
2058These parameters supply forms of interactions between different frames. 2101These parameters supply forms of interactions between different frames.
2059 2102
2060@table @code 2103@table @code
2104@vindex visibility@r{, a frame parameter}
2105@item visibility
2106The state of visibility of the frame. There are three possibilities:
2107@code{nil} for invisible, @code{t} for visible, and @code{icon} for
2108iconified. @xref{Visibility of Frames}.
2109
2061@vindex parent-frame@r{, a frame parameter} 2110@vindex parent-frame@r{, a frame parameter}
2062@item parent-frame 2111@item parent-frame
2063If non-@code{nil}, this means that this frame is a child frame 2112If non-@code{nil}, this means that this frame is a child frame
@@ -2075,7 +2124,7 @@ Frames}.
2075If non-@code{nil}, this parameter specifies the frame whose windows will 2124If non-@code{nil}, this parameter specifies the frame whose windows will
2076be scrolled whenever the mouse wheel is scrolled with the mouse pointer 2125be scrolled whenever the mouse wheel is scrolled with the mouse pointer
2077hovering over this frame, see @ref{Mouse Commands,,, emacs, The GNU 2126hovering over this frame, see @ref{Mouse Commands,,, emacs, The GNU
2078Emacs Manual}. 2127Emacs Manual}. This parameter has no meaning on a text terminal.
2079 2128
2080@vindex no-other-frame@r{, a frame parameter} 2129@vindex no-other-frame@r{, a frame parameter}
2081@item no-other-frame 2130@item no-other-frame
@@ -2089,7 +2138,8 @@ Commands,,, emacs, The GNU Emacs Manual}.
2089When this parameter specifies a function, that function will be called 2138When this parameter specifies a function, that function will be called
2090instead of the function specified by the variable 2139instead of the function specified by the variable
2091@code{frame-auto-hide-function} when quitting the frame's only window 2140@code{frame-auto-hide-function} when quitting the frame's only window
2092(@pxref{Quitting Windows}) and there are other frames left. 2141(@pxref{Quitting Windows}) and there are other frames left. This
2142parameter has not been yet implemented on text terminals.
2093 2143
2094@vindex minibuffer-exit@r{, a frame parameter} 2144@vindex minibuffer-exit@r{, a frame parameter}
2095@item minibuffer-exit 2145@item minibuffer-exit
@@ -2098,7 +2148,8 @@ frame invisible whenever the minibuffer (@pxref{Minibuffers}) is exited.
2098Alternatively, it can specify the functions @code{iconify-frame} and 2148Alternatively, it can specify the functions @code{iconify-frame} and
2099@code{delete-frame}. This parameter is useful to make a child frame 2149@code{delete-frame}. This parameter is useful to make a child frame
2100disappear automatically (similar to how Emacs deals with a window) when 2150disappear automatically (similar to how Emacs deals with a window) when
2101exiting the minibuffer. 2151exiting the minibuffer. This parameter has not been yet implemented on
2152text terminals.
2102 2153
2103@vindex keep-ratio@r{, a frame parameter} 2154@vindex keep-ratio@r{, a frame parameter}
2104@item keep-ratio 2155@item keep-ratio
@@ -2120,7 +2171,8 @@ either @code{t} or @code{width-only}. The height ratio is preserved if
2120the @sc{car} of the cell is either @code{t} or @code{height-only}. The 2171the @sc{car} of the cell is either @code{t} or @code{height-only}. The
2121left position ratio is preserved if the @sc{cdr} of the cell is either 2172left position ratio is preserved if the @sc{cdr} of the cell is either
2122@code{t} or @code{left-only}. The top position ratio is preserved if 2173@code{t} or @code{left-only}. The top position ratio is preserved if
2123the @sc{cdr} of the cell is either @code{t} or @code{top-only}. 2174the @sc{cdr} of the cell is either @code{t} or @code{top-only}. This
2175parameter has not been yet implemented on text terminals.
2124@end table 2176@end table
2125 2177
2126 2178
@@ -2137,13 +2189,15 @@ or the mode line of its bottommost window.
2137 2189
2138These parameters are mostly useful for child frames (@pxref{Child 2190These parameters are mostly useful for child frames (@pxref{Child
2139Frames}) that come without window manager decorations. If necessary, 2191Frames}) that come without window manager decorations. If necessary,
2140they can be used for undecorated top-level frames as well. 2192they can be used for undecorated top-level frames as well. On text
2193terminals these parameters affect child frames only.
2141 2194
2142@table @code 2195@table @code
2143@vindex drag-internal-border@r{, a frame parameter} 2196@vindex drag-internal-border@r{, a frame parameter}
2144@item drag-internal-border 2197@item drag-internal-border
2145If non-@code{nil}, the frame can be resized by dragging its internal 2198If non-@code{nil}, the frame can be resized by dragging its internal
2146borders, if present, with the mouse. 2199borders, if present, with the mouse. On text terminals, the decoration
2200of a child frame must be dragged instead.
2147 2201
2148@vindex drag-with-header-line@r{, a frame parameter} 2202@vindex drag-with-header-line@r{, a frame parameter}
2149@item drag-with-header-line 2203@item drag-with-header-line
@@ -2200,12 +2254,6 @@ interaction with the window manager or window system. They have no
2200effect on text terminals. 2254effect on text terminals.
2201 2255
2202@table @code 2256@table @code
2203@vindex visibility@r{, a frame parameter}
2204@item visibility
2205The state of visibility of the frame. There are three possibilities:
2206@code{nil} for invisible, @code{t} for visible, and @code{icon} for
2207iconified. @xref{Visibility of Frames}.
2208
2209@vindex auto-raise@r{, a frame parameter} 2257@vindex auto-raise@r{, a frame parameter}
2210@item auto-raise 2258@item auto-raise
2211If non-@code{nil}, Emacs automatically raises the frame when it is 2259If non-@code{nil}, Emacs automatically raises the frame when it is
@@ -2304,21 +2352,6 @@ will not be able to receive any keyboard input from the user, not even
2304if the user switches to the frame using the key combination 2352if the user switches to the frame using the key combination
2305@kbd{Alt-@key{TAB}}. 2353@kbd{Alt-@key{TAB}}.
2306 2354
2307@vindex undecorated@r{, a frame parameter}
2308@item undecorated
2309If non-@code{nil}, this frame's window-system window is drawn without
2310decorations, like the title, minimize/maximize boxes and external
2311borders. This usually means that the window cannot be dragged, resized,
2312iconified, maximized or deleted with the mouse. If @code{nil}, the frame's
2313window is usually drawn with all the elements listed above unless their
2314display has been suspended via window manager settings.
2315
2316Under X, Emacs uses the Motif window manager hints to turn off
2317decorations. Some window managers may not honor these hints.
2318
2319NS builds consider the tool bar to be a decoration, and therefore hide
2320it on an undecorated frame.
2321
2322@vindex override-redirect@r{, a frame parameter} 2355@vindex override-redirect@r{, a frame parameter}
2323@item override-redirect 2356@item override-redirect
2324@cindex override redirect frames 2357@cindex override redirect frames
@@ -3240,33 +3273,49 @@ window managers refer to this state as @dfn{minimized} rather than
3240@dfn{iconified}, but from Emacs's point of view they are the same thing). 3273@dfn{iconified}, but from Emacs's point of view they are the same thing).
3241If a frame is invisible, it is not displayed at all. 3274If a frame is invisible, it is not displayed at all.
3242 3275
3276On a text terminal a frame may be only visible or invisible. The top
3277frame (@pxref{Frames}) of a terminal cannot be invisible.
3278
3243@cindex mapped frame 3279@cindex mapped frame
3244@cindex unmapped frame 3280@cindex unmapped frame
3245 The concept of visibility is strongly related to that of (un-)mapped 3281 On graphical displays the concept of visibility is strongly related to
3246frames. A frame (or, more precisely, its window-system window) is and 3282that of (un-)mapped frames. A frame (or, more precisely, its
3247becomes @dfn{mapped} when it is displayed for the first time and 3283window-system window) is and becomes @dfn{mapped} when it is displayed
3248whenever it changes its state of visibility from @code{iconified} or 3284for the first time and whenever it changes its state of visibility from
3249@code{invisible} to @code{visible}. Conversely, a frame is and becomes 3285@code{iconified} or @code{invisible} to @code{visible}. Conversely, a
3250@dfn{unmapped} whenever it changes its status from @code{visible} to 3286frame is and becomes @dfn{unmapped} whenever it changes its status from
3251@code{iconified} or @code{invisible}. 3287@code{visible} to @code{iconified} or @code{invisible}.
3252
3253 Visibility is meaningless on text terminals, since only the selected
3254frame is actually displayed in any case.
3255 3288
3256@defun frame-visible-p frame 3289@defun frame-visible-p frame
3257This function returns the visibility status of frame @var{frame}. The 3290This function returns the visibility status of frame @var{frame}. The
3258value is @code{t} if @var{frame} is visible, @code{nil} if it is 3291value is @code{t} if @var{frame} is visible, @code{nil} if it is
3259invisible, and @code{icon} if it is iconified. 3292invisible, and @code{icon} if it is iconified.
3260 3293
3261On a text terminal, all frames are considered visible for the 3294Note that the visibility status of a frame as reported by this function
3262purposes of this function, even though only one frame is displayed. 3295(and by the @code{visibility} frame parameter, @ref{Frame Interaction
3263@xref{Raising and Lowering}. 3296Parameters}) does not necessarily tell whether the frame is actually
3297seen on display. Any such frame can be partially or completely obscured
3298by other window manager windows on the same graphical terminal. Whether
3299that completely hides the frame may then depend on the transparency of
3300the obscuring window. A frame may also reside on a virtual desktop
3301different from the current one and can be seen only when making that
3302desktop the current one. One notable restriction holds for child frames
3303(@pxref{Child Frames}): A child frame can be seen if and only if this
3304function returns true for all its ancestors including the frame itself
3305and its root frame.
3306
3307 On a text terminal only that terminal's top frame and its child frames
3308can be actually seen. Other root frames and their child frames cannot
3309be seen even if they are considered visible by this function.
3264@end defun 3310@end defun
3265 3311
3266@deffn Command iconify-frame &optional frame 3312@deffn Command iconify-frame &optional frame
3267This function iconifies frame @var{frame}. If you omit @var{frame}, it 3313This function iconifies frame @var{frame}. If you omit @var{frame}, it
3268iconifies the selected frame. This usually makes all child frames of 3314iconifies the selected frame. This will also remove any child frames
3269@var{frame} (and their descendants) invisible (@pxref{Child Frames}). 3315(@pxref{Child Frames}) of @var{frame} from display. On the top frame of
3316a text terminal this function has no effect. visible. If @var{frame} is
3317a child frame, the behavior depends on the value of the variable
3318@code{iconify-child-frame} (@pxref{Child Frames}).
3270@end deffn 3319@end deffn
3271 3320
3272@deffn Command make-frame-visible &optional frame 3321@deffn Command make-frame-visible &optional frame
@@ -3275,8 +3324,8 @@ it makes the selected frame visible. This does not raise the frame, but
3275you can do that with @code{raise-frame} if you wish (@pxref{Raising and 3324you can do that with @code{raise-frame} if you wish (@pxref{Raising and
3276Lowering}). 3325Lowering}).
3277 3326
3278Making a frame visible usually makes all its child frames (and their 3327Making a frame visible makes all its child frames with visible ancestors
3279descendants) visible as well (@pxref{Child Frames}). 3328appear on display again (@pxref{Child Frames}).
3280@end deffn 3329@end deffn
3281 3330
3282@deffn Command make-frame-invisible &optional frame force 3331@deffn Command make-frame-invisible &optional frame force
@@ -3286,11 +3335,19 @@ all child frames of @var{frame} (and their descendants) invisible too
3286(@pxref{Child Frames}). 3335(@pxref{Child Frames}).
3287 3336
3288Unless @var{force} is non-@code{nil}, this function refuses to make 3337Unless @var{force} is non-@code{nil}, this function refuses to make
3289@var{frame} invisible if all other frames are invisible. 3338@var{frame} invisible if all other frames are invisible. On a text
3339terminal this will make @var{frame} invisible if and only if it is a
3340child frame or at least one other non-child frame (@pxref{Child Frames})
3341on that terminal exists. In the former case, if @var{frame} is
3342selected, it will select the first visible ancestor of @var{frame}
3343instead. In the latter case it will make another non-child frame on
3344that terminal visible and the new top frame (@pxref{Frames}) of that
3345terminal. In either case, it will remove all child frames with
3346@var{frame} as their ancestor from display.
3290@end deffn 3347@end deffn
3291 3348
3292 The visibility status of a frame is also available as a frame 3349 The visibility status of a frame is also available as a frame
3293parameter. You can read or change it as such. @xref{Management 3350parameter. You can read or change it as such. @xref{Frame Interaction
3294Parameters}. The user can also iconify and deiconify frames with the 3351Parameters}. The user can also iconify and deiconify frames with the
3295window manager. This happens below the level at which Emacs can exert 3352window manager. This happens below the level at which Emacs can exert
3296any control, but Emacs does provide events that you can use to keep 3353any control, but Emacs does provide events that you can use to keep
@@ -3336,14 +3393,16 @@ This function raises frame @var{frame} (default, the selected frame)
3336above all other frames belonging to the same or a lower z-group as 3393above all other frames belonging to the same or a lower z-group as
3337@var{frame}. If @var{frame} is invisible or iconified, this makes it 3394@var{frame}. If @var{frame} is invisible or iconified, this makes it
3338visible. If @var{frame} is a child frame (@pxref{Child Frames}), this 3395visible. If @var{frame} is a child frame (@pxref{Child Frames}), this
3339raises @var{frame} above all other child frames of its parent. 3396raises @var{frame} above all other child frames of its parent. For
3397non-child frames on a text terminal this function has no effect.
3340@end deffn 3398@end deffn
3341 3399
3342@deffn Command lower-frame &optional frame 3400@deffn Command lower-frame &optional frame
3343This function lowers frame @var{frame} (default, the selected frame) 3401This function lowers frame @var{frame} (default, the selected frame)
3344below all other frames belonging to the same or a higher z-group as 3402below all other frames belonging to the same or a higher z-group as
3345@var{frame}. If @var{frame} is a child frame (@pxref{Child Frames}), 3403@var{frame}. If @var{frame} is a child frame (@pxref{Child Frames}),
3346this lowers @var{frame} below all other child frames of its parent. 3404this lowers @var{frame} below all other child frames of its parent. For
3405non-child frames on a text terminal this function has no effect.
3347@end deffn 3406@end deffn
3348 3407
3349@defun frame-restack frame1 frame2 &optional above 3408@defun frame-restack frame1 frame2 &optional above
@@ -3363,7 +3422,8 @@ true) that of @var{frame2}. Hence the position of @var{frame2} in its
3363display's Z (stacking) order relative to all other frames excluding 3422display's Z (stacking) order relative to all other frames excluding
3364@var{frame1} remains unaltered. 3423@var{frame1} remains unaltered.
3365 3424
3366Some window managers may refuse to restack windows. 3425Some window managers may refuse to restack windows. This function has
3426not been implemented on text terminals yet.
3367@end defun 3427@end defun
3368 3428
3369Note that the effect of restacking will only hold as long as neither of 3429Note that the effect of restacking will only hold as long as neither of
@@ -3378,25 +3438,14 @@ function @code{frame-list-z-order} (@pxref{Finding All Frames}).
3378 3438
3379@defopt minibuffer-auto-raise 3439@defopt minibuffer-auto-raise
3380If this is non-@code{nil}, activation of the minibuffer raises the frame 3440If this is non-@code{nil}, activation of the minibuffer raises the frame
3381that the minibuffer window is in. 3441that the minibuffer window is in. This function has no effect on text
3442terminals.
3382@end defopt 3443@end defopt
3383 3444
3384 On window systems, you can also enable auto-raising (on frame 3445 On window systems, you can also enable auto-raising (on frame
3385selection) or auto-lowering (on frame deselection) using frame 3446selection) or auto-lowering (on frame deselection) using frame
3386parameters. @xref{Management Parameters}. 3447parameters. @xref{Management Parameters}.
3387 3448
3388@cindex top frame
3389 The concept of raising and lowering frames also applies to text
3390terminal frames. On each text terminal, only the top frame is
3391displayed at any one time.
3392
3393@defun tty-top-frame &optional terminal
3394This function returns the top frame on @var{terminal}. @var{terminal}
3395should be a terminal object, a frame (meaning that frame's terminal),
3396or @code{nil} (meaning the selected frame's terminal). If it does not
3397refer to a text terminal, the return value is @code{nil}.
3398@end defun
3399
3400 3449
3401@node Frame Configurations 3450@node Frame Configurations
3402@section Frame Configurations 3451@section Frame Configurations
@@ -3662,14 +3711,17 @@ Customizing the following option can be useful to tweak the behavior of
3662This option tells Emacs how to proceed when it is asked to iconify a 3711This option tells Emacs how to proceed when it is asked to iconify a
3663child frame. If it is @code{nil}, @code{iconify-frame} will do nothing 3712child frame. If it is @code{nil}, @code{iconify-frame} will do nothing
3664when invoked on a child frame. If it is @code{iconify-top-level}, Emacs 3713when invoked on a child frame. If it is @code{iconify-top-level}, Emacs
3665will try to iconify the top-level frame that is the ancestor of this 3714will try to iconify the root frame of this child frame instead. If it
3666child frame instead. If it is @code{make-invisible}, Emacs will try to 3715is @code{make-invisible}, Emacs will try to make this child frame
3667make this child frame invisible instead of iconifying it. 3716invisible instead of iconifying it.
3668 3717
3669Any other value means to try iconifying the child frame. Since such an 3718Any other value means to try iconifying the child frame. Since such an
3670attempt may not be honored by all window managers and can even lead to 3719attempt may not be honored by all window managers and can even lead to
3671making the child frame unresponsive to user actions, the default is to 3720making the child frame unresponsive to user actions, the default is to
3672iconify the top level frame instead. 3721iconify the root frame instead.
3722
3723On a text terminal the only feasible values are @code{nil} and
3724@code{make-invisible}.
3673@end defopt 3725@end defopt
3674 3726
3675 3727
diff --git a/src/dispnew.c b/src/dispnew.c
index 595f27e255a..d97dbfa6d1e 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -3358,8 +3358,26 @@ max_child_z_order (struct frame *parent)
3358 return z_order; 3358 return z_order;
3359} 3359}
3360 3360
3361/* Return true if and only if F and all its ancestors are visible. */
3362
3363static bool
3364frame_ancestors_visible_p (struct frame *f)
3365{
3366 while (f)
3367 {
3368 if (!FRAME_VISIBLE_P (f))
3369 return false;
3370 else
3371 f = FRAME_PARENT_FRAME (f);
3372 }
3373
3374 return true;
3375}
3376
3361/* Return a list of all frames having root frame ROOT. 3377/* Return a list of all frames having root frame ROOT.
3362 If VISIBLE_ONLY is true, return only visible frames. */ 3378
3379 If VISIBLE_ONLY is true, return only frames that are visible and have
3380 visible ancestors only. */
3363 3381
3364static Lisp_Object 3382static Lisp_Object
3365frames_with_root (struct frame *root, bool visible_only) 3383frames_with_root (struct frame *root, bool visible_only)
@@ -3369,8 +3387,9 @@ frames_with_root (struct frame *root, bool visible_only)
3369 FOR_EACH_FRAME (tail, frame) 3387 FOR_EACH_FRAME (tail, frame)
3370 { 3388 {
3371 struct frame *f = XFRAME (frame); 3389 struct frame *f = XFRAME (frame);
3390
3372 if (root_frame (f) == root 3391 if (root_frame (f) == root
3373 && (!visible_only || FRAME_VISIBLE_P (f))) 3392 && (!visible_only || frame_ancestors_visible_p (f)))
3374 list = Fcons (frame, list); 3393 list = Fcons (frame, list);
3375 } 3394 }
3376 return list; 3395 return list;
@@ -3431,7 +3450,7 @@ frames_in_reverse_z_order (struct frame *f, bool visible_only)
3431 return frames; 3450 return frames;
3432} 3451}
3433 3452
3434/* Raise of lower frame F in z-order. If RAISE is true, raise F, else 3453/* Raise or lower frame F in z-order. If RAISE is true, raise F, else
3435 lower f. */ 3454 lower f. */
3436 3455
3437void 3456void
diff --git a/src/frame.c b/src/frame.c
index 3d181312c10..550fd336ff9 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -3294,22 +3294,29 @@ If omitted, FRAME defaults to the currently selected frame.
3294On graphical displays, invisible frames are not updated and are 3294On graphical displays, invisible frames are not updated and are
3295usually not displayed at all, even in a window system's \"taskbar\". 3295usually not displayed at all, even in a window system's \"taskbar\".
3296 3296
3297Normally you may not make FRAME invisible if all other frames are invisible, 3297Normally you may not make FRAME invisible if all other frames are
3298but if the second optional argument FORCE is non-nil, you may do so. 3298invisible, but if the second optional argument FORCE is non-nil, you may
3299 3299do so.
3300This function has no effect on text terminal frames. Such frames are 3300
3301always considered visible, whether or not they are currently being 3301On a text terminal make FRAME invisible if and only FRAME is either a
3302displayed in the terminal. */) 3302child frame or another non-child frame can be found. In the former
3303case, if FRAME is the selected frame, select the first visible ancestor
3304of FRAME instead. In the latter case, if FRAME is the top frame of its
3305terminal, make another frame that terminal's top frame. */)
3303 (Lisp_Object frame, Lisp_Object force) 3306 (Lisp_Object frame, Lisp_Object force)
3304{ 3307{
3305 struct frame *f = decode_live_frame (frame); 3308 struct frame *f = decode_live_frame (frame);
3306 3309
3310 XSETFRAME (frame, f);
3311
3307 if (NILP (force) && !other_frames (f, true, false)) 3312 if (NILP (force) && !other_frames (f, true, false))
3308 error ("Attempt to make invisible the sole visible or iconified frame"); 3313 error ("Attempt to make invisible the sole visible or iconified frame");
3309 3314
3310 if (FRAME_WINDOW_P (f) && FRAME_TERMINAL (f)->frame_visible_invisible_hook) 3315 if (FRAME_WINDOW_P (f) && FRAME_TERMINAL (f)->frame_visible_invisible_hook)
3311 FRAME_TERMINAL (f)->frame_visible_invisible_hook (f, false); 3316 FRAME_TERMINAL (f)->frame_visible_invisible_hook (f, false);
3312 3317
3318 SET_FRAME_VISIBLE (f, false);
3319
3313 if (is_tty_frame (f) && EQ (frame, selected_frame)) 3320 if (is_tty_frame (f) && EQ (frame, selected_frame))
3314 /* On a tty if FRAME is the selected frame, we have to select another 3321 /* On a tty if FRAME is the selected frame, we have to select another
3315 frame instead. If FRAME is a child frame, use the first visible 3322 frame instead. If FRAME is a child frame, use the first visible
@@ -3321,8 +3328,6 @@ displayed in the terminal. */)
3321 : next_frame (frame, make_fixnum (0)), 3328 : next_frame (frame, make_fixnum (0)),
3322 Qnil); 3329 Qnil);
3323 3330
3324 SET_FRAME_VISIBLE (f, false);
3325
3326 /* Make menu bar update for the Buffers and Frames menus. */ 3331 /* Make menu bar update for the Buffers and Frames menus. */
3327 windows_or_buffers_changed = 16; 3332 windows_or_buffers_changed = 16;
3328 3333
@@ -3339,28 +3344,31 @@ for how to proceed. */)
3339 (Lisp_Object frame) 3344 (Lisp_Object frame)
3340{ 3345{
3341 struct frame *f = decode_live_frame (frame); 3346 struct frame *f = decode_live_frame (frame);
3342#ifdef HAVE_WINDOW_SYSTEM
3343 Lisp_Object parent = f->parent_frame;
3344 3347
3345 if (!NILP (parent)) 3348 if (FRAME_PARENT_FRAME (f))
3346 { 3349 {
3347 if (NILP (iconify_child_frame)) 3350 if (NILP (iconify_child_frame))
3348 /* Do nothing. */ 3351 /* Do nothing. */
3349 return Qnil; 3352 return Qnil;
3350 else if (EQ (iconify_child_frame, Qiconify_top_level)) 3353 else if (FRAME_WINDOW_P (f)
3354 && EQ (iconify_child_frame, Qiconify_top_level))
3351 { 3355 {
3352 /* Iconify top level frame instead (the default). */ 3356 /* Iconify root frame (the default). */
3353 Ficonify_frame (parent); 3357 Lisp_Object root;
3358
3359 XSETFRAME (root, root_frame (f));
3360 Ficonify_frame (root);
3361
3354 return Qnil; 3362 return Qnil;
3355 } 3363 }
3356 else if (EQ (iconify_child_frame, Qmake_invisible)) 3364 else if (EQ (iconify_child_frame, Qmake_invisible))
3357 { 3365 {
3358 /* Make frame invisible instead. */ 3366 /* Make frame invisible. */
3359 Fmake_frame_invisible (frame, Qnil); 3367 Fmake_frame_invisible (frame, Qnil);
3368
3360 return Qnil; 3369 return Qnil;
3361 } 3370 }
3362 } 3371 }
3363#endif /* HAVE_WINDOW_SYSTEM */
3364 3372
3365 if (FRAME_WINDOW_P (f) && FRAME_TERMINAL (f)->iconify_frame_hook) 3373 if (FRAME_WINDOW_P (f) && FRAME_TERMINAL (f)->iconify_frame_hook)
3366 FRAME_TERMINAL (f)->iconify_frame_hook (f); 3374 FRAME_TERMINAL (f)->iconify_frame_hook (f);
@@ -4008,10 +4016,18 @@ list, but are otherwise ignored. */)
4008 change_frame_size (f, w, h, false, false, false); 4016 change_frame_size (f, w, h, false, false, false);
4009 4017
4010 Lisp_Object visible = Fassq (Qvisibility, params); 4018 Lisp_Object visible = Fassq (Qvisibility, params);
4019
4011 if (CONSP (visible)) 4020 if (CONSP (visible))
4012 SET_FRAME_VISIBLE (f, !NILP (Fcdr (visible))); 4021 {
4022 if (EQ (Fcdr (visible), Qicon)
4023 && EQ (iconify_child_frame, Qmake_invisible))
4024 SET_FRAME_VISIBLE (f, false);
4025 else
4026 SET_FRAME_VISIBLE (f, !NILP (Fcdr (visible)));
4027 }
4013 4028
4014 Lisp_Object no_special = Fassq (Qno_special_glyphs, params); 4029 Lisp_Object no_special = Fassq (Qno_special_glyphs, params);
4030
4015 if (CONSP (no_special)) 4031 if (CONSP (no_special))
4016 FRAME_NO_SPECIAL_GLYPHS (f) = !NILP (Fcdr (no_special)); 4032 FRAME_NO_SPECIAL_GLYPHS (f) = !NILP (Fcdr (no_special));
4017 } 4033 }
@@ -7287,15 +7303,15 @@ but will not be able to display text properties inside tooltip text. */);
7287 doc: /* How to handle iconification of child frames. 7303 doc: /* How to handle iconification of child frames.
7288This variable tells Emacs how to proceed when it is asked to iconify a 7304This variable tells Emacs how to proceed when it is asked to iconify a
7289child frame. If it is nil, `iconify-frame' will do nothing when invoked 7305child frame. If it is nil, `iconify-frame' will do nothing when invoked
7290on a child frame. If it is `iconify-top-level', Emacs will try to 7306on a child frame. If it is `iconify-top-level' and the child frame is
7291iconify the top level frame associated with this child frame instead. 7307on a graphical terminal, Emacs will try to iconify the root frame of
7292If it is `make-invisible', Emacs will try to make this child frame 7308this child frame. If it is `make-invisible', Emacs will try to make
7293invisible instead. 7309this child frame invisible instead.
7294 7310
7295Any other value means to try iconifying the child frame. Since such an 7311Any other value means to try iconifying the child frame on a graphical
7296attempt is not honored by all window managers and may even lead to 7312terminal. Since such an attempt is not honored by all window managers
7297making the child frame unresponsive to user actions, the default is to 7313and may even lead to making the child frame unresponsive to user
7298iconify the top level frame instead. */); 7314actions, the default is to iconify the root frame instead. */);
7299 iconify_child_frame = Qiconify_top_level; 7315 iconify_child_frame = Qiconify_top_level;
7300 7316
7301 DEFVAR_LISP ("expose-hidden-buffer", expose_hidden_buffer, 7317 DEFVAR_LISP ("expose-hidden-buffer", expose_hidden_buffer,