diff options
| author | Martin Rudalics | 2017-04-13 17:45:12 +0200 |
|---|---|---|
| committer | Martin Rudalics | 2017-04-13 17:45:12 +0200 |
| commit | 7cc613dc68b8c388a7ccd8f79e37a641ad05312c (patch) | |
| tree | 57f988d412897fd139405b42b9f5e8a46aa904bf | |
| parent | 4e77ff0d45b88cade7836c01344cd8d892adfde8 (diff) | |
| download | emacs-7cc613dc68b8c388a7ccd8f79e37a641ad05312c.tar.gz emacs-7cc613dc68b8c388a7ccd8f79e37a641ad05312c.zip | |
Describe recent frame and window changes in manuals
* doc/emacs/emacs.texi (Top):
* doc/emacs/cmdargs.texi (Borders X): Clearly separate the terms
"outer border" (for the X border which can be set from within
Emacs) and "external border" (for the border which is added by
the window manager).
* doc/lispref/display.texi (Tooltips): Clarify slightly.
* doc/lispref/elisp.texi (Top): Update node and section names.
* doc/lispref/frames.texi (Frames): Describe difference between
top-level and child frames.
(Frame Layout): Describe outer border. Add more details about
how Emacs obtains the outer size and position of a frame and
about menu bar/tool bar wrapping. Add references to new frame
parameters.
(Size and Position): Remove subsection.
(Frame Position): New subsection excerpted from the earlier Size
and Position subsection. Clarify positioning concepts and
some of their shortcomings. Describe `move-frame-functions'.
(Frame Size): New subsection excerpted from the earlier Size
and Position subsection. Describe how to track frame size
changes and the new function `frame-size-changed-p'.
(Position Parameters): Describe child frame positioning. Warn
about negative offsets. Describe 'z-group' parameter.
(Size Parameters): Describe 'text-pixels' specification
facility and new 'min-width' and 'min-height' parameters.
(Layout Parameters): Clarify description of 'tool-bar-lines' and
'menu-bar-lines' parameters.
(Frame Interaction Parameters): New subsubsection describing
'parent-frame', 'delete-before', 'mouse-wheel-frame' and
'no-other-frame' parameters.
(Management Parameters): Describe 'skip-taskbar',
'no-focus-on-map', 'no-accept-focus', 'undecorated' and
'override-redirect' parameters.
(Deleting Frames): Describe handling of 'delete-before'
parameter and child frames for `delete-frame' and
`delete-other-frames'.
(Finding All Frames): Describe `frame-list-z-order' and handling
of 'no-other-frame' parameter by `next-frame'.
(Minibuffers and Frames): Minor clarifications.
(Input Focus): Document `x-focus-frame'. Clarify descriptions
of `focus-in-hook', `focus-out-hook' and `focus-follows-mouse'.
(Visibility of Frames): Describe mapping and how the visibility
of a parent frame affects that of its child frames.
(Raising and Lowering): Describe restacking of frames and
z-groups.
(Child Frames): New section.
* doc/lispref/windows.texi (Selecting Windows): Describe
additional semantics of NORECORD argument of `select-window' and
how `buffer-list-update-hook' can emulate a "select window
hook".
(Mouse Window Auto-selection): New section.
| -rw-r--r-- | doc/emacs/cmdargs.texi | 26 | ||||
| -rw-r--r-- | doc/emacs/emacs.texi | 2 | ||||
| -rw-r--r-- | doc/lispref/display.texi | 26 | ||||
| -rw-r--r-- | doc/lispref/elisp.texi | 12 | ||||
| -rw-r--r-- | doc/lispref/frames.texi | 1091 | ||||
| -rw-r--r-- | doc/lispref/windows.texi | 122 |
6 files changed, 997 insertions, 282 deletions
diff --git a/doc/emacs/cmdargs.texi b/doc/emacs/cmdargs.texi index 6c866708245..721a2cebb22 100644 --- a/doc/emacs/cmdargs.texi +++ b/doc/emacs/cmdargs.texi | |||
| @@ -71,7 +71,7 @@ arguments.) | |||
| 71 | * Font X:: Choosing a font for text, under X. | 71 | * Font X:: Choosing a font for text, under X. |
| 72 | * Colors X:: Choosing display colors. | 72 | * Colors X:: Choosing display colors. |
| 73 | * Window Size X:: Start-up window size, under X. | 73 | * Window Size X:: Start-up window size, under X. |
| 74 | * Borders X:: Internal and external borders, under X. | 74 | * Borders X:: Internal and outer borders, under X. |
| 75 | * Title X:: Specifying the initial frame's title. | 75 | * Title X:: Specifying the initial frame's title. |
| 76 | * Icons X:: Choosing what sort of icon to use, under X. | 76 | * Icons X:: Choosing what sort of icon to use, under X. |
| 77 | * Misc X:: Other display options. | 77 | * Misc X:: Other display options. |
| @@ -1053,15 +1053,15 @@ program-specified and user-specified positions. If these are set, | |||
| 1053 | Emacs fails to position the window correctly. | 1053 | Emacs fails to position the window correctly. |
| 1054 | 1054 | ||
| 1055 | @node Borders X | 1055 | @node Borders X |
| 1056 | @appendixsec Internal and External Borders | 1056 | @appendixsec Internal and Outer Borders |
| 1057 | @cindex borders (X Window System) | 1057 | @cindex borders (X Window System) |
| 1058 | 1058 | ||
| 1059 | An Emacs frame has an internal border and an external border. The | 1059 | An Emacs frame has an internal border and an outer border. The |
| 1060 | internal border is an extra strip of the background color around the | 1060 | internal border is an extra strip of the background color around the |
| 1061 | text portion of the frame. Emacs itself draws the internal border. | 1061 | text portion of the frame. Emacs itself draws the internal border. The |
| 1062 | The external border is added by the window manager outside the frame; | 1062 | outer border is drawn by X outside the tool and menu bars of the frame. |
| 1063 | depending on the window manager you use, it may contain various boxes | 1063 | There is also an external border which is drawn by the window manager. |
| 1064 | you can click on to move or iconify the window. | 1064 | The size of the external border cannot be set from within Emacs. |
| 1065 | 1065 | ||
| 1066 | @table @samp | 1066 | @table @samp |
| 1067 | @item -ib @var{width} | 1067 | @item -ib @var{width} |
| @@ -1069,15 +1069,15 @@ you can click on to move or iconify the window. | |||
| 1069 | @itemx --internal-border=@var{width} | 1069 | @itemx --internal-border=@var{width} |
| 1070 | @opindex --internal-border | 1070 | @opindex --internal-border |
| 1071 | @cindex internal border width, command-line argument | 1071 | @cindex internal border width, command-line argument |
| 1072 | Specify @var{width} as the width of the internal border (between the text | 1072 | Specify @var{width} as the width of the internal border (around the |
| 1073 | and the main border), in pixels. | 1073 | frame's text area), in pixels. |
| 1074 | 1074 | ||
| 1075 | @item -bw @var{width} | 1075 | @item -bw @var{width} |
| 1076 | @opindex -bw | 1076 | @opindex -bw |
| 1077 | @itemx --border-width=@var{width} | 1077 | @itemx --border-width=@var{width} |
| 1078 | @opindex --border-width | 1078 | @opindex --border-width |
| 1079 | @cindex main border width, command-line argument | 1079 | @cindex main border width, command-line argument |
| 1080 | Specify @var{width} as the width of the main border, in pixels. | 1080 | Specify @var{width} as the width of the outer border, in pixels. |
| 1081 | @end table | 1081 | @end table |
| 1082 | 1082 | ||
| 1083 | When you specify the size of the frame, that does not count the | 1083 | When you specify the size of the frame, that does not count the |
| @@ -1086,9 +1086,9 @@ external border. | |||
| 1086 | 1086 | ||
| 1087 | Use the @samp{-ib @var{n}} option to specify an internal border | 1087 | Use the @samp{-ib @var{n}} option to specify an internal border |
| 1088 | @var{n} pixels wide. The default is 1. Use @samp{-bw @var{n}} to | 1088 | @var{n} pixels wide. The default is 1. Use @samp{-bw @var{n}} to |
| 1089 | specify the width of the external border (though the window manager may | 1089 | specify the width of the outer border (though the window manager may not |
| 1090 | not pay attention to what you specify). The default width of the | 1090 | pay attention to what you specify). The default width of the outer |
| 1091 | external border is 2. | 1091 | border is 2. |
| 1092 | 1092 | ||
| 1093 | @node Title X | 1093 | @node Title X |
| 1094 | @appendixsec Frame Titles | 1094 | @appendixsec Frame Titles |
diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi index a6f2896231b..599b373fd4c 100644 --- a/doc/emacs/emacs.texi +++ b/doc/emacs/emacs.texi | |||
| @@ -1198,7 +1198,7 @@ Command Line Arguments for Emacs Invocation | |||
| 1198 | * Font X:: Choosing a font for text, under X. | 1198 | * Font X:: Choosing a font for text, under X. |
| 1199 | * Colors X:: Choosing display colors. | 1199 | * Colors X:: Choosing display colors. |
| 1200 | * Window Size X:: Start-up window size, under X. | 1200 | * Window Size X:: Start-up window size, under X. |
| 1201 | * Borders X:: Internal and external borders, under X. | 1201 | * Borders X:: Internal and outer borders, under X. |
| 1202 | * Title X:: Specifying the initial frame's title. | 1202 | * Title X:: Specifying the initial frame's title. |
| 1203 | * Icons X:: Choosing what sort of icon to use, under X. | 1203 | * Icons X:: Choosing what sort of icon to use, under X. |
| 1204 | * Misc X:: Other display options. | 1204 | * Misc X:: Other display options. |
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 57dd16decaf..7a6a21649e4 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi | |||
| @@ -7190,20 +7190,22 @@ changing the value of the variable @code{x-gtk-use-system-tooltips} to | |||
| 7190 | @code{nil}. The rest of this subsection describes how to control | 7190 | @code{nil}. The rest of this subsection describes how to control |
| 7191 | non-GTK+ tooltips, which are presented by Emacs itself. | 7191 | non-GTK+ tooltips, which are presented by Emacs itself. |
| 7192 | 7192 | ||
| 7193 | Since tooltips are special frames, they have their frame parameters | 7193 | @cindex tooltip frames |
| 7194 | (@pxref{Frame Parameters}). Unlike other frames, the frame parameters | 7194 | Tooltips are displayed in special frames called tooltip frames, which |
| 7195 | for tooltips are stored in a special variable. | 7195 | have their own frame parameters (@pxref{Frame Parameters}). Unlike |
| 7196 | other frames, the default parameters for tooltip frames are stored in a | ||
| 7197 | special variable. | ||
| 7196 | 7198 | ||
| 7197 | @defvar tooltip-frame-parameters | 7199 | @defvar tooltip-frame-parameters |
| 7198 | This customizable option holds the frame parameters used for | 7200 | This customizable option holds the default frame parameters used for |
| 7199 | displaying tooltips. Any font and color parameters are ignored, and | 7201 | displaying tooltips. Any font and color parameters are ignored, and the |
| 7200 | the corresponding attributes of the @code{tooltip} face are used | 7202 | corresponding attributes of the @code{tooltip} face are used instead. |
| 7201 | instead. If @code{left} or @code{top} parameters are included, they | 7203 | If @code{left} or @code{top} parameters are included, they are used as |
| 7202 | are used as absolute frame-relative coordinates where the tooltip | 7204 | absolute frame-relative coordinates where the tooltip should be shown. |
| 7203 | should be shown. (Mouse-relative position of the tooltip can be | 7205 | (Mouse-relative position of the tooltip can be customized using the |
| 7204 | customized using the variables described in @ref{Tooltips,,, emacs, | 7206 | variables described in @ref{Tooltips,,, emacs, The GNU Emacs Manual}.) |
| 7205 | The GNU Emacs Manual}.) Note that the @code{left} and @code{top} | 7207 | Note that the @code{left} and @code{top} parameters, if present, |
| 7206 | parameters, if present, override the values of mouse-relative offsets. | 7208 | override the values of mouse-relative offsets. |
| 7207 | @end defvar | 7209 | @end defvar |
| 7208 | 7210 | ||
| 7209 | @vindex tooltip@r{ face} | 7211 | @vindex tooltip@r{ face} |
diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi index bff3112d73b..7cc91a8f7e3 100644 --- a/doc/lispref/elisp.texi +++ b/doc/lispref/elisp.texi | |||
| @@ -1062,6 +1062,7 @@ Windows | |||
| 1062 | * Vertical Scrolling:: Moving the contents up and down on the window. | 1062 | * Vertical Scrolling:: Moving the contents up and down on the window. |
| 1063 | * Horizontal Scrolling:: Moving the contents sideways on the window. | 1063 | * Horizontal Scrolling:: Moving the contents sideways on the window. |
| 1064 | * Coordinates and Windows:: Converting coordinates to windows. | 1064 | * Coordinates and Windows:: Converting coordinates to windows. |
| 1065 | * Mouse Window Auto-selection:: Automatically selecting windows with the mouse. | ||
| 1065 | * Window Configurations:: Saving and restoring the state of the screen. | 1066 | * Window Configurations:: Saving and restoring the state of the screen. |
| 1066 | * Window Parameters:: Associating additional information with windows. | 1067 | * Window Parameters:: Associating additional information with windows. |
| 1067 | * Window Hooks:: Hooks for scrolling, window size changes, | 1068 | * Window Hooks:: Hooks for scrolling, window size changes, |
| @@ -1089,16 +1090,16 @@ Frames | |||
| 1089 | * Minibuffers and Frames:: How a frame finds the minibuffer to use. | 1090 | * Minibuffers and Frames:: How a frame finds the minibuffer to use. |
| 1090 | * Input Focus:: Specifying the selected frame. | 1091 | * Input Focus:: Specifying the selected frame. |
| 1091 | * Visibility of Frames:: Frames may be visible or invisible, or icons. | 1092 | * Visibility of Frames:: Frames may be visible or invisible, or icons. |
| 1092 | * Raising and Lowering:: Raising a frame makes it hide other windows; | 1093 | * Raising and Lowering:: Raising, Lowering and Restacking Frames. |
| 1093 | lowering it makes the others hide it. | ||
| 1094 | * Frame Configurations:: Saving the state of all frames. | 1094 | * Frame Configurations:: Saving the state of all frames. |
| 1095 | * Child Frames:: Making a frame the child of another. | ||
| 1095 | * Mouse Tracking:: Getting events that say when the mouse moves. | 1096 | * Mouse Tracking:: Getting events that say when the mouse moves. |
| 1096 | * Mouse Position:: Asking where the mouse is, or moving it. | 1097 | * Mouse Position:: Asking where the mouse is, or moving it. |
| 1097 | * Pop-Up Menus:: Displaying a menu for the user to select from. | 1098 | * Pop-Up Menus:: Displaying a menu for the user to select from. |
| 1098 | * Dialog Boxes:: Displaying a box to ask yes or no. | 1099 | * Dialog Boxes:: Displaying a box to ask yes or no. |
| 1099 | * Pointer Shape:: Specifying the shape of the mouse pointer. | 1100 | * Pointer Shape:: Specifying the shape of the mouse pointer. |
| 1100 | * Window System Selections::Transferring text to and from other X clients. | 1101 | * Window System Selections::Transferring text to and from other X clients. |
| 1101 | * Drag and Drop:: Internals of Drag-and-Drop implementation. | 1102 | * Drag and Drop:: Internals of Drag-and-Drop implementation. |
| 1102 | * Color Names:: Getting the definitions of color names. | 1103 | * Color Names:: Getting the definitions of color names. |
| 1103 | * Text Terminal Colors:: Defining colors for text terminals. | 1104 | * Text Terminal Colors:: Defining colors for text terminals. |
| 1104 | * Resources:: Getting resource values from the server. | 1105 | * Resources:: Getting resource values from the server. |
| @@ -1108,7 +1109,8 @@ Frame Geometry | |||
| 1108 | 1109 | ||
| 1109 | * Frame Layout:: Basic layout of frames. | 1110 | * Frame Layout:: Basic layout of frames. |
| 1110 | * Frame Font:: The default font of a frame and how to set it. | 1111 | * Frame Font:: The default font of a frame and how to set it. |
| 1111 | * Size and Position:: Changing the size and position of a frame. | 1112 | * Frame Position:: The position of a frame on its display. |
| 1113 | * Frame Size:: Specifying and retrieving a frame's size. | ||
| 1112 | * Implied Frame Resizing:: Implied resizing of frames and how to prevent it. | 1114 | * Implied Frame Resizing:: Implied resizing of frames and how to prevent it. |
| 1113 | 1115 | ||
| 1114 | Frame Parameters | 1116 | Frame Parameters |
| @@ -1126,6 +1128,8 @@ Window Frame Parameters | |||
| 1126 | * Layout Parameters:: Size of parts of the frame, and | 1128 | * Layout Parameters:: Size of parts of the frame, and |
| 1127 | enabling or disabling some parts. | 1129 | enabling or disabling some parts. |
| 1128 | * Buffer Parameters:: Which buffers have been or should be shown. | 1130 | * Buffer Parameters:: Which buffers have been or should be shown. |
| 1131 | * Frame Interaction Parameters:: Parameters for interacting with other | ||
| 1132 | frames. | ||
| 1129 | * Management Parameters:: Communicating with the window manager. | 1133 | * Management Parameters:: Communicating with the window manager. |
| 1130 | * Cursor Parameters:: Controlling the cursor appearance. | 1134 | * Cursor Parameters:: Controlling the cursor appearance. |
| 1131 | * Font and Color Parameters:: Fonts and colors for the frame text. | 1135 | * Font and Color Parameters:: Fonts and colors for the frame text. |
diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index 68aa40fe4dd..2fac8020ffb 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi | |||
| @@ -77,6 +77,13 @@ displayed on that terminal; the list of possible values is the same as | |||
| 77 | for @code{framep} above. | 77 | for @code{framep} above. |
| 78 | @end defun | 78 | @end defun |
| 79 | 79 | ||
| 80 | @cindex top-level frame | ||
| 81 | On a graphical terminal we distinguish two types of frames: A normal | ||
| 82 | @dfn{top-level frame} is a frame whose window-system window is a child | ||
| 83 | of the window-system's root window for that terminal. A child frame is | ||
| 84 | a frame whose window-system window is the child of the window-system | ||
| 85 | window of another Emacs frame. @xref{Child Frames}. | ||
| 86 | |||
| 80 | @menu | 87 | @menu |
| 81 | * Creating Frames:: Creating additional frames. | 88 | * Creating Frames:: Creating additional frames. |
| 82 | * Multiple Terminals:: Displaying on several different devices. | 89 | * Multiple Terminals:: Displaying on several different devices. |
| @@ -89,9 +96,9 @@ for @code{framep} above. | |||
| 89 | * Minibuffers and Frames:: How a frame finds the minibuffer to use. | 96 | * Minibuffers and Frames:: How a frame finds the minibuffer to use. |
| 90 | * Input Focus:: Specifying the selected frame. | 97 | * Input Focus:: Specifying the selected frame. |
| 91 | * Visibility of Frames:: Frames may be visible or invisible, or icons. | 98 | * Visibility of Frames:: Frames may be visible or invisible, or icons. |
| 92 | * Raising and Lowering:: Raising a frame makes it hide other windows; | 99 | * Raising and Lowering:: Raising, Lowering and Restacking Frames. |
| 93 | lowering it makes the others hide it. | ||
| 94 | * Frame Configurations:: Saving the state of all frames. | 100 | * Frame Configurations:: Saving the state of all frames. |
| 101 | * Child Frames:: Making a frame the child of another. | ||
| 95 | * Mouse Tracking:: Getting events that say when the mouse moves. | 102 | * Mouse Tracking:: Getting events that say when the mouse moves. |
| 96 | * Mouse Position:: Asking where the mouse is, or moving it. | 103 | * Mouse Position:: Asking where the mouse is, or moving it. |
| 97 | * Pop-Up Menus:: Displaying a menu for the user to select from. | 104 | * Pop-Up Menus:: Displaying a menu for the user to select from. |
| @@ -436,7 +443,8 @@ has to specify a live frame (@pxref{Deleting Frames}). If omitted or | |||
| 436 | @menu | 443 | @menu |
| 437 | * Frame Layout:: Basic layout of frames. | 444 | * Frame Layout:: Basic layout of frames. |
| 438 | * Frame Font:: The default font of a frame and how to set it. | 445 | * Frame Font:: The default font of a frame and how to set it. |
| 439 | * Size and Position:: Changing the size and position of a frame. | 446 | * Frame Position:: The position of a frame on its display. |
| 447 | * Frame Size:: Specifying and retrieving a frame's size. | ||
| 440 | * Implied Frame Resizing:: Implied resizing of frames and how to prevent it. | 448 | * Implied Frame Resizing:: Implied resizing of frames and how to prevent it. |
| 441 | @end menu | 449 | @end menu |
| 442 | 450 | ||
| @@ -446,14 +454,16 @@ has to specify a live frame (@pxref{Deleting Frames}). If omitted or | |||
| 446 | @cindex frame layout | 454 | @cindex frame layout |
| 447 | @cindex layout of frame | 455 | @cindex layout of frame |
| 448 | 456 | ||
| 449 | The drawing below sketches the layout of a frame on a graphical | 457 | A visible frame occupies a rectangular area on its terminal's display. |
| 450 | terminal: | 458 | This area may contain a number of nested rectangles, each serving a |
| 459 | different purpose. The drawing below sketches the layout of a frame on | ||
| 460 | a graphical terminal: | ||
| 451 | @smallexample | 461 | @smallexample |
| 452 | @group | 462 | @group |
| 453 | 463 | ||
| 454 | <------------ Outer Frame Width -----------> | 464 | <------------ Outer Frame Width -----------> |
| 455 | ___________________________________________ | 465 | ____________________________________________ |
| 456 | ^(0) ___________ External Border __________ | | 466 | ^(0) ________ External/Outer Border _______ | |
| 457 | | | |_____________ Title Bar ______________| | | 467 | | | |_____________ Title Bar ______________| | |
| 458 | | | (1)_____________ Menu Bar ______________| | ^ | 468 | | | (1)_____________ Menu Bar ______________| | ^ |
| 459 | | | (2)_____________ Tool Bar ______________| | ^ | 469 | | | (2)_____________ Tool Bar ______________| | ^ |
| @@ -468,14 +478,14 @@ Height | | | Height | | | Height | |||
| 468 | | | | | | | | | | | 478 | | | | | | | | | | |
| 469 | | | | |___v______________________________| | | | | 479 | | | | |___v______________________________| | | | |
| 470 | | | |___________ Internal Border __________| | v | 480 | | | |___________ Internal Border __________| | v |
| 471 | v |______________ External Border _____________| | 481 | v |___________ External/Outer Border __________| |
| 472 | <-------- Native Frame Width --------> | 482 | <-------- Native Frame Width --------> |
| 473 | 483 | ||
| 474 | @end group | 484 | @end group |
| 475 | @end smallexample | 485 | @end smallexample |
| 476 | 486 | ||
| 477 | In practice not all of the areas shown in the drawing will or may be | 487 | In practice not all of the areas shown in the drawing will or may be |
| 478 | present. The meaning of these areas is: | 488 | present. The meaning of these areas is described below. |
| 479 | 489 | ||
| 480 | @table @samp | 490 | @table @samp |
| 481 | @item Outer Frame | 491 | @item Outer Frame |
| @@ -483,50 +493,100 @@ present. The meaning of these areas is: | |||
| 483 | @cindex outer edges | 493 | @cindex outer edges |
| 484 | @cindex outer width | 494 | @cindex outer width |
| 485 | @cindex outer height | 495 | @cindex outer height |
| 496 | @cindex outer size | ||
| 486 | The @dfn{outer frame} is a rectangle comprising all areas shown in the | 497 | The @dfn{outer frame} is a rectangle comprising all areas shown in the |
| 487 | drawing. The edges of that rectangle are called the @dfn{outer edges} | 498 | drawing. The edges of that rectangle are called the @dfn{outer edges} |
| 488 | of the frame. The @dfn{outer width} and @dfn{outer height} of the frame | 499 | of the frame. Together, the @dfn{outer width} and @dfn{outer height} of |
| 489 | specify the size of that rectangle. | 500 | the frame specify the @dfn{outer size} of that rectangle. |
| 501 | |||
| 502 | Knowing the outer size of a frame is useful for fitting a frame into the | ||
| 503 | working area of its display (@pxref{Multiple Terminals}) or for placing | ||
| 504 | two frames adjacent to each other on the screen. Usually, the outer | ||
| 505 | size of a frame is available only after the frame has been mapped (made | ||
| 506 | visible, @pxref{Visibility of Frames}) at least once. For the initial | ||
| 507 | frame or a frame that has not been created yet, the outer size can be | ||
| 508 | estimated only or must be calculated from the window-system's or window | ||
| 509 | manager defaults. One workaround is to obtain the differences of the | ||
| 510 | outer and native (see below) sizes of a mapped frame and use them for | ||
| 511 | calculating the outer size of the new frame. | ||
| 490 | 512 | ||
| 491 | @cindex outer position | 513 | @cindex outer position |
| 492 | The upper left corner of the outer frame (indicated by @samp{(0)} in the | 514 | The upper left corner of the outer frame (indicated by @samp{(0)} in the |
| 493 | drawing above) is the @dfn{outer position} or the frame. It is | 515 | drawing above) is the @dfn{outer position} of the frame. The outer |
| 494 | specified by and settable via the @code{left} and @code{top} frame | 516 | position of a graphical frame is also referred to as ``the position'' of |
| 495 | parameters (@pxref{Position Parameters}) as well as the functions | 517 | the frame because it usually remains unchanged on its display whenever |
| 496 | @code{frame-position} and @code{set-frame-position} (@pxref{Size and | 518 | the frame is resized or its layout is changed. |
| 497 | Position}). | 519 | |
| 520 | The outer position is specified by and can be set via the @code{left} | ||
| 521 | and @code{top} frame parameters (@pxref{Position Parameters}). For a | ||
| 522 | normal, top-level frame these parameters usually represent its absolute | ||
| 523 | position (see below) with respect to its display's origin. For a child | ||
| 524 | frame (@pxref{Child Frames}) these parameters represent its position | ||
| 525 | relative to the native position (see below) of its parent frame. For | ||
| 526 | frames on text terminals the values of these parameters are meaningless | ||
| 527 | and always zero. | ||
| 498 | 528 | ||
| 499 | @item External Border | 529 | @item External Border |
| 500 | @cindex external border | 530 | @cindex external border |
| 501 | The @dfn{external border} is part of the decorations supplied by the | 531 | The @dfn{external border} is part of the decorations supplied by the |
| 502 | window manager. It's typically used for resizing the frame with the | 532 | window manager. It is typically used for resizing the frame with the |
| 503 | mouse. The external border is normally not shown on ``fullboth'' and | 533 | mouse and is therefore not shown on ``fullboth'' and maximized frames |
| 504 | maximized frames (@pxref{Size Parameters}) and doesn't exist for text | 534 | (@pxref{Size Parameters}). Its width is determined by the window |
| 505 | terminal frames. | 535 | manager and cannot be changed by Emacs' functions. |
| 506 | 536 | ||
| 507 | The external border should not be confused with the @dfn{outer | 537 | External borders don't exist on text terminal frames. For graphical |
| 508 | border} specified by the @code{border-width} frame parameter | 538 | frames, their display can be suppressed by setting the |
| 509 | (@pxref{Layout Parameters}). Since the outer border is usually ignored | 539 | @code{override-redirect} or @code{undecorated} frame parameter |
| 510 | on most platforms it is not covered here. | 540 | (@pxref{Management Parameters}). |
| 541 | |||
| 542 | @item Outer Border | ||
| 543 | @cindex outer border | ||
| 544 | The @dfn{outer border} is a separate border whose width can be specified | ||
| 545 | with the @code{border-width} frame parameter (@pxref{Layout | ||
| 546 | Parameters}). In practice, either the external or the outer border of a | ||
| 547 | frame are displayed but never both at the same time. Usually, the outer | ||
| 548 | border is shown only for special frames that are not (fully) controlled | ||
| 549 | by the window manager like tooltip frames (@pxref{Tooltips}), child | ||
| 550 | frames (@pxref{Child Frames}) and @code{undecorated} or | ||
| 551 | @code{override-redirect} frames (@pxref{Management Parameters}). | ||
| 552 | |||
| 553 | Outer borders are never shown on text terminal frames and on frames | ||
| 554 | generated by GTK+ routines. On Windows, the outer border is emulated | ||
| 555 | with the help of a one pixel wide external border. Non-toolkit builds | ||
| 556 | allow to change the color of the outer border by setting the | ||
| 557 | @code{border-color} frame parameter (@pxref{Layout Parameters}). | ||
| 511 | 558 | ||
| 512 | @item Title Bar | 559 | @item Title Bar |
| 513 | @cindex title bar | 560 | @cindex title bar |
| 514 | The @dfn{title bar} is also part of the window manager's decorations and | 561 | The @dfn{title bar} is also part of the window manager's decorations and |
| 515 | typically displays the title of the frame (@pxref{Frame Titles}) as well | 562 | typically displays the title of the frame (@pxref{Frame Titles}) as well |
| 516 | as buttons for minimizing, maximizing and deleting the frame. The title | 563 | as buttons for minimizing, maximizing and deleting the frame. It can be |
| 517 | bar is usually not displayed on fullboth (@pxref{Size Parameters}) | 564 | also used for dragging the frame with the mouse. The title bar is |
| 518 | or tooltip frames. Title bars don't exist for text terminal frames. | 565 | usually not displayed for fullboth (@pxref{Size Parameters}), tooltip |
| 566 | (@pxref{Tooltips}) and child frames (@pxref{Child Frames}) and doesn't | ||
| 567 | exist for terminal frames. Display of the title bar can be suppressed | ||
| 568 | by setting the @code{override-redirect} or the @code{undecorated} frame | ||
| 569 | parameters (@pxref{Management Parameters}). | ||
| 519 | 570 | ||
| 520 | @item Menu Bar | 571 | @item Menu Bar |
| 521 | @cindex internal menu bar | 572 | @cindex internal menu bar |
| 522 | @cindex external menu bar | 573 | @cindex external menu bar |
| 523 | The menu bar (@pxref{Menu Bar}) can be either internal (drawn by Emacs | 574 | The menu bar (@pxref{Menu Bar}) can be either internal (drawn by Emacs |
| 524 | itself) or external (drawn by a toolkit). Most builds (GTK+, Lucid, | 575 | itself) or external (drawn by the toolkit). Most builds (GTK+, Lucid, |
| 525 | Motif and Windows) rely on an external menu bar. NS also uses an | 576 | Motif and Windows) rely on an external menu bar. NS also uses an |
| 526 | external menu bar which, however, is not part of the outer frame. | 577 | external menu bar which, however, is not part of the outer frame. |
| 527 | Non-toolkit builds can provide an internal menu bar. On text terminal | 578 | Non-toolkit builds can provide an internal menu bar. On text terminal |
| 528 | frames, the menu bar is part of the frame's root window (@pxref{Windows | 579 | frames, the menu bar is part of the frame's root window (@pxref{Windows |
| 529 | and Frames}). | 580 | and Frames}). As a rule, menu bars are never shown on child frames |
| 581 | (@pxref{Child Frames}). Display of the menu bar can be suppressed by | ||
| 582 | setting the @code{menu-bar-lines} parameter (@pxref{Layout Parameters}) | ||
| 583 | to zero. | ||
| 584 | |||
| 585 | It depends on the toolkit whether to wrap or truncate the menu bar | ||
| 586 | whenever it becomes too long to fit on its frame. Usually, only Motif | ||
| 587 | and Windows builds can wrap the menu bar. When they (un-)wrap the menu | ||
| 588 | bar, they try to keep the outer height of the frame unchanged, so the | ||
| 589 | native height of the frame (see below) will change instead. | ||
| 530 | 590 | ||
| 531 | @item Tool Bar | 591 | @item Tool Bar |
| 532 | @cindex internal tool bar | 592 | @cindex internal tool bar |
| @@ -536,21 +596,39 @@ internal (drawn by Emacs itself) or external (drawn by a toolkit). The | |||
| 536 | GTK+ and NS builds have the tool bar drawn by the toolkit. The | 596 | GTK+ and NS builds have the tool bar drawn by the toolkit. The |
| 537 | remaining builds use internal tool bars. With GTK+ the tool bar can be | 597 | remaining builds use internal tool bars. With GTK+ the tool bar can be |
| 538 | located on either side of the frame, immediately outside the internal | 598 | located on either side of the frame, immediately outside the internal |
| 539 | border, see below. | 599 | border, see below. Tool bars are usually not shown for child frames |
| 600 | (@pxref{Child Frames}). Display of the tool bar can be suppressed by | ||
| 601 | setting the @code{tool-bar-lines} parameter (@pxref{Layout | ||
| 602 | Parameters}) to zero. | ||
| 603 | |||
| 604 | If the variable @code{auto-resize-tool-bars} is non-@code{nil}, Emacs | ||
| 605 | wraps the internal tool bar when it becomes too long for its frame. If | ||
| 606 | and when Emacs (un-)wraps the internal tool bar, it by default keeps the | ||
| 607 | outer height of the frame unchanged, so the native height of the frame | ||
| 608 | (see below) will change instead. Emacs built with GTK+, on the other | ||
| 609 | hand, never wraps the tool bar but may automatically increase the outer | ||
| 610 | width of a frame in order to accommodate an overlong tool bar. | ||
| 540 | 611 | ||
| 541 | @item Native Frame | 612 | @item Native Frame |
| 542 | @cindex native frame | 613 | @cindex native frame |
| 543 | @cindex native edges | 614 | @cindex native edges |
| 544 | @cindex native width | 615 | @cindex native width |
| 545 | @cindex native height | 616 | @cindex native height |
| 546 | @cindex display area | 617 | @cindex native size |
| 547 | The @dfn{native frame} is a rectangle located entirely within the outer | 618 | The @dfn{native frame} is a rectangle located entirely within the outer |
| 548 | frame. It excludes the areas occupied by the external border, the title | 619 | frame. It excludes the areas occupied by an external or outer border, |
| 549 | bar and any external menu or external tool bar. The area enclosed by | 620 | the title bar and any external menu or tool bar. The edges of the |
| 550 | the native frame is sometimes also referred to as the @dfn{display area} | 621 | native frame are called the @dfn{native edges} of the frame. Together, |
| 551 | of the frame. The edges of the native frame are called the @dfn{native | 622 | the @dfn{native width} and @dfn{native height} of a frame specify the |
| 552 | edges} of the frame. The @dfn{native width} and @dfn{native height} of | 623 | @dfn{native size} of the frame. |
| 553 | the frame specify the size of the rectangle. | 624 | |
| 625 | The native size of a frame is the size Emacs passes to the window-system | ||
| 626 | or window manager when creating or resizing the frame from within Emacs. | ||
| 627 | It is also the size Emacs receives from the window-system or window | ||
| 628 | manager whenever these resize the frame's window-system window, for | ||
| 629 | example, after maximizing the frame by clicking on the corresponding | ||
| 630 | button in the title bar or when dragging its external border with the | ||
| 631 | mouse. | ||
| 554 | 632 | ||
| 555 | @cindex native position | 633 | @cindex native position |
| 556 | The top left corner of the native frame specifies the @dfn{native | 634 | The top left corner of the native frame specifies the @dfn{native |
| @@ -565,30 +643,42 @@ position for the various builds: | |||
| 565 | @item (3) GTK+ and NS frames | 643 | @item (3) GTK+ and NS frames |
| 566 | @end itemize | 644 | @end itemize |
| 567 | 645 | ||
| 568 | Accordingly, the native height of a frame includes the height of the | 646 | Accordingly, the native height of a frame may include the height of the |
| 569 | tool bar but not that of the menu bar (Lucid, Motif, Windows) or those | 647 | tool bar but not that of the menu bar (Lucid, Motif, Windows) or those |
| 570 | of the menu bar and the tool bar (non-toolkit and text terminal frames). | 648 | of the menu bar and the tool bar (non-toolkit and text terminal frames). |
| 571 | 649 | ||
| 572 | The native position of a frame is the reference position of functions | 650 | The native position of a frame is the reference position for functions |
| 573 | that set or return the current position of the mouse (@pxref{Mouse | 651 | that set or return the current position of the mouse (@pxref{Mouse |
| 574 | Position}) and for functions dealing with the position of windows like | 652 | Position}) and for functions dealing with the position of windows like |
| 575 | @code{window-edges}, @code{window-at} or @code{coordinates-in-window-p} | 653 | @code{window-edges}, @code{window-at} or @code{coordinates-in-window-p} |
| 576 | (@pxref{Coordinates and Windows}). | 654 | (@pxref{Coordinates and Windows}). It also specifies the (0, 0) origin |
| 655 | for locating and positioning child frames within this frame | ||
| 656 | (@pxref{Child Frames}). | ||
| 657 | |||
| 658 | Note also that the native position of a frame usually remains unaltered | ||
| 659 | on its display when removing or adding the window manager decorations by | ||
| 660 | changing the frame's @code{override-redirect} or @code{undecorated} | ||
| 661 | parameter (@pxref{Management Parameters}). | ||
| 577 | 662 | ||
| 578 | @item Internal Border | 663 | @item Internal Border |
| 579 | The internal border (@pxref{Layout Parameters}) is a border drawn by | 664 | The internal border is a border drawn by Emacs around the inner frame |
| 580 | Emacs around the inner frame (see below). | 665 | (see below). Its width is specified by the @code{internal-border-width} |
| 666 | frame parameter (@pxref{Layout Parameters}). Its color is specified by | ||
| 667 | the background of the @code{internal-border} face. | ||
| 581 | 668 | ||
| 582 | @item Inner Frame | 669 | @item Inner Frame |
| 583 | @cindex inner frame | 670 | @cindex inner frame |
| 584 | @cindex inner edges | 671 | @cindex inner edges |
| 585 | @cindex inner width | 672 | @cindex inner width |
| 586 | @cindex inner height | 673 | @cindex inner height |
| 674 | @cindex inner size | ||
| 675 | @cindex display area | ||
| 587 | The @dfn{inner frame} is the rectangle reserved for the frame's windows. | 676 | The @dfn{inner frame} is the rectangle reserved for the frame's windows. |
| 588 | It's enclosed by the internal border which, however, is not part of the | 677 | It's enclosed by the internal border which, however, is not part of the |
| 589 | inner frame. Its edges are called the @dfn{inner edges} of the frame. | 678 | inner frame. Its edges are called the @dfn{inner edges} of the frame. |
| 590 | The @dfn{inner width} and @dfn{inner height} specify the size of the | 679 | The @dfn{inner width} and @dfn{inner height} specify the @dfn{inner |
| 591 | rectangle. | 680 | size} of the rectangle. The inner frame is sometimes also referred to |
| 681 | as the @dfn{display area} of the frame. | ||
| 592 | 682 | ||
| 593 | @cindex minibuffer-less frame | 683 | @cindex minibuffer-less frame |
| 594 | @cindex minibuffer-only frame | 684 | @cindex minibuffer-only frame |
| @@ -603,22 +693,39 @@ configurations. | |||
| 603 | 693 | ||
| 604 | @item Text Area | 694 | @item Text Area |
| 605 | @cindex text area | 695 | @cindex text area |
| 606 | The @dfn{text area} of a frame is a somewhat fictitious area located | 696 | The @dfn{text area} of a frame is a somewhat fictitious area that can be |
| 607 | entirely within the native frame. It can be obtained by removing from | 697 | embedded in the native frame. Its position is unspecified. Its width |
| 608 | the native frame any internal borders, one vertical and one horizontal | 698 | can be obtained by removing from that of the native width the widths of |
| 609 | scroll bar, and one left and one right fringe as specified for this | 699 | the internal border, one vertical scroll bar, and one left and one right |
| 610 | frame, see @ref{Layout Parameters}. | 700 | fringe as specified for this frame, see @ref{Layout Parameters}. Its |
| 701 | height can be obtained by removing from that of the native height the | ||
| 702 | widths of the internal border and the heights of the frame's internal | ||
| 703 | menu and tool bars and one horizontal scroll bar as specified for this | ||
| 704 | frame. | ||
| 611 | @end table | 705 | @end table |
| 612 | 706 | ||
| 613 | @cindex absolute position | 707 | @cindex absolute position |
| 614 | The @dfn{absolute position} of a frame or its edges is usually given in | 708 | @cindex absolute frame position |
| 615 | terms of pixels counted from an origin at position (0, 0) of the frame's | 709 | @cindex absolute edges |
| 616 | display. Note that with multiple monitors the origin does not | 710 | @cindex absolute frame edges |
| 617 | necessarily coincide with the top left corner of the entire usable | 711 | @cindex display origin |
| 618 | display area. Hence the absolute outer position of a frame or the | 712 | @cindex origin of display |
| 619 | absolute positions of the edges of the outer, native or inner frame can | 713 | The @dfn{absolute position} of a frame is given as a pair (X, Y) of |
| 620 | be negative in such an environment even when that frame is completely | 714 | horizontal and vertical pixel offsets relative to an origin (0, 0) of |
| 621 | visible. | 715 | the frame's display. Correspondingly, the @dfn{absolute edges} of a |
| 716 | frame are given as pixel offsets from that origin. | ||
| 717 | |||
| 718 | Note that with multiple monitors the origin of the display does not | ||
| 719 | necessarily coincide with the top-left corner of the entire usable | ||
| 720 | display area of the terminal. Hence the absolute position of a frame | ||
| 721 | can be negative in such an environment even when that frame is | ||
| 722 | completely visible. | ||
| 723 | |||
| 724 | By convention, vertical offsets increase ``downwards''. This means | ||
| 725 | that the height of a frame is obtained by subtracting the offset of its | ||
| 726 | top edge from that of its bottom edge. Horizontal offsets increase | ||
| 727 | ``leftwards'' as expected so a frame's width is calculated by | ||
| 728 | subtracting the offset of its left edge from that of its right edge. | ||
| 622 | 729 | ||
| 623 | For a frame on a graphical terminal the following function returns the | 730 | For a frame on a graphical terminal the following function returns the |
| 624 | sizes of the areas described above: | 731 | sizes of the areas described above: |
| @@ -626,13 +733,15 @@ sizes of the areas described above: | |||
| 626 | @defun frame-geometry &optional frame | 733 | @defun frame-geometry &optional frame |
| 627 | This function returns geometric attributes of @var{frame}. The return | 734 | This function returns geometric attributes of @var{frame}. The return |
| 628 | value is an association list of the attributes listed below. All | 735 | value is an association list of the attributes listed below. All |
| 629 | coordinate, height and width values are integers counting pixels. | 736 | coordinate, height and width values are integers counting pixels. Note |
| 737 | that if @var{frame} has not been mapped (@pxref{Visibility of Frames}) | ||
| 738 | yet, some of the return values may only represent approximations of the | ||
| 739 | actual values---those that can be seen after the frame has been mapped. | ||
| 630 | 740 | ||
| 631 | @table @code | 741 | @table @code |
| 632 | @item outer-position | 742 | @item outer-position |
| 633 | A cons of the absolute X- and Y-coordinates of the outer position of | 743 | A cons representing the absolute position of the outer @var{frame}, |
| 634 | @var{frame}, relative to the origin at position (0, 0) of @var{frame}'s | 744 | relative to the origin at position (0, 0) of @var{frame}'s display. |
| 635 | display. | ||
| 636 | 745 | ||
| 637 | @item outer-size | 746 | @item outer-size |
| 638 | A cons of the outer width and height of @var{frame}. | 747 | A cons of the outer width and height of @var{frame}. |
| @@ -643,6 +752,10 @@ borders as supplied by the window manager. If the window manager | |||
| 643 | doesn't supply these values, Emacs will try to guess them from the | 752 | doesn't supply these values, Emacs will try to guess them from the |
| 644 | coordinates of the outer and inner frame. | 753 | coordinates of the outer and inner frame. |
| 645 | 754 | ||
| 755 | @item outer-border-width | ||
| 756 | The width of the outer border of @var{frame}. The value is meaningful | ||
| 757 | for non-GTK+ X builds only. | ||
| 758 | |||
| 646 | @item title-bar-size | 759 | @item title-bar-size |
| 647 | A cons of the width and height of the title bar of @var{frame} as | 760 | A cons of the width and height of the title bar of @var{frame} as |
| 648 | supplied by the window manager or operating system. If both of them are | 761 | supplied by the window manager or operating system. If both of them are |
| @@ -677,24 +790,27 @@ The following function can be used to retrieve the edges of the outer, | |||
| 677 | native and inner frame. | 790 | native and inner frame. |
| 678 | 791 | ||
| 679 | @defun frame-edges &optional frame type | 792 | @defun frame-edges &optional frame type |
| 680 | This function returns the edges of the outer, native or inner frame of | 793 | This function returns the absolute edges of the outer, native or inner |
| 681 | @var{frame}. @var{frame} must be a live frame and defaults to the | 794 | frame of @var{frame}. @var{frame} must be a live frame and defaults to |
| 682 | selected one. The list returned has the form (@var{left} @var{top} | 795 | the selected one. The list returned has the form (@var{left} @var{top} |
| 683 | @var{right} @var{bottom}) where all values are in pixels relative to the | 796 | @var{right} @var{bottom}) where all values are in pixels relative to the |
| 684 | position (0, 0) of @var{frame}'s display. For terminal frames | 797 | origin of @var{frame}'s display. For terminal frames the values |
| 685 | @var{left} and @var{top} are both zero. | 798 | returned for @var{left} and @var{top} are always zero. |
| 686 | 799 | ||
| 687 | Optional argument @var{type} specifies the type of the edges to return: | 800 | Optional argument @var{type} specifies the type of the edges to return: |
| 688 | @var{type} @code{outer-edges} means to return the outer edges of | 801 | @code{outer-edges} means to return the outer edges of @var{frame}, |
| 689 | @var{frame}, @code{native-edges} (or @code{nil}) means to return its | 802 | @code{native-edges} (or @code{nil}) means to return its native edges and |
| 690 | native edges and @code{inner-edges} means to return its inner edges. | 803 | @code{inner-edges} means to return its inner edges. |
| 691 | 804 | ||
| 692 | Notice that the pixels at the positions @var{bottom} and @var{right} | 805 | By convention, the pixels of the display at the values returned for |
| 693 | lie immediately outside the corresponding frame. This means that if you | 806 | @var{left} and @var{top} are inside (part of) @var{frame}. Hence, if |
| 694 | have, for example, two side-by-side frames positioned such that the | 807 | @var{left} and @var{top} are both zero, the pixel at the display's |
| 695 | right outer edge of the frame on the left equals the left outer edge of | 808 | origin is part of @var{frame}. The pixels at @var{bottom} and |
| 696 | the frame on the right, the pixels representing that edge are part | 809 | @var{right}, on the other hand, lie immediately outside @var{frame}. |
| 697 | of the frame on the right. | 810 | This means that if you have, for example, two side-by-side frames |
| 811 | positioned such that the right outer edge of the frame on the left | ||
| 812 | equals the left outer edge of the frame on the right, the pixels at that | ||
| 813 | edge show a part of the frame on the right. | ||
| 698 | @end defun | 814 | @end defun |
| 699 | 815 | ||
| 700 | 816 | ||
| @@ -751,62 +867,112 @@ and all future graphical frames. | |||
| 751 | @end deffn | 867 | @end deffn |
| 752 | 868 | ||
| 753 | 869 | ||
| 754 | @node Size and Position | 870 | @node Frame Position |
| 755 | @subsection Size and Position | 871 | @subsection Frame Position |
| 756 | @cindex frame size | ||
| 757 | @cindex frame position | 872 | @cindex frame position |
| 758 | @cindex position of frame | 873 | @cindex position of frame |
| 759 | 874 | ||
| 760 | You can read or change the position of a frame using the frame | 875 | On graphical systems, the position of a normal top-level frame is |
| 761 | parameters @code{left} and @code{top} (@pxref{Position Parameters}) and | 876 | specified as the absolute position of its outer frame (@pxref{Frame |
| 762 | its size using the @code{height} and @code{width} parameters | 877 | Geometry}). The position of a child frame (@pxref{Child Frames}) is |
| 763 | (@pxref{Size Parameters}). Here are some special features for working | 878 | specified via pixel offsets of its outer edges relative to the native |
| 764 | with sizes and positions. For all of these functions the argument | 879 | position of its parent frame. |
| 765 | @var{frame} must denote a live frame and defaults to the selected frame. | 880 | |
| 881 | You can read or change the position of a frame using the frame | ||
| 882 | parameters @code{left} and @code{top} (@pxref{Position Parameters}). | ||
| 883 | Here are two additional functions for working with the positions of an | ||
| 884 | existing, visible frame. For both functions, the argument @var{frame} | ||
| 885 | must denote a live frame and defaults to the selected frame. | ||
| 766 | 886 | ||
| 767 | @defun frame-position &optional frame | 887 | @defun frame-position &optional frame |
| 768 | This function returns the outer position (@pxref{Frame Layout}) of | 888 | For a normal, non-child frame this function returns a cons of the (X, Y) |
| 769 | @var{frame} in pixels. The value is a cons giving the coordinates of | 889 | pixel coordinates of its outer position (@pxref{Frame Layout}) with |
| 770 | the top left corner of the outer frame of @var{frame} relative to an | 890 | respect to the origin (0, 0) of its display. For a child frame |
| 771 | origin at the position (0, 0) of the frame's display. On a text | 891 | (@pxref{Child Frames}) this function returns the pixel coordinates of |
| 772 | terminal frame both values are zero. | 892 | its outer position with respect to an origin (0, 0) at the native |
| 893 | position of @var{frame}'s parent. | ||
| 894 | |||
| 895 | Negative return values never indicate an offset from the right or bottom | ||
| 896 | edge of @var{frame}'s display or parent frame. Rather, they mean that | ||
| 897 | @var{frame}'s outer position is on the left and/or above the origin of | ||
| 898 | its display or the native position of its parent frame. This usually | ||
| 899 | means that @var{frame} is only partially visible (or completely | ||
| 900 | invisible). However, on systems where the display's origin does not | ||
| 901 | coincide with its top-left corner, the frame may be visible on a | ||
| 902 | secondary monitor. | ||
| 903 | |||
| 904 | On a text terminal frame both values are zero. | ||
| 773 | @end defun | 905 | @end defun |
| 774 | 906 | ||
| 775 | @defun set-frame-position frame x y | 907 | @defun set-frame-position frame x y |
| 776 | This function sets the outer frame position of @var{frame} to @var{x} | 908 | This function sets the outer frame position of @var{frame} to (@var{x}, |
| 777 | and @var{y}. The latter arguments specify pixels and normally count | 909 | @var{y}). The latter arguments specify pixels and normally count from |
| 778 | from an origin at the position (0, 0) of @var{frame}'s display. | 910 | an origin at the position (0, 0) of @var{frame}'s display. For child |
| 911 | frames, they count from the native position of @var{frame}'s parent | ||
| 912 | frame. | ||
| 913 | |||
| 914 | Negative parameter values position the right edge of the outer frame by | ||
| 915 | @var{-x} pixels left from the right edge of the screen (or the parent | ||
| 916 | frame's native rectangle) and the bottom edge by @var{-y} pixels up from | ||
| 917 | the bottom edge of the screen (or the parent frame's native rectangle). | ||
| 779 | 918 | ||
| 780 | A negative parameter value positions the right edge of the outer frame | 919 | Note that negative values do not permit to align the right or bottom |
| 781 | by @var{-x} pixels left from the right edge of the screen or the bottom | 920 | edge of @var{frame} exactly at the right or bottom edge of its display |
| 782 | edge by @var{-y} pixels up from the bottom edge of the screen. | 921 | or parent frame. Neither do they allow to specify a position that does |
| 922 | not lie within the edges of the display or parent frame. The frame | ||
| 923 | parameters @code{left} and @code{top} (@pxref{Position Parameters}) | ||
| 924 | allow to do that but may still fail to provide good results for the | ||
| 925 | initial or a new frame. | ||
| 783 | 926 | ||
| 784 | This function has no effect on text terminal frames. | 927 | This function has no effect on text terminal frames. |
| 785 | @end defun | 928 | @end defun |
| 786 | 929 | ||
| 787 | @defun frame-pixel-height &optional frame | 930 | @defvar move-frame-functions |
| 788 | @defunx frame-pixel-width &optional frame | 931 | This hook specifies the functions run when an Emacs frame is moved |
| 789 | These functions return the inner height and width (the height and | 932 | (assigned a new position) by the window-system or window manager. The |
| 790 | width of the display area, see @ref{Frame Layout}) of @var{frame} in | 933 | functions are run with one argument, the frame that moved. For a child |
| 791 | pixels. For a text terminal, the results are in characters rather than | 934 | frame (@pxref{Child Frames}), the functions are run only when the |
| 792 | pixels. | 935 | position of the frame changes in relation to that of its parent frame. |
| 793 | @end defun | 936 | @end defvar |
| 937 | |||
| 938 | |||
| 939 | @node Frame Size | ||
| 940 | @subsection Frame Size | ||
| 941 | @cindex frame size | ||
| 942 | @cindex text width of a frame | ||
| 943 | @cindex text height of a frame | ||
| 944 | @cindex text size of a frame | ||
| 945 | The canonical way to specify the @dfn{size of a frame} from within Emacs | ||
| 946 | is by specifying its @dfn{text size}---a tuple of the width and height | ||
| 947 | of the frame's text area (@pxref{Frame Layout}). It can be measured | ||
| 948 | either in pixels or in terms of the frame's canonical character size | ||
| 949 | (@pxref{Frame Font}). | ||
| 950 | |||
| 951 | For frames with an internal menu or tool bar, the frame's native | ||
| 952 | height cannot be told exactly before the frame has been actually drawn. | ||
| 953 | This means that in general you cannot use the native size to specify the | ||
| 954 | initial size of a frame. As soon as you know the native size of a | ||
| 955 | visible frame, you can calculate its outer size (@pxref{Frame Layout}) | ||
| 956 | by adding in the remaining components from the return value of | ||
| 957 | @code{frame-geometry} . For invisible frames or for frames that have | ||
| 958 | yet to be created, however, the outer size can be estimated only. This | ||
| 959 | also means that calculating an exact initial position of a frame | ||
| 960 | specified via offsets from the right or bottom edge of the screen | ||
| 961 | (@pxref{Frame Position}) is impossible. | ||
| 962 | |||
| 963 | The text size of any frame can be set and retrieved with the help of | ||
| 964 | the @code{height} and @code{width} frame parameters (@pxref{Size | ||
| 965 | Parameters}). The text size of the initial frame can be also set with | ||
| 966 | the help of an X-style geometry specification. @xref{Emacs Invocation,, | ||
| 967 | Command Line Arguments for Emacs Invocation, emacs, The GNU Emacs | ||
| 968 | Manual}. Below we list some functions to access and set the size of an | ||
| 969 | existing, visible frame. | ||
| 794 | 970 | ||
| 795 | @defun frame-text-height &optional frame | 971 | @defun frame-text-height &optional frame |
| 796 | @defunx frame-text-width &optional frame | 972 | @defunx frame-text-width &optional frame |
| 797 | These functions return the height and width of the text area of | 973 | These functions return the height and width of the text area of |
| 798 | @var{frame} (@pxref{Frame Layout}), measured in pixels. For a text | 974 | @var{frame} (@pxref{Frame Layout}), measured in pixels. For a text |
| 799 | terminal, the results are in characters rather than pixels. | 975 | terminal, the results are in characters rather than pixels. |
| 800 | |||
| 801 | The value returned by @code{frame-text-height} differs from that | ||
| 802 | returned by @code{frame-pixel-height} by not including the heights of | ||
| 803 | any internal tool bar or menu bar, the height of one horizontal scroll | ||
| 804 | bar and the widths of the internal border. | ||
| 805 | |||
| 806 | The value returned by @code{frame-text-width} differs from that returned | ||
| 807 | by @code{frame-pixel-width} by not including the width of one vertical | ||
| 808 | scroll bar, the widths of one left and one right fringe and the widths | ||
| 809 | of the internal border. | ||
| 810 | @end defun | 976 | @end defun |
| 811 | 977 | ||
| 812 | @defun frame-height &optional frame | 978 | @defun frame-height &optional frame |
| @@ -823,12 +989,28 @@ rounded down to the number of characters of the default font that fully | |||
| 823 | fit into the text area. | 989 | fit into the text area. |
| 824 | @end defun | 990 | @end defun |
| 825 | 991 | ||
| 992 | @defun frame-pixel-height &optional frame | ||
| 993 | @defunx frame-pixel-width &optional frame | ||
| 994 | These functions return the native width and height, see @ref{Frame | ||
| 995 | Layout}) of @var{frame} in pixels. For a text terminal, the results are | ||
| 996 | in characters rather than pixels. | ||
| 997 | @end defun | ||
| 998 | |||
| 999 | On window systems that support it, Emacs tries by default to make the | ||
| 1000 | text size of a frame measured in pixels a multiple of the frame's | ||
| 1001 | character size. This, however, usually means that a frame can be | ||
| 1002 | resized only in character size increments when dragging its external | ||
| 1003 | borders. It also may break attempts to truly maximize the frame or | ||
| 1004 | making it ``fullheight'' or ``fullwidth'' (@pxref{Size Parameters}) | ||
| 1005 | leaving some empty space below and/or on the right of the frame. The | ||
| 1006 | following option may help in that case. | ||
| 1007 | |||
| 826 | @defopt frame-resize-pixelwise | 1008 | @defopt frame-resize-pixelwise |
| 827 | If this option is @code{nil}, a frame's size is usually rounded to a | 1009 | If this option is @code{nil}, a frame's text pixel size is usually |
| 828 | multiple of the current values of that frame's @code{frame-char-height} | 1010 | rounded to a multiple of the current values of that frame's |
| 829 | and @code{frame-char-width} whenever the frame is resized. If this is | 1011 | @code{frame-char-height} and @code{frame-char-width} whenever the frame |
| 830 | non-@code{nil}, no rounding occurs, hence frame sizes can | 1012 | is resized. If this is non-@code{nil}, no rounding occurs, hence frame |
| 831 | increase/decrease by one pixel. | 1013 | sizes can increase/decrease by one pixel. |
| 832 | 1014 | ||
| 833 | Setting this variable usually causes the next resize operation to pass | 1015 | Setting this variable usually causes the next resize operation to pass |
| 834 | the corresponding size hints to the window manager. This means that | 1016 | the corresponding size hints to the window manager. This means that |
| @@ -855,7 +1037,7 @@ terms of the canonical height and width of a character on @var{frame} | |||
| 855 | The optional argument @var{pixelwise} non-@code{nil} means to measure | 1037 | The optional argument @var{pixelwise} non-@code{nil} means to measure |
| 856 | the new width and height in units of pixels instead. Note that if | 1038 | the new width and height in units of pixels instead. Note that if |
| 857 | @code{frame-resize-pixelwise} is @code{nil}, some toolkits may refuse to | 1039 | @code{frame-resize-pixelwise} is @code{nil}, some toolkits may refuse to |
| 858 | fully honor the request if it does not increase/decrease the frame size | 1040 | truly honor the request if it does not increase/decrease the frame size |
| 859 | to a multiple of its character size. | 1041 | to a multiple of its character size. |
| 860 | @end defun | 1042 | @end defun |
| 861 | 1043 | ||
| @@ -876,9 +1058,9 @@ text terminals. | |||
| 876 | 1058 | ||
| 877 | The optional fourth argument @var{pixelwise} non-@code{nil} means that | 1059 | The optional fourth argument @var{pixelwise} non-@code{nil} means that |
| 878 | @var{frame} should be @var{height} pixels high. Note that if | 1060 | @var{frame} should be @var{height} pixels high. Note that if |
| 879 | @code{frame-resize-pixelwise} is @code{nil}, some toolkits may refuse to | 1061 | @code{frame-resize-pixelwise} is @code{nil}, some window managers may |
| 880 | fully honor the request if it does not increase/decrease the frame | 1062 | refuse to truly honor the request if it does not increase/decrease the |
| 881 | height to a multiple of its character height. | 1063 | frame height to a multiple of its character height. |
| 882 | @end defun | 1064 | @end defun |
| 883 | 1065 | ||
| 884 | @defun set-frame-width frame width &optional pretend pixelwise | 1066 | @defun set-frame-width frame width &optional pretend pixelwise |
| @@ -888,9 +1070,9 @@ in characters. The argument @var{pretend} has the same meaning as in | |||
| 888 | 1070 | ||
| 889 | The optional fourth argument @var{pixelwise} non-@code{nil} means that | 1071 | The optional fourth argument @var{pixelwise} non-@code{nil} means that |
| 890 | @var{frame} should be @var{width} pixels wide. Note that if | 1072 | @var{frame} should be @var{width} pixels wide. Note that if |
| 891 | @code{frame-resize-pixelwise} is @code{nil}, some toolkits may refuse to | 1073 | @code{frame-resize-pixelwise} is @code{nil}, some window managers may |
| 892 | fully honor the request if it does not increase/decrease the frame width | 1074 | refuse to fully honor the request if it does not increase/decrease the |
| 893 | to a multiple of its character width. | 1075 | frame width to a multiple of its character width. |
| 894 | @end defun | 1076 | @end defun |
| 895 | 1077 | ||
| 896 | None of these three functions will make a frame smaller than needed to | 1078 | None of these three functions will make a frame smaller than needed to |
| @@ -899,7 +1081,25 @@ margins, dividers, mode and header lines. This contrasts with requests | |||
| 899 | by the window manager triggered, for example, by dragging the external | 1081 | by the window manager triggered, for example, by dragging the external |
| 900 | border of a frame with the mouse. Such requests are always honored by | 1082 | border of a frame with the mouse. Such requests are always honored by |
| 901 | clipping, if necessary, portions that cannot be displayed at the right, | 1083 | clipping, if necessary, portions that cannot be displayed at the right, |
| 902 | bottom corner of the frame. | 1084 | bottom corner of the frame. The parameters @code{min-width} and |
| 1085 | @code{min-height} (@pxref{Size Parameters}) can be used to obtain a | ||
| 1086 | similar behavior when changing the frame size from within Emacs. | ||
| 1087 | |||
| 1088 | @cindex tracking frame size changes | ||
| 1089 | The abnormal hook @code{window-size-change-functions} (@pxref{Window | ||
| 1090 | Hooks}) tracks all changes of the inner size of a frame including those | ||
| 1091 | induced by request of the window-system or window manager. To rule out | ||
| 1092 | false positives that might occur when changing only the sizes of a | ||
| 1093 | frame's windows without actually changing the size of the inner frame, | ||
| 1094 | use the following function. | ||
| 1095 | |||
| 1096 | @defun frame-size-changed-p &optional frame | ||
| 1097 | This function returns non-@code{nil} when the inner width or height of | ||
| 1098 | @var{frame} has changed since @code{window-size-change-functions} was | ||
| 1099 | run the last time for @var{frame}. It always returns @code{nil} | ||
| 1100 | immediately after running @code{window-size-change-functions} for | ||
| 1101 | @var{frame}. | ||
| 1102 | @end defun | ||
| 903 | 1103 | ||
| 904 | 1104 | ||
| 905 | @node Implied Frame Resizing | 1105 | @node Implied Frame Resizing |
| @@ -916,7 +1116,7 @@ size change. Note that wrapping a menu or tool bar usually does not | |||
| 916 | resize the frame's outer size, hence this will alter the number of | 1116 | resize the frame's outer size, hence this will alter the number of |
| 917 | displayed lines. | 1117 | displayed lines. |
| 918 | 1118 | ||
| 919 | Occasionally, such @dfn{implied frame resizing} may be unwanted, for | 1119 | Occasionally, such @dfn{implied frame resizing} may be unwanted, for |
| 920 | example, when the frame is maximized or made full-screen (where it's | 1120 | example, when the frame is maximized or made full-screen (where it's |
| 921 | turned off by default). In other cases you can disable implied resizing | 1121 | turned off by default). In other cases you can disable implied resizing |
| 922 | with the following option: | 1122 | with the following option: |
| @@ -928,7 +1128,7 @@ implicitly resize the frame's display area in order to preserve the | |||
| 928 | number of columns or lines the frame displays. If this option is | 1128 | number of columns or lines the frame displays. If this option is |
| 929 | non-@code{nil}, no implied resizing is done. | 1129 | non-@code{nil}, no implied resizing is done. |
| 930 | 1130 | ||
| 931 | The value of this option can be also be a list of frame parameters. In | 1131 | The value of this option can be also a list of frame parameters. In |
| 932 | that case, implied resizing is inhibited when changing a parameter that | 1132 | that case, implied resizing is inhibited when changing a parameter that |
| 933 | appears in this list. The frame parameters currently handled by this | 1133 | appears in this list. The frame parameters currently handled by this |
| 934 | option are: @code{font}, @code{font-backend}, | 1134 | option are: @code{font}, @code{font-backend}, |
| @@ -1135,6 +1335,8 @@ text terminals. | |||
| 1135 | * Layout Parameters:: Size of parts of the frame, and | 1335 | * Layout Parameters:: Size of parts of the frame, and |
| 1136 | enabling or disabling some parts. | 1336 | enabling or disabling some parts. |
| 1137 | * Buffer Parameters:: Which buffers have been or should be shown. | 1337 | * Buffer Parameters:: Which buffers have been or should be shown. |
| 1338 | * Frame Interaction Parameters:: Parameters for interacting with other | ||
| 1339 | frames. | ||
| 1138 | * Management Parameters:: Communicating with the window manager. | 1340 | * Management Parameters:: Communicating with the window manager. |
| 1139 | * Cursor Parameters:: Controlling the cursor appearance. | 1341 | * Cursor Parameters:: Controlling the cursor appearance. |
| 1140 | * Font and Color Parameters:: Fonts and colors for the frame text. | 1342 | * Font and Color Parameters:: Fonts and colors for the frame text. |
| @@ -1180,64 +1382,81 @@ If you specify the frame name explicitly when you create the frame, the | |||
| 1180 | name is also used (instead of the name of the Emacs executable) when | 1382 | name is also used (instead of the name of the Emacs executable) when |
| 1181 | looking up X resources for the frame. | 1383 | looking up X resources for the frame. |
| 1182 | 1384 | ||
| 1385 | @vindex explicit-name, a frame parameter | ||
| 1183 | @item explicit-name | 1386 | @item explicit-name |
| 1184 | If the frame name was specified explicitly when the frame was created, | 1387 | If the frame name was specified explicitly when the frame was created, |
| 1185 | this parameter will be that name. If the frame wasn't explicitly | 1388 | this parameter will be that name. If the frame wasn't explicitly |
| 1186 | named, this parameter will be @code{nil}. | 1389 | named, this parameter will be @code{nil}. |
| 1187 | @end table | 1390 | @end table |
| 1188 | 1391 | ||
| 1392 | |||
| 1189 | @node Position Parameters | 1393 | @node Position Parameters |
| 1190 | @subsubsection Position Parameters | 1394 | @subsubsection Position Parameters |
| 1191 | @cindex window position on display | 1395 | @cindex window position on display |
| 1192 | @cindex frame position | 1396 | @cindex frame position |
| 1193 | 1397 | ||
| 1194 | Position parameters' values are measured in pixels. (Note that none | 1398 | Parameters describing the X- and Y-offsets of a frame are always |
| 1195 | of these parameters exist on TTY frames.) | 1399 | measured in pixels. For normal, non-child frames they specify the |
| 1400 | frame's absolute outer position (@pxref{Frame Geometry}) with respect to | ||
| 1401 | its display's origin. For a child frame (@pxref{Child Frames}) they | ||
| 1402 | specify the frame's outer position relative to the native position of | ||
| 1403 | the frame's parent frame. (Note that none of these parameters is | ||
| 1404 | meaningful on TTY frames.) | ||
| 1196 | 1405 | ||
| 1197 | @table @code | 1406 | @table @code |
| 1198 | @vindex left, a frame parameter | 1407 | @vindex left, a frame parameter |
| 1199 | @item left | 1408 | @item left |
| 1200 | The position, in pixels, of the left (or right) edge of the frame with | 1409 | The position, in pixels, of the left outer edge of the frame with |
| 1201 | respect to the left (or right) edge of the screen. The value may be: | 1410 | respect to the left edge of the frame's display or parent frame. |
| 1202 | 1411 | ||
| 1203 | @table @asis | 1412 | @table @asis |
| 1204 | @item an integer | 1413 | @item an integer |
| 1205 | A positive integer relates the left edge of the frame to the left edge | 1414 | A positive integer always relates the left edge of the frame to the left |
| 1206 | of the screen. A negative integer relates the right frame edge to the | 1415 | edge of its display or parent frame. A negative integer relates the |
| 1207 | right screen edge. | 1416 | right frame edge to the right edge of the display or parent frame. |
| 1208 | 1417 | ||
| 1209 | @item @code{(+ @var{pos})} | 1418 | @item @code{(+ @var{pos})} |
| 1210 | This specifies the position of the left frame edge relative to the left | 1419 | This specifies the position of the left frame edge relative to the left |
| 1211 | screen edge. The integer @var{pos} may be positive or negative; a | 1420 | edge of its display or parent frame. The integer @var{pos} may be |
| 1212 | negative value specifies a position outside the screen or on a monitor | 1421 | positive or negative; a negative value specifies a position outside the |
| 1213 | other than the primary one (for multi-monitor displays). | 1422 | screen or parent frame or on a monitor other than the primary one (for |
| 1423 | multi-monitor displays). | ||
| 1214 | 1424 | ||
| 1215 | @item @code{(- @var{pos})} | 1425 | @item @code{(- @var{pos})} |
| 1216 | This specifies the position of the right frame edge relative to the right | 1426 | This specifies the position of the right frame edge relative to the |
| 1217 | screen edge. The integer @var{pos} may be positive or negative; a | 1427 | right edge of the display or parent frame. The integer @var{pos} may be |
| 1218 | negative value specifies a position outside the screen or on a monitor | 1428 | positive or negative; a negative value specifies a position outside the |
| 1219 | other than the primary one (for multi-monitor displays). | 1429 | screen or parent frame or on a monitor other than the primary one (for |
| 1430 | multi-monitor displays). | ||
| 1220 | @end table | 1431 | @end table |
| 1221 | 1432 | ||
| 1222 | Some window managers ignore program-specified positions. If you want to | 1433 | Some window managers ignore program-specified positions. If you want to |
| 1223 | be sure the position you specify is not ignored, specify a | 1434 | be sure the position you specify is not ignored, specify a |
| 1224 | non-@code{nil} value for the @code{user-position} parameter as well. | 1435 | non-@code{nil} value for the @code{user-position} parameter as in the |
| 1225 | 1436 | following example: | |
| 1226 | If the window manager refuses to align a frame at the left or top screen | ||
| 1227 | edge, combining position notation and @code{user-position} as in | ||
| 1228 | 1437 | ||
| 1229 | @example | 1438 | @example |
| 1230 | (modify-frame-parameters | 1439 | (modify-frame-parameters |
| 1231 | nil '((user-position . t) (left . (+ -4)))) | 1440 | nil '((user-position . t) (left . (+ -4)))) |
| 1232 | @end example | 1441 | @end example |
| 1233 | 1442 | ||
| 1234 | may help to override that. | 1443 | In general, it is not a good idea to specify negative offsets to |
| 1444 | position a frame relative to the right or bottom edge of its display. | ||
| 1445 | Positioning the initial or a new frame is either not accurate (because | ||
| 1446 | the size of the outer frame is not yet fully known before the frame has | ||
| 1447 | been made visible) or will cause additional flicker (if the frame is | ||
| 1448 | repositioned after becoming visible). | ||
| 1449 | |||
| 1450 | Note also, that negative offsets are not stored internally and are not | ||
| 1451 | returned by the function @code{frame-parameters}. This means that the | ||
| 1452 | desktop saving routines will restore the frame from the positive offsets | ||
| 1453 | obtained by that function. | ||
| 1235 | 1454 | ||
| 1236 | @vindex top, a frame parameter | 1455 | @vindex top, a frame parameter |
| 1237 | @item top | 1456 | @item top |
| 1238 | The screen position of the top (or bottom) edge, in pixels, with respect | 1457 | The screen position of the top (or bottom) edge, in pixels, with respect |
| 1239 | to the top (or bottom) edge of the screen. It works just like | 1458 | to the top (or bottom) edge of the display or parent frame. It works |
| 1240 | @code{left}, except vertically instead of horizontally. | 1459 | just like @code{left}, except vertically instead of horizontally. |
| 1241 | 1460 | ||
| 1242 | @vindex icon-left, a frame parameter | 1461 | @vindex icon-left, a frame parameter |
| 1243 | @item icon-left | 1462 | @item icon-left |
| @@ -1273,6 +1492,22 @@ When you call @code{make-frame}, you should specify a non-@code{nil} | |||
| 1273 | value for this parameter if the values of the @code{left} and @code{top} | 1492 | value for this parameter if the values of the @code{left} and @code{top} |
| 1274 | parameters represent the user's stated preference; otherwise, use | 1493 | parameters represent the user's stated preference; otherwise, use |
| 1275 | @code{nil}. | 1494 | @code{nil}. |
| 1495 | |||
| 1496 | @vindex z-group, a frame parameter | ||
| 1497 | @item z-group | ||
| 1498 | This parameter specifies a relative position of the frame's | ||
| 1499 | window-system window in the stacking (Z-) order of the frame's display. | ||
| 1500 | |||
| 1501 | If this is @code{above}, the frame's window-system window is displayed | ||
| 1502 | above all other window-system windows that do not have the @code{above} | ||
| 1503 | property set. If this is nil, the frame's window is displayed below all | ||
| 1504 | windows that have the @code{above} property set and above all windows | ||
| 1505 | that have the @code{below} property set. If this is @code{below}, the | ||
| 1506 | frame's window is displayed below all windows that do not have the | ||
| 1507 | @code{below} property set. | ||
| 1508 | |||
| 1509 | To position the frame above or below a specific other frame use the | ||
| 1510 | function @code{frame-restack} (@pxref{Raising and Lowering}). | ||
| 1276 | @end table | 1511 | @end table |
| 1277 | 1512 | ||
| 1278 | 1513 | ||
| @@ -1285,15 +1520,19 @@ graphical displays, the @code{default} face determines the actual | |||
| 1285 | pixel sizes of these character units (@pxref{Face Attributes}). | 1520 | pixel sizes of these character units (@pxref{Face Attributes}). |
| 1286 | 1521 | ||
| 1287 | @table @code | 1522 | @table @code |
| 1288 | @vindex height, a frame parameter | ||
| 1289 | @item height | ||
| 1290 | The height of the frame's text area (@pxref{Frame Geometry}), in | ||
| 1291 | characters. | ||
| 1292 | |||
| 1293 | @vindex width, a frame parameter | 1523 | @vindex width, a frame parameter |
| 1294 | @item width | 1524 | @item width |
| 1295 | The width of the frame's text area (@pxref{Frame Geometry}), in | 1525 | The width of the frame's text area (@pxref{Frame Geometry}), in |
| 1296 | characters. | 1526 | characters. The value can be also a cons cell of the symbol |
| 1527 | @code{text-pixels} and an integer denoting the width of the text area in | ||
| 1528 | pixels. | ||
| 1529 | |||
| 1530 | @vindex height, a frame parameter | ||
| 1531 | @item height | ||
| 1532 | The height of the frame's text area (@pxref{Frame Geometry}), in | ||
| 1533 | characters. The value can be also a cons cell of the symbol | ||
| 1534 | @code{text-pixels} and an integer denoting the height of the text area | ||
| 1535 | in pixels. | ||
| 1297 | 1536 | ||
| 1298 | @vindex user-size, a frame parameter | 1537 | @vindex user-size, a frame parameter |
| 1299 | @item user-size | 1538 | @item user-size |
| @@ -1302,6 +1541,28 @@ the @code{user-position} parameter (@pxref{Position Parameters, | |||
| 1302 | user-position}) does for the position parameters @code{top} and | 1541 | user-position}) does for the position parameters @code{top} and |
| 1303 | @code{left}. | 1542 | @code{left}. |
| 1304 | 1543 | ||
| 1544 | @vindex min-width, a frame parameter | ||
| 1545 | @item min-width | ||
| 1546 | This parameter specifies the minimum native width of the frame | ||
| 1547 | (@pxref{Frame Geometry}), in characters. Normally, the functions that | ||
| 1548 | establish a frame's initial width or resize a frame horizontally make | ||
| 1549 | sure that all the frame's windows, vertical scroll bars, fringes, | ||
| 1550 | margins and vertical dividers can be displayed. This parameter, if | ||
| 1551 | non-@code{nil} allows to make a frame narrower than that with the | ||
| 1552 | consequence that any components that do not fit on the frame will be | ||
| 1553 | clipped by the window manager. | ||
| 1554 | |||
| 1555 | @vindex min-height, a frame parameter | ||
| 1556 | @item min-height | ||
| 1557 | This parameter specifies the minimum height of the native (@pxref{Frame | ||
| 1558 | Geometry}), in characters. Normally, the functions that establish a | ||
| 1559 | frame's initial size or resize a frame make sure that all the frame's | ||
| 1560 | windows, horizontal scroll bars and dividers, mode and header lines, the | ||
| 1561 | echo area and the internal menu and tool bar can be displayed. This | ||
| 1562 | parameter, if non-@code{nil} allows to make a frame smaller than that | ||
| 1563 | with the consequence that any components that do not fit on the frame | ||
| 1564 | will be clipped by the window-system or window manager. | ||
| 1565 | |||
| 1305 | @cindex fullboth frames | 1566 | @cindex fullboth frames |
| 1306 | @cindex fullheight frames | 1567 | @cindex fullheight frames |
| 1307 | @cindex fullwidth frames | 1568 | @cindex fullwidth frames |
| @@ -1327,10 +1588,10 @@ of maximized and full-height frames and the widths of maximized and | |||
| 1327 | full-width frames often differ by a few pixels. | 1588 | full-width frames often differ by a few pixels. |
| 1328 | 1589 | ||
| 1329 | With some window managers you may have to customize the variable | 1590 | With some window managers you may have to customize the variable |
| 1330 | @code{frame-resize-pixelwise} (@pxref{Size and Position}) in order to | 1591 | @code{frame-resize-pixelwise} (@pxref{Frame Size}) in order to make a |
| 1331 | make a frame truly appear maximized or full-screen. Moreover, | 1592 | frame truly appear maximized or full-screen. Moreover, some window |
| 1332 | some window managers might not support smooth transition between the | 1593 | managers might not support smooth transition between the various |
| 1333 | various full-screen or maximization states. Customizing the variable | 1594 | full-screen or maximization states. Customizing the variable |
| 1334 | @code{x-frame-normalize-before-maximize} can help to overcome that. | 1595 | @code{x-frame-normalize-before-maximize} can help to overcome that. |
| 1335 | 1596 | ||
| 1336 | @vindex fullscreen-restore, a frame parameter | 1597 | @vindex fullscreen-restore, a frame parameter |
| @@ -1364,11 +1625,12 @@ frame, or control their sizes. | |||
| 1364 | @table @code | 1625 | @table @code |
| 1365 | @vindex border-width, a frame parameter | 1626 | @vindex border-width, a frame parameter |
| 1366 | @item border-width | 1627 | @item border-width |
| 1367 | The width in pixels of the frame's border. | 1628 | The width in pixels of the frame's outer border (@pxref{Frame Geometry}). |
| 1368 | 1629 | ||
| 1369 | @vindex internal-border-width, a frame parameter | 1630 | @vindex internal-border-width, a frame parameter |
| 1370 | @item internal-border-width | 1631 | @item internal-border-width |
| 1371 | The distance in pixels between text (or fringe) and the frame's border. | 1632 | The width in pixels of the frame's internal border (@pxref{Frame |
| 1633 | Geometry}). | ||
| 1372 | 1634 | ||
| 1373 | @vindex vertical-scroll-bars, a frame parameter | 1635 | @vindex vertical-scroll-bars, a frame parameter |
| 1374 | @item vertical-scroll-bars | 1636 | @item vertical-scroll-bars |
| @@ -1418,21 +1680,25 @@ to not draw bottom dividers. | |||
| 1418 | 1680 | ||
| 1419 | @vindex menu-bar-lines frame parameter | 1681 | @vindex menu-bar-lines frame parameter |
| 1420 | @item menu-bar-lines | 1682 | @item menu-bar-lines |
| 1421 | The number of lines to allocate at the top of the frame for a menu | 1683 | The number of lines to allocate at the top of the frame for a menu bar. |
| 1422 | bar. The default is 1 if Menu Bar mode is enabled, and 0 otherwise. | 1684 | The default is one if Menu Bar mode is enabled and zero otherwise. |
| 1423 | @xref{Menu Bars,,,emacs, The GNU Emacs Manual}. | 1685 | @xref{Menu Bars,,,emacs, The GNU Emacs Manual}. For an external menu |
| 1686 | bar, this value remains unchanged even when the menu bar wraps to two or | ||
| 1687 | more lines. In that case, the @code{menu-bar-size} value returned by | ||
| 1688 | @code{frame-geometry} (@pxref{Frame Geometry}) allows to derive whether | ||
| 1689 | the menu bar actually occupies one or more lines. | ||
| 1424 | 1690 | ||
| 1425 | @vindex tool-bar-lines frame parameter | 1691 | @vindex tool-bar-lines frame parameter |
| 1426 | @item tool-bar-lines | 1692 | @item tool-bar-lines |
| 1427 | The number of lines to use for the tool bar. The default is 1 if Tool | 1693 | The number of lines to use for the tool bar. The default is one if Tool |
| 1428 | Bar mode is enabled, and 0 otherwise. @xref{Tool Bars,,,emacs, The | 1694 | Bar mode is enabled and zero otherwise. @xref{Tool Bars,,,emacs, The |
| 1429 | GNU Emacs Manual}. | 1695 | GNU Emacs Manual}. This value may change whenever the tool bar wraps. |
| 1430 | 1696 | ||
| 1431 | @vindex tool-bar-position frame parameter | 1697 | @vindex tool-bar-position frame parameter |
| 1432 | @item tool-bar-position | 1698 | @item tool-bar-position |
| 1433 | The position of the tool bar. Currently only for the GTK tool bar. | 1699 | The position of the tool bar. Currently only for the GTK tool bar. |
| 1434 | Value can be one of @code{top}, @code{bottom} @code{left}, @code{right}. | 1700 | Value can be one of @code{top}, @code{bottom} @code{left}, @code{right}. |
| 1435 | The default is @code{top}. | 1701 | The default is @code{top}. |
| 1436 | 1702 | ||
| 1437 | @vindex line-spacing, a frame parameter | 1703 | @vindex line-spacing, a frame parameter |
| 1438 | @item line-spacing | 1704 | @item line-spacing |
| @@ -1440,6 +1706,7 @@ Additional space to leave below each text line, in pixels (a positive | |||
| 1440 | integer). @xref{Line Height}, for more information. | 1706 | integer). @xref{Line Height}, for more information. |
| 1441 | @end table | 1707 | @end table |
| 1442 | 1708 | ||
| 1709 | |||
| 1443 | @node Buffer Parameters | 1710 | @node Buffer Parameters |
| 1444 | @subsubsection Buffer Parameters | 1711 | @subsubsection Buffer Parameters |
| 1445 | @cindex frame, which buffers to display | 1712 | @cindex frame, which buffers to display |
| @@ -1478,6 +1745,40 @@ most-recently-selected first. | |||
| 1478 | If non-@code{nil}, this frame's window is never split automatically. | 1745 | If non-@code{nil}, this frame's window is never split automatically. |
| 1479 | @end table | 1746 | @end table |
| 1480 | 1747 | ||
| 1748 | @node Frame Interaction Parameters | ||
| 1749 | @subsubsection Frame Interaction Parameters | ||
| 1750 | |||
| 1751 | These parameters supply forms of interactions between different frames. | ||
| 1752 | |||
| 1753 | @table @code | ||
| 1754 | @vindex parent-frame, a frame parameter | ||
| 1755 | @item parent-frame | ||
| 1756 | If non-@code{nil}, this means that this frame is a child frame | ||
| 1757 | (@pxref{Child Frames}) and this parameter specifies its parent frame. | ||
| 1758 | If nil, this means that this frame is a normal, top-level frame. | ||
| 1759 | |||
| 1760 | @vindex delete-before, a frame parameter | ||
| 1761 | @item delete-before | ||
| 1762 | If non-@code{nil}, this parameter specifies another frame whose deletion | ||
| 1763 | will automatically trigger the deletion of this frame. @xref{Deleting | ||
| 1764 | Frames}. | ||
| 1765 | |||
| 1766 | @vindex mouse-wheel-frame, a frame parameter | ||
| 1767 | @item mouse-wheel-frame | ||
| 1768 | If non-@code{nil}, this parameter specifies the frame whose windows will | ||
| 1769 | be scrolled whenever the mouse wheel is scrolled with the mouse pointer | ||
| 1770 | hovering over this frame (@pxref{Mouse Commands,,, emacs, The GNU Emacs | ||
| 1771 | Manual}). | ||
| 1772 | |||
| 1773 | @vindex no-other-frame, a frame parameter | ||
| 1774 | @item no-other-frame | ||
| 1775 | If this is non-@code{nil}, then this frame is not eligible as candidate | ||
| 1776 | for the functions @code{next-frame}, @code{previous-frame} | ||
| 1777 | (@pxref{Finding All Frames}) and @code{other-frame} (@pxref{Frame | ||
| 1778 | Commands,,, emacs, The GNU Emacs Manual}). | ||
| 1779 | @end table | ||
| 1780 | |||
| 1781 | |||
| 1481 | @node Management Parameters | 1782 | @node Management Parameters |
| 1482 | @subsubsection Window Management Parameters | 1783 | @subsubsection Window Management Parameters |
| 1483 | @cindex window manager interaction, and frame parameters | 1784 | @cindex window manager interaction, and frame parameters |
| @@ -1541,10 +1842,56 @@ with virtual desktops. | |||
| 1541 | 1842 | ||
| 1542 | @vindex inhibit-double-buffering, a frame parameter | 1843 | @vindex inhibit-double-buffering, a frame parameter |
| 1543 | @item inhibit-double-buffering | 1844 | @item inhibit-double-buffering |
| 1544 | If non-@code{nil}, the frame is drawn to the screen without double buffering. | 1845 | If non-@code{nil}, the frame is drawn to the screen without double |
| 1545 | Emacs normally attempts to use double buffering, where available, to | 1846 | buffering. Emacs normally attempts to use double buffering, where |
| 1546 | reduce flicker. Set this property if you experience display bugs or | 1847 | available, to reduce flicker. Set this property if you experience |
| 1547 | pine for that retro, flicker-y feeling. | 1848 | display bugs or pine for that retro, flicker-y feeling. |
| 1849 | |||
| 1850 | @vindex skip-taskbar, a frame parameter | ||
| 1851 | @item skip-taskbar | ||
| 1852 | If non-@code{nil}, this tells the window manager to remove the frame's | ||
| 1853 | icon from the taskbar associated with the frame's display and inhibit | ||
| 1854 | switching to the frame's window via the combination @kbd{Alt-@key{TAB}}. | ||
| 1855 | On Windows, iconifying such a frame will "roll in" its window-system | ||
| 1856 | window at the bottom of the desktop. Some window managers may not honor | ||
| 1857 | this parameter. | ||
| 1858 | |||
| 1859 | @vindex no-focus-on-map, a frame parameter | ||
| 1860 | @item no-focus-on-map | ||
| 1861 | If non-@code{nil}, this means that the frame dos not want to receive | ||
| 1862 | input focus when it is mapped (@pxref{Visibility of Frames}). Some | ||
| 1863 | window managers may not honor this parameter. | ||
| 1864 | |||
| 1865 | @vindex no-accept-focus, a frame parameter | ||
| 1866 | @item no-accept-focus | ||
| 1867 | If non-@code{nil}, this means that the frame does not want to receive | ||
| 1868 | input focus via explicit mouse clicks or when moving the mouse into it | ||
| 1869 | either via @code{focus-follows-mouse} (@pxref{Input Focus}) or | ||
| 1870 | @code{mouse-autoselect-window} (@pxref{Mouse Window Auto-selection}). | ||
| 1871 | This may have the unwanted side-effect that a user cannot scroll a | ||
| 1872 | non-selected frame with the mouse. Some window managers may not honor | ||
| 1873 | this parameter. | ||
| 1874 | |||
| 1875 | @vindex undecorated, a frame parameter | ||
| 1876 | @item undecorated | ||
| 1877 | If non-@code{nil}, this frame's window-system window is drawn without | ||
| 1878 | decorations like title, minimize/maximize boxes and external borders. | ||
| 1879 | This usually means that the window cannot be dragged, resized, | ||
| 1880 | iconified, maximized or deleted with the mouse. If nil, the frame's | ||
| 1881 | window is usually drawn with all the elements listed above unless their | ||
| 1882 | display has been suspended via window manager settings. | ||
| 1883 | |||
| 1884 | Under X, Emacs uses the Motif window manager hints to turn off | ||
| 1885 | decorations. Some window managers may not honor these hints. | ||
| 1886 | |||
| 1887 | @vindex override-redirect, a frame parameter | ||
| 1888 | @item override-redirect | ||
| 1889 | @cindex override redirect frames | ||
| 1890 | If non-@code{nil}, this means that this is an @dfn{override redirect} | ||
| 1891 | frame---a frame not handled by window managers under X. Override | ||
| 1892 | redirect frames have no window manager decorations, can be positioned | ||
| 1893 | and resized only via Emacs' positioning and resizing functions and are | ||
| 1894 | usually drawn on top of all other frames. | ||
| 1548 | 1895 | ||
| 1549 | @ignore | 1896 | @ignore |
| 1550 | @vindex parent-id, a frame parameter | 1897 | @vindex parent-id, a frame parameter |
| @@ -1557,6 +1904,7 @@ it and see if it works.) | |||
| 1557 | @end ignore | 1904 | @end ignore |
| 1558 | @end table | 1905 | @end table |
| 1559 | 1906 | ||
| 1907 | |||
| 1560 | @node Cursor Parameters | 1908 | @node Cursor Parameters |
| 1561 | @subsubsection Cursor Parameters | 1909 | @subsubsection Cursor Parameters |
| 1562 | @cindex cursor, and frame parameters | 1910 | @cindex cursor, and frame parameters |
| @@ -1904,21 +2252,28 @@ while processing @code{frame-title-format} or | |||
| 1904 | @section Deleting Frames | 2252 | @section Deleting Frames |
| 1905 | @cindex deleting frames | 2253 | @cindex deleting frames |
| 1906 | 2254 | ||
| 1907 | A @dfn{live frame} is one that has not been deleted. When a frame | 2255 | A @dfn{live frame} is one that has not been deleted. When a frame is |
| 1908 | is deleted, it is removed from its terminal display, although it may | 2256 | deleted, it is removed from its terminal display, although it may |
| 1909 | continue to exist as a Lisp object until there are no more references | 2257 | continue to exist as a Lisp object until there are no more references to |
| 1910 | to it. | 2258 | it. |
| 1911 | 2259 | ||
| 1912 | @deffn Command delete-frame &optional frame force | 2260 | @deffn Command delete-frame &optional frame force |
| 1913 | @vindex delete-frame-functions | 2261 | @vindex delete-frame-functions |
| 1914 | This function deletes the frame @var{frame}. The argument @var{frame} | 2262 | This function deletes the frame @var{frame}. The argument @var{frame} |
| 1915 | must specify a live frame (see below) and defaults to the selected | 2263 | must specify a live frame (see below) and defaults to the selected |
| 1916 | frame. Unless @var{frame} specifies a tooltip, this function first runs | 2264 | frame. |
| 1917 | the hook @code{delete-frame-functions} (each function getting one | ||
| 1918 | argument, @var{frame}). | ||
| 1919 | 2265 | ||
| 1920 | A frame cannot be deleted as long as its minibuffer serves as surrogate | 2266 | It first deletes any child frame of @var{frame} (@pxref{Child Frames}) |
| 1921 | minibuffer for another frame (@pxref{Minibuffers and Frames}). | 2267 | and any frame whose @code{delete-before} frame parameter (@pxref{Frame |
| 2268 | Interaction Parameters}) specifies @var{frame}. All such deletions are | ||
| 2269 | performed recursively; so this step makes sure that there will not exist | ||
| 2270 | any other frames with @var{frame} as their ancestor. Then, unless | ||
| 2271 | @var{frame} specifies a tooltip, this function runs the hook | ||
| 2272 | @code{delete-frame-functions} (each function getting one argument, | ||
| 2273 | @var{frame}) before actually killing the frame. | ||
| 2274 | |||
| 2275 | Note that a frame cannot be deleted as long as its minibuffer serves as | ||
| 2276 | surrogate minibuffer for another frame (@pxref{Minibuffers and Frames}). | ||
| 1922 | Normally, you cannot delete a frame if all other frames are invisible, | 2277 | Normally, you cannot delete a frame if all other frames are invisible, |
| 1923 | but if @var{force} is non-@code{nil}, then you are allowed to do so. | 2278 | but if @var{force} is non-@code{nil}, then you are allowed to do so. |
| 1924 | @end deffn | 2279 | @end deffn |
| @@ -1942,8 +2297,13 @@ minibuffer frame is left untouched. The argument @var{frame} must | |||
| 1942 | specify a live frame and defaults to the selected frame. Internally, | 2297 | specify a live frame and defaults to the selected frame. Internally, |
| 1943 | this command works by calling @code{delete-frame} with @var{force} | 2298 | this command works by calling @code{delete-frame} with @var{force} |
| 1944 | @code{nil} for all frames that shall be deleted. | 2299 | @code{nil} for all frames that shall be deleted. |
| 2300 | |||
| 2301 | This function does not delete any of @var{frame}'s child frames | ||
| 2302 | (@pxref{Child Frames}). If @var{frame} is a child frame, it deletes | ||
| 2303 | @var{frame}'s siblings only. | ||
| 1945 | @end deffn | 2304 | @end deffn |
| 1946 | 2305 | ||
| 2306 | |||
| 1947 | @node Finding All Frames | 2307 | @node Finding All Frames |
| 1948 | @section Finding All Frames | 2308 | @section Finding All Frames |
| 1949 | @cindex frames, scanning all | 2309 | @cindex frames, scanning all |
| @@ -1962,12 +2322,29 @@ This function returns a list of just the currently visible frames. | |||
| 1962 | visible, even though only the selected one is actually displayed. | 2322 | visible, even though only the selected one is actually displayed. |
| 1963 | @end defun | 2323 | @end defun |
| 1964 | 2324 | ||
| 2325 | @defun frame-list-z-order &optional display | ||
| 2326 | This function returns a list of Emacs' frames, in Z (stacking) order | ||
| 2327 | (@pxref{Raising and Lowering}). The optional argument @var{display} | ||
| 2328 | specifies which display to poll. @var{display} should be either a frame | ||
| 2329 | or a display name (a string). If omitted or @code{nil}, that stands for | ||
| 2330 | the selected frame's display. It returns @code{nil} if @var{display} | ||
| 2331 | contains no Emacs frame. | ||
| 2332 | |||
| 2333 | Frames are listed from topmost (first) to bottommost (last). As a | ||
| 2334 | special case, if @var{display} is non-@code{nil} and specifies a live | ||
| 2335 | frame, it returns the child frames of that frame in Z (stacking) order. | ||
| 2336 | |||
| 2337 | This function is not meaningful on text terminals. | ||
| 2338 | @end defun | ||
| 2339 | |||
| 1965 | @defun next-frame &optional frame minibuf | 2340 | @defun next-frame &optional frame minibuf |
| 1966 | This function lets you cycle conveniently through all the frames on a | 2341 | This function lets you cycle conveniently through all the frames on a |
| 1967 | specific terminal from an arbitrary starting point. It returns the | 2342 | specific terminal from an arbitrary starting point. It returns the |
| 1968 | frame following @var{frame}, in the list of all live frames, on | 2343 | frame following @var{frame}, in the list of all live frames, on |
| 1969 | @var{frame}'s terminal. The argument @var{frame} must specify a live | 2344 | @var{frame}'s terminal. The argument @var{frame} must specify a live |
| 1970 | frame and defaults to the selected frame. | 2345 | frame and defaults to the selected frame. It never returns a frame |
| 2346 | whose @code{no-other-frame} parameter (@pxref{Frame Interaction | ||
| 2347 | Parameters}) is non-@code{nil}. | ||
| 1971 | 2348 | ||
| 1972 | The second argument, @var{minibuf}, says which frames to consider: | 2349 | The second argument, @var{minibuf}, says which frames to consider: |
| 1973 | 2350 | ||
| @@ -1998,8 +2375,8 @@ Window Ordering}. | |||
| 1998 | @section Minibuffers and Frames | 2375 | @section Minibuffers and Frames |
| 1999 | 2376 | ||
| 2000 | Normally, each frame has its own minibuffer window at the bottom, which | 2377 | Normally, each frame has its own minibuffer window at the bottom, which |
| 2001 | is used whenever that frame is selected. If the frame has a minibuffer, | 2378 | is used whenever that frame is selected. You can get that window with |
| 2002 | you can get it with @code{minibuffer-window} (@pxref{Minibuffer Windows}). | 2379 | the function @code{minibuffer-window} (@pxref{Minibuffer Windows}). |
| 2003 | 2380 | ||
| 2004 | @cindex frame without a minibuffer | 2381 | @cindex frame without a minibuffer |
| 2005 | @cindex surrogate minibuffer frame | 2382 | @cindex surrogate minibuffer frame |
| @@ -2009,9 +2386,10 @@ will serve as @dfn{surrogate minibuffer frame} for this frame and cannot | |||
| 2009 | be deleted via @code{delete-frame} (@pxref{Deleting Frames}) as long as | 2386 | be deleted via @code{delete-frame} (@pxref{Deleting Frames}) as long as |
| 2010 | this frame is live. | 2387 | this frame is live. |
| 2011 | 2388 | ||
| 2012 | When you create the frame, you can explicitly specify the minibuffer | 2389 | When you create the frame, you can explicitly specify its minibuffer |
| 2013 | window to use (in some other frame). If you don't, then the minibuffer | 2390 | window (in some other frame) with the @code{minibuffer} frame parameter |
| 2014 | is found in the frame which is the value of the variable | 2391 | (@pxref{Buffer Parameters}). If you don't, then the minibuffer is found |
| 2392 | in the frame which is the value of the variable | ||
| 2015 | @code{default-minibuffer-frame}. Its value should be a frame that does | 2393 | @code{default-minibuffer-frame}. Its value should be a frame that does |
| 2016 | have a minibuffer. | 2394 | have a minibuffer. |
| 2017 | 2395 | ||
| @@ -2026,13 +2404,14 @@ the current terminal and cannot be buffer-local. @xref{Multiple | |||
| 2026 | Terminals}. | 2404 | Terminals}. |
| 2027 | @end defvar | 2405 | @end defvar |
| 2028 | 2406 | ||
| 2407 | |||
| 2029 | @node Input Focus | 2408 | @node Input Focus |
| 2030 | @section Input Focus | 2409 | @section Input Focus |
| 2031 | @cindex input focus | 2410 | @cindex input focus |
| 2032 | @c @cindex selected frame Duplicates selected-frame, same for selected-window. | 2411 | @cindex selected frame |
| 2033 | 2412 | ||
| 2034 | At any time, one frame in Emacs is the @dfn{selected frame}. The selected | 2413 | At any time, one frame in Emacs is the @dfn{selected frame}. The |
| 2035 | window always resides on the selected frame. | 2414 | selected window always resides on the selected frame. |
| 2036 | 2415 | ||
| 2037 | When Emacs displays its frames on several terminals (@pxref{Multiple | 2416 | When Emacs displays its frames on several terminals (@pxref{Multiple |
| 2038 | Terminals}), each terminal has its own selected frame. But only one | 2417 | Terminals}), each terminal has its own selected frame. But only one |
| @@ -2077,6 +2456,26 @@ same meaning as for @code{select-frame} (see below). The return value | |||
| 2077 | of this function is not significant. | 2456 | of this function is not significant. |
| 2078 | @end defun | 2457 | @end defun |
| 2079 | 2458 | ||
| 2459 | Ideally, the function described next should focus a frame without also | ||
| 2460 | raising it above other frames. Unfortunately, many window-systems or | ||
| 2461 | window managers may refuse to comply. | ||
| 2462 | |||
| 2463 | @defun x-focus-frame &optional frame noactivate | ||
| 2464 | This function gives @var{frame} the focus of the X server without | ||
| 2465 | necessarily raising it. @var{frame} @code{nil} means use the selected | ||
| 2466 | frame. Under X, the optional argument @var{noactivate}, if | ||
| 2467 | non-@code{nil}, means to avoid making @var{frame}'s window-system window | ||
| 2468 | the ``active'' window which should insist a bit more on avoiding to | ||
| 2469 | raise @var{frame} above other frames. | ||
| 2470 | |||
| 2471 | On Windows the @var{noactivate} argument has no effect. However, if | ||
| 2472 | @var{frame} is a child frame (@pxref{Child Frames}), this function | ||
| 2473 | usualy does focus @var{frame} without raising it above other child | ||
| 2474 | frames. | ||
| 2475 | |||
| 2476 | If there is no window system support, this function does nothing. | ||
| 2477 | @end defun | ||
| 2478 | |||
| 2080 | @deffn Command select-frame frame &optional norecord | 2479 | @deffn Command select-frame frame &optional norecord |
| 2081 | This function selects frame @var{frame}, temporarily disregarding the | 2480 | This function selects frame @var{frame}, temporarily disregarding the |
| 2082 | focus of the X server if any. The selection of @var{frame} lasts until | 2481 | focus of the X server if any. The selection of @var{frame} lasts until |
| @@ -2091,7 +2490,7 @@ becomes the selected terminal. This function then calls | |||
| 2091 | @code{select-window} as a subroutine, passing the window selected | 2490 | @code{select-window} as a subroutine, passing the window selected |
| 2092 | within @var{frame} as its first argument and @var{norecord} as its | 2491 | within @var{frame} as its first argument and @var{norecord} as its |
| 2093 | second argument (hence, if @var{norecord} is non-@code{nil}, this | 2492 | second argument (hence, if @var{norecord} is non-@code{nil}, this |
| 2094 | avoids changing the order of recently selected windows nor the buffer | 2493 | avoids changing the order of recently selected windows and the buffer |
| 2095 | list). @xref{Selecting Windows}. | 2494 | list). @xref{Selecting Windows}. |
| 2096 | 2495 | ||
| 2097 | This function returns @var{frame}, or @code{nil} if @var{frame} has | 2496 | This function returns @var{frame}, or @code{nil} if @var{frame} has |
| @@ -2147,20 +2546,64 @@ change it. | |||
| 2147 | @end defun | 2546 | @end defun |
| 2148 | 2547 | ||
| 2149 | @defvar focus-in-hook | 2548 | @defvar focus-in-hook |
| 2150 | This is a normal hook run when an Emacs frame gains input focus. | 2549 | This is a normal hook run when an Emacs frame gains input focus. The |
| 2550 | frame gaining focus is selected when this hook is run. | ||
| 2151 | @end defvar | 2551 | @end defvar |
| 2152 | 2552 | ||
| 2153 | @defvar focus-out-hook | 2553 | @defvar focus-out-hook |
| 2154 | This is a normal hook run when an Emacs frame loses input focus. | 2554 | This is a normal hook run when an Emacs frame has lost input focus and |
| 2555 | no other Emacs frame has gained input focus instead. | ||
| 2155 | @end defvar | 2556 | @end defvar |
| 2156 | 2557 | ||
| 2157 | @defopt focus-follows-mouse | 2558 | @defopt focus-follows-mouse |
| 2158 | This option is how you inform Emacs whether the window manager transfers | 2559 | This option informs Emacs whether and how the window manager transfers |
| 2159 | focus when the user moves the mouse. Non-@code{nil} says that it does. | 2560 | focus when you move the mouse pointer into a frame. It can have three |
| 2160 | When this is so, the command @code{other-frame} moves the mouse to a | 2561 | meaningful values: |
| 2161 | position consistent with the new selected frame. | 2562 | |
| 2563 | @table @asis | ||
| 2564 | @item @code{nil} | ||
| 2565 | The default value @code{nil} should be used when your window manager | ||
| 2566 | follows a ``click-to-focus'' policy where you have to click the mouse | ||
| 2567 | inside of a frame in order for that frame to gain focus. | ||
| 2568 | |||
| 2569 | @item @code{t} | ||
| 2570 | The value @code{t} should be used when your window manager has the focus | ||
| 2571 | automatically follow the position of the mouse pointer but a frame that | ||
| 2572 | gains focus is not raised automatically and may even remain occluded by | ||
| 2573 | other window-system windows. | ||
| 2574 | |||
| 2575 | @item @code{auto-raise} | ||
| 2576 | The value @code{auto-raise} should be used when your window manager has | ||
| 2577 | the focus automatically follow the position of the mouse pointer and a | ||
| 2578 | frame that gains focus is raised automatically. | ||
| 2579 | @end table | ||
| 2580 | |||
| 2581 | If this option is non-@code{nil}, Emacs moves the mouse pointer to the | ||
| 2582 | frame selected by @code{select-frame-set-input-focus}. That function is | ||
| 2583 | used by a number of commands like, for example, @code{other-frame} and | ||
| 2584 | @code{pop-to-buffer}. | ||
| 2585 | |||
| 2586 | The distinction between the values @code{t} and @code{auto-raise} is not | ||
| 2587 | needed for ``normal'' frames because the window manager usually takes | ||
| 2588 | care of raising them. It is useful to automatically raise child frames | ||
| 2589 | via @code{mouse-autoselect-window} (@pxref{Mouse Window | ||
| 2590 | Auto-selection}). | ||
| 2591 | |||
| 2592 | Note that this option does not distinguish ``sloppy'' focus (where the | ||
| 2593 | frame that previously had focus retains focus as long as the mouse | ||
| 2594 | pointer does not move into another window manager window) from | ||
| 2595 | ``strict'' focus (where a frame immediately loses focus when it's left | ||
| 2596 | by the mouse pointer). It neither recognizes whether your window | ||
| 2597 | manager supports delayed focusing or auto-raising where you can | ||
| 2598 | explicitly specify the time until a new frame gets focus or is | ||
| 2599 | auto-raised. | ||
| 2600 | |||
| 2601 | You can supply a ``focus follows mouse'' policy for individual Emacs | ||
| 2602 | windows by customizing the variable @code{mouse-autoselect-window} | ||
| 2603 | (@pxref{Mouse Window Auto-selection}). | ||
| 2162 | @end defopt | 2604 | @end defopt |
| 2163 | 2605 | ||
| 2606 | |||
| 2164 | @node Visibility of Frames | 2607 | @node Visibility of Frames |
| 2165 | @section Visibility of Frames | 2608 | @section Visibility of Frames |
| 2166 | @cindex visible frame | 2609 | @cindex visible frame |
| @@ -2169,16 +2612,26 @@ position consistent with the new selected frame. | |||
| 2169 | @cindex minimized frame | 2612 | @cindex minimized frame |
| 2170 | @cindex frame visibility | 2613 | @cindex frame visibility |
| 2171 | 2614 | ||
| 2172 | A frame on a graphical display may be @dfn{visible}, @dfn{invisible}, | 2615 | A frame on a graphical display may be @dfn{visible}, @dfn{invisible}, or |
| 2173 | or @dfn{iconified}. If it is visible, its contents are displayed in | 2616 | @dfn{iconified}. If it is visible, its contents are displayed in the |
| 2174 | the usual manner. If it is iconified, its contents are not displayed, | 2617 | usual manner. If it is iconified, its contents are not displayed, but |
| 2175 | but there is a little icon somewhere to bring the frame back into view | 2618 | there is a little icon somewhere to bring the frame back into view (some |
| 2176 | (some window managers refer to this state as @dfn{minimized} rather | 2619 | window managers refer to this state as @dfn{minimized} rather than |
| 2177 | than @dfn{iconified}, but from Emacs' point of view they are the same | 2620 | @dfn{iconified}, but from Emacs' point of view they are the same thing). |
| 2178 | thing). If a frame is invisible, it is not displayed at all. | 2621 | If a frame is invisible, it is not displayed at all. |
| 2622 | |||
| 2623 | @cindex mapped frame | ||
| 2624 | @cindex unmapped frame | ||
| 2625 | The concept of visibility is strongly related to that of (un-)mapped | ||
| 2626 | frames. A frame (or, more precisely, its window-system window) is and | ||
| 2627 | becomes @dfn{mapped} when it is displayed for the first time and | ||
| 2628 | whenever it changes its state of visibility from @code{iconified} or | ||
| 2629 | @code{invisible} to @code{visible}. Conversely, a frame is and becomes | ||
| 2630 | @dfn{unmapped} whenever it changes its status from @code{visible} to | ||
| 2631 | @code{iconified} or @code{invisible}. | ||
| 2179 | 2632 | ||
| 2180 | Visibility is meaningless on text terminals, since only the selected | 2633 | Visibility is meaningless on text terminals, since only the selected |
| 2181 | one is actually displayed in any case. | 2634 | frame is actually displayed in any case. |
| 2182 | 2635 | ||
| 2183 | @defun frame-visible-p frame | 2636 | @defun frame-visible-p frame |
| 2184 | This function returns the visibility status of frame @var{frame}. The | 2637 | This function returns the visibility status of frame @var{frame}. The |
| @@ -2192,22 +2645,28 @@ purposes of this function, even though only one frame is displayed. | |||
| 2192 | 2645 | ||
| 2193 | @deffn Command iconify-frame &optional frame | 2646 | @deffn Command iconify-frame &optional frame |
| 2194 | This function iconifies frame @var{frame}. If you omit @var{frame}, it | 2647 | This function iconifies frame @var{frame}. If you omit @var{frame}, it |
| 2195 | iconifies the selected frame. | 2648 | iconifies the selected frame. This usually makes all child frames of |
| 2649 | @var{frame} (and their descendants) invisible (@pxref{Child Frames}). | ||
| 2196 | @end deffn | 2650 | @end deffn |
| 2197 | 2651 | ||
| 2198 | @deffn Command make-frame-visible &optional frame | 2652 | @deffn Command make-frame-visible &optional frame |
| 2199 | This function makes frame @var{frame} visible. If you omit | 2653 | This function makes frame @var{frame} visible. If you omit @var{frame}, |
| 2200 | @var{frame}, it makes the selected frame visible. This does not raise | 2654 | it makes the selected frame visible. This does not raise the frame, but |
| 2201 | the frame, but you can do that with @code{raise-frame} if you wish | 2655 | you can do that with @code{raise-frame} if you wish (@pxref{Raising and |
| 2202 | (@pxref{Raising and Lowering}). | 2656 | Lowering}). |
| 2657 | |||
| 2658 | Making a frame visible usually makes all its child frames (and their | ||
| 2659 | descendants) visible too (@pxref{Child Frames}). | ||
| 2203 | @end deffn | 2660 | @end deffn |
| 2204 | 2661 | ||
| 2205 | @deffn Command make-frame-invisible &optional frame force | 2662 | @deffn Command make-frame-invisible &optional frame force |
| 2206 | This function makes frame @var{frame} invisible. If you omit | 2663 | This function makes frame @var{frame} invisible. If you omit |
| 2207 | @var{frame}, it makes the selected frame invisible. | 2664 | @var{frame}, it makes the selected frame invisible. Usually, this makes |
| 2665 | all child frames of @var{frame} (and their descendants) invisible too | ||
| 2666 | (@pxref{Child Frames}). | ||
| 2208 | 2667 | ||
| 2209 | Unless @var{force} is non-@code{nil}, this function refuses to make | 2668 | Unless @var{force} is non-@code{nil}, this function refuses to make |
| 2210 | @var{frame} invisible if all other frames are invisible.. | 2669 | @var{frame} invisible if all other frames are invisible. |
| 2211 | @end deffn | 2670 | @end deffn |
| 2212 | 2671 | ||
| 2213 | The visibility status of a frame is also available as a frame | 2672 | The visibility status of a frame is also available as a frame |
| @@ -2223,27 +2682,79 @@ being rendered with double buffering. @var{frame} defaults to the | |||
| 2223 | selected frame. | 2682 | selected frame. |
| 2224 | @end defun | 2683 | @end defun |
| 2225 | 2684 | ||
| 2685 | |||
| 2226 | @node Raising and Lowering | 2686 | @node Raising and Lowering |
| 2227 | @section Raising and Lowering Frames | 2687 | @section Raising, Lowering and Restacking Frames |
| 2228 | 2688 | ||
| 2229 | @cindex raising a frame | 2689 | @cindex raising a frame |
| 2230 | @cindex lowering a frame | 2690 | @cindex lowering a frame |
| 2231 | Most window systems use a desktop metaphor. Part of this metaphor | 2691 | @cindex restacking a frame |
| 2232 | is the idea that system-level windows (e.g., Emacs frames) are | 2692 | @cindex frame stacking order |
| 2233 | stacked in a notional third dimension perpendicular to the screen | 2693 | @cindex frame Z-order |
| 2234 | surface. Where two overlap, the one higher up covers the one | 2694 | Most window systems use a desktop metaphor. Part of this metaphor is |
| 2235 | underneath. You can @dfn{raise} or @dfn{lower} a frame using the | 2695 | the idea that system-level windows (representing, e.g., Emacs frames) |
| 2236 | functions @code{raise-frame} and @code{lower-frame}. | 2696 | are stacked in a notional third dimension perpendicular to the screen |
| 2697 | surface. The order induced by stacking is total and usually referred to | ||
| 2698 | as stacking (or Z-) order. Where the areas of two windows overlap, the | ||
| 2699 | one higher up in that order will (partially) cover the one underneath. | ||
| 2700 | |||
| 2701 | You can @dfn{raise} a frame to the top of that order or @dfn{lower} a | ||
| 2702 | frame to its bottom by using the functions @code{raise-frame} and | ||
| 2703 | @code{lower-frame}. You can @dfn{restack} a frame directly above or | ||
| 2704 | below another frame using the function @code{frame-restack}. | ||
| 2705 | |||
| 2706 | Note that all functions described below will respect the adherence of | ||
| 2707 | frames (and all other window-system windows) to their respective z-group | ||
| 2708 | (@pxref{Position Parameters}). For example, you usually cannot lower a | ||
| 2709 | frame below that of the desktop window and you cannot raise a frame | ||
| 2710 | whose @code{z-group} parameter is @code{nil} above the window-system's | ||
| 2711 | taskbar or tooltip window. | ||
| 2237 | 2712 | ||
| 2238 | @deffn Command raise-frame &optional frame | 2713 | @deffn Command raise-frame &optional frame |
| 2239 | This function raises frame @var{frame} (default, the selected frame). | 2714 | This function raises frame @var{frame} (default, the selected frame) |
| 2240 | If @var{frame} is invisible or iconified, this makes it visible. | 2715 | above all other frames belonging to the same or a lower z-group as |
| 2716 | @var{frame}. If @var{frame} is invisible or iconified, this makes it | ||
| 2717 | visible. If @var{frame} is a child frame (@pxref{Child Frames}), this | ||
| 2718 | raises @var{frame} above all other child frames of its parent. | ||
| 2241 | @end deffn | 2719 | @end deffn |
| 2242 | 2720 | ||
| 2243 | @deffn Command lower-frame &optional frame | 2721 | @deffn Command lower-frame &optional frame |
| 2244 | This function lowers frame @var{frame} (default, the selected frame). | 2722 | This function lowers frame @var{frame} (default, the selected frame) |
| 2723 | below all other frames belonging to the same or a higher z-group as | ||
| 2724 | @var{frame}. If @var{frame} is a child frame (@pxref{Child Frames}), | ||
| 2725 | this lowers @var{frame} below all other child frames of its parent. | ||
| 2245 | @end deffn | 2726 | @end deffn |
| 2246 | 2727 | ||
| 2728 | @defun frame-restack frame1 frame2 &optional above | ||
| 2729 | This function restacks @var{frame1} below @var{frame2}. This implies | ||
| 2730 | that if both frames are visible and their display areas overlap, | ||
| 2731 | @var{frame2} will (partially) obscure @var{frame1}. If the optional | ||
| 2732 | third argument @var{above} is non-@code{nil}, this function restacks | ||
| 2733 | @var{frame1} above @var{frame2}. This means that if both frames are | ||
| 2734 | visible and their display areas overlap, @var{frame1} will (partially) | ||
| 2735 | obscure @var{frame2}. | ||
| 2736 | |||
| 2737 | Technically, this function may be thought of as an atomic action | ||
| 2738 | performed in two steps: The first step removes @var{frame1}'s | ||
| 2739 | window-system window from the display. The second step reinserts | ||
| 2740 | @var{frame1}'s window into the display below (above if @var{above} is | ||
| 2741 | true) that of @var{frame2}. Hence the position of @var{frame2} in its | ||
| 2742 | display's Z (stacking) order relative to all other frames excluding | ||
| 2743 | @var{frame1} remains unaltered. | ||
| 2744 | |||
| 2745 | Some window managers may refuse to restack windows. | ||
| 2746 | @end defun | ||
| 2747 | |||
| 2748 | Note that the effect of restacking will only hold as long as neither of | ||
| 2749 | the involved frames is iconified or made invisible. You can use the | ||
| 2750 | @code{z-group} (@pxref{Position Parameters}) frame parameter to add a | ||
| 2751 | frame to a group of frames permanently shown above or below other | ||
| 2752 | frames. As long as a frame belongs to one of these groups, restacking | ||
| 2753 | it will only affect its relative stacking position within that group. | ||
| 2754 | The effect of restacking frames belonging to different z-groups is | ||
| 2755 | undefined. You can list frames in their current stacking order with the | ||
| 2756 | function @code{frame-list-z-order} (@pxref{Finding All Frames}). | ||
| 2757 | |||
| 2247 | @defopt minibuffer-auto-raise | 2758 | @defopt minibuffer-auto-raise |
| 2248 | If this is non-@code{nil}, activation of the minibuffer raises the frame | 2759 | If this is non-@code{nil}, activation of the minibuffer raises the frame |
| 2249 | that the minibuffer window is in. | 2760 | that the minibuffer window is in. |
| @@ -2265,6 +2776,7 @@ or @code{nil} (meaning the selected frame's terminal). If it does not | |||
| 2265 | refer to a text terminal, the return value is @code{nil}. | 2776 | refer to a text terminal, the return value is @code{nil}. |
| 2266 | @end defun | 2777 | @end defun |
| 2267 | 2778 | ||
| 2779 | |||
| 2268 | @node Frame Configurations | 2780 | @node Frame Configurations |
| 2269 | @section Frame Configurations | 2781 | @section Frame Configurations |
| 2270 | @cindex frame configuration | 2782 | @cindex frame configuration |
| @@ -2288,6 +2800,135 @@ Ordinarily, this function deletes all existing frames not listed in | |||
| 2288 | unwanted frames are iconified instead. | 2800 | unwanted frames are iconified instead. |
| 2289 | @end defun | 2801 | @end defun |
| 2290 | 2802 | ||
| 2803 | |||
| 2804 | @node Child Frames | ||
| 2805 | @section Child Frames | ||
| 2806 | @cindex child frames | ||
| 2807 | @cindex parent frames | ||
| 2808 | |||
| 2809 | On some window-systems the @code{parent-frame} parameter (@pxref{Frame | ||
| 2810 | Interaction Parameters}) can be used to make a frame a child of the | ||
| 2811 | frame specified by that parameter. The frame specified by that | ||
| 2812 | parameter will then be the frame's parent frame as long as the parameter | ||
| 2813 | is not changed or reset. Technically, this makes the child frame's | ||
| 2814 | window-system window a child window of the parent frame's window-system | ||
| 2815 | window. | ||
| 2816 | |||
| 2817 | The @code{parent-frame} parameter can be changed at any time. Setting | ||
| 2818 | it to another frame ``reparents'' the child frame. Setting it to | ||
| 2819 | another child frame makes the frame a ``nested'' child frame. Setting | ||
| 2820 | it to @code{nil} restores the frame's status as a top-level frame---one | ||
| 2821 | whose window-system window is a child of its display's root window. | ||
| 2822 | |||
| 2823 | Since child frames can be arbitrarily nested, a frame can be both a | ||
| 2824 | child and a parent frame. Also, the relative roles of child and parent | ||
| 2825 | frame may be reversed at any time (though it's usually a good idea to | ||
| 2826 | keep the size of child frames sufficiently smaller than that of their | ||
| 2827 | parent). An error will be signalled for the attempt to make a frame an | ||
| 2828 | ancestor of itself. | ||
| 2829 | |||
| 2830 | A child frame is clipped at the native edges (@pxref{Frame Geometry}) | ||
| 2831 | of its parent frame---everything outside these edges is invisible. Its | ||
| 2832 | @code{left} and @code{top} parameters specify positions relative to the | ||
| 2833 | top-left corner of its parent's native frame. When either of the frames | ||
| 2834 | is resized, the relative position of the child frame remains unaltered. | ||
| 2835 | Hence, resizing either of these frames can hide or reveal parts of the | ||
| 2836 | child frame. | ||
| 2837 | |||
| 2838 | Usually, moving a parent frame moves along all its child frames and | ||
| 2839 | their descendants as well, keeping their relative positions unaltered. | ||
| 2840 | The hook @code{move-frame-functions} (@pxref{Frame Position}) is run for | ||
| 2841 | a child frame only when the position of the child frame relative to its | ||
| 2842 | parent frame changes. When a parent frame is resized, the child frame | ||
| 2843 | retains its position respective to the left and upper native edges of | ||
| 2844 | its parent. In this case, the position respective to the lower or right | ||
| 2845 | native edge of the parent frame is usually lost. | ||
| 2846 | |||
| 2847 | A visible child frame always appears on top of its parent frame thus | ||
| 2848 | obscuring parts of it. This is comparable to the window-system window | ||
| 2849 | of a top-level frame which also always appears on top of its parent | ||
| 2850 | window---the desktop's root window. When a parent frame is iconified or | ||
| 2851 | made invisible (@pxref{Visibility of Frames}), its child frames are made | ||
| 2852 | invisible. When a parent frame is deiconified or made visible, its | ||
| 2853 | child frames are made visible. When a parent frame is about to be | ||
| 2854 | deleted, (@pxref{Deleting Frames}) its child frames are recursively | ||
| 2855 | deleted before it. | ||
| 2856 | |||
| 2857 | Whether a child frame can have a menu or tool bar is window-system or | ||
| 2858 | window manager dependent. Most window-systems explicitly disallow menus | ||
| 2859 | bars for child frames. It seems advisable to disable both, menu and | ||
| 2860 | tool bars, via the frame's initial parameters settings. | ||
| 2861 | |||
| 2862 | Usually, child frames do not exhibit window manager decorations like a | ||
| 2863 | title bar or external borders (@pxref{Frame Geometry}). When the child | ||
| 2864 | frame does not show a menu or tool bar, any other of the frame's borders | ||
| 2865 | (@pxref{Layout Parameters}) can be used instead of the external borders. | ||
| 2866 | |||
| 2867 | In particular, under X (but not when building with GTK+), the frame's | ||
| 2868 | outer border can be used. On Windows, specifying a non-zero outer | ||
| 2869 | border width will show a one pixel wide external border. Under all | ||
| 2870 | window-systems, the internal border can be used. In either case, it's | ||
| 2871 | advisable to disable a child frame's window manager decorations with the | ||
| 2872 | @code{undecorated} frame parameter @pxref{Management Parameters}). | ||
| 2873 | |||
| 2874 | The behavior of child frames deviates from that of top-level frames in | ||
| 2875 | a number of other ways as well. Here we sketch a few of them: | ||
| 2876 | |||
| 2877 | @itemize @bullet | ||
| 2878 | @item | ||
| 2879 | The semantics of maximizing and iconifying child frames is highly | ||
| 2880 | window-system dependent. As a rule, applications should never invoke | ||
| 2881 | these operations for child frames. | ||
| 2882 | |||
| 2883 | @item | ||
| 2884 | Raising, lowering and restacking child frames (@pxref{Raising and | ||
| 2885 | Lowering}) or changing the @code{z-group} (@pxref{Position Parameters}) | ||
| 2886 | of a child frame changes only the stacking order of child frames with | ||
| 2887 | the same parent. | ||
| 2888 | |||
| 2889 | @item | ||
| 2890 | Many window-systems are not able to change the opacity (@pxref{Font and | ||
| 2891 | Color Parameters}) of child frames. | ||
| 2892 | |||
| 2893 | @item | ||
| 2894 | Transferring focus from a child frame to an ancestor that is not its | ||
| 2895 | parent by clicking with the mouse in a visible part of that ancestor's | ||
| 2896 | window may fail with some window-systems. You may have to click into | ||
| 2897 | the direct parent's window-system window first. | ||
| 2898 | |||
| 2899 | @item | ||
| 2900 | Window managers might not bother to extend their focus follows mouse | ||
| 2901 | policy to child frames. Customizing @code{mouse-autoselect-window} can | ||
| 2902 | help in this regard (@pxref{Mouse Window Auto-selection}). | ||
| 2903 | |||
| 2904 | @item | ||
| 2905 | Dropping (@pxref{Drag and Drop}) on child frames is not guaranteed too | ||
| 2906 | work on all window-systems. Some will drop the object on the parent | ||
| 2907 | frame or some ancestor instead. | ||
| 2908 | @end itemize | ||
| 2909 | |||
| 2910 | The following two functions may be useful when working with child and | ||
| 2911 | parent frames: | ||
| 2912 | |||
| 2913 | @defun frame-parent &optional frame | ||
| 2914 | This function returns the parent frame of @var{frame}. The parent frame | ||
| 2915 | of @var{frame} is the Emacs frame whose window-system window is the | ||
| 2916 | parent window of @var{frame}'s window-system window. If such a frame | ||
| 2917 | exists, @var{frame} is considered a child frame of that frame. | ||
| 2918 | |||
| 2919 | This function returns @code{nil} if @var{frame} has no parent frame. | ||
| 2920 | @end defun | ||
| 2921 | |||
| 2922 | @defun frame-ancestor-p &optional ancestor descendant | ||
| 2923 | This functions returns non-@code{nil} if @var{ancestor} is an ancestor | ||
| 2924 | of @var{descendant}. @var{ancestor} is an ancestor of @var{descendant} | ||
| 2925 | when it is either @var{descendant}'s parent frame or it is an ancestor | ||
| 2926 | of @var{descendant}'s parent frame. Both, @var{ancestor} and | ||
| 2927 | @var{descendant} must specify live frames and default to the selected | ||
| 2928 | frame. | ||
| 2929 | @end defun | ||
| 2930 | |||
| 2931 | |||
| 2291 | @node Mouse Tracking | 2932 | @node Mouse Tracking |
| 2292 | @section Mouse Tracking | 2933 | @section Mouse Tracking |
| 2293 | @cindex mouse tracking | 2934 | @cindex mouse tracking |
| @@ -3203,9 +3844,3 @@ ever be developed and distributed noncommercially. | |||
| 3203 | This variable's value is @code{t} if no X window manager is in use. | 3844 | This variable's value is @code{t} if no X window manager is in use. |
| 3204 | @end defvar | 3845 | @end defvar |
| 3205 | @end ignore | 3846 | @end ignore |
| 3206 | |||
| 3207 | @ignore | ||
| 3208 | @item | ||
| 3209 | The functions @code{x-pixel-width} and @code{x-pixel-height} return the | ||
| 3210 | width and height of an X Window frame, measured in pixels. | ||
| 3211 | @end ignore | ||
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 6aa9591e09f..931d1060d5d 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi | |||
| @@ -42,6 +42,7 @@ is displayed in windows. | |||
| 42 | * Vertical Scrolling:: Moving the contents up and down on the window. | 42 | * Vertical Scrolling:: Moving the contents up and down on the window. |
| 43 | * Horizontal Scrolling:: Moving the contents sideways on the window. | 43 | * Horizontal Scrolling:: Moving the contents sideways on the window. |
| 44 | * Coordinates and Windows:: Converting coordinates to windows. | 44 | * Coordinates and Windows:: Converting coordinates to windows. |
| 45 | * Mouse Window Auto-selection:: Automatically selecting windows with the mouse. | ||
| 45 | * Window Configurations:: Saving and restoring the state of the screen. | 46 | * Window Configurations:: Saving and restoring the state of the screen. |
| 46 | * Window Parameters:: Associating additional information with windows. | 47 | * Window Parameters:: Associating additional information with windows. |
| 47 | * Window Hooks:: Hooks for scrolling, window size changes, | 48 | * Window Hooks:: Hooks for scrolling, window size changes, |
| @@ -763,7 +764,7 @@ changing the size of its frame. Because live windows do not overlap, | |||
| 763 | these functions are meaningful only on frames that contain two or more | 764 | these functions are meaningful only on frames that contain two or more |
| 764 | windows: resizing a window also changes the size of a neighboring | 765 | windows: resizing a window also changes the size of a neighboring |
| 765 | window. If there is just one window on a frame, its size cannot be | 766 | window. If there is just one window on a frame, its size cannot be |
| 766 | changed except by resizing the frame (@pxref{Size and Position}). | 767 | changed except by resizing the frame (@pxref{Frame Size}). |
| 767 | 768 | ||
| 768 | Except where noted, these functions also accept internal windows as | 769 | Except where noted, these functions also accept internal windows as |
| 769 | arguments. Resizing an internal window causes its child windows to be | 770 | arguments. Resizing an internal window causes its child windows to be |
| @@ -1016,7 +1017,7 @@ A window can get resized explicitly by using one of the functions from | |||
| 1016 | the preceding section or implicitly, for example, when resizing an | 1017 | the preceding section or implicitly, for example, when resizing an |
| 1017 | adjacent window, when splitting or deleting a window (@pxref{Splitting | 1018 | adjacent window, when splitting or deleting a window (@pxref{Splitting |
| 1018 | Windows}, @pxref{Deleting Windows}) or when resizing the window's frame | 1019 | Windows}, @pxref{Deleting Windows}) or when resizing the window's frame |
| 1019 | (@pxref{Size and Position}). | 1020 | (@pxref{Frame Size}). |
| 1020 | 1021 | ||
| 1021 | It is possible to avoid implicit resizing of a specific window when | 1022 | It is possible to avoid implicit resizing of a specific window when |
| 1022 | there are one or more other resizable windows on the same frame. For | 1023 | there are one or more other resizable windows on the same frame. For |
| @@ -1716,23 +1717,47 @@ value of @code{window-point} (@pxref{Window Point}) in @var{window}. | |||
| 1716 | @var{window} must be a live window. The return value is @var{window}. | 1717 | @var{window} must be a live window. The return value is @var{window}. |
| 1717 | 1718 | ||
| 1718 | By default, this function also moves @var{window}'s buffer to the front | 1719 | By default, this function also moves @var{window}'s buffer to the front |
| 1719 | of the buffer list (@pxref{Buffer List}), and makes @var{window} the | 1720 | of the buffer list (@pxref{Buffer List}) and makes @var{window} the most |
| 1720 | most recently selected window. However, if the optional argument | 1721 | recently selected window. If the optional argument @var{norecord} is |
| 1721 | @var{norecord} is non-@code{nil}, these additional actions are omitted. | 1722 | non-@code{nil}, these additional actions are omitted. |
| 1722 | 1723 | ||
| 1723 | This function runs @code{buffer-list-update-hook} (@pxref{Buffer List}) | 1724 | In addition, this function by default also tells the display engine to |
| 1724 | unless @var{norecord} is non-@code{nil}. Note that applications and | 1725 | update the display of @var{window} when its frame gets redisplayed the |
| 1725 | internal routines often temporarily select a window in order to simplify | 1726 | next time. If @var{norecord} is non-@code{nil}, such updates are |
| 1726 | coding. As a rule, such selections (including those made by the macros | 1727 | usually not performed. If, however, @var{norecord} equals the special |
| 1727 | @code{save-selected-window} and @code{with-selected-window} below) are | 1728 | symbol @code{mark-for-redisplay}, the additional actions mentioned above |
| 1728 | not recorded thus avoiding to pollute @code{buffer-list-update-hook}. | 1729 | are omitted but @var{window} will be nevertheless updated. |
| 1729 | Selections that really count are those causing a visible change in | ||
| 1730 | the next redisplay of @var{window}'s frame and should be always | ||
| 1731 | recorded. This also means that to run a function each time a window | ||
| 1732 | gets selected, putting it on @code{buffer-list-update-hook} should be | ||
| 1733 | the right choice. | ||
| 1734 | @end defun | 1730 | @end defun |
| 1735 | 1731 | ||
| 1732 | @cindex select window hook | ||
| 1733 | @cindex running a hook when a windows gets selected | ||
| 1734 | For historical reasons, Emacs does not run a separate hook whenever a | ||
| 1735 | window gets selected. Applications and internal routines often | ||
| 1736 | temporarily select a window to perform a few actions on it. They do | ||
| 1737 | that either to simplify coding---because many functions by default | ||
| 1738 | operate on the selected window when no @var{window} argument is | ||
| 1739 | specified---or because some functions did not (and still do not) take a | ||
| 1740 | window as argument and always operate(d) on the selected window instead. | ||
| 1741 | Running a hook every time a window gets selected for a short time and | ||
| 1742 | once more when the previously selected window gets restored is not | ||
| 1743 | useful. | ||
| 1744 | |||
| 1745 | However, when its @var{norecord} argument is @code{nil}, | ||
| 1746 | @code{select-window} updates the buffer list and thus indirectly runs | ||
| 1747 | the normal hook @code{buffer-list-update-hook} (@pxref{Buffer List}). | ||
| 1748 | Consequently, that hook provides a reasonable way to run a function | ||
| 1749 | whenever a window gets selected more ``permanently''. | ||
| 1750 | |||
| 1751 | Since @code{buffer-list-update-hook} is also run by functions that are | ||
| 1752 | not related to window management, it will usually make sense to save the | ||
| 1753 | value of the selected window somewhere and compare it with the value of | ||
| 1754 | @code{selected-window} while running that hook. Also, to avoid false | ||
| 1755 | positives when using @code{buffer-list-update-hook} it is good practice | ||
| 1756 | that every @code{select-window} call supposed to select a window only | ||
| 1757 | temporarily, passes a non-@code{nil} @var{norecord} argument. If | ||
| 1758 | possible, the macro @code{with-selected-window} (see below) should be | ||
| 1759 | used in such cases. | ||
| 1760 | |||
| 1736 | @cindex most recently selected windows | 1761 | @cindex most recently selected windows |
| 1737 | The sequence of calls to @code{select-window} with a non-@code{nil} | 1762 | The sequence of calls to @code{select-window} with a non-@code{nil} |
| 1738 | @var{norecord} argument determines an ordering of windows by their | 1763 | @var{norecord} argument determines an ordering of windows by their |
| @@ -1761,13 +1786,13 @@ the buffer list. | |||
| 1761 | 1786 | ||
| 1762 | @defmac with-selected-window window forms@dots{} | 1787 | @defmac with-selected-window window forms@dots{} |
| 1763 | This macro selects @var{window}, executes @var{forms} in sequence, then | 1788 | This macro selects @var{window}, executes @var{forms} in sequence, then |
| 1764 | restores the previously selected window and current buffer. The ordering | 1789 | restores the previously selected window and current buffer. The |
| 1765 | of recently selected windows and the buffer list remain unchanged unless | 1790 | ordering of recently selected windows and the buffer list remain |
| 1766 | you deliberately change them within @var{forms}; for example, by calling | 1791 | unchanged unless you deliberately change them within @var{forms}; for |
| 1767 | @code{select-window} with argument @var{norecord} @code{nil}. | 1792 | example, by calling @code{select-window} with argument @var{norecord} |
| 1768 | 1793 | @code{nil}. Hence, this macro is the preferred way to temporarily work | |
| 1769 | This macro does not change the order of recently selected windows or | 1794 | with @var{window} as the selected window without needlessly running |
| 1770 | the buffer list. | 1795 | @code{buffer-list-update-hook}. |
| 1771 | @end defmac | 1796 | @end defmac |
| 1772 | 1797 | ||
| 1773 | @defun frame-selected-window &optional frame | 1798 | @defun frame-selected-window &optional frame |
| @@ -4566,6 +4591,55 @@ point in the selected window, it's sufficient to write: | |||
| 4566 | @end defun | 4591 | @end defun |
| 4567 | 4592 | ||
| 4568 | 4593 | ||
| 4594 | @node Mouse Window Auto-selection | ||
| 4595 | @section Mouse Window Auto-selection | ||
| 4596 | @cindex window auto-selection | ||
| 4597 | @cindex auto-selection of window | ||
| 4598 | The following option allows to automatically select the window under the | ||
| 4599 | mouse pointer. This accomplishes a policy similar to that of window | ||
| 4600 | managers that give focus to a frame (and thus trigger its subsequent | ||
| 4601 | selection) whenever the mouse pointer enters its window-system window | ||
| 4602 | (@pxref{Input Focus}). | ||
| 4603 | |||
| 4604 | @defvar mouse-autoselect-window | ||
| 4605 | If this variable is non-@code{nil}, Emacs will try to automatically | ||
| 4606 | select the window under the mouse pointer. The following values are | ||
| 4607 | meaningful: | ||
| 4608 | |||
| 4609 | @table @asis | ||
| 4610 | @item A positive number | ||
| 4611 | This specifies a delay in seconds after which auto-selection triggers. | ||
| 4612 | The window under the mouse pointer is selected after the mouse has | ||
| 4613 | remained in it for the entire duration of the delay. | ||
| 4614 | |||
| 4615 | @item A negative number | ||
| 4616 | A negative number has a similar effect as a positive number, but selects | ||
| 4617 | the window under the mouse pointer only after the mouse pointer has | ||
| 4618 | remained in it for the entire duration of the absolute value of that | ||
| 4619 | number and in addition has stopped moving. | ||
| 4620 | |||
| 4621 | @item Other value | ||
| 4622 | Any other non-@code{nil} value means to select a window instantaneously | ||
| 4623 | as soon as the mouse pointer enters it. | ||
| 4624 | @end table | ||
| 4625 | |||
| 4626 | In either case the mouse pointer must enter the text area of a window in | ||
| 4627 | order to trigger its selection. Dragging the scroll bar slider or the | ||
| 4628 | mode line of a window conceptually should not cause its auto-selection. | ||
| 4629 | |||
| 4630 | Mouse auto-selection selects the minibuffer window only if it is active, | ||
| 4631 | and never deselects the active minibuffer window. | ||
| 4632 | @end defvar | ||
| 4633 | |||
| 4634 | Mouse auto-selection can be used to emulate a focus follows mouse policy | ||
| 4635 | for child frames (@pxref{Child Frames}) which usually are not tracked by | ||
| 4636 | the window manager. This requires to set the value of | ||
| 4637 | @code{focus-follows-mouse} (@pxref{Input Focus}) to a non-@code{nil} | ||
| 4638 | value. If the value of @code{focus-follows-mouse} is @code{auto-raise}, | ||
| 4639 | entering a child frame with the mouse will raise it automatically above | ||
| 4640 | all other child frames of that frame's parent frame. | ||
| 4641 | |||
| 4642 | |||
| 4569 | @node Window Configurations | 4643 | @node Window Configurations |
| 4570 | @section Window Configurations | 4644 | @section Window Configurations |
| 4571 | @cindex window configurations | 4645 | @cindex window configurations |