diff options
| author | Glenn Morris | 2018-12-10 09:43:05 -0800 |
|---|---|---|
| committer | Glenn Morris | 2018-12-10 09:43:05 -0800 |
| commit | 3d353ce585e4f9726b59b054218aaa0923d77fea (patch) | |
| tree | 985b48667adc151eff87dfd85ac598c2c23c3fd0 | |
| parent | 874f69acecf0c6c3c4886375c092fb389d207241 (diff) | |
| parent | 908af9dfc46f783c89d06cb48d9499eb6a582d3e (diff) | |
| download | emacs-3d353ce585e4f9726b59b054218aaa0923d77fea.tar.gz emacs-3d353ce585e4f9726b59b054218aaa0923d77fea.zip | |
Merge from origin/emacs-26
908af9d Indexing followup to recent changes
505ac9a Improve documentation of cursor-sensor.el (bug#33664)
d817d2c * doc/lispref/commands.texi (Adjusting Point): Bug#33662
18442da Tramp multi-hop methods must be inline
1e3e24d ; * src/xterm.c (x_update_begin): Fix whitespace.
1d743d2 Fix scaling problem in Cairo builds
2b9e993 ; * doc/lispref/text.texi (Special Properties): Fix wording. ...
e568202 * lisp/simple.el (next-line-or-history-element): Use current-...
c7897c2 A few further fixes of window internals description
# Conflicts:
# doc/misc/tramp.texi
| -rw-r--r-- | doc/lispref/commands.texi | 3 | ||||
| -rw-r--r-- | doc/lispref/internals.texi | 96 | ||||
| -rw-r--r-- | doc/lispref/text.texi | 10 | ||||
| -rw-r--r-- | doc/misc/tramp.texi | 2 | ||||
| -rw-r--r-- | lisp/emacs-lisp/cursor-sensor.el | 26 | ||||
| -rw-r--r-- | lisp/simple.el | 22 | ||||
| -rw-r--r-- | src/window.h | 142 | ||||
| -rw-r--r-- | src/xterm.c | 14 |
8 files changed, 210 insertions, 105 deletions
diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi index 427379bc79c..b6749d0a0cc 100644 --- a/doc/lispref/commands.texi +++ b/doc/lispref/commands.texi | |||
| @@ -1012,7 +1012,8 @@ If the last event came from a keyboard macro, the value is @code{macro}. | |||
| 1012 | sequence of text that has the @code{display} or @code{composition} | 1012 | sequence of text that has the @code{display} or @code{composition} |
| 1013 | property, or is invisible. Therefore, after a command finishes and | 1013 | property, or is invisible. Therefore, after a command finishes and |
| 1014 | returns to the command loop, if point is within such a sequence, the | 1014 | returns to the command loop, if point is within such a sequence, the |
| 1015 | command loop normally moves point to the edge of the sequence. | 1015 | command loop normally moves point to the edge of the sequence, making this |
| 1016 | sequence effectively intangible. | ||
| 1016 | 1017 | ||
| 1017 | A command can inhibit this feature by setting the variable | 1018 | A command can inhibit this feature by setting the variable |
| 1018 | @code{disable-point-adjustment}: | 1019 | @code{disable-point-adjustment}: |
diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi index a2f7e8c792b..dddbf38c591 100644 --- a/doc/lispref/internals.texi +++ b/doc/lispref/internals.texi | |||
| @@ -2033,45 +2033,76 @@ if that window no longer displays this buffer. | |||
| 2033 | The frame that this window is on, as a Lisp object. | 2033 | The frame that this window is on, as a Lisp object. |
| 2034 | 2034 | ||
| 2035 | @item mini | 2035 | @item mini |
| 2036 | Non-zero if this window is a minibuffer window. | 2036 | Non-zero if this window is a minibuffer window, a window showing the |
| 2037 | minibuffer or the echo area. | ||
| 2038 | |||
| 2039 | @item pseudo_window_p | ||
| 2040 | @cindex pseudo window | ||
| 2041 | Non-zero if this window is a @dfn{pseudo window}. A pseudo window is | ||
| 2042 | either a window used to display the menu bar or the tool bar (when | ||
| 2043 | Emacs uses toolkits that don't display their own menu bar and tool | ||
| 2044 | bar) or a window showing a tooltip on a tooltip frame. Pseudo windows | ||
| 2045 | are in general not accessible from Lisp code. | ||
| 2037 | 2046 | ||
| 2038 | @item parent | 2047 | @item parent |
| 2039 | Internally, Emacs arranges windows in a tree; each group of siblings has | 2048 | Internally, Emacs arranges windows in a tree; each group of siblings |
| 2040 | a parent window whose area includes all the siblings. This field points | 2049 | has a parent window whose area includes all the siblings. This field |
| 2041 | to a window's parent, as a Lisp object. | 2050 | points to the window's parent in that tree, as a Lisp object. For the |
| 2051 | root window of the tree and a minibuffer window this is always | ||
| 2052 | @code{nil}. | ||
| 2042 | 2053 | ||
| 2043 | Parent windows do not display buffers, and play little role in display | 2054 | Parent windows do not display buffers, and play little role in display |
| 2044 | except to shape their child windows. Emacs Lisp programs usually have | 2055 | except to shape their child windows. Emacs Lisp programs cannot |
| 2045 | no access to the parent windows; they operate on the windows at the | 2056 | directly manipulate parent windows; they operate on the windows at the |
| 2046 | leaves of the tree, which actually display buffers. | 2057 | leaves of the tree, which actually display buffers. |
| 2047 | 2058 | ||
| 2059 | @item contents | ||
| 2060 | For a leaf window and windows showing a tooltip, this is the buffer, | ||
| 2061 | as a Lisp object, that the window is displaying. For an internal | ||
| 2062 | (``parent'') window, this is its first child window. For a pseudo | ||
| 2063 | window showing a menu or tool bar this is @code{nil}. It is also | ||
| 2064 | @code{nil} for a window that has been deleted. | ||
| 2065 | |||
| 2048 | @item next | 2066 | @item next |
| 2049 | @itemx prev | 2067 | @itemx prev |
| 2050 | The next sibling and previous sibling of this window. @code{next} is | 2068 | The next and previous sibling of this window as Lisp objects. |
| 2051 | @code{nil} if the window is the right-most or bottom-most in its group; | 2069 | @code{next} is @code{nil} if the window is the right-most or |
| 2052 | @code{prev} is @code{nil} if it is the left-most or top-most in its | 2070 | bottom-most in its group; @code{prev} is @code{nil} if it is the |
| 2053 | group. Whether the sibling is left/right or up/down is determined by | 2071 | left-most or top-most in its group. Whether the sibling is left/right |
| 2054 | the @code{horizontal} field: if it's non-zero, the siblings are | 2072 | or up/down is determined by the @code{horizontal} field of the |
| 2055 | arranged horizontally. | 2073 | sibling's parent: if it's non-zero, the siblings are arranged |
| 2074 | horizontally. | ||
| 2075 | |||
| 2076 | As a special case, @code{next} of a frame's root window points to the | ||
| 2077 | frame's minibuffer window, provided this is not a minibuffer-only or | ||
| 2078 | minibuffer-less frame. On such frames @code{prev} of the minibuffer | ||
| 2079 | window points to that frame's root window. In any other case, the | ||
| 2080 | root window's @code{next} and the minibuffer window's (if present) | ||
| 2081 | @code{prev} fields are @code{nil}. | ||
| 2056 | 2082 | ||
| 2057 | @item left_col | 2083 | @item left_col |
| 2058 | The left-hand edge of the window, measured in columns, relative to the | 2084 | The left-hand edge of the window, measured in columns, relative to the |
| 2059 | leftmost column in the frame (column 0). | 2085 | leftmost column (column 0) of the window's native frame. |
| 2060 | 2086 | ||
| 2061 | @item top_line | 2087 | @item top_line |
| 2062 | The top edge of the window, measured in lines, relative to the topmost | 2088 | The top edge of the window, measured in lines, relative to the topmost |
| 2063 | line in the frame (line 0). | 2089 | line (line 0) of the window's native frame. |
| 2090 | |||
| 2091 | @item pixel_left | ||
| 2092 | @itemx pixel_top | ||
| 2093 | The left-hand and top edges of this window, measured in pixels, | ||
| 2094 | relative to the top-left corner (0, 0) of the window's native frame. | ||
| 2064 | 2095 | ||
| 2065 | @item total_cols | 2096 | @item total_cols |
| 2066 | @itemx total_lines | 2097 | @itemx total_lines |
| 2067 | The width and height of the window, measured in columns and lines | 2098 | The total width and height of the window, measured in columns and |
| 2068 | respectively. The width includes the scroll bar and fringes, and/or | 2099 | lines respectively. The values include scroll bars and fringes, |
| 2069 | the separator line on the right of the window (if any). | 2100 | dividers and/or the separator line on the right of the window (if |
| 2101 | any). | ||
| 2070 | 2102 | ||
| 2071 | @item contents | 2103 | @item pixel_width; |
| 2072 | For leaf windows, this is the buffer, as a Lisp object, that the | 2104 | @itemx pixel_height; |
| 2073 | window is displaying. For an internal (``parent'') window, this is | 2105 | The total width and height of the window measured in pixels. |
| 2074 | its child window. It can also be @code{nil}, for a pseudo-window. | ||
| 2075 | 2106 | ||
| 2076 | @item start | 2107 | @item start |
| 2077 | A marker pointing to the position in the buffer that is the first | 2108 | A marker pointing to the position in the buffer that is the first |
| @@ -2125,8 +2156,14 @@ in this window. | |||
| 2125 | A non-zero value means the window's buffer was modified when the | 2156 | A non-zero value means the window's buffer was modified when the |
| 2126 | window was last updated. | 2157 | window was last updated. |
| 2127 | 2158 | ||
| 2128 | @item vertical_scroll_bar | 2159 | @item vertical_scroll_bar_type |
| 2129 | This window's vertical scroll bar, a Lisp object. | 2160 | @itemx horizontal_scroll_bar_type |
| 2161 | The types of this window's vertical and horizontal scroll bars. | ||
| 2162 | |||
| 2163 | @item scroll_bar_width | ||
| 2164 | @itemx scroll_bar_height | ||
| 2165 | The width of this window's vertical scroll bar and the height of this | ||
| 2166 | window's horizontal scroll bar, in pixels. | ||
| 2130 | 2167 | ||
| 2131 | @item left_margin_cols | 2168 | @item left_margin_cols |
| 2132 | @itemx right_margin_cols | 2169 | @itemx right_margin_cols |
| @@ -2210,6 +2247,14 @@ Vertical scroll amount, in pixels. Normally, this is 0. | |||
| 2210 | @item dedicated | 2247 | @item dedicated |
| 2211 | Non-@code{nil} if this window is dedicated to its buffer. | 2248 | Non-@code{nil} if this window is dedicated to its buffer. |
| 2212 | 2249 | ||
| 2250 | @item combination_limit | ||
| 2251 | This window's combination limit, meaningful only for a parent window. | ||
| 2252 | If this is @code{t}, then it is not allowed to delete this window and | ||
| 2253 | recombine its child windows with other siblings of this window. | ||
| 2254 | |||
| 2255 | @item window_parameters | ||
| 2256 | The alist of this window's parameters. | ||
| 2257 | |||
| 2213 | @item display_table | 2258 | @item display_table |
| 2214 | The window's display table, or @code{nil} if none is specified for it. | 2259 | The window's display table, or @code{nil} if none is specified for it. |
| 2215 | 2260 | ||
| @@ -2234,11 +2279,6 @@ the line number as long as the window shows that buffer. | |||
| 2234 | The column number currently displayed in this window's mode line, or | 2279 | The column number currently displayed in this window's mode line, or |
| 2235 | @minus{}1 if column numbers are not being displayed. | 2280 | @minus{}1 if column numbers are not being displayed. |
| 2236 | 2281 | ||
| 2237 | @item pseudo_window_p | ||
| 2238 | This is non-zero for windows that display the menu bar and the tool | ||
| 2239 | bar (when Emacs uses toolkits that don't display their own menu bar | ||
| 2240 | and tool bar). | ||
| 2241 | |||
| 2242 | @item current_matrix | 2282 | @item current_matrix |
| 2243 | @itemx desired_matrix | 2283 | @itemx desired_matrix |
| 2244 | Glyph matrices describing the current and desired display of this window. | 2284 | Glyph matrices describing the current and desired display of this window. |
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 51d2753f404..6d93264758f 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi | |||
| @@ -3496,9 +3496,14 @@ property is obsolete; use the @code{cursor-intangible} property instead. | |||
| 3496 | @kindex cursor-intangible @r{(text property)} | 3496 | @kindex cursor-intangible @r{(text property)} |
| 3497 | @findex cursor-intangible-mode | 3497 | @findex cursor-intangible-mode |
| 3498 | When the minor mode @code{cursor-intangible-mode} is turned on, point | 3498 | When the minor mode @code{cursor-intangible-mode} is turned on, point |
| 3499 | is moved away of any position that has a non-@code{nil} | 3499 | is moved away from any position that has a non-@code{nil} |
| 3500 | @code{cursor-intangible} property, just before redisplay happens. | 3500 | @code{cursor-intangible} property, just before redisplay happens. |
| 3501 | 3501 | ||
| 3502 | @vindex cursor-sensor-inhibit | ||
| 3503 | When the variable @code{cursor-sensor-inhibit} is non-@code{nil}, the | ||
| 3504 | @code{cursor-intangible} property and the | ||
| 3505 | @code{cursor-sensor-functions} property (described below) are ignored. | ||
| 3506 | |||
| 3502 | @item field | 3507 | @item field |
| 3503 | @kindex field @r{(text property)} | 3508 | @kindex field @r{(text property)} |
| 3504 | Consecutive characters with the same @code{field} property constitute a | 3509 | Consecutive characters with the same @code{field} property constitute a |
| @@ -3680,6 +3685,9 @@ depending on whether the cursor is entering the text that has this | |||
| 3680 | property or leaving it. The functions are called only when the minor | 3685 | property or leaving it. The functions are called only when the minor |
| 3681 | mode @code{cursor-sensor-mode} is turned on. | 3686 | mode @code{cursor-sensor-mode} is turned on. |
| 3682 | 3687 | ||
| 3688 | When the variable @code{cursor-sensor-inhibit} is non-@code{nil}, the | ||
| 3689 | @code{cursor-sensor-functions} property is ignored. | ||
| 3690 | |||
| 3683 | @item composition | 3691 | @item composition |
| 3684 | @kindex composition @r{(text property)} | 3692 | @kindex composition @r{(text property)} |
| 3685 | This text property is used to display a sequence of characters as a | 3693 | This text property is used to display a sequence of characters as a |
diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index d5a45ad27c6..5c5402133a7 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi | |||
| @@ -2739,6 +2739,8 @@ proxy @samp{bird@@bastion} to a remote file on @samp{you@@remotehost}: | |||
| 2739 | @kbd{C-x C-f @value{prefix}ssh@value{postfixhop}bird@@bastion|ssh@value{postfixhop}you@@remotehost@value{postfix}/path @key{RET}} | 2739 | @kbd{C-x C-f @value{prefix}ssh@value{postfixhop}bird@@bastion|ssh@value{postfixhop}you@@remotehost@value{postfix}/path @key{RET}} |
| 2740 | @end example | 2740 | @end example |
| 2741 | 2741 | ||
| 2742 | Each involved method must be an inline method (@pxref{Inline methods}). | ||
| 2743 | |||
| 2742 | @value{tramp} adds the ad-hoc definitions on the fly to | 2744 | @value{tramp} adds the ad-hoc definitions on the fly to |
| 2743 | @code{tramp-default-proxies-alist} and is available for re-use | 2745 | @code{tramp-default-proxies-alist} and is available for re-use |
| 2744 | during that Emacs session. Subsequent @value{tramp} connections to | 2746 | during that Emacs session. Subsequent @value{tramp} connections to |
diff --git a/lisp/emacs-lisp/cursor-sensor.el b/lisp/emacs-lisp/cursor-sensor.el index 7e3088dd91e..21c48f830f2 100644 --- a/lisp/emacs-lisp/cursor-sensor.el +++ b/lisp/emacs-lisp/cursor-sensor.el | |||
| @@ -22,17 +22,29 @@ | |||
| 22 | 22 | ||
| 23 | ;;; Commentary: | 23 | ;;; Commentary: |
| 24 | 24 | ||
| 25 | ;; This package implements the `cursor-intangible' property, which is | 25 | ;; This package implements the `cursor-intangible' and |
| 26 | ;; meant to replace the old `intangible' property. To use it, just enable the | 26 | ;; `cursor-sensor-functions' properties, which are meant to replace |
| 27 | ;; `cursor-intangible-mode', after which this package will move point away from | 27 | ;; the old `intangible', `point-entered', and `point-left' properties. |
| 28 | ;; any position that has a non-nil `cursor-intangible' property. This is only | 28 | |
| 29 | ;; done just before redisplay happens, contrary to the old `intangible' | 29 | ;; To use `cursor-intangible', just enable the |
| 30 | ;; property which was done at a much lower level. | 30 | ;; `cursor-intangible-mode' minor mode, after which this package will |
| 31 | ;; move point away from any position that has a non-nil | ||
| 32 | ;; `cursor-intangible' property. This is only done just before | ||
| 33 | ;; redisplay happens, contrary to the old `intangible' property which | ||
| 34 | ;; was done at a much lower level. | ||
| 35 | |||
| 36 | ;; To use `cursor-sensor-functions', enable the `cursor-sensor-mode' | ||
| 37 | ;; minor mode, after which the `cursor-sensor-functions' will be | ||
| 38 | ;; called just before redisplay happens, according to the movement of | ||
| 39 | ;; the cursor since the last redisplay. | ||
| 31 | 40 | ||
| 32 | ;;; Code: | 41 | ;;; Code: |
| 33 | 42 | ||
| 34 | ;;;###autoload | 43 | ;;;###autoload |
| 35 | (defvar cursor-sensor-inhibit nil) | 44 | (defvar cursor-sensor-inhibit nil |
| 45 | "When non-nil, suspend `cursor-sensor-mode' and `cursor-intangible-mode'. | ||
| 46 | By convention, this is a list of symbols where each symbol stands for the | ||
| 47 | \"cause\" of the suspension.") | ||
| 36 | 48 | ||
| 37 | (defun cursor-sensor--intangible-p (pos) | 49 | (defun cursor-sensor--intangible-p (pos) |
| 38 | (let ((p (get-pos-property pos 'cursor-intangible))) | 50 | (let ((p (get-pos-property pos 'cursor-intangible))) |
diff --git a/lisp/simple.el b/lisp/simple.el index db59b9f5bc3..6eb56b73c09 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -2172,7 +2172,11 @@ next element of the minibuffer history in the minibuffer." | |||
| 2172 | (prompt-end (minibuffer-prompt-end)) | 2172 | (prompt-end (minibuffer-prompt-end)) |
| 2173 | (old-column (unless (and (eolp) (> (point) prompt-end)) | 2173 | (old-column (unless (and (eolp) (> (point) prompt-end)) |
| 2174 | (if (= (line-number-at-pos) 1) | 2174 | (if (= (line-number-at-pos) 1) |
| 2175 | (max (- (current-column) (1- prompt-end)) 0) | 2175 | (max (- (current-column) |
| 2176 | (save-excursion | ||
| 2177 | (goto-char (1- prompt-end)) | ||
| 2178 | (current-column))) | ||
| 2179 | 0) | ||
| 2176 | (current-column))))) | 2180 | (current-column))))) |
| 2177 | (condition-case nil | 2181 | (condition-case nil |
| 2178 | (with-no-warnings | 2182 | (with-no-warnings |
| @@ -2191,7 +2195,10 @@ next element of the minibuffer history in the minibuffer." | |||
| 2191 | (goto-char (point-max)) | 2195 | (goto-char (point-max)) |
| 2192 | (when old-column | 2196 | (when old-column |
| 2193 | (if (= (line-number-at-pos) 1) | 2197 | (if (= (line-number-at-pos) 1) |
| 2194 | (move-to-column (+ old-column (1- (minibuffer-prompt-end)))) | 2198 | (move-to-column (+ old-column |
| 2199 | (save-excursion | ||
| 2200 | (goto-char (1- (minibuffer-prompt-end))) | ||
| 2201 | (current-column)))) | ||
| 2195 | (move-to-column old-column))))))) | 2202 | (move-to-column old-column))))))) |
| 2196 | 2203 | ||
| 2197 | (defun previous-line-or-history-element (&optional arg) | 2204 | (defun previous-line-or-history-element (&optional arg) |
| @@ -2206,7 +2213,11 @@ previous element of the minibuffer history in the minibuffer." | |||
| 2206 | (prompt-end (minibuffer-prompt-end)) | 2213 | (prompt-end (minibuffer-prompt-end)) |
| 2207 | (old-column (unless (and (eolp) (> (point) prompt-end)) | 2214 | (old-column (unless (and (eolp) (> (point) prompt-end)) |
| 2208 | (if (= (line-number-at-pos) 1) | 2215 | (if (= (line-number-at-pos) 1) |
| 2209 | (max (- (current-column) (1- prompt-end)) 0) | 2216 | (max (- (current-column) |
| 2217 | (save-excursion | ||
| 2218 | (goto-char (1- prompt-end)) | ||
| 2219 | (current-column))) | ||
| 2220 | 0) | ||
| 2210 | (current-column))))) | 2221 | (current-column))))) |
| 2211 | (condition-case nil | 2222 | (condition-case nil |
| 2212 | (with-no-warnings | 2223 | (with-no-warnings |
| @@ -2225,7 +2236,10 @@ previous element of the minibuffer history in the minibuffer." | |||
| 2225 | (goto-char (minibuffer-prompt-end)) | 2236 | (goto-char (minibuffer-prompt-end)) |
| 2226 | (if old-column | 2237 | (if old-column |
| 2227 | (if (= (line-number-at-pos) 1) | 2238 | (if (= (line-number-at-pos) 1) |
| 2228 | (move-to-column (+ old-column (1- (minibuffer-prompt-end)))) | 2239 | (move-to-column (+ old-column |
| 2240 | (save-excursion | ||
| 2241 | (goto-char (1- (minibuffer-prompt-end))) | ||
| 2242 | (current-column)))) | ||
| 2229 | (move-to-column old-column)) | 2243 | (move-to-column old-column)) |
| 2230 | ;; Put the cursor at the end of the visual line instead of the | 2244 | ;; Put the cursor at the end of the visual line instead of the |
| 2231 | ;; logical line, so the next `previous-line-or-history-element' | 2245 | ;; logical line, so the next `previous-line-or-history-element' |
diff --git a/src/window.h b/src/window.h index b3673a0b454..4bb6293435c 100644 --- a/src/window.h +++ b/src/window.h | |||
| @@ -24,57 +24,69 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | |||
| 24 | 24 | ||
| 25 | INLINE_HEADER_BEGIN | 25 | INLINE_HEADER_BEGIN |
| 26 | 26 | ||
| 27 | /* Windows are allocated as if they were vectors, but then the | 27 | /* Windows are allocated as if they were vectors, but then the Lisp |
| 28 | Lisp data type is changed to Lisp_Window. They are garbage | 28 | data type is changed to Lisp_Window. They are garbage collected along |
| 29 | collected along with the vectors. | 29 | with the vectors. |
| 30 | 30 | ||
| 31 | All windows in use are arranged into a tree, with pointers up and down. | 31 | All windows in use are arranged into a tree, with pointers up and down. |
| 32 | 32 | ||
| 33 | Windows that are leaves of the tree are actually displayed | 33 | Windows that are leaves of the tree are actually displayed and show |
| 34 | and show the contents of buffers. Windows that are not leaves | 34 | the contents of buffers. Windows that are not leaves are used for |
| 35 | are used for representing the way groups of leaf windows are | 35 | representing the way groups of leaf windows are arranged on the frame. |
| 36 | arranged on the frame. Leaf windows never become non-leaves. | 36 | Leaf windows never become non-leaves. They are deleted only by |
| 37 | They are deleted only by calling delete-window on them (but | 37 | calling `delete-window' on them (but this can be done implicitly). |
| 38 | this can be done implicitly). Combination windows can be created | 38 | Non-leaf windows never become leaf windows and can be created and |
| 39 | and deleted at any time. | 39 | deleted at any time by the window management code. Non-leaf windows |
| 40 | 40 | can be seen but not directly manipulated by Lisp functions. | |
| 41 | A leaf window has a buffer stored in contents field and markers in its start | 41 | |
| 42 | and pointm fields. Non-leaf windows have nil in the latter two fields. | 42 | A leaf window has a buffer stored in its contents field and markers in |
| 43 | 43 | its 'start' and 'pointm' fields. Non-leaf windows have nil in the | |
| 44 | Non-leaf windows are either vertical or horizontal combinations. | 44 | latter two fields. Non-leaf windows are either vertical or horizontal |
| 45 | 45 | combinations. | |
| 46 | A vertical combination window has children that are arranged on the frame | 46 | |
| 47 | one above the next. Its contents field points to the uppermost child. | 47 | A vertical combination window has children that are arranged on the |
| 48 | The parent field of each of the children points to the vertical | 48 | frame one above the next. Its 'contents' field points to the |
| 49 | combination window. The next field of each child points to the | 49 | uppermost child. The 'parent' field of each of the children points to |
| 50 | child below it, or is nil for the lowest child. The prev field | 50 | the vertical combination window. The 'next' field of each child |
| 51 | of each child points to the child above it, or is nil for the | 51 | points to the child below it, or is nil for the lowest child. The |
| 52 | highest child. | 52 | 'prev' field of each child points to the child above it, or is nil for |
| 53 | 53 | the highest child. | |
| 54 | A horizontal combination window has children that are side by side. | 54 | |
| 55 | Its contents field points to the leftmost child. In each child | 55 | A horizontal combination window has children that are arranged side by |
| 56 | the next field points to the child to the right and the prev field | 56 | side. Its 'contents' field points to the leftmost child. In each |
| 57 | points to the child to the left. | 57 | child the 'next' field points to the child to the right and the 'prev' |
| 58 | 58 | field points to the child to the left. | |
| 59 | The children of a vertical combination window may be leaf windows | 59 | |
| 60 | or horizontal combination windows. The children of a horizontal | 60 | On each frame there are at least one and at most two windows which |
| 61 | combination window may be leaf windows or vertical combination windows. | 61 | have nil as parent. The second of these, if present, is the frame's |
| 62 | 62 | minibuffer window and shows the minibuffer or the echo area. The | |
| 63 | At the top of the tree are two windows which have nil as parent. | 63 | first one manages the remaining frame area and is called the frame's |
| 64 | The second of these is minibuf_window. The first one manages all | 64 | root window. Different windows can be the root at different times; |
| 65 | the frame area that is not minibuffer, and is called the root window. | 65 | initially the root window is a leaf window, but if more windows are |
| 66 | Different windows can be the root at different times; | 66 | created, then that leaf window ceases to be root and a newly made |
| 67 | initially the root window is a leaf window, but if more windows | 67 | combination window becomes the root instead. |
| 68 | are created then that leaf window ceases to be root and a newly | 68 | |
| 69 | made combination window becomes root instead. | 69 | On frames which have an ordinary window and a minibuffer window, |
| 70 | 70 | 'prev' of the minibuffer window is the root window and 'next' of the | |
| 71 | In any case, on screens which have an ordinary window and a | 71 | root window is the minibuffer window. On minibuffer-less frames there |
| 72 | minibuffer, prev of the minibuf window is the root window and next of | 72 | is only a root window and 'next' of the root window is nil. On |
| 73 | the root window is the minibuf window. On minibufferless screens or | 73 | minibuffer-only frames, the root window and the minibuffer window are |
| 74 | minibuffer-only screens, the root window and the minibuffer window are | 74 | one and the same, so its 'prev' and 'next' members are nil. In any |
| 75 | one and the same, so its prev and next members are nil. | 75 | case, 'prev' of a root window and 'next' of a minibuffer window are |
| 76 | 76 | always nil. | |
| 77 | A dead window has its contents field set to nil. */ | 77 | |
| 78 | In Lisp parlance, leaf windows are called "live windows" and non-leaf | ||
| 79 | windows are called "internal windows". Together, live and internal | ||
| 80 | windows form the set of "valid windows". A window that has been | ||
| 81 | deleted is considered "dead" regardless of whether it formerly was a | ||
| 82 | leaf or a non-leaf window. A dead window has its 'contents' field set | ||
| 83 | to nil. | ||
| 84 | |||
| 85 | Frames may also contain pseudo windows, windows that are not exposed | ||
| 86 | directly to Lisp code. Pseudo windows are currently either used to | ||
| 87 | display the menu bar or the tool bar (when Emacs uses toolkits that | ||
| 88 | don't display their own menu bar and tool bar) or a tooltip in a | ||
| 89 | tooltip frame (when tooltips are not display by the toolkit). */ | ||
| 78 | 90 | ||
| 79 | struct cursor_pos | 91 | struct cursor_pos |
| 80 | { | 92 | { |
| @@ -95,29 +107,39 @@ struct window | |||
| 95 | 107 | ||
| 96 | /* Following (to right or down) and preceding (to left or up) | 108 | /* Following (to right or down) and preceding (to left or up) |
| 97 | child at same level of tree. Whether this is left/right or | 109 | child at same level of tree. Whether this is left/right or |
| 98 | up/down is determined by the 'horizontal' flag, see below. | 110 | up/down is determined by the parent window's 'horizontal' flag, |
| 99 | A minibuffer window has the frame's root window pointed by 'prev'. */ | 111 | see below. On a frame that is neither a minibuffer-only nor a |
| 112 | minibuffer-less frame, 'next' of the root window points to the | ||
| 113 | frame's minibuffer window and 'prev' of the minibuffer window | ||
| 114 | points to the frame's root window. In all other cases, 'next' | ||
| 115 | of the root window and 'prev' of the minibuffer window, if | ||
| 116 | present, are nil. 'prev' of the root window and 'next' of the | ||
| 117 | minibuffer window are always nil. */ | ||
| 100 | Lisp_Object next; | 118 | Lisp_Object next; |
| 101 | Lisp_Object prev; | 119 | Lisp_Object prev; |
| 102 | 120 | ||
| 103 | /* The window this one is a child of. For a minibuffer window: nil. */ | 121 | /* The window this one is a child of. For the root and a |
| 122 | minibuffer window this is always nil. */ | ||
| 104 | Lisp_Object parent; | 123 | Lisp_Object parent; |
| 105 | 124 | ||
| 106 | /* The normal size of the window. These are fractions, but we do | 125 | /* The "normal" size of the window. These are fractions, but we |
| 107 | not use C doubles to avoid creating new Lisp_Float objects while | 126 | do not use C doubles to avoid creating new Lisp_Float objects |
| 108 | interfacing Lisp in Fwindow_normal_size. */ | 127 | while interfacing Lisp in Fwindow_normal_size. */ |
| 109 | Lisp_Object normal_lines; | 128 | Lisp_Object normal_lines; |
| 110 | Lisp_Object normal_cols; | 129 | Lisp_Object normal_cols; |
| 111 | 130 | ||
| 112 | /* New sizes of the window. Note that Lisp code may set new_normal | 131 | /* The new sizes of the window as proposed by the window resizing |
| 113 | to something beyond an integer, so C int can't be used here. */ | 132 | functions. Note that Lisp code may set new_normal to something |
| 133 | beyond an integer, so C int can't be used here. */ | ||
| 114 | Lisp_Object new_total; | 134 | Lisp_Object new_total; |
| 115 | Lisp_Object new_normal; | 135 | Lisp_Object new_normal; |
| 116 | Lisp_Object new_pixel; | 136 | Lisp_Object new_pixel; |
| 117 | 137 | ||
| 118 | /* For a leaf window: a buffer; for an internal window: a window; | 138 | /* For a leaf window or a tooltip window this is the buffer shown |
| 119 | for a pseudo-window (such as menu bar or tool bar): nil. It is | 139 | in the window; for a combination window this is the first of |
| 120 | a buffer for a minibuffer window as well. */ | 140 | its child windows; for a pseudo window showing the menu bar or |
| 141 | tool bar this is nil. It is a buffer for a minibuffer window | ||
| 142 | as well. */ | ||
| 121 | Lisp_Object contents; | 143 | Lisp_Object contents; |
| 122 | 144 | ||
| 123 | /* A marker pointing to where in the text to start displaying. | 145 | /* A marker pointing to where in the text to start displaying. |
| @@ -195,7 +217,7 @@ struct window | |||
| 195 | 217 | ||
| 196 | /* The two Lisp_Object fields below are marked in a special way, | 218 | /* The two Lisp_Object fields below are marked in a special way, |
| 197 | which is why they're placed after `current_matrix'. */ | 219 | which is why they're placed after `current_matrix'. */ |
| 198 | /* Alist of <buffer, window-start, window-point> triples listing | 220 | /* A list of <buffer, window-start, window-point> triples listing |
| 199 | buffers previously shown in this window. */ | 221 | buffers previously shown in this window. */ |
| 200 | Lisp_Object prev_buffers; | 222 | Lisp_Object prev_buffers; |
| 201 | /* List of buffers re-shown in this window. */ | 223 | /* List of buffers re-shown in this window. */ |
diff --git a/src/xterm.c b/src/xterm.c index 3a7e31e7129..943f4c3b3d8 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -360,10 +360,15 @@ x_begin_cr_clip (struct frame *f, GC gc) | |||
| 360 | 360 | ||
| 361 | if (! FRAME_CR_SURFACE (f)) | 361 | if (! FRAME_CR_SURFACE (f)) |
| 362 | { | 362 | { |
| 363 | int scale = 1; | ||
| 364 | #ifdef USE_GTK | ||
| 365 | scale = xg_get_scale (f); | ||
| 366 | #endif | ||
| 367 | |||
| 363 | FRAME_CR_SURFACE (f) = | 368 | FRAME_CR_SURFACE (f) = |
| 364 | cairo_image_surface_create (CAIRO_FORMAT_ARGB32, | 369 | cairo_image_surface_create (CAIRO_FORMAT_ARGB32, |
| 365 | FRAME_PIXEL_WIDTH (f), | 370 | scale * FRAME_PIXEL_WIDTH (f), |
| 366 | FRAME_PIXEL_HEIGHT (f)); | 371 | scale * FRAME_PIXEL_HEIGHT (f)); |
| 367 | } | 372 | } |
| 368 | cr = cairo_create (FRAME_CR_SURFACE (f)); | 373 | cr = cairo_create (FRAME_CR_SURFACE (f)); |
| 369 | FRAME_CR_CONTEXT (f) = cr; | 374 | FRAME_CR_CONTEXT (f) = cr; |
| @@ -999,8 +1004,9 @@ x_update_begin (struct frame *f) | |||
| 999 | if (FRAME_GTK_WIDGET (f)) | 1004 | if (FRAME_GTK_WIDGET (f)) |
| 1000 | { | 1005 | { |
| 1001 | GdkWindow *w = gtk_widget_get_window (FRAME_GTK_WIDGET (f)); | 1006 | GdkWindow *w = gtk_widget_get_window (FRAME_GTK_WIDGET (f)); |
| 1002 | width = gdk_window_get_width (w); | 1007 | int scale = xg_get_scale (f); |
| 1003 | height = gdk_window_get_height (w); | 1008 | width = scale * gdk_window_get_width (w); |
| 1009 | height = scale * gdk_window_get_height (w); | ||
| 1004 | } | 1010 | } |
| 1005 | else | 1011 | else |
| 1006 | #endif | 1012 | #endif |