aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/window.h142
-rw-r--r--src/xterm.c14
2 files changed, 92 insertions, 64 deletions
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
25INLINE_HEADER_BEGIN 25INLINE_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
28Lisp data type is changed to Lisp_Window. They are garbage 28data type is changed to Lisp_Window. They are garbage collected along
29collected along with the vectors. 29with the vectors.
30 30
31All windows in use are arranged into a tree, with pointers up and down. 31All windows in use are arranged into a tree, with pointers up and down.
32 32
33Windows that are leaves of the tree are actually displayed 33Windows that are leaves of the tree are actually displayed and show
34and show the contents of buffers. Windows that are not leaves 34the contents of buffers. Windows that are not leaves are used for
35are used for representing the way groups of leaf windows are 35representing the way groups of leaf windows are arranged on the frame.
36arranged on the frame. Leaf windows never become non-leaves. 36Leaf windows never become non-leaves. They are deleted only by
37They are deleted only by calling delete-window on them (but 37calling `delete-window' on them (but this can be done implicitly).
38this can be done implicitly). Combination windows can be created 38Non-leaf windows never become leaf windows and can be created and
39and deleted at any time. 39deleted at any time by the window management code. Non-leaf windows
40 40can be seen but not directly manipulated by Lisp functions.
41A leaf window has a buffer stored in contents field and markers in its start 41
42and pointm fields. Non-leaf windows have nil in the latter two fields. 42A leaf window has a buffer stored in its contents field and markers in
43 43its 'start' and 'pointm' fields. Non-leaf windows have nil in the
44Non-leaf windows are either vertical or horizontal combinations. 44latter two fields. Non-leaf windows are either vertical or horizontal
45 45combinations.
46A vertical combination window has children that are arranged on the frame 46
47one above the next. Its contents field points to the uppermost child. 47A vertical combination window has children that are arranged on the
48The parent field of each of the children points to the vertical 48frame one above the next. Its 'contents' field points to the
49combination window. The next field of each child points to the 49uppermost child. The 'parent' field of each of the children points to
50child below it, or is nil for the lowest child. The prev field 50the vertical combination window. The 'next' field of each child
51of each child points to the child above it, or is nil for the 51points to the child below it, or is nil for the lowest child. The
52highest child. 52'prev' field of each child points to the child above it, or is nil for
53 53the highest child.
54A horizontal combination window has children that are side by side. 54
55Its contents field points to the leftmost child. In each child 55A horizontal combination window has children that are arranged side by
56the next field points to the child to the right and the prev field 56side. Its 'contents' field points to the leftmost child. In each
57points to the child to the left. 57child the 'next' field points to the child to the right and the 'prev'
58 58field points to the child to the left.
59The children of a vertical combination window may be leaf windows 59
60or horizontal combination windows. The children of a horizontal 60On each frame there are at least one and at most two windows which
61combination window may be leaf windows or vertical combination windows. 61have nil as parent. The second of these, if present, is the frame's
62 62minibuffer window and shows the minibuffer or the echo area. The
63At the top of the tree are two windows which have nil as parent. 63first one manages the remaining frame area and is called the frame's
64The second of these is minibuf_window. The first one manages all 64root window. Different windows can be the root at different times;
65the frame area that is not minibuffer, and is called the root window. 65initially the root window is a leaf window, but if more windows are
66Different windows can be the root at different times; 66created, then that leaf window ceases to be root and a newly made
67initially the root window is a leaf window, but if more windows 67combination window becomes the root instead.
68are created then that leaf window ceases to be root and a newly 68
69made combination window becomes root instead. 69On 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
71In any case, on screens which have an ordinary window and a 71root window is the minibuffer window. On minibuffer-less frames there
72minibuffer, prev of the minibuf window is the root window and next of 72is only a root window and 'next' of the root window is nil. On
73the root window is the minibuf window. On minibufferless screens or 73minibuffer-only frames, the root window and the minibuffer window are
74minibuffer-only screens, the root window and the minibuffer window are 74one and the same, so its 'prev' and 'next' members are nil. In any
75one and the same, so its prev and next members are nil. 75case, 'prev' of a root window and 'next' of a minibuffer window are
76 76always nil.
77A dead window has its contents field set to nil. */ 77
78In Lisp parlance, leaf windows are called "live windows" and non-leaf
79windows are called "internal windows". Together, live and internal
80windows form the set of "valid windows". A window that has been
81deleted is considered "dead" regardless of whether it formerly was a
82leaf or a non-leaf window. A dead window has its 'contents' field set
83to nil.
84
85Frames may also contain pseudo windows, windows that are not exposed
86directly to Lisp code. Pseudo windows are currently either used to
87display the menu bar or the tool bar (when Emacs uses toolkits that
88don't display their own menu bar and tool bar) or a tooltip in a
89tooltip frame (when tooltips are not display by the toolkit). */
78 90
79struct cursor_pos 91struct 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