diff options
| author | Martin Rudalics | 2025-03-22 09:34:53 +0100 |
|---|---|---|
| committer | Martin Rudalics | 2025-03-22 09:34:53 +0100 |
| commit | 1ee2a921ad528e18cc68c594f4f2ffcb0599cfe7 (patch) | |
| tree | 73f6f6202c4dd1ba29c3f1ef6508ea516a530142 | |
| parent | cf7fdd374ac96ddd53a026bda2aa2b7211e5ee70 (diff) | |
| download | emacs-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.texi | 328 | ||||
| -rw-r--r-- | src/dispnew.c | 25 | ||||
| -rw-r--r-- | src/frame.c | 68 |
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 |
| 31 | displays, including @command{xterm} and other terminal emulators. On | 32 | displays, including @command{xterm} and other terminal emulators. On a |
| 32 | a text terminal, each Emacs frame occupies the terminal's entire | 33 | text terminal, each Emacs frame occupies the terminal's entire screen; |
| 33 | screen; although you can create additional frames and switch between | 34 | although you can create additional frames and switch between them, the |
| 34 | them, the terminal only shows one frame at a time. Graphical | 35 | terminal only shows one non-child frame at a time. This frame is |
| 35 | terminals, on the other hand, are managed by graphical display systems | 36 | referred to as the @dfn{top frame} of that terminal and can be retrieved |
| 36 | such as the X Window System, which allow Emacs to show multiple frames | 37 | with the function @code{tty-top-frame} described below. A top frame may |
| 37 | simultaneously on the same display. | 38 | have child frames (@pxref{Child Frames}) which will be shown together |
| 39 | with it but cannot be a child frame itself. | ||
| 40 | |||
| 41 | Graphical terminals, on the other hand, are managed by graphical display | ||
| 42 | systems such as the X Window System, which allow Emacs to show multiple | ||
| 43 | frames 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 |
| 40 | available terminal, within a single Emacs session, regardless of | 46 | available terminal, within a single Emacs session, regardless of whether |
| 41 | whether Emacs was started on a text or graphical terminal. Emacs can | 47 | Emacs was started on a text or graphical terminal. Emacs can display on |
| 42 | display on both graphical and text terminals simultaneously. This | 48 | both, graphical and text terminals, simultaneously. This comes in |
| 43 | comes in handy, for instance, when you connect to the same session | 49 | handy, for instance, when you connect to the same session from several |
| 44 | from several remote locations. @xref{Multiple Terminals}. | 50 | remote locations. @xref{Multiple Terminals}. |
| 45 | 51 | ||
| 46 | @defun framep object | 52 | @defun framep object |
| 47 | This predicate returns a non-@code{nil} value if @var{object} is a | 53 | This 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 |
| 73 | This function returns the terminal object that displays @var{frame}. | 79 | This function returns the terminal object that displays @var{frame}. If |
| 74 | If @var{frame} is @code{nil} or unspecified, it defaults to the | 80 | @var{frame} is @code{nil} or unspecified, it defaults to the selected |
| 75 | selected frame. | 81 | frame (@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 | |||
| 90 | a frame whose window-system window is the child of the window-system | 96 | a frame whose window-system window is the child of the window-system |
| 91 | window of another Emacs frame. @xref{Child Frames}. | 97 | window of another Emacs frame. @xref{Child Frames}. |
| 92 | 98 | ||
| 99 | On a text terminal you can get its top frame with the following | ||
| 100 | function: | ||
| 101 | |||
| 102 | @defun tty-top-frame &optional terminal | ||
| 103 | This function returns the top frame on @var{terminal}. @var{terminal} | ||
| 104 | should 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 | ||
| 106 | refer to a text terminal, the return value is @code{nil}. A top frame | ||
| 107 | must 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 | ||
| 109 | descending 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 | |||
| 595 | position (see below) with respect to its display's origin. For a child | 614 | position (see below) with respect to its display's origin. For a child |
| 596 | frame (@pxref{Child Frames}) these parameters represent its position | 615 | frame (@pxref{Child Frames}) these parameters represent its position |
| 597 | relative to the native position (see below) of its parent frame. For | 616 | relative to the native position (see below) of its parent frame. For |
| 598 | frames on text terminals the values of these parameters are meaningless | 617 | root frames (@pxref{Child Frames}) on text terminals the values of these |
| 599 | and always zero. | 618 | parameters 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 | |||
| 622 | frames (@pxref{Child Frames}) and @code{undecorated} or | 641 | frames (@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 | ||
| 625 | Outer borders are never shown on text terminal frames and on frames | 644 | As a rule, outer borders are never shown on text terminal frames and on |
| 626 | generated by GTK+ routines. On MS-Windows, the outer border is emulated | 645 | frames generated by GTK+ routines. For a child frame on a text terminal |
| 627 | with the help of a one pixel wide external border. Non-toolkit builds | 646 | you can emulate the outer border by setting the @code{undecorated} |
| 628 | on X allow changing the color of the outer border by setting the | 647 | parameter of that frame to @code{nil} (@pxref{Layout Parameters}). On |
| 629 | @code{border-color} frame parameter (@pxref{Layout Parameters}). | 648 | MS-Windows, the outer border is emulated with the help of a one pixel |
| 649 | wide external border. Non-toolkit builds on X allow changing the color | ||
| 650 | of 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 | |||
| 1003 | coincide with its top-left corner, the frame may be visible on a | 1025 | coincide with its top-left corner, the frame may be visible on a |
| 1004 | secondary monitor. | 1026 | secondary monitor. |
| 1005 | 1027 | ||
| 1006 | On a text terminal frame both values are zero. | 1028 | On 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. |
| 1328 | Just what parameters a frame has depends on what display mechanism it | 1351 | Just what parameters are meaningful for a frame depends on what display |
| 1329 | uses. | 1352 | mechanism it uses. Many frame parameters exist mostly for the sake of |
| 1330 | 1353 | graphical 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. |
| 1332 | Most frame parameters have no effect when applied to a frame on a text | ||
| 1333 | terminal; 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 | ||
| 1336 | terminal 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 | ||
| 1339 | frame 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 |
| 1342 | library functions (@pxref{Desktop Save Mode}) when the variable | 1357 | library 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 |
| 1492 | it uses. This section describes the parameters that have special | 1507 | it uses. This section describes the parameters that have special |
| 1493 | meanings on some or all kinds of terminals. Of these, @code{name}, | 1508 | meanings 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 | ||
| 1496 | frames, and @code{tty-color-mode} is meaningful only for frames on | ||
| 1497 | text 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 | |||
| 1575 | frame's outer position (@pxref{Frame Geometry}) relative to its | 1586 | frame's outer position (@pxref{Frame Geometry}) relative to its |
| 1576 | display's origin. For a child frame (@pxref{Child Frames}) they specify | 1587 | display's origin. For a child frame (@pxref{Child Frames}) they specify |
| 1577 | the frame's outer position relative to the native position of the | 1588 | the frame's outer position relative to the native position of the |
| 1578 | frame's parent frame. (Note that none of these parameters is meaningful | 1589 | frame's parent frame. On a text terminal these parameters are |
| 1579 | on TTY frames.) | 1590 | meaningful 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 | |||
| 1628 | advisable to use floating-point values when creating decorated frames. | 1639 | advisable to use floating-point values when creating decorated frames. |
| 1629 | Floating-point values are more suited for ensuring that an (undecorated) | 1640 | Floating-point values are more suited for ensuring that an (undecorated) |
| 1630 | child frame is positioned nicely within the area of its parent frame. | 1641 | child frame is positioned nicely within the area of its parent frame. |
| 1642 | |||
| 1643 | Floating-point values are currently not handled on text terminal frames. | ||
| 1631 | @end table | 1644 | @end table |
| 1632 | 1645 | ||
| 1633 | Some window managers ignore program-specified positions. If you want to | 1646 | Some 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 |
| 1665 | The screen position of the left edge of the frame's icon, in pixels, | 1678 | The screen position of the left edge of the frame's icon, in pixels, |
| 1666 | counting from the left edge of the screen. This takes effect when the | 1679 | counting from the left edge of the screen. This takes effect when the |
| 1667 | frame is iconified, if the window manager supports this feature. If | 1680 | frame is iconified, if the window manager supports this feature. If you |
| 1668 | you specify a value for this parameter, then you must also specify a | 1681 | specify a value for this parameter, then you must also specify a value |
| 1669 | value for @code{icon-top} and vice versa. | 1682 | for @code{icon-top} and vice versa. This parameter has no meaning on a |
| 1683 | text 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 |
| 1673 | The screen position of the top edge of the frame's icon, in pixels, | 1687 | The screen position of the top edge of the frame's icon, in pixels, |
| 1674 | counting from the top edge of the screen. This takes effect when the | 1688 | counting from the top edge of the screen. This takes effect when the |
| 1675 | frame is iconified, if the window manager supports this feature. | 1689 | frame is iconified, if the window manager supports this feature. This |
| 1690 | parameter 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 |
| 1681 | the specified position was user-specified (explicitly requested in some | 1696 | the specified position was user-specified (explicitly requested in some |
| 1682 | way by a human user) or merely program-specified (chosen by a program). | 1697 | way by a human user) or merely program-specified (chosen by a program). |
| 1683 | A non-@code{nil} value says the position was user-specified. | 1698 | A non-@code{nil} value says the position was user-specified. This |
| 1699 | parameter has no meaning on a text terminal. | ||
| 1684 | 1700 | ||
| 1685 | @cindex window positions and window managers | 1701 | @cindex window positions and window managers |
| 1686 | Window managers generally heed user-specified positions, and some heed | 1702 | Window 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 |
| 1700 | This parameter specifies a relative position of the frame's | 1716 | This parameter specifies a relative position of the frame's |
| 1701 | window-system window in the stacking (Z-) order of the frame's display. | 1717 | window-system window in the stacking (Z-) order of the frame's display. |
| 1718 | It has not been implemented yet on text terminals. | ||
| 1702 | 1719 | ||
| 1703 | If this is @code{above}, the window-system will display the window | 1720 | If this is @code{above}, the window-system will display the window |
| 1704 | that corresponds to the frame above all other window-system windows | 1721 | that corresponds to the frame above all other window-system windows |
| @@ -1720,7 +1737,8 @@ function @code{frame-restack} (@pxref{Raising and Lowering}). | |||
| 1720 | 1737 | ||
| 1721 | Frame parameters usually specify frame sizes in character units. On | 1738 | Frame parameters usually specify frame sizes in character units. On |
| 1722 | graphical displays, the @code{default} face determines the actual pixel | 1739 | graphical displays, the @code{default} face determines the actual pixel |
| 1723 | sizes of these character units (@pxref{Face Attributes}). | 1740 | sizes of these character units (@pxref{Face Attributes}). On text |
| 1741 | terminals 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 | |||
| 1779 | This does for the size parameters @code{height} and @code{width} what | 1797 | This does for the size parameters @code{height} and @code{width} what |
| 1780 | the @code{user-position} parameter (@pxref{Position Parameters, | 1798 | the @code{user-position} parameter (@pxref{Position Parameters, |
| 1781 | user-position}) does for the position parameters @code{top} and | 1799 | user-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 |
| 1812 | This parameter specifies whether to maximize the frame's width, height | 1830 | This parameter specifies whether to maximize the frame's width, height |
| 1813 | or both. Its value can be @code{fullwidth}, @code{fullheight}, | 1831 | or 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 |
| 1815 | the 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 |
| 1817 | is as tall as possible, and a @dfn{fullboth} frame is both as wide and | 1836 | is as tall as possible, and a @dfn{fullboth} frame is both as wide and |
| 1818 | as tall as possible. A @dfn{maximized} frame is like a ``fullboth'' | 1837 | as tall as possible. A @dfn{maximized} frame is like a ``fullboth'' |
| 1819 | frame, except that it usually keeps its title bar and the buttons for | 1838 | frame, except that it usually keeps its title bar and the buttons for |
| 1820 | resizing and closing the frame. Also, maximized frames typically | 1839 | resizing and closing the frame. Also, maximized frames typically avoid |
| 1821 | avoid hiding any task bar or panels displayed on the desktop. A | 1840 | hiding any task bar or panels displayed on the desktop. A ``fullboth'' |
| 1822 | ``fullboth'' frame, on the other hand, usually omits the title bar and | 1841 | frame, on the other hand, usually omits the title bar and occupies the |
| 1823 | occupies the entire available screen space. | 1842 | entire available screen space. |
| 1824 | 1843 | ||
| 1825 | Full-height and full-width frames are more similar to maximized | 1844 | Full-height and full-width frames are more similar to maximized |
| 1826 | frames in this regard. However, these typically display an external | 1845 | frames 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 | ||
| 1858 | This will give a new frame full height after typing in it @key{F11} for | 1877 | This will give a new frame full height after typing in it @key{F11} for |
| 1859 | the first time. | 1878 | the 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, |
| 1883 | frame, or control their sizes. | 1902 | or control their sizes. Unless stated otherwise, these parameters have |
| 1903 | no meaning on text terminals. | ||
| 1884 | 1904 | ||
| 1885 | @table @code | 1905 | @table @code |
| 1906 | @vindex undecorated@r{, a frame parameter} | ||
| 1907 | @item undecorated | ||
| 1908 | If non-@code{nil}, then on a graphical system this frame's window-system | ||
| 1909 | window is drawn without decorations, like the title, minimize/maximize | ||
| 1910 | boxes and external borders. This usually means that the window cannot | ||
| 1911 | be dragged, resized, iconified, maximized or deleted with the mouse. If | ||
| 1912 | @code{nil}, the frame's window is usually drawn with all the elements | ||
| 1913 | listed above unless their display has been suspended via window manager | ||
| 1914 | settings. | ||
| 1915 | |||
| 1916 | Under X, Emacs uses the Motif window manager hints to turn off | ||
| 1917 | decorations. Some window managers may not honor these hints. | ||
| 1918 | |||
| 1919 | NS builds consider the tool bar to be a decoration, and therefore hide | ||
| 1920 | it on an undecorated frame. | ||
| 1921 | |||
| 1922 | On a text terminal, this parameter, if non-@code{nil}, will make a child | ||
| 1923 | frame show an outer border, which allows to resize that frame via mouse | ||
| 1924 | dragging (@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 |
| 1888 | The width in pixels of the frame's outer border (@pxref{Frame Geometry}). | 1928 | The 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 |
| 1950 | The number of lines to allocate at the top of the frame for a menu bar | 1990 | The 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 |
| 1952 | and zero otherwise. @xref{Menu Bars,,,emacs, The GNU Emacs Manual}. | 1992 | otherwise. @xref{Menu Bars,,,emacs, The GNU Emacs Manual}. For an |
| 1953 | For an external menu bar (@pxref{Frame Layout}), this value remains | 1993 | external menu bar (@pxref{Frame Layout}), this value remains unchanged |
| 1954 | unchanged even when the menu bar wraps to two or more lines. In that | 1994 | even when the menu bar wraps to two or more lines. In that case, the |
| 1955 | case, 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 |
| 1957 | actually occupies one or more lines. | 1997 | actually occupies one or more lines. This parameter affects the |
| 1998 | presence of a menu bar on the root frame (@pxref{Child Frames}) of a | ||
| 1999 | text 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+. | |||
| 1976 | The number of lines to use for the tab bar (@pxref{Tab Bars,,,emacs, The | 2018 | The number of lines to use for the tab bar (@pxref{Tab Bars,,,emacs, The |
| 1977 | GNU Emacs Manual}). The default is one if Tab Bar mode is enabled and | 2019 | GNU Emacs Manual}). The default is one if Tab Bar mode is enabled and |
| 1978 | zero otherwise. This value may change whenever the tab bar wraps | 2020 | zero 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 |
| 2022 | bar 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 | |||
| 1991 | fitting a frame to its buffer via @code{fit-frame-to-buffer} | 2034 | fitting 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 |
| 1993 | GUI frames shown on graphical displays, and only if the fringes are | 2036 | GUI frames shown on graphical displays, and only if the fringes are |
| 1994 | disabled. This parameter is intended as a purely-presentation | 2037 | disabled. This parameter is intended as a purely-presentation feature, |
| 1995 | feature, and in particular should not be used for frames where the | 2038 | and in particular should not be used for frames where the user can |
| 1996 | user can interactively insert text, or more generally where the cursor | 2039 | interactively insert text, or more generally where the cursor is shown. |
| 1997 | is shown. A notable example of frames where this is used is tooltip | 2040 | A notable example of frames where this is used is tooltip frames |
| 1998 | frames (@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. | |||
| 2058 | These parameters supply forms of interactions between different frames. | 2101 | These 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 | ||
| 2106 | The state of visibility of the frame. There are three possibilities: | ||
| 2107 | @code{nil} for invisible, @code{t} for visible, and @code{icon} for | ||
| 2108 | iconified. @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 |
| 2063 | If non-@code{nil}, this means that this frame is a child frame | 2112 | If non-@code{nil}, this means that this frame is a child frame |
| @@ -2075,7 +2124,7 @@ Frames}. | |||
| 2075 | If non-@code{nil}, this parameter specifies the frame whose windows will | 2124 | If non-@code{nil}, this parameter specifies the frame whose windows will |
| 2076 | be scrolled whenever the mouse wheel is scrolled with the mouse pointer | 2125 | be scrolled whenever the mouse wheel is scrolled with the mouse pointer |
| 2077 | hovering over this frame, see @ref{Mouse Commands,,, emacs, The GNU | 2126 | hovering over this frame, see @ref{Mouse Commands,,, emacs, The GNU |
| 2078 | Emacs Manual}. | 2127 | Emacs 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}. | |||
| 2089 | When this parameter specifies a function, that function will be called | 2138 | When this parameter specifies a function, that function will be called |
| 2090 | instead of the function specified by the variable | 2139 | instead 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 |
| 2142 | parameter 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. | |||
| 2098 | Alternatively, it can specify the functions @code{iconify-frame} and | 2148 | Alternatively, 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 |
| 2100 | disappear automatically (similar to how Emacs deals with a window) when | 2150 | disappear automatically (similar to how Emacs deals with a window) when |
| 2101 | exiting the minibuffer. | 2151 | exiting the minibuffer. This parameter has not been yet implemented on |
| 2152 | text 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 | |||
| 2120 | the @sc{car} of the cell is either @code{t} or @code{height-only}. The | 2171 | the @sc{car} of the cell is either @code{t} or @code{height-only}. The |
| 2121 | left position ratio is preserved if the @sc{cdr} of the cell is either | 2172 | left 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 |
| 2123 | the @sc{cdr} of the cell is either @code{t} or @code{top-only}. | 2174 | the @sc{cdr} of the cell is either @code{t} or @code{top-only}. This |
| 2175 | parameter 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 | ||
| 2138 | These parameters are mostly useful for child frames (@pxref{Child | 2190 | These parameters are mostly useful for child frames (@pxref{Child |
| 2139 | Frames}) that come without window manager decorations. If necessary, | 2191 | Frames}) that come without window manager decorations. If necessary, |
| 2140 | they can be used for undecorated top-level frames as well. | 2192 | they can be used for undecorated top-level frames as well. On text |
| 2193 | terminals 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 |
| 2145 | If non-@code{nil}, the frame can be resized by dragging its internal | 2198 | If non-@code{nil}, the frame can be resized by dragging its internal |
| 2146 | borders, if present, with the mouse. | 2199 | borders, if present, with the mouse. On text terminals, the decoration |
| 2200 | of 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 | |||
| 2200 | effect on text terminals. | 2254 | effect on text terminals. |
| 2201 | 2255 | ||
| 2202 | @table @code | 2256 | @table @code |
| 2203 | @vindex visibility@r{, a frame parameter} | ||
| 2204 | @item visibility | ||
| 2205 | The state of visibility of the frame. There are three possibilities: | ||
| 2206 | @code{nil} for invisible, @code{t} for visible, and @code{icon} for | ||
| 2207 | iconified. @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 |
| 2211 | If non-@code{nil}, Emacs automatically raises the frame when it is | 2259 | If 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 | |||
| 2304 | if the user switches to the frame using the key combination | 2352 | if 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 | ||
| 2309 | If non-@code{nil}, this frame's window-system window is drawn without | ||
| 2310 | decorations, like the title, minimize/maximize boxes and external | ||
| 2311 | borders. This usually means that the window cannot be dragged, resized, | ||
| 2312 | iconified, maximized or deleted with the mouse. If @code{nil}, the frame's | ||
| 2313 | window is usually drawn with all the elements listed above unless their | ||
| 2314 | display has been suspended via window manager settings. | ||
| 2315 | |||
| 2316 | Under X, Emacs uses the Motif window manager hints to turn off | ||
| 2317 | decorations. Some window managers may not honor these hints. | ||
| 2318 | |||
| 2319 | NS builds consider the tool bar to be a decoration, and therefore hide | ||
| 2320 | it 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). |
| 3241 | If a frame is invisible, it is not displayed at all. | 3274 | If a frame is invisible, it is not displayed at all. |
| 3242 | 3275 | ||
| 3276 | On a text terminal a frame may be only visible or invisible. The top | ||
| 3277 | frame (@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 |
| 3246 | frames. A frame (or, more precisely, its window-system window) is and | 3282 | that of (un-)mapped frames. A frame (or, more precisely, its |
| 3247 | becomes @dfn{mapped} when it is displayed for the first time and | 3283 | window-system window) is and becomes @dfn{mapped} when it is displayed |
| 3248 | whenever it changes its state of visibility from @code{iconified} or | 3284 | for 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 | 3286 | frame 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 | ||
| 3254 | frame is actually displayed in any case. | ||
| 3255 | 3288 | ||
| 3256 | @defun frame-visible-p frame | 3289 | @defun frame-visible-p frame |
| 3257 | This function returns the visibility status of frame @var{frame}. The | 3290 | This function returns the visibility status of frame @var{frame}. The |
| 3258 | value is @code{t} if @var{frame} is visible, @code{nil} if it is | 3291 | value is @code{t} if @var{frame} is visible, @code{nil} if it is |
| 3259 | invisible, and @code{icon} if it is iconified. | 3292 | invisible, and @code{icon} if it is iconified. |
| 3260 | 3293 | ||
| 3261 | On a text terminal, all frames are considered visible for the | 3294 | Note that the visibility status of a frame as reported by this function |
| 3262 | purposes 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}. | 3296 | Parameters}) does not necessarily tell whether the frame is actually |
| 3297 | seen on display. Any such frame can be partially or completely obscured | ||
| 3298 | by other window manager windows on the same graphical terminal. Whether | ||
| 3299 | that completely hides the frame may then depend on the transparency of | ||
| 3300 | the obscuring window. A frame may also reside on a virtual desktop | ||
| 3301 | different from the current one and can be seen only when making that | ||
| 3302 | desktop 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 | ||
| 3304 | function returns true for all its ancestors including the frame itself | ||
| 3305 | and its root frame. | ||
| 3306 | |||
| 3307 | On a text terminal only that terminal's top frame and its child frames | ||
| 3308 | can be actually seen. Other root frames and their child frames cannot | ||
| 3309 | be 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 |
| 3267 | This function iconifies frame @var{frame}. If you omit @var{frame}, it | 3313 | This function iconifies frame @var{frame}. If you omit @var{frame}, it |
| 3268 | iconifies the selected frame. This usually makes all child frames of | 3314 | iconifies 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 |
| 3316 | a text terminal this function has no effect. visible. If @var{frame} is | ||
| 3317 | a 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 | |||
| 3275 | you can do that with @code{raise-frame} if you wish (@pxref{Raising and | 3324 | you can do that with @code{raise-frame} if you wish (@pxref{Raising and |
| 3276 | Lowering}). | 3325 | Lowering}). |
| 3277 | 3326 | ||
| 3278 | Making a frame visible usually makes all its child frames (and their | 3327 | Making a frame visible makes all its child frames with visible ancestors |
| 3279 | descendants) visible as well (@pxref{Child Frames}). | 3328 | appear 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 | ||
| 3288 | Unless @var{force} is non-@code{nil}, this function refuses to make | 3337 | Unless @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 |
| 3339 | terminal this will make @var{frame} invisible if and only if it is a | ||
| 3340 | child frame or at least one other non-child frame (@pxref{Child Frames}) | ||
| 3341 | on that terminal exists. In the former case, if @var{frame} is | ||
| 3342 | selected, it will select the first visible ancestor of @var{frame} | ||
| 3343 | instead. In the latter case it will make another non-child frame on | ||
| 3344 | that terminal visible and the new top frame (@pxref{Frames}) of that | ||
| 3345 | terminal. 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 |
| 3293 | parameter. You can read or change it as such. @xref{Management | 3350 | parameter. You can read or change it as such. @xref{Frame Interaction |
| 3294 | Parameters}. The user can also iconify and deiconify frames with the | 3351 | Parameters}. The user can also iconify and deiconify frames with the |
| 3295 | window manager. This happens below the level at which Emacs can exert | 3352 | window manager. This happens below the level at which Emacs can exert |
| 3296 | any control, but Emacs does provide events that you can use to keep | 3353 | any 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) | |||
| 3336 | above all other frames belonging to the same or a lower z-group as | 3393 | above 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 |
| 3338 | visible. If @var{frame} is a child frame (@pxref{Child Frames}), this | 3395 | visible. If @var{frame} is a child frame (@pxref{Child Frames}), this |
| 3339 | raises @var{frame} above all other child frames of its parent. | 3396 | raises @var{frame} above all other child frames of its parent. For |
| 3397 | non-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 |
| 3343 | This function lowers frame @var{frame} (default, the selected frame) | 3401 | This function lowers frame @var{frame} (default, the selected frame) |
| 3344 | below all other frames belonging to the same or a higher z-group as | 3402 | below 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}), |
| 3346 | this lowers @var{frame} below all other child frames of its parent. | 3404 | this lowers @var{frame} below all other child frames of its parent. For |
| 3405 | non-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 | |||
| 3363 | display's Z (stacking) order relative to all other frames excluding | 3422 | display's Z (stacking) order relative to all other frames excluding |
| 3364 | @var{frame1} remains unaltered. | 3423 | @var{frame1} remains unaltered. |
| 3365 | 3424 | ||
| 3366 | Some window managers may refuse to restack windows. | 3425 | Some window managers may refuse to restack windows. This function has |
| 3426 | not been implemented on text terminals yet. | ||
| 3367 | @end defun | 3427 | @end defun |
| 3368 | 3428 | ||
| 3369 | Note that the effect of restacking will only hold as long as neither of | 3429 | Note 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 |
| 3380 | If this is non-@code{nil}, activation of the minibuffer raises the frame | 3440 | If this is non-@code{nil}, activation of the minibuffer raises the frame |
| 3381 | that the minibuffer window is in. | 3441 | that the minibuffer window is in. This function has no effect on text |
| 3442 | terminals. | ||
| 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 |
| 3385 | selection) or auto-lowering (on frame deselection) using frame | 3446 | selection) or auto-lowering (on frame deselection) using frame |
| 3386 | parameters. @xref{Management Parameters}. | 3447 | parameters. @xref{Management Parameters}. |
| 3387 | 3448 | ||
| 3388 | @cindex top frame | ||
| 3389 | The concept of raising and lowering frames also applies to text | ||
| 3390 | terminal frames. On each text terminal, only the top frame is | ||
| 3391 | displayed at any one time. | ||
| 3392 | |||
| 3393 | @defun tty-top-frame &optional terminal | ||
| 3394 | This function returns the top frame on @var{terminal}. @var{terminal} | ||
| 3395 | should be a terminal object, a frame (meaning that frame's terminal), | ||
| 3396 | or @code{nil} (meaning the selected frame's terminal). If it does not | ||
| 3397 | refer 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 | |||
| 3662 | This option tells Emacs how to proceed when it is asked to iconify a | 3711 | This option tells Emacs how to proceed when it is asked to iconify a |
| 3663 | child frame. If it is @code{nil}, @code{iconify-frame} will do nothing | 3712 | child frame. If it is @code{nil}, @code{iconify-frame} will do nothing |
| 3664 | when invoked on a child frame. If it is @code{iconify-top-level}, Emacs | 3713 | when invoked on a child frame. If it is @code{iconify-top-level}, Emacs |
| 3665 | will try to iconify the top-level frame that is the ancestor of this | 3714 | will try to iconify the root frame of this child frame instead. If it |
| 3666 | child frame instead. If it is @code{make-invisible}, Emacs will try to | 3715 | is @code{make-invisible}, Emacs will try to make this child frame |
| 3667 | make this child frame invisible instead of iconifying it. | 3716 | invisible instead of iconifying it. |
| 3668 | 3717 | ||
| 3669 | Any other value means to try iconifying the child frame. Since such an | 3718 | Any other value means to try iconifying the child frame. Since such an |
| 3670 | attempt may not be honored by all window managers and can even lead to | 3719 | attempt may not be honored by all window managers and can even lead to |
| 3671 | making the child frame unresponsive to user actions, the default is to | 3720 | making the child frame unresponsive to user actions, the default is to |
| 3672 | iconify the top level frame instead. | 3721 | iconify the root frame instead. |
| 3722 | |||
| 3723 | On 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 | |||
| 3363 | static bool | ||
| 3364 | frame_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 | ||
| 3364 | static Lisp_Object | 3382 | static Lisp_Object |
| 3365 | frames_with_root (struct frame *root, bool visible_only) | 3383 | frames_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 | ||
| 3437 | void | 3456 | void |
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. | |||
| 3294 | On graphical displays, invisible frames are not updated and are | 3294 | On graphical displays, invisible frames are not updated and are |
| 3295 | usually not displayed at all, even in a window system's \"taskbar\". | 3295 | usually not displayed at all, even in a window system's \"taskbar\". |
| 3296 | 3296 | ||
| 3297 | Normally you may not make FRAME invisible if all other frames are invisible, | 3297 | Normally you may not make FRAME invisible if all other frames are |
| 3298 | but if the second optional argument FORCE is non-nil, you may do so. | 3298 | invisible, but if the second optional argument FORCE is non-nil, you may |
| 3299 | 3299 | do so. | |
| 3300 | This function has no effect on text terminal frames. Such frames are | 3300 | |
| 3301 | always considered visible, whether or not they are currently being | 3301 | On a text terminal make FRAME invisible if and only FRAME is either a |
| 3302 | displayed in the terminal. */) | 3302 | child frame or another non-child frame can be found. In the former |
| 3303 | case, if FRAME is the selected frame, select the first visible ancestor | ||
| 3304 | of FRAME instead. In the latter case, if FRAME is the top frame of its | ||
| 3305 | terminal, 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. |
| 7288 | This variable tells Emacs how to proceed when it is asked to iconify a | 7304 | This variable tells Emacs how to proceed when it is asked to iconify a |
| 7289 | child frame. If it is nil, `iconify-frame' will do nothing when invoked | 7305 | child frame. If it is nil, `iconify-frame' will do nothing when invoked |
| 7290 | on a child frame. If it is `iconify-top-level', Emacs will try to | 7306 | on a child frame. If it is `iconify-top-level' and the child frame is |
| 7291 | iconify the top level frame associated with this child frame instead. | 7307 | on a graphical terminal, Emacs will try to iconify the root frame of |
| 7292 | If it is `make-invisible', Emacs will try to make this child frame | 7308 | this child frame. If it is `make-invisible', Emacs will try to make |
| 7293 | invisible instead. | 7309 | this child frame invisible instead. |
| 7294 | 7310 | ||
| 7295 | Any other value means to try iconifying the child frame. Since such an | 7311 | Any other value means to try iconifying the child frame on a graphical |
| 7296 | attempt is not honored by all window managers and may even lead to | 7312 | terminal. Since such an attempt is not honored by all window managers |
| 7297 | making the child frame unresponsive to user actions, the default is to | 7313 | and may even lead to making the child frame unresponsive to user |
| 7298 | iconify the top level frame instead. */); | 7314 | actions, 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, |