diff options
| author | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
| commit | 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch) | |
| tree | f1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/elisp/frame-position.html | |
new repository
Diffstat (limited to 'devdocs/elisp/frame-position.html')
| -rw-r--r-- | devdocs/elisp/frame-position.html | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/devdocs/elisp/frame-position.html b/devdocs/elisp/frame-position.html new file mode 100644 index 00000000..81805444 --- /dev/null +++ b/devdocs/elisp/frame-position.html @@ -0,0 +1,18 @@ + <h4 class="subsection">Frame Position</h4> <p>On graphical systems, the position of a normal top-level frame is specified as the absolute position of its outer frame (see <a href="frame-geometry">Frame Geometry</a>). The position of a child frame (see <a href="child-frames">Child Frames</a>) is specified via pixel offsets of its outer edges relative to the native position of its parent frame. </p> <p>You can access or change the position of a frame using the frame parameters <code>left</code> and <code>top</code> (see <a href="position-parameters">Position Parameters</a>). Here are two additional functions for working with the positions of an existing, visible frame. For both functions, the argument <var>frame</var> must denote a live frame and defaults to the selected frame. </p> <dl> <dt id="frame-position">Function: <strong>frame-position</strong> <em>&optional frame</em> +</dt> <dd> +<p>For a normal, non-child frame this function returns a cons of the pixel coordinates of its outer position (see <a href="frame-layout">Frame Layout</a>) with respect to the origin <code>(0, 0)</code> of its display. For a child frame (see <a href="child-frames">Child Frames</a>) this function returns the pixel coordinates of its outer position with respect to an origin <code>(0, 0)</code> at the native position of <var>frame</var>’s parent. </p> <p>Negative values never indicate an offset from the right or bottom edge of <var>frame</var>’s display or parent frame. Rather, they mean that <var>frame</var>’s outer position is on the left and/or above the origin of its display or the native position of its parent frame. This usually means that <var>frame</var> is only partially visible (or completely invisible). However, on systems where the display’s origin does not coincide with its top-left corner, the frame may be visible on a secondary monitor. </p> <p>On a text terminal frame both values are zero. </p> +</dd> +</dl> <dl> <dt id="set-frame-position">Function: <strong>set-frame-position</strong> <em>frame x y</em> +</dt> <dd> +<p>This function sets the outer frame position of <var>frame</var> to (<var>x</var>, <var>y</var>). The latter arguments specify pixels and normally count from the origin at the position (0, 0) of <var>frame</var>’s display. For child frames, they count from the native position of <var>frame</var>’s parent frame. </p> <p>Negative parameter values position the right edge of the outer frame by <var>-x</var> pixels left from the right edge of the screen (or the parent frame’s native rectangle) and the bottom edge by <var>-y</var> pixels up from the bottom edge of the screen (or the parent frame’s native rectangle). </p> <p>Note that negative values do not permit to align the right or bottom edge of <var>frame</var> exactly at the right or bottom edge of its display or parent frame. Neither do they allow to specify a position that does not lie within the edges of the display or parent frame. The frame parameters <code>left</code> and <code>top</code> (see <a href="position-parameters">Position Parameters</a>) allow to do that, but may still fail to provide good results for the initial or a new frame. </p> <p>This function has no effect on text terminal frames. </p> +</dd> +</dl> <dl> <dt id="move-frame-functions">Variable: <strong>move-frame-functions</strong> +</dt> <dd> + <p>This hook specifies the functions that are run when an Emacs frame is moved (assigned a new position) by the window-system or window manager. The functions are run with one argument, the frame that moved. For a child frame (see <a href="child-frames">Child Frames</a>), the functions are run only when the position of the frame changes in relation to that of its parent frame. </p> +</dd> +</dl><div class="_attribution"> + <p class="_attribution-p"> + Copyright © 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br> + <a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Frame-Position.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Frame-Position.html</a> + </p> +</div> |
