aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDmitry Antipov2013-09-13 19:03:51 +0400
committerDmitry Antipov2013-09-13 19:03:51 +0400
commitaad3612f9eb7280bd4db8ee697186e75b1e82765 (patch)
treefd251b7978e9a570a6b66c93a43b0021bac0c7b7 /src
parent7830899f39515bcb4938715ebf58d1ba855deb41 (diff)
downloademacs-aad3612f9eb7280bd4db8ee697186e75b1e82765.tar.gz
emacs-aad3612f9eb7280bd4db8ee697186e75b1e82765.zip
Unify FRAME_window_system_DISPLAY_INFO macros between all ports.
All of them are replaced with FRAME_DISPLAY_INFO, defined in each port to reference the port-specific window system data. * msdos.h (FRAME_X_DISPLAY_INFO): Remove. (FRAME_DISPLAY_INFO): Define. * w32term.h (FRAME_W32_DISPLAY_INFO, FRAME_X_DISPLAY_INFO): Remove. (FRAME_DISPLAY_INFO): Define. Adjust users. * xterm.h (FRAME_X_DISPLAY_INFO): Remove. (FRAME_DISPLAY_INFO): Define. Adjust users. * frame.h (FRAME_RES_X, FRAME_RES_Y): Unify. * font.c, frame.c, gtkutil.c, image.c, menu.c, msdos.c, nsfns.m: * nsfont.m, nsterm.m, w32fns.c, w32font.c, w32menu.c, w32term.c: * w32xfns.c, widget.c, xdisp.c, xfaces.c, xfns.c, xfont.c, xmenu.c: * xselect.c, xterm.c: All related users changed.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog17
-rw-r--r--src/font.c8
-rw-r--r--src/frame.c16
-rw-r--r--src/frame.h52
-rw-r--r--src/gtkutil.c6
-rw-r--r--src/image.c30
-rw-r--r--src/menu.c4
-rw-r--r--src/msdos.c4
-rw-r--r--src/msdos.h2
-rw-r--r--src/nsfns.m26
-rw-r--r--src/nsfont.m4
-rw-r--r--src/nsterm.h14
-rw-r--r--src/nsterm.m22
-rw-r--r--src/w32fns.c76
-rw-r--r--src/w32font.c2
-rw-r--r--src/w32menu.c6
-rw-r--r--src/w32term.c44
-rw-r--r--src/w32term.h7
-rw-r--r--src/w32xfns.c2
-rw-r--r--src/widget.c2
-rw-r--r--src/xdisp.c10
-rw-r--r--src/xfaces.c12
-rw-r--r--src/xfns.c122
-rw-r--r--src/xfont.c10
-rw-r--r--src/xmenu.c20
-rw-r--r--src/xselect.c20
-rw-r--r--src/xterm.c150
-rw-r--r--src/xterm.h18
28 files changed, 352 insertions, 354 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 960165a22f9..57cb776038a 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,22 @@
12013-09-13 Dmitry Antipov <dmantipov@yandex.ru> 12013-09-13 Dmitry Antipov <dmantipov@yandex.ru>
2 2
3 Unify FRAME_window_system_DISPLAY_INFO macros between all ports.
4 All of them are replaced with FRAME_DISPLAY_INFO, defined in
5 each port to reference the port-specific window system data.
6 * msdos.h (FRAME_X_DISPLAY_INFO): Remove.
7 (FRAME_DISPLAY_INFO): Define.
8 * w32term.h (FRAME_W32_DISPLAY_INFO, FRAME_X_DISPLAY_INFO): Remove.
9 (FRAME_DISPLAY_INFO): Define. Adjust users.
10 * xterm.h (FRAME_X_DISPLAY_INFO): Remove.
11 (FRAME_DISPLAY_INFO): Define. Adjust users.
12 * frame.h (FRAME_RES_X, FRAME_RES_Y): Unify.
13 * font.c, frame.c, gtkutil.c, image.c, menu.c, msdos.c, nsfns.m:
14 * nsfont.m, nsterm.m, w32fns.c, w32font.c, w32menu.c, w32term.c:
15 * w32xfns.c, widget.c, xdisp.c, xfaces.c, xfns.c, xfont.c, xmenu.c:
16 * xselect.c, xterm.c: All related users changed.
17
182013-09-13 Dmitry Antipov <dmantipov@yandex.ru>
19
3 * xterm.h (x_window_to_frame, x_any_window_to_frame) 20 * xterm.h (x_window_to_frame, x_any_window_to_frame)
4 (x_menubar_window_to_frame): Remove prototypes. 21 (x_menubar_window_to_frame): Remove prototypes.
5 * xfns.c (x_window_to_frame, x_any_window_to_frame) 22 * xfns.c (x_window_to_frame, x_any_window_to_frame)
diff --git a/src/font.c b/src/font.c
index 2606a25dff8..fb64f2d9071 100644
--- a/src/font.c
+++ b/src/font.c
@@ -2861,8 +2861,8 @@ font_open_entity (struct frame *f, Lisp_Object entity, int pixel_size)
2861 : 1); 2861 : 1);
2862 height = (font->height ? font->height : 1); 2862 height = (font->height ? font->height : 1);
2863#ifdef HAVE_WINDOW_SYSTEM 2863#ifdef HAVE_WINDOW_SYSTEM
2864 FRAME_X_DISPLAY_INFO (f)->n_fonts++; 2864 FRAME_DISPLAY_INFO (f)->n_fonts++;
2865 if (FRAME_X_DISPLAY_INFO (f)->n_fonts == 1) 2865 if (FRAME_DISPLAY_INFO (f)->n_fonts == 1)
2866 { 2866 {
2867 FRAME_SMALLEST_CHAR_WIDTH (f) = min_width; 2867 FRAME_SMALLEST_CHAR_WIDTH (f) = min_width;
2868 FRAME_SMALLEST_FONT_HEIGHT (f) = height; 2868 FRAME_SMALLEST_FONT_HEIGHT (f) = height;
@@ -2894,8 +2894,8 @@ font_close_object (struct frame *f, Lisp_Object font_object)
2894 FONT_ADD_LOG ("close", font_object, Qnil); 2894 FONT_ADD_LOG ("close", font_object, Qnil);
2895 font->driver->close (f, font); 2895 font->driver->close (f, font);
2896#ifdef HAVE_WINDOW_SYSTEM 2896#ifdef HAVE_WINDOW_SYSTEM
2897 eassert (FRAME_X_DISPLAY_INFO (f)->n_fonts); 2897 eassert (FRAME_DISPLAY_INFO (f)->n_fonts);
2898 FRAME_X_DISPLAY_INFO (f)->n_fonts--; 2898 FRAME_DISPLAY_INFO (f)->n_fonts--;
2899#endif 2899#endif
2900} 2900}
2901 2901
diff --git a/src/frame.c b/src/frame.c
index 692d224866c..0de3152166e 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -2207,7 +2207,7 @@ If FRAME is nil, describe the currently selected frame. */)
2207 value = f->name; 2207 value = f->name;
2208#ifdef HAVE_X_WINDOWS 2208#ifdef HAVE_X_WINDOWS
2209 else if (EQ (parameter, Qdisplay) && FRAME_X_P (f)) 2209 else if (EQ (parameter, Qdisplay) && FRAME_X_P (f))
2210 value = XCAR (FRAME_X_DISPLAY_INFO (f)->name_list_element); 2210 value = XCAR (FRAME_DISPLAY_INFO (f)->name_list_element);
2211#endif /* HAVE_X_WINDOWS */ 2211#endif /* HAVE_X_WINDOWS */
2212 else if (EQ (parameter, Qbackground_color) 2212 else if (EQ (parameter, Qbackground_color)
2213 || EQ (parameter, Qforeground_color)) 2213 || EQ (parameter, Qforeground_color))
@@ -2598,7 +2598,7 @@ x_fullscreen_adjust (struct frame *f, int *width, int *height, int *top_pos, int
2598{ 2598{
2599 int newwidth = FRAME_COLS (f); 2599 int newwidth = FRAME_COLS (f);
2600 int newheight = FRAME_LINES (f); 2600 int newheight = FRAME_LINES (f);
2601 Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 2601 Display_Info *dpyinfo = FRAME_DISPLAY_INFO (f);
2602 2602
2603 *top_pos = f->top_pos; 2603 *top_pos = f->top_pos;
2604 *left_pos = f->left_pos; 2604 *left_pos = f->left_pos;
@@ -2973,9 +2973,9 @@ x_report_frame_params (struct frame *f, Lisp_Object *alistptr)
2973 (FRAME_VISIBLE_P (f) ? Qt 2973 (FRAME_VISIBLE_P (f) ? Qt
2974 : FRAME_ICONIFIED_P (f) ? Qicon : Qnil)); 2974 : FRAME_ICONIFIED_P (f) ? Qicon : Qnil));
2975 store_in_alist (alistptr, Qdisplay, 2975 store_in_alist (alistptr, Qdisplay,
2976 XCAR (FRAME_X_DISPLAY_INFO (f)->name_list_element)); 2976 XCAR (FRAME_DISPLAY_INFO (f)->name_list_element));
2977 2977
2978 if (FRAME_X_OUTPUT (f)->parent_desc == FRAME_X_DISPLAY_INFO (f)->root_window) 2978 if (FRAME_X_OUTPUT (f)->parent_desc == FRAME_DISPLAY_INFO (f)->root_window)
2979 tem = Qnil; 2979 tem = Qnil;
2980 else 2980 else
2981 tem = make_natnum ((uintptr_t) FRAME_X_OUTPUT (f)->parent_desc); 2981 tem = make_natnum ((uintptr_t) FRAME_X_OUTPUT (f)->parent_desc);
@@ -3631,7 +3631,7 @@ x_get_resource_string (const char *attribute, const char *class)
3631 esprintf (name_key, "%s.%s", SSDATA (Vinvocation_name), attribute); 3631 esprintf (name_key, "%s.%s", SSDATA (Vinvocation_name), attribute);
3632 sprintf (class_key, "%s.%s", EMACS_CLASS, class); 3632 sprintf (class_key, "%s.%s", EMACS_CLASS, class);
3633 3633
3634 result = x_get_string_resource (FRAME_X_DISPLAY_INFO (sf)->xrdb, 3634 result = x_get_string_resource (FRAME_DISPLAY_INFO (sf)->xrdb,
3635 name_key, class_key); 3635 name_key, class_key);
3636 SAFE_FREE (); 3636 SAFE_FREE ();
3637 return result; 3637 return result;
@@ -3753,7 +3753,7 @@ x_frame_get_arg (struct frame *f, Lisp_Object alist, Lisp_Object param,
3753 const char *attribute, const char *class, 3753 const char *attribute, const char *class,
3754 enum resource_types type) 3754 enum resource_types type)
3755{ 3755{
3756 return x_get_arg (FRAME_X_DISPLAY_INFO (f), 3756 return x_get_arg (FRAME_DISPLAY_INFO (f),
3757 alist, param, attribute, class, type); 3757 alist, param, attribute, class, type);
3758} 3758}
3759 3759
@@ -3767,7 +3767,7 @@ x_frame_get_and_record_arg (struct frame *f, Lisp_Object alist,
3767{ 3767{
3768 Lisp_Object value; 3768 Lisp_Object value;
3769 3769
3770 value = x_get_arg (FRAME_X_DISPLAY_INFO (f), alist, param, 3770 value = x_get_arg (FRAME_DISPLAY_INFO (f), alist, param,
3771 attribute, class, type); 3771 attribute, class, type);
3772 if (! NILP (value) && ! EQ (value, Qunbound)) 3772 if (! NILP (value) && ! EQ (value, Qunbound))
3773 store_frame_param (f, param, value); 3773 store_frame_param (f, param, value);
@@ -3971,7 +3971,7 @@ x_figure_window_size (struct frame *f, Lisp_Object parms, bool toolbar_p)
3971{ 3971{
3972 register Lisp_Object tem0, tem1, tem2; 3972 register Lisp_Object tem0, tem1, tem2;
3973 long window_prompting = 0; 3973 long window_prompting = 0;
3974 Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 3974 Display_Info *dpyinfo = FRAME_DISPLAY_INFO (f);
3975 3975
3976 /* Default values if we fall through. 3976 /* Default values if we fall through.
3977 Actually, if that happens we should get 3977 Actually, if that happens we should get
diff --git a/src/frame.h b/src/frame.h
index 3aea0cfa27c..4184ce24a17 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -600,36 +600,6 @@ default_pixels_per_inch_y (void)
600#define FRAME_NS_P(f) ((f)->output_method == output_ns) 600#define FRAME_NS_P(f) ((f)->output_method == output_ns)
601#endif 601#endif
602 602
603/* Dots per inch of the screen the frame F is on. */
604
605#ifdef HAVE_X_WINDOWS
606#define FRAME_RES_X(f) \
607 (eassert (FRAME_X_P (f)), FRAME_X_DISPLAY_INFO (f)->resx)
608#define FRAME_RES_Y(f) \
609 (eassert (FRAME_X_P (f)), FRAME_X_DISPLAY_INFO (f)->resy)
610#endif
611
612#ifdef HAVE_NTGUI
613#define FRAME_RES_X(f) \
614 (eassert (FRAME_W32_P (f)), FRAME_W32_DISPLAY_INFO (f)->resx)
615#define FRAME_RES_Y(f) \
616 (eassert (FRAME_W32_P (f)), FRAME_W32_DISPLAY_INFO (f)->resy)
617#endif
618
619#ifdef HAVE_NS
620#define FRAME_RES_X(f) \
621 (eassert (FRAME_NS_P (f)), FRAME_NS_DISPLAY_INFO (f)->resx)
622#define FRAME_RES_Y(f) \
623 (eassert (FRAME_NS_P (f)), FRAME_NS_DISPLAY_INFO (f)->resy)
624#endif
625
626/* Defaults when no window system available. */
627
628#ifndef FRAME_RES_X
629#define FRAME_RES_X(f) default_pixels_per_inch_x ()
630#define FRAME_RES_Y(f) default_pixels_per_inch_y ()
631#endif
632
633/* FRAME_WINDOW_P tests whether the frame is a window, and is 603/* FRAME_WINDOW_P tests whether the frame is a window, and is
634 defined to be the predicate for the window system being used. */ 604 defined to be the predicate for the window system being used. */
635 605
@@ -646,14 +616,32 @@ default_pixels_per_inch_y (void)
646#define FRAME_WINDOW_P(f) ((void) (f), 0) 616#define FRAME_WINDOW_P(f) ((void) (f), 0)
647#endif 617#endif
648 618
619/* Dots per inch of the screen the frame F is on. */
620
621#ifdef HAVE_WINDOW_SYSTEM
622
623#define FRAME_RES_X(f) \
624 (eassert (FRAME_WINDOW_P (f)), FRAME_DISPLAY_INFO (f)->resx)
625#define FRAME_RES_Y(f) \
626 (eassert (FRAME_WINDOW_P (f)), FRAME_DISPLAY_INFO (f)->resy)
627
628#else /* !HAVE_WINDOW_SYSTEM */
629
630/* Defaults when no window system available. */
631
632#define FRAME_RES_X(f) default_pixels_per_inch_x ()
633#define FRAME_RES_Y(f) default_pixels_per_inch_y ()
634
635#endif /* HAVE_WINDOW_SYSTEM */
636
649/* Return a pointer to the structure holding information about the 637/* Return a pointer to the structure holding information about the
650 region of text, if any, that is currently shown in mouse-face on 638 region of text, if any, that is currently shown in mouse-face on
651 frame F. We need to define two versions because a TTY-only build 639 frame F. We need to define two versions because a TTY-only build
652 does not have FRAME_X_DISPLAY_INFO. */ 640 does not have FRAME_DISPLAY_INFO. */
653#ifdef HAVE_WINDOW_SYSTEM 641#ifdef HAVE_WINDOW_SYSTEM
654# define MOUSE_HL_INFO(F) \ 642# define MOUSE_HL_INFO(F) \
655 (FRAME_WINDOW_P(F) \ 643 (FRAME_WINDOW_P(F) \
656 ? &FRAME_X_DISPLAY_INFO(F)->mouse_highlight \ 644 ? &FRAME_DISPLAY_INFO(F)->mouse_highlight \
657 : &(F)->output_data.tty->display_info->mouse_highlight) 645 : &(F)->output_data.tty->display_info->mouse_highlight)
658#else 646#else
659# define MOUSE_HL_INFO(F) \ 647# define MOUSE_HL_INFO(F) \
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 6228f2150f5..064145282bc 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -2737,7 +2737,7 @@ xg_create_widget (const char *type, const char *name, struct frame *f,
2737 { 2737 {
2738 /* Must realize so the GdkWindow inside the widget is created. */ 2738 /* Must realize so the GdkWindow inside the widget is created. */
2739 gtk_widget_realize (w); 2739 gtk_widget_realize (w);
2740 xg_set_cursor (w, FRAME_X_DISPLAY_INFO (f)->xg_cursor); 2740 xg_set_cursor (w, FRAME_DISPLAY_INFO (f)->xg_cursor);
2741 } 2741 }
2742 } 2742 }
2743 else 2743 else
@@ -3676,7 +3676,7 @@ xg_create_scroll_bar (struct frame *f,
3676 3676
3677 3677
3678 /* Set the cursor to an arrow. */ 3678 /* Set the cursor to an arrow. */
3679 xg_set_cursor (webox, FRAME_X_DISPLAY_INFO (f)->xg_cursor); 3679 xg_set_cursor (webox, FRAME_DISPLAY_INFO (f)->xg_cursor);
3680 3680
3681 bar->x_window = scroll_id; 3681 bar->x_window = scroll_id;
3682} 3682}
@@ -3972,7 +3972,7 @@ xg_tool_bar_callback (GtkWidget *w, gpointer client_data)
3972 /* Convert between the modifier bits GDK uses and the modifier bits 3972 /* Convert between the modifier bits GDK uses and the modifier bits
3973 Emacs uses. This assumes GDK and X masks are the same, which they are when 3973 Emacs uses. This assumes GDK and X masks are the same, which they are when
3974 this is written. */ 3974 this is written. */
3975 event.modifiers = x_x_to_emacs_modifiers (FRAME_X_DISPLAY_INFO (f), mod); 3975 event.modifiers = x_x_to_emacs_modifiers (FRAME_DISPLAY_INFO (f), mod);
3976 kbd_buffer_store_event (&event); 3976 kbd_buffer_store_event (&event);
3977 3977
3978 /* Return focus to the frame after we have clicked on a detached 3978 /* Return focus to the frame after we have clicked on a detached
diff --git a/src/image.c b/src/image.c
index 1271376bcab..f0f7ff4b01f 100644
--- a/src/image.c
+++ b/src/image.c
@@ -161,13 +161,13 @@ XPutPixel (XImagePtr ximage, int x, int y, unsigned long pixel)
161int 161int
162x_bitmap_height (struct frame *f, ptrdiff_t id) 162x_bitmap_height (struct frame *f, ptrdiff_t id)
163{ 163{
164 return FRAME_X_DISPLAY_INFO (f)->bitmaps[id - 1].height; 164 return FRAME_DISPLAY_INFO (f)->bitmaps[id - 1].height;
165} 165}
166 166
167int 167int
168x_bitmap_width (struct frame *f, ptrdiff_t id) 168x_bitmap_width (struct frame *f, ptrdiff_t id)
169{ 169{
170 return FRAME_X_DISPLAY_INFO (f)->bitmaps[id - 1].width; 170 return FRAME_DISPLAY_INFO (f)->bitmaps[id - 1].width;
171} 171}
172 172
173#if defined (HAVE_X_WINDOWS) || defined (HAVE_NTGUI) 173#if defined (HAVE_X_WINDOWS) || defined (HAVE_NTGUI)
@@ -175,7 +175,7 @@ ptrdiff_t
175x_bitmap_pixmap (struct frame *f, ptrdiff_t id) 175x_bitmap_pixmap (struct frame *f, ptrdiff_t id)
176{ 176{
177 /* HAVE_NTGUI needs the explicit cast here. */ 177 /* HAVE_NTGUI needs the explicit cast here. */
178 return (ptrdiff_t) FRAME_X_DISPLAY_INFO (f)->bitmaps[id - 1].pixmap; 178 return (ptrdiff_t) FRAME_DISPLAY_INFO (f)->bitmaps[id - 1].pixmap;
179} 179}
180#endif 180#endif
181 181
@@ -183,7 +183,7 @@ x_bitmap_pixmap (struct frame *f, ptrdiff_t id)
183int 183int
184x_bitmap_mask (struct frame *f, ptrdiff_t id) 184x_bitmap_mask (struct frame *f, ptrdiff_t id)
185{ 185{
186 return FRAME_X_DISPLAY_INFO (f)->bitmaps[id - 1].mask; 186 return FRAME_DISPLAY_INFO (f)->bitmaps[id - 1].mask;
187} 187}
188#endif 188#endif
189 189
@@ -192,7 +192,7 @@ x_bitmap_mask (struct frame *f, ptrdiff_t id)
192static ptrdiff_t 192static ptrdiff_t
193x_allocate_bitmap_record (struct frame *f) 193x_allocate_bitmap_record (struct frame *f)
194{ 194{
195 Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 195 Display_Info *dpyinfo = FRAME_DISPLAY_INFO (f);
196 ptrdiff_t i; 196 ptrdiff_t i;
197 197
198 if (dpyinfo->bitmaps_last < dpyinfo->bitmaps_size) 198 if (dpyinfo->bitmaps_last < dpyinfo->bitmaps_size)
@@ -213,7 +213,7 @@ x_allocate_bitmap_record (struct frame *f)
213void 213void
214x_reference_bitmap (struct frame *f, ptrdiff_t id) 214x_reference_bitmap (struct frame *f, ptrdiff_t id)
215{ 215{
216 ++FRAME_X_DISPLAY_INFO (f)->bitmaps[id - 1].refcount; 216 ++FRAME_DISPLAY_INFO (f)->bitmaps[id - 1].refcount;
217} 217}
218 218
219/* Create a bitmap for frame F from a HEIGHT x WIDTH array of bits at BITS. */ 219/* Create a bitmap for frame F from a HEIGHT x WIDTH array of bits at BITS. */
@@ -221,7 +221,7 @@ x_reference_bitmap (struct frame *f, ptrdiff_t id)
221ptrdiff_t 221ptrdiff_t
222x_create_bitmap_from_data (struct frame *f, char *bits, unsigned int width, unsigned int height) 222x_create_bitmap_from_data (struct frame *f, char *bits, unsigned int width, unsigned int height)
223{ 223{
224 Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 224 Display_Info *dpyinfo = FRAME_DISPLAY_INFO (f);
225 ptrdiff_t id; 225 ptrdiff_t id;
226 226
227#ifdef HAVE_X_WINDOWS 227#ifdef HAVE_X_WINDOWS
@@ -235,8 +235,8 @@ x_create_bitmap_from_data (struct frame *f, char *bits, unsigned int width, unsi
235#ifdef HAVE_NTGUI 235#ifdef HAVE_NTGUI
236 Pixmap bitmap; 236 Pixmap bitmap;
237 bitmap = CreateBitmap (width, height, 237 bitmap = CreateBitmap (width, height,
238 FRAME_X_DISPLAY_INFO (XFRAME (frame))->n_planes, 238 FRAME_DISPLAY_INFO (XFRAME (frame))->n_planes,
239 FRAME_X_DISPLAY_INFO (XFRAME (frame))->n_cbits, 239 FRAME_DISPLAY_INFO (XFRAME (frame))->n_cbits,
240 bits); 240 bits);
241 if (! bitmap) 241 if (! bitmap)
242 return -1; 242 return -1;
@@ -280,7 +280,7 @@ x_create_bitmap_from_data (struct frame *f, char *bits, unsigned int width, unsi
280ptrdiff_t 280ptrdiff_t
281x_create_bitmap_from_file (struct frame *f, Lisp_Object file) 281x_create_bitmap_from_file (struct frame *f, Lisp_Object file)
282{ 282{
283 Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 283 Display_Info *dpyinfo = FRAME_DISPLAY_INFO (f);
284 284
285#ifdef HAVE_NTGUI 285#ifdef HAVE_NTGUI
286 return -1; /* W32_TODO : bitmap support */ 286 return -1; /* W32_TODO : bitmap support */
@@ -379,7 +379,7 @@ free_bitmap_record (Display_Info *dpyinfo, Bitmap_Record *bm)
379void 379void
380x_destroy_bitmap (struct frame *f, ptrdiff_t id) 380x_destroy_bitmap (struct frame *f, ptrdiff_t id)
381{ 381{
382 Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 382 Display_Info *dpyinfo = FRAME_DISPLAY_INFO (f);
383 383
384 if (id > 0) 384 if (id > 0)
385 { 385 {
@@ -454,7 +454,7 @@ x_create_bitmap_mask (struct frame *f, ptrdiff_t id)
454 unsigned long x, y, xp, xm, yp, ym; 454 unsigned long x, y, xp, xm, yp, ym;
455 GC gc; 455 GC gc;
456 456
457 Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 457 Display_Info *dpyinfo = FRAME_DISPLAY_INFO (f);
458 458
459 if (!(id > 0)) 459 if (!(id > 0))
460 return; 460 return;
@@ -3421,7 +3421,7 @@ xpm_image_p (Lisp_Object object)
3421ptrdiff_t 3421ptrdiff_t
3422x_create_bitmap_from_xpm_data (struct frame *f, const char **bits) 3422x_create_bitmap_from_xpm_data (struct frame *f, const char **bits)
3423{ 3423{
3424 Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 3424 Display_Info *dpyinfo = FRAME_DISPLAY_INFO (f);
3425 ptrdiff_t id; 3425 ptrdiff_t id;
3426 int rc; 3426 int rc;
3427 XpmAttributes attrs; 3427 XpmAttributes attrs;
@@ -4325,7 +4325,7 @@ lookup_rgb_color (struct frame *f, int r, int g, int b)
4325 two orders of magnitude. Freeing colors on TrueColor visuals is 4325 two orders of magnitude. Freeing colors on TrueColor visuals is
4326 a nop, and pixel colors specify RGB values directly. See also 4326 a nop, and pixel colors specify RGB values directly. See also
4327 the Xlib spec, chapter 3.1. */ 4327 the Xlib spec, chapter 3.1. */
4328 dpyinfo = FRAME_X_DISPLAY_INFO (f); 4328 dpyinfo = FRAME_DISPLAY_INFO (f);
4329 if (dpyinfo->red_bits > 0) 4329 if (dpyinfo->red_bits > 0)
4330 { 4330 {
4331 unsigned long pr, pg, pb; 4331 unsigned long pr, pg, pb;
@@ -4820,7 +4820,7 @@ x_edge_detection (struct frame *f, struct image *img, Lisp_Object matrix,
4820static void 4820static void
4821x_disable_image (struct frame *f, struct image *img) 4821x_disable_image (struct frame *f, struct image *img)
4822{ 4822{
4823 Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 4823 Display_Info *dpyinfo = FRAME_DISPLAY_INFO (f);
4824#ifdef HAVE_NTGUI 4824#ifdef HAVE_NTGUI
4825 int n_planes = dpyinfo->n_planes * dpyinfo->n_cbits; 4825 int n_planes = dpyinfo->n_planes * dpyinfo->n_cbits;
4826#else 4826#else
diff --git a/src/menu.c b/src/menu.c
index 6fce5b91caf..44bb5a57317 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -1299,7 +1299,7 @@ no quit occurs and `x-popup-menu' returns nil. */)
1299 if (current_popup_menu) 1299 if (current_popup_menu)
1300 { 1300 {
1301 discard_menu_items (); 1301 discard_menu_items ();
1302 FRAME_X_DISPLAY_INFO (f)->grabbed = 0; 1302 FRAME_DISPLAY_INFO (f)->grabbed = 0;
1303 UNGCPRO; 1303 UNGCPRO;
1304 return Qnil; 1304 return Qnil;
1305 } 1305 }
@@ -1338,7 +1338,7 @@ no quit occurs and `x-popup-menu' returns nil. */)
1338#endif 1338#endif
1339 1339
1340#ifdef HAVE_NTGUI /* FIXME: Is it really w32-specific? --Stef */ 1340#ifdef HAVE_NTGUI /* FIXME: Is it really w32-specific? --Stef */
1341 FRAME_X_DISPLAY_INFO (f)->grabbed = 0; 1341 FRAME_DISPLAY_INFO (f)->grabbed = 0;
1342#endif 1342#endif
1343 1343
1344#endif /* HAVE_MENUS */ 1344#endif /* HAVE_MENUS */
diff --git a/src/msdos.c b/src/msdos.c
index 7142c3ada77..3a74846f8ea 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -1222,7 +1222,7 @@ IT_cmgoto (struct frame *f)
1222static void 1222static void
1223IT_update_begin (struct frame *f) 1223IT_update_begin (struct frame *f)
1224{ 1224{
1225 struct tty_display_info *display_info = FRAME_X_DISPLAY_INFO (f); 1225 struct tty_display_info *display_info = FRAME_DISPLAY_INFO (f);
1226 Mouse_HLInfo *hlinfo = &display_info->mouse_highlight; 1226 Mouse_HLInfo *hlinfo = &display_info->mouse_highlight;
1227 struct frame *mouse_face_frame = hlinfo->mouse_face_mouse_frame; 1227 struct frame *mouse_face_frame = hlinfo->mouse_face_mouse_frame;
1228 1228
@@ -1279,7 +1279,7 @@ IT_update_begin (struct frame *f)
1279static void 1279static void
1280IT_update_end (struct frame *f) 1280IT_update_end (struct frame *f)
1281{ 1281{
1282 struct tty_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 1282 struct tty_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
1283 1283
1284 if (dpyinfo->termscript) 1284 if (dpyinfo->termscript)
1285 fprintf (dpyinfo->termscript, "\n<UPDATE_END\n"); 1285 fprintf (dpyinfo->termscript, "\n<UPDATE_END\n");
diff --git a/src/msdos.h b/src/msdos.h
index 6a6fe349131..27090324b44 100644
--- a/src/msdos.h
+++ b/src/msdos.h
@@ -63,7 +63,7 @@ extern struct tty_display_info the_only_display_info;
63 63
64#define FRAME_X_DISPLAY(f) ((Display *) 0) 64#define FRAME_X_DISPLAY(f) ((Display *) 0)
65#define FRAME_FONT(f) ((f)->output_data.tty->font) 65#define FRAME_FONT(f) ((f)->output_data.tty->font)
66#define FRAME_X_DISPLAY_INFO(f) (&the_only_display_info) 66#define FRAME_DISPLAY_INFO(f) (&the_only_display_info)
67 67
68/* Prototypes. */ 68/* Prototypes. */
69 69
diff --git a/src/nsfns.m b/src/nsfns.m
index f021e834d59..2d828991ffe 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -124,7 +124,7 @@ check_ns_display_info (Lisp_Object object)
124 struct frame *sf = XFRAME (selected_frame); 124 struct frame *sf = XFRAME (selected_frame);
125 125
126 if (FRAME_NS_P (sf) && FRAME_LIVE_P (sf)) 126 if (FRAME_NS_P (sf) && FRAME_LIVE_P (sf))
127 dpyinfo = FRAME_NS_DISPLAY_INFO (sf); 127 dpyinfo = FRAME_DISPLAY_INFO (sf);
128 else if (x_display_list != 0) 128 else if (x_display_list != 0)
129 dpyinfo = x_display_list; 129 dpyinfo = x_display_list;
130 else 130 else
@@ -144,7 +144,7 @@ check_ns_display_info (Lisp_Object object)
144 else 144 else
145 { 145 {
146 struct frame *f = decode_window_system_frame (object); 146 struct frame *f = decode_window_system_frame (object);
147 dpyinfo = FRAME_NS_DISPLAY_INFO (f); 147 dpyinfo = FRAME_DISPLAY_INFO (f);
148 } 148 }
149 149
150 return dpyinfo; 150 return dpyinfo;
@@ -992,7 +992,7 @@ unwind_create_frame (Lisp_Object frame)
992 if (NILP (Fmemq (frame, Vframe_list))) 992 if (NILP (Fmemq (frame, Vframe_list)))
993 { 993 {
994#if defined GLYPH_DEBUG && defined ENABLE_CHECKING 994#if defined GLYPH_DEBUG && defined ENABLE_CHECKING
995 struct ns_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 995 struct ns_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
996#endif 996#endif
997 997
998 x_free_frame_resources (f); 998 x_free_frame_resources (f);
@@ -1139,9 +1139,9 @@ This function is an internal primitive--use `make-frame' instead. */)
1139 if (! STRINGP (f->icon_name)) 1139 if (! STRINGP (f->icon_name))
1140 fset_icon_name (f, Qnil); 1140 fset_icon_name (f, Qnil);
1141 1141
1142 FRAME_NS_DISPLAY_INFO (f) = dpyinfo; 1142 FRAME_DISPLAY_INFO (f) = dpyinfo;
1143 1143
1144 /* With FRAME_NS_DISPLAY_INFO set up, this unwind-protect is safe. */ 1144 /* With FRAME_DISPLAY_INFO set up, this unwind-protect is safe. */
1145 record_unwind_protect (unwind_create_frame, frame); 1145 record_unwind_protect (unwind_create_frame, frame);
1146 1146
1147 f->output_data.ns->window_desc = desc_ctr++; 1147 f->output_data.ns->window_desc = desc_ctr++;
@@ -1152,7 +1152,7 @@ This function is an internal primitive--use `make-frame' instead. */)
1152 } 1152 }
1153 else 1153 else
1154 { 1154 {
1155 f->output_data.ns->parent_desc = FRAME_NS_DISPLAY_INFO (f)->root_window; 1155 f->output_data.ns->parent_desc = FRAME_DISPLAY_INFO (f)->root_window;
1156 f->output_data.ns->explicit_parent = 0; 1156 f->output_data.ns->explicit_parent = 0;
1157 } 1157 }
1158 1158
@@ -1255,7 +1255,7 @@ This function is an internal primitive--use `make-frame' instead. */)
1255 f->output_data.ns->hand_cursor = [NSCursor pointingHandCursor]; 1255 f->output_data.ns->hand_cursor = [NSCursor pointingHandCursor];
1256 f->output_data.ns->hourglass_cursor = [NSCursor disappearingItemCursor]; 1256 f->output_data.ns->hourglass_cursor = [NSCursor disappearingItemCursor];
1257 f->output_data.ns->horizontal_drag_cursor = [NSCursor resizeLeftRightCursor]; 1257 f->output_data.ns->horizontal_drag_cursor = [NSCursor resizeLeftRightCursor];
1258 FRAME_NS_DISPLAY_INFO (f)->vertical_scroll_bar_cursor 1258 FRAME_DISPLAY_INFO (f)->vertical_scroll_bar_cursor
1259 = [NSCursor arrowCursor]; 1259 = [NSCursor arrowCursor];
1260 f->output_data.ns->current_pointer = f->output_data.ns->text_cursor; 1260 f->output_data.ns->current_pointer = f->output_data.ns->text_cursor;
1261 1261
@@ -1346,7 +1346,7 @@ FRAME nil means use the selected frame. */)
1346 (Lisp_Object frame) 1346 (Lisp_Object frame)
1347{ 1347{
1348 struct frame *f = decode_window_system_frame (frame); 1348 struct frame *f = decode_window_system_frame (frame);
1349 struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (f); 1349 struct ns_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
1350 1350
1351 if (dpyinfo->x_focus_frame != f) 1351 if (dpyinfo->x_focus_frame != f)
1352 { 1352 {
@@ -2221,7 +2221,7 @@ x_get_string_resource (XrmDatabase rdb, char *name, char *class)
2221Lisp_Object 2221Lisp_Object
2222x_get_focus_frame (struct frame *frame) 2222x_get_focus_frame (struct frame *frame)
2223{ 2223{
2224 struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (frame); 2224 struct ns_display_info *dpyinfo = FRAME_DISPLAY_INFO (frame);
2225 Lisp_Object nsfocus; 2225 Lisp_Object nsfocus;
2226 2226
2227 if (!dpyinfo->x_focus_frame) 2227 if (!dpyinfo->x_focus_frame)
@@ -2568,7 +2568,7 @@ compute_tip_xy (struct frame *f,
2568 { 2568 {
2569 /* Absolute coordinates. */ 2569 /* Absolute coordinates. */
2570 pt.x = XINT (left); 2570 pt.x = XINT (left);
2571 pt.y = x_display_pixel_height (FRAME_NS_DISPLAY_INFO (f)) - XINT (top) 2571 pt.y = x_display_pixel_height (FRAME_DISPLAY_INFO (f)) - XINT (top)
2572 - height; 2572 - height;
2573 } 2573 }
2574 2574
@@ -2578,7 +2578,7 @@ compute_tip_xy (struct frame *f,
2578 else if (pt.x + XINT (dx) <= 0) 2578 else if (pt.x + XINT (dx) <= 0)
2579 *root_x = 0; /* Can happen for negative dx */ 2579 *root_x = 0; /* Can happen for negative dx */
2580 else if (pt.x + XINT (dx) + width 2580 else if (pt.x + XINT (dx) + width
2581 <= x_display_pixel_width (FRAME_NS_DISPLAY_INFO (f))) 2581 <= x_display_pixel_width (FRAME_DISPLAY_INFO (f)))
2582 /* It fits to the right of the pointer. */ 2582 /* It fits to the right of the pointer. */
2583 *root_x = pt.x + XINT (dx); 2583 *root_x = pt.x + XINT (dx);
2584 else if (width + XINT (dx) <= pt.x) 2584 else if (width + XINT (dx) <= pt.x)
@@ -2594,12 +2594,12 @@ compute_tip_xy (struct frame *f,
2594 /* It fits below the pointer. */ 2594 /* It fits below the pointer. */
2595 *root_y = pt.y - height - XINT (dy); 2595 *root_y = pt.y - height - XINT (dy);
2596 else if (pt.y + XINT (dy) + height 2596 else if (pt.y + XINT (dy) + height
2597 <= x_display_pixel_height (FRAME_NS_DISPLAY_INFO (f))) 2597 <= x_display_pixel_height (FRAME_DISPLAY_INFO (f)))
2598 /* It fits above the pointer */ 2598 /* It fits above the pointer */
2599 *root_y = pt.y + XINT (dy); 2599 *root_y = pt.y + XINT (dy);
2600 else 2600 else
2601 /* Put it on the top. */ 2601 /* Put it on the top. */
2602 *root_y = x_display_pixel_height (FRAME_NS_DISPLAY_INFO (f)) - height; 2602 *root_y = x_display_pixel_height (FRAME_DISPLAY_INFO (f)) - height;
2603} 2603}
2604 2604
2605 2605
diff --git a/src/nsfont.m b/src/nsfont.m
index e1c7d32dde0..b61147d66c4 100644
--- a/src/nsfont.m
+++ b/src/nsfont.m
@@ -662,7 +662,7 @@ struct font_driver nsfont_driver =
662static Lisp_Object 662static Lisp_Object
663nsfont_get_cache (struct frame *frame) 663nsfont_get_cache (struct frame *frame)
664{ 664{
665 Display_Info *dpyinfo = FRAME_NS_DISPLAY_INFO (frame); 665 Display_Info *dpyinfo = FRAME_DISPLAY_INFO (frame);
666 return (dpyinfo->name_list_element); 666 return (dpyinfo->name_list_element);
667} 667}
668 668
@@ -1175,7 +1175,7 @@ nsfont_draw (struct glyph_string *s, int from, int to, int x, int y,
1175 : FRAME_BACKGROUND_COLOR (s->f)) set]; 1175 : FRAME_BACKGROUND_COLOR (s->f)) set];
1176 else 1176 else
1177 { 1177 {
1178 struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (s->f); 1178 struct ns_display_info *dpyinfo = FRAME_DISPLAY_INFO (s->f);
1179 [[dpyinfo->bitmaps[face->stipple-1].img stippleMask] set]; 1179 [[dpyinfo->bitmaps[face->stipple-1].img stippleMask] set];
1180 } 1180 }
1181 NSRectFill (br); 1181 NSRectFill (br);
diff --git a/src/nsterm.h b/src/nsterm.h
index 4e07d796250..487422b13db 100644
--- a/src/nsterm.h
+++ b/src/nsterm.h
@@ -678,9 +678,7 @@ struct x_output
678 678
679 679
680/* This gives the ns_display_info structure for the display F is on. */ 680/* This gives the ns_display_info structure for the display F is on. */
681#define FRAME_NS_DISPLAY_INFO(f) ((f)->output_data.ns->display_info) 681#define FRAME_DISPLAY_INFO(f) ((f)->output_data.ns->display_info)
682/* the primacy of X must be constantly worked with... */
683#define FRAME_X_DISPLAY_INFO(f) ((f)->output_data.ns->display_info)
684#define FRAME_X_OUTPUT(f) ((f)->output_data.ns) 682#define FRAME_X_OUTPUT(f) ((f)->output_data.ns)
685#define FRAME_NS_WINDOW(f) ((f)->output_data.ns->window_desc) 683#define FRAME_NS_WINDOW(f) ((f)->output_data.ns->window_desc)
686#define FRAME_X_WINDOW(f) ((f)->output_data.ns->window_desc) 684#define FRAME_X_WINDOW(f) ((f)->output_data.ns->window_desc)
@@ -689,12 +687,12 @@ struct x_output
689#define FRAME_NS_DISPLAY(f) (0) 687#define FRAME_NS_DISPLAY(f) (0)
690#define FRAME_X_DISPLAY(f) (0) 688#define FRAME_X_DISPLAY(f) (0)
691#define FRAME_X_SCREEN(f) (0) 689#define FRAME_X_SCREEN(f) (0)
692#define FRAME_X_VISUAL(f) FRAME_NS_DISPLAY_INFO(f)->visual 690#define FRAME_X_VISUAL(f) FRAME_DISPLAY_INFO(f)->visual
693 691
694#define FRAME_FOREGROUND_COLOR(f) ((f)->output_data.ns->foreground_color) 692#define FRAME_FOREGROUND_COLOR(f) ((f)->output_data.ns->foreground_color)
695#define FRAME_BACKGROUND_COLOR(f) ((f)->output_data.ns->background_color) 693#define FRAME_BACKGROUND_COLOR(f) ((f)->output_data.ns->background_color)
696 694
697#define FRAME_X_IMAGE_CACHE(F) FRAME_NS_DISPLAY_INFO ((F))->image_cache 695#define FRAME_X_IMAGE_CACHE(F) FRAME_DISPLAY_INFO ((F))->image_cache
698 696
699#define NS_FACE_FOREGROUND(f) ((f)->foreground) 697#define NS_FACE_FOREGROUND(f) ((f)->foreground)
700#define NS_FACE_BACKGROUND(f) ((f)->background) 698#define NS_FACE_BACKGROUND(f) ((f)->background)
@@ -744,14 +742,14 @@ struct x_output
744#define NS_TOP_POS(f) ((f)->top_pos) 742#define NS_TOP_POS(f) ((f)->top_pos)
745#endif 743#endif
746 744
747#define FRAME_NS_FONT_TABLE(f) (FRAME_NS_DISPLAY_INFO (f)->font_table) 745#define FRAME_NS_FONT_TABLE(f) (FRAME_DISPLAY_INFO (f)->font_table)
748 746
749#define FRAME_FONTSET(f) ((f)->output_data.ns->fontset) 747#define FRAME_FONTSET(f) ((f)->output_data.ns->fontset)
750 748
751#define FRAME_SMALLEST_CHAR_WIDTH(f) \ 749#define FRAME_SMALLEST_CHAR_WIDTH(f) \
752 (FRAME_NS_DISPLAY_INFO (f)->smallest_char_width) 750 (FRAME_DISPLAY_INFO (f)->smallest_char_width)
753#define FRAME_SMALLEST_FONT_HEIGHT(f) \ 751#define FRAME_SMALLEST_FONT_HEIGHT(f) \
754 (FRAME_NS_DISPLAY_INFO (f)->smallest_font_height) 752 (FRAME_DISPLAY_INFO (f)->smallest_font_height)
755#define FRAME_BASELINE_OFFSET(f) ((f)->output_data.ns->baseline_offset) 753#define FRAME_BASELINE_OFFSET(f) ((f)->output_data.ns->baseline_offset)
756#define BLACK_PIX_DEFAULT(f) 0x000000 754#define BLACK_PIX_DEFAULT(f) 0x000000
757#define WHITE_PIX_DEFAULT(f) 0xFFFFFF 755#define WHITE_PIX_DEFAULT(f) 0xFFFFFF
diff --git a/src/nsterm.m b/src/nsterm.m
index 59627a38087..1dac6ba9fe4 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -1007,7 +1007,7 @@ ns_frame_rehighlight (struct frame *frame)
1007 External (hook): called on things like window switching within frame 1007 External (hook): called on things like window switching within frame
1008 -------------------------------------------------------------------------- */ 1008 -------------------------------------------------------------------------- */
1009{ 1009{
1010 struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (frame); 1010 struct ns_display_info *dpyinfo = FRAME_DISPLAY_INFO (frame);
1011 struct frame *old_highlight = dpyinfo->x_highlight_frame; 1011 struct frame *old_highlight = dpyinfo->x_highlight_frame;
1012 1012
1013 NSTRACE (ns_frame_rehighlight); 1013 NSTRACE (ns_frame_rehighlight);
@@ -1104,7 +1104,7 @@ x_iconify_frame (struct frame *f)
1104 NSTRACE (x_iconify_frame); 1104 NSTRACE (x_iconify_frame);
1105 check_window_system (f); 1105 check_window_system (f);
1106 view = FRAME_NS_VIEW (f); 1106 view = FRAME_NS_VIEW (f);
1107 dpyinfo = FRAME_NS_DISPLAY_INFO (f); 1107 dpyinfo = FRAME_DISPLAY_INFO (f);
1108 1108
1109 if (dpyinfo->x_highlight_frame == f) 1109 if (dpyinfo->x_highlight_frame == f)
1110 dpyinfo->x_highlight_frame = 0; 1110 dpyinfo->x_highlight_frame = 0;
@@ -1136,7 +1136,7 @@ x_free_frame_resources (struct frame *f)
1136 NSTRACE (x_free_frame_resources); 1136 NSTRACE (x_free_frame_resources);
1137 check_window_system (f); 1137 check_window_system (f);
1138 view = FRAME_NS_VIEW (f); 1138 view = FRAME_NS_VIEW (f);
1139 dpyinfo = FRAME_NS_DISPLAY_INFO (f); 1139 dpyinfo = FRAME_DISPLAY_INFO (f);
1140 hlinfo = MOUSE_HL_INFO (f); 1140 hlinfo = MOUSE_HL_INFO (f);
1141 1141
1142 [(EmacsView *)view setWindowClosing: YES]; /* may not have been informed */ 1142 [(EmacsView *)view setWindowClosing: YES]; /* may not have been informed */
@@ -1356,7 +1356,7 @@ ns_fullscreen_hook (struct frame *f)
1356NSColor * 1356NSColor *
1357ns_lookup_indexed_color (unsigned long idx, struct frame *f) 1357ns_lookup_indexed_color (unsigned long idx, struct frame *f)
1358{ 1358{
1359 struct ns_color_table *color_table = FRAME_NS_DISPLAY_INFO (f)->color_table; 1359 struct ns_color_table *color_table = FRAME_DISPLAY_INFO (f)->color_table;
1360 if (idx < 1 || idx >= color_table->avail) 1360 if (idx < 1 || idx >= color_table->avail)
1361 return nil; 1361 return nil;
1362 return color_table->colors[idx]; 1362 return color_table->colors[idx];
@@ -1366,7 +1366,7 @@ ns_lookup_indexed_color (unsigned long idx, struct frame *f)
1366unsigned long 1366unsigned long
1367ns_index_color (NSColor *color, struct frame *f) 1367ns_index_color (NSColor *color, struct frame *f)
1368{ 1368{
1369 struct ns_color_table *color_table = FRAME_NS_DISPLAY_INFO (f)->color_table; 1369 struct ns_color_table *color_table = FRAME_DISPLAY_INFO (f)->color_table;
1370 ptrdiff_t idx; 1370 ptrdiff_t idx;
1371 ptrdiff_t i; 1371 ptrdiff_t i;
1372 1372
@@ -1416,7 +1416,7 @@ ns_free_indexed_color (unsigned long idx, struct frame *f)
1416 if (!f) 1416 if (!f)
1417 return; 1417 return;
1418 1418
1419 color_table = FRAME_NS_DISPLAY_INFO (f)->color_table; 1419 color_table = FRAME_DISPLAY_INFO (f)->color_table;
1420 1420
1421 if (idx <= 0 || idx >= color_table->size) { 1421 if (idx <= 0 || idx >= color_table->size) {
1422 message1 ("ns_free_indexed_color: Color index out of range.\n"); 1422 message1 ("ns_free_indexed_color: Color index out of range.\n");
@@ -1651,7 +1651,7 @@ x_set_frame_alpha (struct frame *f)
1651 change the entire-frame transparency 1651 change the entire-frame transparency
1652 -------------------------------------------------------------------------- */ 1652 -------------------------------------------------------------------------- */
1653{ 1653{
1654 struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (f); 1654 struct ns_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
1655 double alpha = 1.0; 1655 double alpha = 1.0;
1656 double alpha_min = 1.0; 1656 double alpha_min = 1.0;
1657 1657
@@ -1786,7 +1786,7 @@ ns_mouse_position (struct frame **fp, int insist, Lisp_Object *bar_window,
1786 return; 1786 return;
1787 } 1787 }
1788 1788
1789 dpyinfo = FRAME_NS_DISPLAY_INFO (*fp); 1789 dpyinfo = FRAME_DISPLAY_INFO (*fp);
1790 1790
1791 block_input (); 1791 block_input ();
1792 1792
@@ -2877,7 +2877,7 @@ ns_maybe_dumpglyphs_background (struct glyph_string *s, char force_p)
2877 : FRAME_BACKGROUND_COLOR (s->f)) set]; 2877 : FRAME_BACKGROUND_COLOR (s->f)) set];
2878 else 2878 else
2879 { 2879 {
2880 struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (s->f); 2880 struct ns_display_info *dpyinfo = FRAME_DISPLAY_INFO (s->f);
2881 [[dpyinfo->bitmaps[face->stipple-1].img stippleMask] set]; 2881 [[dpyinfo->bitmaps[face->stipple-1].img stippleMask] set];
2882 } 2882 }
2883 2883
@@ -5705,7 +5705,7 @@ if (cols > 0 && rows > 0)
5705- (void)windowDidBecomeKey: (NSNotification *)notification 5705- (void)windowDidBecomeKey: (NSNotification *)notification
5706/* cf. x_detect_focus_change(), x_focus_changed(), x_new_focus_frame() */ 5706/* cf. x_detect_focus_change(), x_focus_changed(), x_new_focus_frame() */
5707{ 5707{
5708 struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (emacsframe); 5708 struct ns_display_info *dpyinfo = FRAME_DISPLAY_INFO (emacsframe);
5709 struct frame *old_focus = dpyinfo->x_focus_frame; 5709 struct frame *old_focus = dpyinfo->x_focus_frame;
5710 5710
5711 NSTRACE (windowDidBecomeKey); 5711 NSTRACE (windowDidBecomeKey);
@@ -5726,7 +5726,7 @@ if (cols > 0 && rows > 0)
5726- (void)windowDidResignKey: (NSNotification *)notification 5726- (void)windowDidResignKey: (NSNotification *)notification
5727/* cf. x_detect_focus_change(), x_focus_changed(), x_new_focus_frame() */ 5727/* cf. x_detect_focus_change(), x_focus_changed(), x_new_focus_frame() */
5728{ 5728{
5729 struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (emacsframe); 5729 struct ns_display_info *dpyinfo = FRAME_DISPLAY_INFO (emacsframe);
5730 BOOL is_focus_frame = dpyinfo->x_focus_frame == emacsframe; 5730 BOOL is_focus_frame = dpyinfo->x_focus_frame == emacsframe;
5731 NSTRACE (windowDidResignKey); 5731 NSTRACE (windowDidResignKey);
5732 5732
diff --git a/src/w32fns.c b/src/w32fns.c
index a8b444e0409..d2defeed529 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -277,7 +277,7 @@ check_x_display_info (Lisp_Object frame)
277 struct frame *sf = XFRAME (selected_frame); 277 struct frame *sf = XFRAME (selected_frame);
278 278
279 if (FRAME_W32_P (sf) && FRAME_LIVE_P (sf)) 279 if (FRAME_W32_P (sf) && FRAME_LIVE_P (sf))
280 return FRAME_W32_DISPLAY_INFO (sf); 280 return FRAME_DISPLAY_INFO (sf);
281 else 281 else
282 return &one_w32_display_info; 282 return &one_w32_display_info;
283 } 283 }
@@ -291,7 +291,7 @@ check_x_display_info (Lisp_Object frame)
291 f = XFRAME (frame); 291 f = XFRAME (frame);
292 if (! FRAME_W32_P (f)) 292 if (! FRAME_W32_P (f))
293 error ("Non-W32 frame used"); 293 error ("Non-W32 frame used");
294 return FRAME_W32_DISPLAY_INFO (f); 294 return FRAME_DISPLAY_INFO (f);
295 } 295 }
296} 296}
297 297
@@ -307,7 +307,7 @@ x_window_to_frame (struct w32_display_info *dpyinfo, HWND wdesc)
307 FOR_EACH_FRAME (tail, frame) 307 FOR_EACH_FRAME (tail, frame)
308 { 308 {
309 f = XFRAME (frame); 309 f = XFRAME (frame);
310 if (!FRAME_W32_P (f) || FRAME_W32_DISPLAY_INFO (f) != dpyinfo) 310 if (!FRAME_W32_P (f) || FRAME_DISPLAY_INFO (f) != dpyinfo)
311 continue; 311 continue;
312 312
313 if (FRAME_W32_WINDOW (f) == wdesc) 313 if (FRAME_W32_WINDOW (f) == wdesc)
@@ -1027,18 +1027,18 @@ w32_regenerate_palette (struct frame *f)
1027 int i; 1027 int i;
1028 1028
1029 /* don't bother trying to create palette if not supported */ 1029 /* don't bother trying to create palette if not supported */
1030 if (! FRAME_W32_DISPLAY_INFO (f)->has_palette) 1030 if (! FRAME_DISPLAY_INFO (f)->has_palette)
1031 return; 1031 return;
1032 1032
1033 log_palette = (LOGPALETTE *) 1033 log_palette = (LOGPALETTE *)
1034 alloca (sizeof (LOGPALETTE) + 1034 alloca (sizeof (LOGPALETTE) +
1035 FRAME_W32_DISPLAY_INFO (f)->num_colors * sizeof (PALETTEENTRY)); 1035 FRAME_DISPLAY_INFO (f)->num_colors * sizeof (PALETTEENTRY));
1036 log_palette->palVersion = 0x300; 1036 log_palette->palVersion = 0x300;
1037 log_palette->palNumEntries = FRAME_W32_DISPLAY_INFO (f)->num_colors; 1037 log_palette->palNumEntries = FRAME_DISPLAY_INFO (f)->num_colors;
1038 1038
1039 list = FRAME_W32_DISPLAY_INFO (f)->color_list; 1039 list = FRAME_DISPLAY_INFO (f)->color_list;
1040 for (i = 0; 1040 for (i = 0;
1041 i < FRAME_W32_DISPLAY_INFO (f)->num_colors; 1041 i < FRAME_DISPLAY_INFO (f)->num_colors;
1042 i++, list = list->next) 1042 i++, list = list->next)
1043 log_palette->palPalEntry[i] = list->entry; 1043 log_palette->palPalEntry[i] = list->entry;
1044 1044
@@ -1046,9 +1046,9 @@ w32_regenerate_palette (struct frame *f)
1046 1046
1047 enter_crit (); 1047 enter_crit ();
1048 1048
1049 if (FRAME_W32_DISPLAY_INFO (f)->palette) 1049 if (FRAME_DISPLAY_INFO (f)->palette)
1050 DeleteObject (FRAME_W32_DISPLAY_INFO (f)->palette); 1050 DeleteObject (FRAME_DISPLAY_INFO (f)->palette);
1051 FRAME_W32_DISPLAY_INFO (f)->palette = new_palette; 1051 FRAME_DISPLAY_INFO (f)->palette = new_palette;
1052 1052
1053 /* Realize display palette and garbage all frames. */ 1053 /* Realize display palette and garbage all frames. */
1054 release_frame_dc (f, get_frame_dc (f)); 1054 release_frame_dc (f, get_frame_dc (f));
@@ -1071,7 +1071,7 @@ w32_regenerate_palette (struct frame *f)
1071void 1071void
1072w32_map_color (struct frame *f, COLORREF color) 1072w32_map_color (struct frame *f, COLORREF color)
1073{ 1073{
1074 struct w32_palette_entry * list = FRAME_W32_DISPLAY_INFO (f)->color_list; 1074 struct w32_palette_entry * list = FRAME_DISPLAY_INFO (f)->color_list;
1075 1075
1076 if (NILP (Vw32_enable_palette)) 1076 if (NILP (Vw32_enable_palette))
1077 return; 1077 return;
@@ -1091,19 +1091,19 @@ w32_map_color (struct frame *f, COLORREF color)
1091 list = xmalloc (sizeof (struct w32_palette_entry)); 1091 list = xmalloc (sizeof (struct w32_palette_entry));
1092 SET_W32_COLOR (list->entry, color); 1092 SET_W32_COLOR (list->entry, color);
1093 list->refcount = 1; 1093 list->refcount = 1;
1094 list->next = FRAME_W32_DISPLAY_INFO (f)->color_list; 1094 list->next = FRAME_DISPLAY_INFO (f)->color_list;
1095 FRAME_W32_DISPLAY_INFO (f)->color_list = list; 1095 FRAME_DISPLAY_INFO (f)->color_list = list;
1096 FRAME_W32_DISPLAY_INFO (f)->num_colors++; 1096 FRAME_DISPLAY_INFO (f)->num_colors++;
1097 1097
1098 /* set flag that palette must be regenerated */ 1098 /* set flag that palette must be regenerated */
1099 FRAME_W32_DISPLAY_INFO (f)->regen_palette = TRUE; 1099 FRAME_DISPLAY_INFO (f)->regen_palette = TRUE;
1100} 1100}
1101 1101
1102void 1102void
1103w32_unmap_color (struct frame *f, COLORREF color) 1103w32_unmap_color (struct frame *f, COLORREF color)
1104{ 1104{
1105 struct w32_palette_entry * list = FRAME_W32_DISPLAY_INFO (f)->color_list; 1105 struct w32_palette_entry * list = FRAME_DISPLAY_INFO (f)->color_list;
1106 struct w32_palette_entry **prev = &FRAME_W32_DISPLAY_INFO (f)->color_list; 1106 struct w32_palette_entry **prev = &FRAME_DISPLAY_INFO (f)->color_list;
1107 1107
1108 if (NILP (Vw32_enable_palette)) 1108 if (NILP (Vw32_enable_palette))
1109 return; 1109 return;
@@ -1117,7 +1117,7 @@ w32_unmap_color (struct frame *f, COLORREF color)
1117 { 1117 {
1118 *prev = list->next; 1118 *prev = list->next;
1119 xfree (list); 1119 xfree (list);
1120 FRAME_W32_DISPLAY_INFO (f)->num_colors--; 1120 FRAME_DISPLAY_INFO (f)->num_colors--;
1121 break; 1121 break;
1122 } 1122 }
1123 else 1123 else
@@ -1128,7 +1128,7 @@ w32_unmap_color (struct frame *f, COLORREF color)
1128 } 1128 }
1129 1129
1130 /* set flag that palette must be regenerated */ 1130 /* set flag that palette must be regenerated */
1131 FRAME_W32_DISPLAY_INFO (f)->regen_palette = TRUE; 1131 FRAME_DISPLAY_INFO (f)->regen_palette = TRUE;
1132} 1132}
1133#endif 1133#endif
1134 1134
@@ -1235,7 +1235,7 @@ x_decode_color (struct frame *f, Lisp_Object arg, int def)
1235 else if (strcmp (SDATA (arg), "white") == 0) 1235 else if (strcmp (SDATA (arg), "white") == 0)
1236 return WHITE_PIX_DEFAULT (f); 1236 return WHITE_PIX_DEFAULT (f);
1237 1237
1238 if ((FRAME_W32_DISPLAY_INFO (f)->n_planes * FRAME_W32_DISPLAY_INFO (f)->n_cbits) == 1) 1238 if ((FRAME_DISPLAY_INFO (f)->n_planes * FRAME_DISPLAY_INFO (f)->n_cbits) == 1)
1239 return def; 1239 return def;
1240 1240
1241 /* w32_defined_color is responsible for coping with failures 1241 /* w32_defined_color is responsible for coping with failures
@@ -1752,10 +1752,10 @@ x_set_name (struct frame *f, Lisp_Object name, int explicit)
1752 { 1752 {
1753 /* Check for no change needed in this very common case 1753 /* Check for no change needed in this very common case
1754 before we do any consing. */ 1754 before we do any consing. */
1755 if (!strcmp (FRAME_W32_DISPLAY_INFO (f)->w32_id_name, 1755 if (!strcmp (FRAME_DISPLAY_INFO (f)->w32_id_name,
1756 SDATA (f->name))) 1756 SDATA (f->name)))
1757 return; 1757 return;
1758 name = build_string (FRAME_W32_DISPLAY_INFO (f)->w32_id_name); 1758 name = build_string (FRAME_DISPLAY_INFO (f)->w32_id_name);
1759 } 1759 }
1760 else 1760 else
1761 CHECK_STRING (name); 1761 CHECK_STRING (name);
@@ -4232,7 +4232,7 @@ unwind_create_frame (Lisp_Object frame)
4232 if (NILP (Fmemq (frame, Vframe_list))) 4232 if (NILP (Fmemq (frame, Vframe_list)))
4233 { 4233 {
4234#ifdef GLYPH_DEBUG 4234#ifdef GLYPH_DEBUG
4235 struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f); 4235 struct w32_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
4236#endif 4236#endif
4237 4237
4238 x_free_frame_resources (f); 4238 x_free_frame_resources (f);
@@ -4258,7 +4258,7 @@ do_unwind_create_frame (Lisp_Object frame)
4258static void 4258static void
4259x_default_font_parameter (struct frame *f, Lisp_Object parms) 4259x_default_font_parameter (struct frame *f, Lisp_Object parms)
4260{ 4260{
4261 struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f); 4261 struct w32_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
4262 Lisp_Object font_param = x_get_arg (dpyinfo, parms, Qfont, NULL, NULL, 4262 Lisp_Object font_param = x_get_arg (dpyinfo, parms, Qfont, NULL, NULL,
4263 RES_TYPE_STRING); 4263 RES_TYPE_STRING);
4264 Lisp_Object font; 4264 Lisp_Object font;
@@ -4392,9 +4392,9 @@ This function is an internal primitive--use `make-frame' instead. */)
4392 if (! STRINGP (f->icon_name)) 4392 if (! STRINGP (f->icon_name))
4393 fset_icon_name (f, Qnil); 4393 fset_icon_name (f, Qnil);
4394 4394
4395/* FRAME_W32_DISPLAY_INFO (f) = dpyinfo; */ 4395/* FRAME_DISPLAY_INFO (f) = dpyinfo; */
4396 4396
4397 /* With FRAME_X_DISPLAY_INFO set up, this unwind-protect is safe. */ 4397 /* With FRAME_DISPLAY_INFO set up, this unwind-protect is safe. */
4398 record_unwind_protect (do_unwind_create_frame, frame); 4398 record_unwind_protect (do_unwind_create_frame, frame);
4399#ifdef GLYPH_DEBUG 4399#ifdef GLYPH_DEBUG
4400 image_cache_refcount = 4400 image_cache_refcount =
@@ -4411,7 +4411,7 @@ This function is an internal primitive--use `make-frame' instead. */)
4411 } 4411 }
4412 else 4412 else
4413 { 4413 {
4414 f->output_data.w32->parent_desc = FRAME_W32_DISPLAY_INFO (f)->root_window; 4414 f->output_data.w32->parent_desc = FRAME_DISPLAY_INFO (f)->root_window;
4415 f->output_data.w32->explicit_parent = 0; 4415 f->output_data.w32->explicit_parent = 0;
4416 } 4416 }
4417 4417
@@ -4506,7 +4506,7 @@ This function is an internal primitive--use `make-frame' instead. */)
4506 "fullscreen", "Fullscreen", RES_TYPE_SYMBOL); 4506 "fullscreen", "Fullscreen", RES_TYPE_SYMBOL);
4507 4507
4508 f->output_data.w32->dwStyle = WS_OVERLAPPEDWINDOW; 4508 f->output_data.w32->dwStyle = WS_OVERLAPPEDWINDOW;
4509 f->output_data.w32->parent_desc = FRAME_W32_DISPLAY_INFO (f)->root_window; 4509 f->output_data.w32->parent_desc = FRAME_DISPLAY_INFO (f)->root_window;
4510 4510
4511 f->output_data.w32->text_cursor = w32_load_cursor (IDC_IBEAM); 4511 f->output_data.w32->text_cursor = w32_load_cursor (IDC_IBEAM);
4512 f->output_data.w32->nontext_cursor = w32_load_cursor (IDC_ARROW); 4512 f->output_data.w32->nontext_cursor = w32_load_cursor (IDC_ARROW);
@@ -4529,7 +4529,7 @@ This function is an internal primitive--use `make-frame' instead. */)
4529 4529
4530 /* Now consider the frame official. */ 4530 /* Now consider the frame official. */
4531 f->terminal->reference_count++; 4531 f->terminal->reference_count++;
4532 FRAME_W32_DISPLAY_INFO (f)->reference_count++; 4532 FRAME_DISPLAY_INFO (f)->reference_count++;
4533 Vframe_list = Fcons (frame, Vframe_list); 4533 Vframe_list = Fcons (frame, Vframe_list);
4534 4534
4535 /* We need to do this after creating the window, so that the 4535 /* We need to do this after creating the window, so that the
@@ -4613,7 +4613,7 @@ This function is an internal primitive--use `make-frame' instead. */)
4613Lisp_Object 4613Lisp_Object
4614x_get_focus_frame (struct frame *frame) 4614x_get_focus_frame (struct frame *frame)
4615{ 4615{
4616 struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (frame); 4616 struct w32_display_info *dpyinfo = FRAME_DISPLAY_INFO (frame);
4617 Lisp_Object xfocus; 4617 Lisp_Object xfocus;
4618 if (! dpyinfo->w32_focus_frame) 4618 if (! dpyinfo->w32_focus_frame)
4619 return Qnil; 4619 return Qnil;
@@ -5131,7 +5131,7 @@ SOUND is nil to use the normal beep. */)
5131int 5131int
5132x_screen_planes (register struct frame *f) 5132x_screen_planes (register struct frame *f)
5133{ 5133{
5134 return FRAME_W32_DISPLAY_INFO (f)->n_planes; 5134 return FRAME_DISPLAY_INFO (f)->n_planes;
5135} 5135}
5136 5136
5137/* Return the display structure for the display named NAME. 5137/* Return the display structure for the display named NAME.
@@ -5660,7 +5660,7 @@ x_create_tip_frame (struct w32_display_info *dpyinfo,
5660 dpyinfo_refcount = dpyinfo->reference_count; 5660 dpyinfo_refcount = dpyinfo->reference_count;
5661#endif /* GLYPH_DEBUG */ 5661#endif /* GLYPH_DEBUG */
5662 FRAME_KBOARD (f) = kb; 5662 FRAME_KBOARD (f) = kb;
5663 f->output_data.w32->parent_desc = FRAME_W32_DISPLAY_INFO (f)->root_window; 5663 f->output_data.w32->parent_desc = FRAME_DISPLAY_INFO (f)->root_window;
5664 f->output_data.w32->explicit_parent = 0; 5664 f->output_data.w32->explicit_parent = 0;
5665 5665
5666 /* Set the name; the functions to which we pass f expect the name to 5666 /* Set the name; the functions to which we pass f expect the name to
@@ -5729,7 +5729,7 @@ x_create_tip_frame (struct w32_display_info *dpyinfo,
5729 init_frame_faces (f); 5729 init_frame_faces (f);
5730 5730
5731 f->output_data.w32->dwStyle = WS_BORDER | WS_POPUP | WS_DISABLED; 5731 f->output_data.w32->dwStyle = WS_BORDER | WS_POPUP | WS_DISABLED;
5732 f->output_data.w32->parent_desc = FRAME_W32_DISPLAY_INFO (f)->root_window; 5732 f->output_data.w32->parent_desc = FRAME_DISPLAY_INFO (f)->root_window;
5733 5733
5734 window_prompting = x_figure_window_size (f, parms, 0); 5734 window_prompting = x_figure_window_size (f, parms, 0);
5735 5735
@@ -5796,7 +5796,7 @@ x_create_tip_frame (struct w32_display_info *dpyinfo,
5796 5796
5797 /* Now that the frame is official, it counts as a reference to 5797 /* Now that the frame is official, it counts as a reference to
5798 its display. */ 5798 its display. */
5799 FRAME_W32_DISPLAY_INFO (f)->reference_count++; 5799 FRAME_DISPLAY_INFO (f)->reference_count++;
5800 f->terminal->reference_count++; 5800 f->terminal->reference_count++;
5801 5801
5802 /* It is now ok to make the frame official even if we get an error 5802 /* It is now ok to make the frame official even if we get an error
@@ -5843,8 +5843,8 @@ compute_tip_xy (struct frame *f,
5843 /* Default min and max values. */ 5843 /* Default min and max values. */
5844 min_x = 0; 5844 min_x = 0;
5845 min_y = 0; 5845 min_y = 0;
5846 max_x = x_display_pixel_width (FRAME_W32_DISPLAY_INFO (f)); 5846 max_x = x_display_pixel_width (FRAME_DISPLAY_INFO (f));
5847 max_y = x_display_pixel_height (FRAME_W32_DISPLAY_INFO (f)); 5847 max_y = x_display_pixel_height (FRAME_DISPLAY_INFO (f));
5848 5848
5849 block_input (); 5849 block_input ();
5850 GetCursorPos (&pt); 5850 GetCursorPos (&pt);
@@ -6030,7 +6030,7 @@ Text larger than the specified size is clipped. */)
6030 6030
6031 /* Create a frame for the tooltip, and record it in the global 6031 /* Create a frame for the tooltip, and record it in the global
6032 variable tip_frame. */ 6032 variable tip_frame. */
6033 frame = x_create_tip_frame (FRAME_W32_DISPLAY_INFO (f), parms, string); 6033 frame = x_create_tip_frame (FRAME_DISPLAY_INFO (f), parms, string);
6034 f = XFRAME (frame); 6034 f = XFRAME (frame);
6035 6035
6036 /* Set up the frame's root window. */ 6036 /* Set up the frame's root window. */
diff --git a/src/w32font.c b/src/w32font.c
index 4a97fd90a4e..845df68f09d 100644
--- a/src/w32font.c
+++ b/src/w32font.c
@@ -299,7 +299,7 @@ intern_font_name (char * string)
299Lisp_Object 299Lisp_Object
300w32font_get_cache (struct frame *f) 300w32font_get_cache (struct frame *f)
301{ 301{
302 struct w32_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 302 struct w32_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
303 303
304 return (dpyinfo->name_list_element); 304 return (dpyinfo->name_list_element);
305} 305}
diff --git a/src/w32menu.c b/src/w32menu.c
index 34020fa61d2..7435a09b627 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -231,7 +231,7 @@ otherwise it is "Question". */)
231 unblock_input (); 231 unblock_input ();
232 232
233 discard_menu_items (); 233 discard_menu_items ();
234 FRAME_X_DISPLAY_INFO (f)->grabbed = 0; 234 FRAME_DISPLAY_INFO (f)->grabbed = 0;
235 235
236 if (error_name) error (error_name); 236 if (error_name) error (error_name);
237 return selection; 237 return selection;
@@ -883,7 +883,7 @@ w32_menu_show (struct frame *f, int x, int y, int for_click, int keymaps,
883 /* Clean up extraneous mouse events which might have been generated 883 /* Clean up extraneous mouse events which might have been generated
884 during the call. */ 884 during the call. */
885 discard_mouse_events (); 885 discard_mouse_events ();
886 FRAME_X_DISPLAY_INFO (f)->grabbed = 0; 886 FRAME_DISPLAY_INFO (f)->grabbed = 0;
887 887
888 /* Free the widget_value objects we used to specify the contents. */ 888 /* Free the widget_value objects we used to specify the contents. */
889 free_menubar_widget_value_tree (first_wv); 889 free_menubar_widget_value_tree (first_wv);
@@ -1123,7 +1123,7 @@ w32_dialog_show (struct frame *f, int keymaps,
1123 lw_pop_up_all_widgets (dialog_id); 1123 lw_pop_up_all_widgets (dialog_id);
1124 1124
1125 /* Process events that apply to the menu. */ 1125 /* Process events that apply to the menu. */
1126 popup_get_selection ((XEvent *) 0, FRAME_X_DISPLAY_INFO (f), dialog_id); 1126 popup_get_selection ((XEvent *) 0, FRAME_DISPLAY_INFO (f), dialog_id);
1127 1127
1128 lw_destroy_all_widgets (dialog_id); 1128 lw_destroy_all_widgets (dialog_id);
1129 1129
diff --git a/src/w32term.c b/src/w32term.c
index d47509e4ece..f86f7d351aa 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -477,7 +477,7 @@ w32_clear_window (struct frame *f)
477void 477void
478x_set_frame_alpha (struct frame *f) 478x_set_frame_alpha (struct frame *f)
479{ 479{
480 struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f); 480 struct w32_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
481 double alpha = 1.0; 481 double alpha = 1.0;
482 double alpha_min = 1.0; 482 double alpha_min = 1.0;
483 BYTE opac; 483 BYTE opac;
@@ -557,7 +557,7 @@ x_display_pixel_width (struct w32_display_info *dpyinfo)
557static void 557static void
558x_update_begin (struct frame *f) 558x_update_begin (struct frame *f)
559{ 559{
560 struct w32_display_info *display_info = FRAME_W32_DISPLAY_INFO (f); 560 struct w32_display_info *display_info = FRAME_DISPLAY_INFO (f);
561 561
562 if (! FRAME_W32_P (f)) 562 if (! FRAME_W32_P (f))
563 return; 563 return;
@@ -1003,14 +1003,14 @@ x_set_cursor_gc (struct glyph_string *s)
1003 xgcv.font = s->font; 1003 xgcv.font = s->font;
1004 mask = GCForeground | GCBackground | GCFont; 1004 mask = GCForeground | GCBackground | GCFont;
1005 1005
1006 if (FRAME_W32_DISPLAY_INFO (s->f)->scratch_cursor_gc) 1006 if (FRAME_DISPLAY_INFO (s->f)->scratch_cursor_gc)
1007 XChangeGC (NULL, FRAME_W32_DISPLAY_INFO (s->f)->scratch_cursor_gc, 1007 XChangeGC (NULL, FRAME_DISPLAY_INFO (s->f)->scratch_cursor_gc,
1008 mask, &xgcv); 1008 mask, &xgcv);
1009 else 1009 else
1010 FRAME_W32_DISPLAY_INFO (s->f)->scratch_cursor_gc 1010 FRAME_DISPLAY_INFO (s->f)->scratch_cursor_gc
1011 = XCreateGC (NULL, s->window, mask, &xgcv); 1011 = XCreateGC (NULL, s->window, mask, &xgcv);
1012 1012
1013 s->gc = FRAME_W32_DISPLAY_INFO (s->f)->scratch_cursor_gc; 1013 s->gc = FRAME_DISPLAY_INFO (s->f)->scratch_cursor_gc;
1014 } 1014 }
1015} 1015}
1016 1016
@@ -1052,14 +1052,14 @@ x_set_mouse_face_gc (struct glyph_string *s)
1052 xgcv.font = s->font; 1052 xgcv.font = s->font;
1053 mask = GCForeground | GCBackground | GCFont; 1053 mask = GCForeground | GCBackground | GCFont;
1054 1054
1055 if (FRAME_W32_DISPLAY_INFO (s->f)->scratch_cursor_gc) 1055 if (FRAME_DISPLAY_INFO (s->f)->scratch_cursor_gc)
1056 XChangeGC (NULL, FRAME_W32_DISPLAY_INFO (s->f)->scratch_cursor_gc, 1056 XChangeGC (NULL, FRAME_DISPLAY_INFO (s->f)->scratch_cursor_gc,
1057 mask, &xgcv); 1057 mask, &xgcv);
1058 else 1058 else
1059 FRAME_W32_DISPLAY_INFO (s->f)->scratch_cursor_gc 1059 FRAME_DISPLAY_INFO (s->f)->scratch_cursor_gc
1060 = XCreateGC (NULL, s->window, mask, &xgcv); 1060 = XCreateGC (NULL, s->window, mask, &xgcv);
1061 1061
1062 s->gc = FRAME_W32_DISPLAY_INFO (s->f)->scratch_cursor_gc; 1062 s->gc = FRAME_DISPLAY_INFO (s->f)->scratch_cursor_gc;
1063 } 1063 }
1064 1064
1065 eassert (s->gc != 0); 1065 eassert (s->gc != 0);
@@ -1623,7 +1623,7 @@ w32_setup_relief_color (struct frame *f, struct relief *relief, double factor,
1623 unsigned long mask = GCForeground; 1623 unsigned long mask = GCForeground;
1624 COLORREF pixel; 1624 COLORREF pixel;
1625 COLORREF background = di->relief_background; 1625 COLORREF background = di->relief_background;
1626 struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f); 1626 struct w32_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
1627 1627
1628 /* TODO: Free colors (if using palette)? */ 1628 /* TODO: Free colors (if using palette)? */
1629 1629
@@ -2930,7 +2930,7 @@ w32_frame_rehighlight (struct frame *frame)
2930{ 2930{
2931 if (! FRAME_W32_P (frame)) 2931 if (! FRAME_W32_P (frame))
2932 return; 2932 return;
2933 x_frame_rehighlight (FRAME_W32_DISPLAY_INFO (frame)); 2933 x_frame_rehighlight (FRAME_DISPLAY_INFO (frame));
2934} 2934}
2935 2935
2936static void 2936static void
@@ -3429,7 +3429,7 @@ w32_mouse_position (struct frame **fp, int insist, Lisp_Object *bar_window,
3429 /* Now we have a position on the root; find the innermost window 3429 /* Now we have a position on the root; find the innermost window
3430 containing the pointer. */ 3430 containing the pointer. */
3431 { 3431 {
3432 if (FRAME_W32_DISPLAY_INFO (*fp)->grabbed && last_mouse_frame 3432 if (FRAME_DISPLAY_INFO (*fp)->grabbed && last_mouse_frame
3433 && FRAME_LIVE_P (last_mouse_frame)) 3433 && FRAME_LIVE_P (last_mouse_frame))
3434 { 3434 {
3435 /* If mouse was grabbed on a frame, give coords for that frame 3435 /* If mouse was grabbed on a frame, give coords for that frame
@@ -3439,7 +3439,7 @@ w32_mouse_position (struct frame **fp, int insist, Lisp_Object *bar_window,
3439 else 3439 else
3440 { 3440 {
3441 /* Is window under mouse one of our frames? */ 3441 /* Is window under mouse one of our frames? */
3442 f1 = x_any_window_to_frame (FRAME_W32_DISPLAY_INFO (*fp), 3442 f1 = x_any_window_to_frame (FRAME_DISPLAY_INFO (*fp),
3443 WindowFromPoint (pt)); 3443 WindowFromPoint (pt));
3444 } 3444 }
3445 3445
@@ -5539,13 +5539,13 @@ x_calc_absolute_position (struct frame *f)
5539 /* Treat negative positions as relative to the rightmost bottommost 5539 /* Treat negative positions as relative to the rightmost bottommost
5540 position that fits on the screen. */ 5540 position that fits on the screen. */
5541 if (flags & XNegative) 5541 if (flags & XNegative)
5542 f->left_pos = (x_display_pixel_width (FRAME_W32_DISPLAY_INFO (f)) 5542 f->left_pos = (x_display_pixel_width (FRAME_DISPLAY_INFO (f))
5543 - FRAME_PIXEL_WIDTH (f) 5543 - FRAME_PIXEL_WIDTH (f)
5544 + f->left_pos 5544 + f->left_pos
5545 - (left_right_borders_width - 1)); 5545 - (left_right_borders_width - 1));
5546 5546
5547 if (flags & YNegative) 5547 if (flags & YNegative)
5548 f->top_pos = (x_display_pixel_height (FRAME_W32_DISPLAY_INFO (f)) 5548 f->top_pos = (x_display_pixel_height (FRAME_DISPLAY_INFO (f))
5549 - FRAME_PIXEL_HEIGHT (f) 5549 - FRAME_PIXEL_HEIGHT (f)
5550 + f->top_pos 5550 + f->top_pos
5551 - (top_bottom_borders_height - 1)); 5551 - (top_bottom_borders_height - 1));
@@ -6013,8 +6013,8 @@ void
6013x_make_frame_invisible (struct frame *f) 6013x_make_frame_invisible (struct frame *f)
6014{ 6014{
6015 /* Don't keep the highlight on an invisible frame. */ 6015 /* Don't keep the highlight on an invisible frame. */
6016 if (FRAME_W32_DISPLAY_INFO (f)->x_highlight_frame == f) 6016 if (FRAME_DISPLAY_INFO (f)->x_highlight_frame == f)
6017 FRAME_W32_DISPLAY_INFO (f)->x_highlight_frame = 0; 6017 FRAME_DISPLAY_INFO (f)->x_highlight_frame = 0;
6018 6018
6019 block_input (); 6019 block_input ();
6020 6020
@@ -6039,8 +6039,8 @@ x_iconify_frame (struct frame *f)
6039 Lisp_Object type; 6039 Lisp_Object type;
6040 6040
6041 /* Don't keep the highlight on an invisible frame. */ 6041 /* Don't keep the highlight on an invisible frame. */
6042 if (FRAME_W32_DISPLAY_INFO (f)->x_highlight_frame == f) 6042 if (FRAME_DISPLAY_INFO (f)->x_highlight_frame == f)
6043 FRAME_W32_DISPLAY_INFO (f)->x_highlight_frame = 0; 6043 FRAME_DISPLAY_INFO (f)->x_highlight_frame = 0;
6044 6044
6045 if (FRAME_ICONIFIED_P (f)) 6045 if (FRAME_ICONIFIED_P (f))
6046 return; 6046 return;
@@ -6066,7 +6066,7 @@ x_iconify_frame (struct frame *f)
6066void 6066void
6067x_free_frame_resources (struct frame *f) 6067x_free_frame_resources (struct frame *f)
6068{ 6068{
6069 struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f); 6069 struct w32_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
6070 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); 6070 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
6071 6071
6072 block_input (); 6072 block_input ();
@@ -6116,7 +6116,7 @@ x_free_frame_resources (struct frame *f)
6116void 6116void
6117x_destroy_window (struct frame *f) 6117x_destroy_window (struct frame *f)
6118{ 6118{
6119 struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f); 6119 struct w32_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
6120 6120
6121 x_free_frame_resources (f); 6121 x_free_frame_resources (f);
6122 dpyinfo->reference_count--; 6122 dpyinfo->reference_count--;
diff --git a/src/w32term.h b/src/w32term.h
index b4818f69aee..68c0245acb9 100644
--- a/src/w32term.h
+++ b/src/w32term.h
@@ -379,8 +379,7 @@ extern struct w32_output w32term_display;
379#define FRAME_BASELINE_OFFSET(f) ((f)->output_data.w32->baseline_offset) 379#define FRAME_BASELINE_OFFSET(f) ((f)->output_data.w32->baseline_offset)
380 380
381/* This gives the w32_display_info structure for the display F is on. */ 381/* This gives the w32_display_info structure for the display F is on. */
382#define FRAME_W32_DISPLAY_INFO(f) (&one_w32_display_info) 382#define FRAME_DISPLAY_INFO(f) (&one_w32_display_info)
383#define FRAME_X_DISPLAY_INFO(f) (&one_w32_display_info)
384 383
385/* This is the `Display *' which frame F is on. */ 384/* This is the `Display *' which frame F is on. */
386#define FRAME_X_DISPLAY(f) (0) 385#define FRAME_X_DISPLAY(f) (0)
@@ -388,12 +387,12 @@ extern struct w32_output w32term_display;
388/* Value is the smallest width of any character in any font on frame F. */ 387/* Value is the smallest width of any character in any font on frame F. */
389 388
390#define FRAME_SMALLEST_CHAR_WIDTH(F) \ 389#define FRAME_SMALLEST_CHAR_WIDTH(F) \
391 FRAME_W32_DISPLAY_INFO(F)->smallest_char_width 390 FRAME_DISPLAY_INFO(F)->smallest_char_width
392 391
393/* Value is the smallest height of any font on frame F. */ 392/* Value is the smallest height of any font on frame F. */
394 393
395#define FRAME_SMALLEST_FONT_HEIGHT(F) \ 394#define FRAME_SMALLEST_FONT_HEIGHT(F) \
396 FRAME_W32_DISPLAY_INFO(F)->smallest_font_height 395 FRAME_DISPLAY_INFO(F)->smallest_font_height
397 396
398#define FRAME_NORMAL_PLACEMENT(F) ((F)->output_data.w32->normal_placement) 397#define FRAME_NORMAL_PLACEMENT(F) ((F)->output_data.w32->normal_placement)
399#define FRAME_PREV_FSMODE(F) ((F)->output_data.w32->prev_fsmode) 398#define FRAME_PREV_FSMODE(F) ((F)->output_data.w32->prev_fsmode)
diff --git a/src/w32xfns.c b/src/w32xfns.c
index 7629e49caf8..07f75477863 100644
--- a/src/w32xfns.c
+++ b/src/w32xfns.c
@@ -92,7 +92,7 @@ signal_quit (void)
92void 92void
93select_palette (struct frame *f, HDC hdc) 93select_palette (struct frame *f, HDC hdc)
94{ 94{
95 struct w32_display_info *display_info = FRAME_W32_DISPLAY_INFO (f); 95 struct w32_display_info *display_info = FRAME_DISPLAY_INFO (f);
96 96
97 if (!display_info->has_palette) 97 if (!display_info->has_palette)
98 return; 98 return;
diff --git a/src/widget.c b/src/widget.c
index ec0b506046b..d6469d7eec5 100644
--- a/src/widget.c
+++ b/src/widget.c
@@ -525,7 +525,7 @@ setup_frame_gcs (EmacsFrame ew)
525 font = Ffont_xlfd_name (font, Qnil); 525 font = Ffont_xlfd_name (font, Qnil);
526 if (STRINGP (font)) 526 if (STRINGP (font))
527 { 527 {
528 XFontStruct *xfont = XLoadQueryFont (FRAME_X_DISPLAY_INFO (s)->display, 528 XFontStruct *xfont = XLoadQueryFont (FRAME_DISPLAY_INFO (s)->display,
529 SSDATA (font)); 529 SSDATA (font));
530 if (xfont) 530 if (xfont)
531 { 531 {
diff --git a/src/xdisp.c b/src/xdisp.c
index 58316a0667f..4582002fa0e 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -12275,7 +12275,7 @@ note_tool_bar_highlight (struct frame *f, int x, int y)
12275{ 12275{
12276 Lisp_Object window = f->tool_bar_window; 12276 Lisp_Object window = f->tool_bar_window;
12277 struct window *w = XWINDOW (window); 12277 struct window *w = XWINDOW (window);
12278 Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 12278 Display_Info *dpyinfo = FRAME_DISPLAY_INFO (f);
12279 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); 12279 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
12280 int hpos, vpos; 12280 int hpos, vpos;
12281 struct glyph *glyph; 12281 struct glyph *glyph;
@@ -26005,7 +26005,7 @@ get_window_cursor_type (struct window *w, struct glyph *glyph, int *width,
26005 26005
26006 /* Detect a nonselected window or nonselected frame. */ 26006 /* Detect a nonselected window or nonselected frame. */
26007 else if (w != XWINDOW (f->selected_window) 26007 else if (w != XWINDOW (f->selected_window)
26008 || f != FRAME_X_DISPLAY_INFO (f)->x_highlight_frame) 26008 || f != FRAME_DISPLAY_INFO (f)->x_highlight_frame)
26009 { 26009 {
26010 *active_cursor = 0; 26010 *active_cursor = 0;
26011 26011
@@ -27658,7 +27658,7 @@ define_frame_cursor1 (struct frame *f, Cursor cursor, Lisp_Object pointer)
27658 cursor = FRAME_X_OUTPUT (f)->horizontal_drag_cursor; 27658 cursor = FRAME_X_OUTPUT (f)->horizontal_drag_cursor;
27659#ifdef HAVE_X_WINDOWS 27659#ifdef HAVE_X_WINDOWS
27660 else if (EQ (pointer, intern ("vdrag"))) 27660 else if (EQ (pointer, intern ("vdrag")))
27661 cursor = FRAME_X_DISPLAY_INFO (f)->vertical_scroll_bar_cursor; 27661 cursor = FRAME_DISPLAY_INFO (f)->vertical_scroll_bar_cursor;
27662#endif 27662#endif
27663 else if (EQ (pointer, intern ("hourglass"))) 27663 else if (EQ (pointer, intern ("hourglass")))
27664 cursor = FRAME_X_OUTPUT (f)->hourglass_cursor; 27664 cursor = FRAME_X_OUTPUT (f)->hourglass_cursor;
@@ -27821,7 +27821,7 @@ note_mode_line_or_margin_highlight (Lisp_Object window, int x, int y,
27821 /* Change the mouse pointer according to what is under it. */ 27821 /* Change the mouse pointer according to what is under it. */
27822 if (FRAME_WINDOW_P (f)) 27822 if (FRAME_WINDOW_P (f))
27823 { 27823 {
27824 dpyinfo = FRAME_X_DISPLAY_INFO (f); 27824 dpyinfo = FRAME_DISPLAY_INFO (f);
27825 if (STRINGP (string)) 27825 if (STRINGP (string))
27826 { 27826 {
27827 cursor = FRAME_X_OUTPUT (f)->nontext_cursor; 27827 cursor = FRAME_X_OUTPUT (f)->nontext_cursor;
@@ -27843,7 +27843,7 @@ note_mode_line_or_margin_highlight (Lisp_Object window, int x, int y,
27843 } 27843 }
27844 else 27844 else
27845 /* Default mode-line pointer. */ 27845 /* Default mode-line pointer. */
27846 cursor = FRAME_X_DISPLAY_INFO (f)->vertical_scroll_bar_cursor; 27846 cursor = FRAME_DISPLAY_INFO (f)->vertical_scroll_bar_cursor;
27847 } 27847 }
27848#endif 27848#endif
27849 } 27849 }
diff --git a/src/xfaces.c b/src/xfaces.c
index e8cb7a70322..335018dfee2 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -224,15 +224,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
224#include TERM_HEADER 224#include TERM_HEADER
225#include "fontset.h" 225#include "fontset.h"
226#ifdef HAVE_NTGUI 226#ifdef HAVE_NTGUI
227#undef FRAME_X_DISPLAY_INFO
228#define FRAME_X_DISPLAY_INFO FRAME_W32_DISPLAY_INFO
229#define x_display_info w32_display_info 227#define x_display_info w32_display_info
230#define GCGraphicsExposures 0 228#define GCGraphicsExposures 0
231#endif /* HAVE_NTGUI */ 229#endif /* HAVE_NTGUI */
232 230
233#ifdef HAVE_NS 231#ifdef HAVE_NS
234#undef FRAME_X_DISPLAY_INFO
235#define FRAME_X_DISPLAY_INFO FRAME_NS_DISPLAY_INFO
236#define GCGraphicsExposures 0 232#define GCGraphicsExposures 0
237#endif /* HAVE_NS */ 233#endif /* HAVE_NS */
238 234
@@ -546,7 +542,7 @@ DEFUN ("dump-colors", Fdump_colors, Sdump_colors, 0, 0, 0,
546void 542void
547x_free_colors (struct frame *f, long unsigned int *pixels, int npixels) 543x_free_colors (struct frame *f, long unsigned int *pixels, int npixels)
548{ 544{
549 int class = FRAME_X_DISPLAY_INFO (f)->visual->class; 545 int class = FRAME_DISPLAY_INFO (f)->visual->class;
550 546
551 /* If display has an immutable color map, freeing colors is not 547 /* If display has an immutable color map, freeing colors is not
552 necessary and some servers don't allow it. So don't do it. */ 548 necessary and some servers don't allow it. So don't do it. */
@@ -767,7 +763,7 @@ clear_face_cache (int clear_fonts_p)
767 { 763 {
768 struct frame *f = XFRAME (frame); 764 struct frame *f = XFRAME (frame);
769 if (FRAME_WINDOW_P (f) 765 if (FRAME_WINDOW_P (f)
770 && FRAME_X_DISPLAY_INFO (f)->n_fonts > CLEAR_FONT_TABLE_NFONTS) 766 && FRAME_DISPLAY_INFO (f)->n_fonts > CLEAR_FONT_TABLE_NFONTS)
771 { 767 {
772 clear_font_cache (f); 768 clear_font_cache (f);
773 free_all_realized_faces (frame); 769 free_all_realized_faces (frame);
@@ -3400,7 +3396,7 @@ ordinary `x-get-resource' doesn't take a frame argument. */)
3400 CHECK_STRING (class); 3396 CHECK_STRING (class);
3401 f = decode_live_frame (frame); 3397 f = decode_live_frame (frame);
3402 block_input (); 3398 block_input ();
3403 value = display_x_get_resource (FRAME_X_DISPLAY_INFO (f), 3399 value = display_x_get_resource (FRAME_DISPLAY_INFO (f),
3404 resource, class, Qnil, Qnil); 3400 resource, class, Qnil, Qnil);
3405 unblock_input (); 3401 unblock_input ();
3406 return value; 3402 return value;
@@ -3490,7 +3486,7 @@ DEFUN ("internal-set-lisp-face-attribute-from-resource",
3490static void 3486static void
3491x_update_menu_appearance (struct frame *f) 3487x_update_menu_appearance (struct frame *f)
3492{ 3488{
3493 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 3489 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
3494 XrmDatabase rdb; 3490 XrmDatabase rdb;
3495 3491
3496 if (dpyinfo 3492 if (dpyinfo
diff --git a/src/xfns.c b/src/xfns.c
index fa83b6faf1a..df5f0a742d9 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -153,7 +153,7 @@ check_x_display_info (Lisp_Object object)
153 struct frame *sf = XFRAME (selected_frame); 153 struct frame *sf = XFRAME (selected_frame);
154 154
155 if (FRAME_X_P (sf) && FRAME_LIVE_P (sf)) 155 if (FRAME_X_P (sf) && FRAME_LIVE_P (sf))
156 dpyinfo = FRAME_X_DISPLAY_INFO (sf); 156 dpyinfo = FRAME_DISPLAY_INFO (sf);
157 else if (x_display_list != 0) 157 else if (x_display_list != 0)
158 dpyinfo = x_display_list; 158 dpyinfo = x_display_list;
159 else 159 else
@@ -173,7 +173,7 @@ check_x_display_info (Lisp_Object object)
173 else 173 else
174 { 174 {
175 struct frame *f = decode_window_system_frame (object); 175 struct frame *f = decode_window_system_frame (object);
176 dpyinfo = FRAME_X_DISPLAY_INFO (f); 176 dpyinfo = FRAME_DISPLAY_INFO (f);
177 } 177 }
178 178
179 return dpyinfo; 179 return dpyinfo;
@@ -193,7 +193,7 @@ x_real_positions (struct frame *f, int *xptr, int *yptr)
193 Atom actual_type; 193 Atom actual_type;
194 unsigned long actual_size, bytes_remaining; 194 unsigned long actual_size, bytes_remaining;
195 int rc, actual_format; 195 int rc, actual_format;
196 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 196 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
197 long max_len = 400; 197 long max_len = 400;
198 Display *dpy = FRAME_X_DISPLAY (f); 198 Display *dpy = FRAME_X_DISPLAY (f);
199 unsigned char *tmp_data = NULL; 199 unsigned char *tmp_data = NULL;
@@ -256,7 +256,7 @@ x_real_positions (struct frame *f, int *xptr, int *yptr)
256 XTranslateCoordinates (FRAME_X_DISPLAY (f), 256 XTranslateCoordinates (FRAME_X_DISPLAY (f),
257 257
258 /* From-window, to-window. */ 258 /* From-window, to-window. */
259 FRAME_X_DISPLAY_INFO (f)->root_window, 259 FRAME_DISPLAY_INFO (f)->root_window,
260 FRAME_X_WINDOW (f), 260 FRAME_X_WINDOW (f),
261 261
262 /* From-position, to-position. */ 262 /* From-position, to-position. */
@@ -275,7 +275,7 @@ x_real_positions (struct frame *f, int *xptr, int *yptr)
275 XTranslateCoordinates (FRAME_X_DISPLAY (f), 275 XTranslateCoordinates (FRAME_X_DISPLAY (f),
276 276
277 /* From-window, to-window. */ 277 /* From-window, to-window. */
278 FRAME_X_DISPLAY_INFO (f)->root_window, 278 FRAME_DISPLAY_INFO (f)->root_window,
279 FRAME_OUTER_WINDOW (f), 279 FRAME_OUTER_WINDOW (f),
280 280
281 /* From-position, to-position. */ 281 /* From-position, to-position. */
@@ -396,7 +396,7 @@ x_decode_color (struct frame *f, Lisp_Object color_name, int mono_color)
396#endif 396#endif
397 397
398 /* Return MONO_COLOR for monochrome frames. */ 398 /* Return MONO_COLOR for monochrome frames. */
399 if (FRAME_X_DISPLAY_INFO (f)->n_planes == 1) 399 if (FRAME_DISPLAY_INFO (f)->n_planes == 1)
400 return mono_color; 400 return mono_color;
401 401
402 /* x_defined_color is responsible for coping with failures 402 /* x_defined_color is responsible for coping with failures
@@ -589,7 +589,7 @@ make_invisible_cursor (struct frame *f)
589 Cursor c = 0; 589 Cursor c = 0;
590 590
591 x_catch_errors (dpy); 591 x_catch_errors (dpy);
592 pix = XCreateBitmapFromData (dpy, FRAME_X_DISPLAY_INFO (f)->root_window, 592 pix = XCreateBitmapFromData (dpy, FRAME_DISPLAY_INFO (f)->root_window,
593 no_data, 1, 1); 593 no_data, 1, 1);
594 if (! x_had_errors_p (dpy) && pix != None) 594 if (! x_had_errors_p (dpy) && pix != None)
595 { 595 {
@@ -714,8 +714,8 @@ x_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
714 XDefineCursor (dpy, FRAME_X_WINDOW (f), 714 XDefineCursor (dpy, FRAME_X_WINDOW (f),
715 f->output_data.x->current_cursor = cursor); 715 f->output_data.x->current_cursor = cursor);
716 716
717 if (FRAME_X_DISPLAY_INFO (f)->invisible_cursor == 0) 717 if (FRAME_DISPLAY_INFO (f)->invisible_cursor == 0)
718 FRAME_X_DISPLAY_INFO (f)->invisible_cursor = make_invisible_cursor (f); 718 FRAME_DISPLAY_INFO (f)->invisible_cursor = make_invisible_cursor (f);
719 719
720 if (cursor != x->text_cursor 720 if (cursor != x->text_cursor
721 && x->text_cursor != 0) 721 && x->text_cursor != 0)
@@ -1308,7 +1308,7 @@ x_set_name_internal (struct frame *f, Lisp_Object name)
1308 text.value = x_encode_text (name, coding_system, 0, &bytes, &stringp, 1308 text.value = x_encode_text (name, coding_system, 0, &bytes, &stringp,
1309 &do_free_text_value); 1309 &do_free_text_value);
1310 text.encoding = (stringp ? XA_STRING 1310 text.encoding = (stringp ? XA_STRING
1311 : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT); 1311 : FRAME_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT);
1312 text.format = 8; 1312 text.format = 8;
1313 text.nitems = bytes; 1313 text.nitems = bytes;
1314 if (text.nitems != bytes) 1314 if (text.nitems != bytes)
@@ -1325,7 +1325,7 @@ x_set_name_internal (struct frame *f, Lisp_Object name)
1325 icon.value = x_encode_text (f->icon_name, coding_system, 0, 1325 icon.value = x_encode_text (f->icon_name, coding_system, 0,
1326 &bytes, &stringp, &do_free_icon_value); 1326 &bytes, &stringp, &do_free_icon_value);
1327 icon.encoding = (stringp ? XA_STRING 1327 icon.encoding = (stringp ? XA_STRING
1328 : FRAME_X_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT); 1328 : FRAME_DISPLAY_INFO (f)->Xatom_COMPOUND_TEXT);
1329 icon.format = 8; 1329 icon.format = 8;
1330 icon.nitems = bytes; 1330 icon.nitems = bytes;
1331 if (icon.nitems != bytes) 1331 if (icon.nitems != bytes)
@@ -1340,8 +1340,8 @@ x_set_name_internal (struct frame *f, Lisp_Object name)
1340#else /* not USE_GTK */ 1340#else /* not USE_GTK */
1341 XSetWMName (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), &text); 1341 XSetWMName (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), &text);
1342 XChangeProperty (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), 1342 XChangeProperty (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f),
1343 FRAME_X_DISPLAY_INFO (f)->Xatom_net_wm_name, 1343 FRAME_DISPLAY_INFO (f)->Xatom_net_wm_name,
1344 FRAME_X_DISPLAY_INFO (f)->Xatom_UTF8_STRING, 1344 FRAME_DISPLAY_INFO (f)->Xatom_UTF8_STRING,
1345 8, PropModeReplace, 1345 8, PropModeReplace,
1346 SDATA (encoded_name), 1346 SDATA (encoded_name),
1347 SBYTES (encoded_name)); 1347 SBYTES (encoded_name));
@@ -1349,8 +1349,8 @@ x_set_name_internal (struct frame *f, Lisp_Object name)
1349 1349
1350 XSetWMIconName (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), &icon); 1350 XSetWMIconName (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), &icon);
1351 XChangeProperty (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), 1351 XChangeProperty (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f),
1352 FRAME_X_DISPLAY_INFO (f)->Xatom_net_wm_icon_name, 1352 FRAME_DISPLAY_INFO (f)->Xatom_net_wm_icon_name,
1353 FRAME_X_DISPLAY_INFO (f)->Xatom_UTF8_STRING, 1353 FRAME_DISPLAY_INFO (f)->Xatom_UTF8_STRING,
1354 8, PropModeReplace, 1354 8, PropModeReplace,
1355 SDATA (encoded_icon_name), 1355 SDATA (encoded_icon_name),
1356 SBYTES (encoded_icon_name)); 1356 SBYTES (encoded_icon_name));
@@ -1397,10 +1397,10 @@ x_set_name (struct frame *f, Lisp_Object name, int explicit)
1397 { 1397 {
1398 /* Check for no change needed in this very common case 1398 /* Check for no change needed in this very common case
1399 before we do any consing. */ 1399 before we do any consing. */
1400 if (!strcmp (FRAME_X_DISPLAY_INFO (f)->x_id_name, 1400 if (!strcmp (FRAME_DISPLAY_INFO (f)->x_id_name,
1401 SSDATA (f->name))) 1401 SSDATA (f->name)))
1402 return; 1402 return;
1403 name = build_string (FRAME_X_DISPLAY_INFO (f)->x_id_name); 1403 name = build_string (FRAME_DISPLAY_INFO (f)->x_id_name);
1404 } 1404 }
1405 else 1405 else
1406 CHECK_STRING (name); 1406 CHECK_STRING (name);
@@ -1496,7 +1496,7 @@ x_default_scroll_bar_color_parameter (struct frame *f,
1496 const char *xprop, const char *xclass, 1496 const char *xprop, const char *xclass,
1497 int foreground_p) 1497 int foreground_p)
1498{ 1498{
1499 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 1499 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
1500 Lisp_Object tem; 1500 Lisp_Object tem;
1501 1501
1502 tem = x_get_arg (dpyinfo, alist, prop, xprop, xclass, RES_TYPE_STRING); 1502 tem = x_get_arg (dpyinfo, alist, prop, xprop, xclass, RES_TYPE_STRING);
@@ -1562,7 +1562,7 @@ hack_wm_protocols (struct frame *f, Widget widget)
1562 unsigned long bytes_after; 1562 unsigned long bytes_after;
1563 1563
1564 if ((XGetWindowProperty (dpy, w, 1564 if ((XGetWindowProperty (dpy, w,
1565 FRAME_X_DISPLAY_INFO (f)->Xatom_wm_protocols, 1565 FRAME_DISPLAY_INFO (f)->Xatom_wm_protocols,
1566 (long)0, (long)100, False, XA_ATOM, 1566 (long)0, (long)100, False, XA_ATOM,
1567 &type, &format, &nitems, &bytes_after, 1567 &type, &format, &nitems, &bytes_after,
1568 &catoms) 1568 &catoms)
@@ -1574,13 +1574,13 @@ hack_wm_protocols (struct frame *f, Widget widget)
1574 { 1574 {
1575 nitems--; 1575 nitems--;
1576 if (atoms[nitems] 1576 if (atoms[nitems]
1577 == FRAME_X_DISPLAY_INFO (f)->Xatom_wm_delete_window) 1577 == FRAME_DISPLAY_INFO (f)->Xatom_wm_delete_window)
1578 need_delete = 0; 1578 need_delete = 0;
1579 else if (atoms[nitems] 1579 else if (atoms[nitems]
1580 == FRAME_X_DISPLAY_INFO (f)->Xatom_wm_take_focus) 1580 == FRAME_DISPLAY_INFO (f)->Xatom_wm_take_focus)
1581 need_focus = 0; 1581 need_focus = 0;
1582 else if (atoms[nitems] 1582 else if (atoms[nitems]
1583 == FRAME_X_DISPLAY_INFO (f)->Xatom_wm_save_yourself) 1583 == FRAME_DISPLAY_INFO (f)->Xatom_wm_save_yourself)
1584 need_save = 0; 1584 need_save = 0;
1585 } 1585 }
1586 } 1586 }
@@ -1591,13 +1591,13 @@ hack_wm_protocols (struct frame *f, Widget widget)
1591 Atom props [10]; 1591 Atom props [10];
1592 int count = 0; 1592 int count = 0;
1593 if (need_delete) 1593 if (need_delete)
1594 props[count++] = FRAME_X_DISPLAY_INFO (f)->Xatom_wm_delete_window; 1594 props[count++] = FRAME_DISPLAY_INFO (f)->Xatom_wm_delete_window;
1595 if (need_focus) 1595 if (need_focus)
1596 props[count++] = FRAME_X_DISPLAY_INFO (f)->Xatom_wm_take_focus; 1596 props[count++] = FRAME_DISPLAY_INFO (f)->Xatom_wm_take_focus;
1597 if (need_save) 1597 if (need_save)
1598 props[count++] = FRAME_X_DISPLAY_INFO (f)->Xatom_wm_save_yourself; 1598 props[count++] = FRAME_DISPLAY_INFO (f)->Xatom_wm_save_yourself;
1599 if (count) 1599 if (count)
1600 XChangeProperty (dpy, w, FRAME_X_DISPLAY_INFO (f)->Xatom_wm_protocols, 1600 XChangeProperty (dpy, w, FRAME_DISPLAY_INFO (f)->Xatom_wm_protocols,
1601 XA_ATOM, 32, PropModeAppend, 1601 XA_ATOM, 32, PropModeAppend,
1602 (unsigned char *) props, count); 1602 (unsigned char *) props, count);
1603 } 1603 }
@@ -1792,7 +1792,7 @@ xic_create_xfontset (struct frame *f)
1792 struct frame *cf = XFRAME (frame); 1792 struct frame *cf = XFRAME (frame);
1793 1793
1794 if (cf != f && FRAME_LIVE_P (f) && FRAME_X_P (cf) 1794 if (cf != f && FRAME_LIVE_P (f) && FRAME_X_P (cf)
1795 && FRAME_X_DISPLAY_INFO (cf) == FRAME_X_DISPLAY_INFO (f) 1795 && FRAME_DISPLAY_INFO (cf) == FRAME_DISPLAY_INFO (f)
1796 && FRAME_FONT (f) 1796 && FRAME_FONT (f)
1797 && FRAME_FONT (f)->pixel_size == pixel_size) 1797 && FRAME_FONT (f)->pixel_size == pixel_size)
1798 { 1798 {
@@ -1891,7 +1891,7 @@ xic_free_xfontset (struct frame *f)
1891 { 1891 {
1892 struct frame *cf = XFRAME (frame); 1892 struct frame *cf = XFRAME (frame);
1893 if (cf != f && FRAME_LIVE_P (f) && FRAME_X_P (cf) 1893 if (cf != f && FRAME_LIVE_P (f) && FRAME_X_P (cf)
1894 && FRAME_X_DISPLAY_INFO (cf) == FRAME_X_DISPLAY_INFO (f) 1894 && FRAME_DISPLAY_INFO (cf) == FRAME_DISPLAY_INFO (f)
1895 && FRAME_XIC_FONTSET (cf) == FRAME_XIC_FONTSET (f)) 1895 && FRAME_XIC_FONTSET (cf) == FRAME_XIC_FONTSET (f))
1896 { 1896 {
1897 shared_p = 1; 1897 shared_p = 1;
@@ -2136,7 +2136,7 @@ x_window (struct frame *f, long window_prompting, int minibuffer_only)
2136 XtSetArg (al[ac], XtNmappedWhenManaged, 0); ac++; 2136 XtSetArg (al[ac], XtNmappedWhenManaged, 0); ac++;
2137 XtSetArg (al[ac], XtNborderWidth, f->border_width); ac++; 2137 XtSetArg (al[ac], XtNborderWidth, f->border_width); ac++;
2138 XtSetArg (al[ac], XtNvisual, FRAME_X_VISUAL (f)); ac++; 2138 XtSetArg (al[ac], XtNvisual, FRAME_X_VISUAL (f)); ac++;
2139 XtSetArg (al[ac], XtNdepth, FRAME_X_DISPLAY_INFO (f)->n_planes); ac++; 2139 XtSetArg (al[ac], XtNdepth, FRAME_DISPLAY_INFO (f)->n_planes); ac++;
2140 XtSetArg (al[ac], XtNcolormap, FRAME_X_COLORMAP (f)); ac++; 2140 XtSetArg (al[ac], XtNcolormap, FRAME_X_COLORMAP (f)); ac++;
2141 shell_widget = XtAppCreateShell (f->namebuf, EMACS_CLASS, 2141 shell_widget = XtAppCreateShell (f->namebuf, EMACS_CLASS,
2142 applicationShellWidgetClass, 2142 applicationShellWidgetClass,
@@ -2151,7 +2151,7 @@ x_window (struct frame *f, long window_prompting, int minibuffer_only)
2151 2151
2152 ac = 0; 2152 ac = 0;
2153 XtSetArg (al[ac], XtNvisual, FRAME_X_VISUAL (f)); ac++; 2153 XtSetArg (al[ac], XtNvisual, FRAME_X_VISUAL (f)); ac++;
2154 XtSetArg (al[ac], XtNdepth, FRAME_X_DISPLAY_INFO (f)->n_planes); ac++; 2154 XtSetArg (al[ac], XtNdepth, FRAME_DISPLAY_INFO (f)->n_planes); ac++;
2155 XtSetArg (al[ac], XtNcolormap, FRAME_X_COLORMAP (f)); ac++; 2155 XtSetArg (al[ac], XtNcolormap, FRAME_X_COLORMAP (f)); ac++;
2156 XtSetArg (al[ac], XtNborderWidth, 0); ac++; 2156 XtSetArg (al[ac], XtNborderWidth, 0); ac++;
2157 XtSetValues (pane_widget, al, ac); 2157 XtSetValues (pane_widget, al, ac);
@@ -2167,7 +2167,7 @@ x_window (struct frame *f, long window_prompting, int minibuffer_only)
2167 XtSetArg (al[ac], XtNresizeToPreferred, 1); ac++; 2167 XtSetArg (al[ac], XtNresizeToPreferred, 1); ac++;
2168 XtSetArg (al[ac], XtNemacsFrame, f); ac++; 2168 XtSetArg (al[ac], XtNemacsFrame, f); ac++;
2169 XtSetArg (al[ac], XtNvisual, FRAME_X_VISUAL (f)); ac++; 2169 XtSetArg (al[ac], XtNvisual, FRAME_X_VISUAL (f)); ac++;
2170 XtSetArg (al[ac], XtNdepth, FRAME_X_DISPLAY_INFO (f)->n_planes); ac++; 2170 XtSetArg (al[ac], XtNdepth, FRAME_DISPLAY_INFO (f)->n_planes); ac++;
2171 XtSetArg (al[ac], XtNcolormap, FRAME_X_COLORMAP (f)); ac++; 2171 XtSetArg (al[ac], XtNcolormap, FRAME_X_COLORMAP (f)); ac++;
2172 XtSetArg (al[ac], XtNborderWidth, 0); ac++; 2172 XtSetArg (al[ac], XtNborderWidth, 0); ac++;
2173 frame_widget = XtCreateWidget (f->namebuf, emacsFrameClass, pane_widget, 2173 frame_widget = XtCreateWidget (f->namebuf, emacsFrameClass, pane_widget,
@@ -2293,7 +2293,7 @@ x_window (struct frame *f, long window_prompting, int minibuffer_only)
2293 be initialized to something relevant to the time we created the window. 2293 be initialized to something relevant to the time we created the window.
2294 */ 2294 */
2295 XChangeProperty (XtDisplay (frame_widget), XtWindow (frame_widget), 2295 XChangeProperty (XtDisplay (frame_widget), XtWindow (frame_widget),
2296 FRAME_X_DISPLAY_INFO (f)->Xatom_wm_protocols, 2296 FRAME_DISPLAY_INFO (f)->Xatom_wm_protocols,
2297 XA_ATOM, 32, PropModeAppend, NULL, 0); 2297 XA_ATOM, 32, PropModeAppend, NULL, 0);
2298 2298
2299 /* Make all the standard events reach the Emacs frame. */ 2299 /* Make all the standard events reach the Emacs frame. */
@@ -2453,8 +2453,8 @@ x_window (struct frame *f)
2453 /* Request "save yourself" and "delete window" commands from wm. */ 2453 /* Request "save yourself" and "delete window" commands from wm. */
2454 { 2454 {
2455 Atom protocols[2]; 2455 Atom protocols[2];
2456 protocols[0] = FRAME_X_DISPLAY_INFO (f)->Xatom_wm_delete_window; 2456 protocols[0] = FRAME_DISPLAY_INFO (f)->Xatom_wm_delete_window;
2457 protocols[1] = FRAME_X_DISPLAY_INFO (f)->Xatom_wm_save_yourself; 2457 protocols[1] = FRAME_DISPLAY_INFO (f)->Xatom_wm_save_yourself;
2458 XSetWMProtocols (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), protocols, 2); 2458 XSetWMProtocols (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), protocols, 2);
2459 } 2459 }
2460 2460
@@ -2514,7 +2514,7 @@ x_icon (struct frame *f, Lisp_Object parms)
2514{ 2514{
2515 Lisp_Object icon_x, icon_y; 2515 Lisp_Object icon_x, icon_y;
2516#if 0 2516#if 0
2517 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 2517 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
2518#endif 2518#endif
2519 2519
2520 /* Set the position of the icon. Note that twm groups all 2520 /* Set the position of the icon. Note that twm groups all
@@ -2598,7 +2598,7 @@ x_make_gc (struct frame *f)
2598 this must be done on a per-frame basis. */ 2598 this must be done on a per-frame basis. */
2599 f->output_data.x->border_tile 2599 f->output_data.x->border_tile
2600 = (XCreatePixmapFromBitmapData 2600 = (XCreatePixmapFromBitmapData
2601 (FRAME_X_DISPLAY (f), FRAME_X_DISPLAY_INFO (f)->root_window, 2601 (FRAME_X_DISPLAY (f), FRAME_DISPLAY_INFO (f)->root_window,
2602 gray_bits, gray_width, gray_height, 2602 gray_bits, gray_width, gray_height,
2603 FRAME_FOREGROUND_PIXEL (f), 2603 FRAME_FOREGROUND_PIXEL (f),
2604 FRAME_BACKGROUND_PIXEL (f), 2604 FRAME_BACKGROUND_PIXEL (f),
@@ -2664,7 +2664,7 @@ unwind_create_frame (Lisp_Object frame)
2664 if (NILP (Fmemq (frame, Vframe_list))) 2664 if (NILP (Fmemq (frame, Vframe_list)))
2665 { 2665 {
2666#if defined GLYPH_DEBUG && defined ENABLE_CHECKING 2666#if defined GLYPH_DEBUG && defined ENABLE_CHECKING
2667 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 2667 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
2668#endif 2668#endif
2669 2669
2670 x_free_frame_resources (f); 2670 x_free_frame_resources (f);
@@ -2696,7 +2696,7 @@ unwind_create_frame_1 (Lisp_Object val)
2696static void 2696static void
2697x_default_font_parameter (struct frame *f, Lisp_Object parms) 2697x_default_font_parameter (struct frame *f, Lisp_Object parms)
2698{ 2698{
2699 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 2699 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
2700 Lisp_Object font_param = x_get_arg (dpyinfo, parms, Qfont, NULL, NULL, 2700 Lisp_Object font_param = x_get_arg (dpyinfo, parms, Qfont, NULL, NULL,
2701 RES_TYPE_STRING); 2701 RES_TYPE_STRING);
2702 Lisp_Object font = Qnil; 2702 Lisp_Object font = Qnil;
@@ -2890,9 +2890,9 @@ This function is an internal primitive--use `make-frame' instead. */)
2890 if (! STRINGP (f->icon_name)) 2890 if (! STRINGP (f->icon_name))
2891 fset_icon_name (f, Qnil); 2891 fset_icon_name (f, Qnil);
2892 2892
2893 FRAME_X_DISPLAY_INFO (f) = dpyinfo; 2893 FRAME_DISPLAY_INFO (f) = dpyinfo;
2894 2894
2895 /* With FRAME_X_DISPLAY_INFO set up, this unwind-protect is safe. */ 2895 /* With FRAME_DISPLAY_INFO set up, this unwind-protect is safe. */
2896 record_unwind_protect (do_unwind_create_frame, frame); 2896 record_unwind_protect (do_unwind_create_frame, frame);
2897 2897
2898 /* These colors will be set anyway later, but it's important 2898 /* These colors will be set anyway later, but it's important
@@ -2937,7 +2937,7 @@ This function is an internal primitive--use `make-frame' instead. */)
2937 } 2937 }
2938 else 2938 else
2939 { 2939 {
2940 f->output_data.x->parent_desc = FRAME_X_DISPLAY_INFO (f)->root_window; 2940 f->output_data.x->parent_desc = FRAME_DISPLAY_INFO (f)->root_window;
2941 f->output_data.x->explicit_parent = 0; 2941 f->output_data.x->explicit_parent = 0;
2942 } 2942 }
2943 2943
@@ -3108,7 +3108,7 @@ This function is an internal primitive--use `make-frame' instead. */)
3108 3108
3109 /* Now consider the frame official. */ 3109 /* Now consider the frame official. */
3110 f->terminal->reference_count++; 3110 f->terminal->reference_count++;
3111 FRAME_X_DISPLAY_INFO (f)->reference_count++; 3111 FRAME_DISPLAY_INFO (f)->reference_count++;
3112 Vframe_list = Fcons (frame, Vframe_list); 3112 Vframe_list = Fcons (frame, Vframe_list);
3113 3113
3114 /* We need to do this after creating the X window, so that the 3114 /* We need to do this after creating the X window, so that the
@@ -3233,7 +3233,7 @@ This function is an internal primitive--use `make-frame' instead. */)
3233Lisp_Object 3233Lisp_Object
3234x_get_focus_frame (struct frame *frame) 3234x_get_focus_frame (struct frame *frame)
3235{ 3235{
3236 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (frame); 3236 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (frame);
3237 Lisp_Object xfocus; 3237 Lisp_Object xfocus;
3238 if (! dpyinfo->x_focus_frame) 3238 if (! dpyinfo->x_focus_frame)
3239 return Qnil; 3239 return Qnil;
@@ -3761,7 +3761,7 @@ x_make_monitor_attribute_list (struct MonitorInfo *monitors,
3761 { 3761 {
3762 struct frame *f = XFRAME (frame); 3762 struct frame *f = XFRAME (frame);
3763 3763
3764 if (FRAME_X_P (f) && FRAME_X_DISPLAY_INFO (f) == dpyinfo 3764 if (FRAME_X_P (f) && FRAME_DISPLAY_INFO (f) == dpyinfo
3765 && !EQ (frame, tip_frame)) 3765 && !EQ (frame, tip_frame))
3766 { 3766 {
3767 int i = x_get_monitor_for_frame (f, monitors, n_monitors); 3767 int i = x_get_monitor_for_frame (f, monitors, n_monitors);
@@ -4041,7 +4041,7 @@ Internal use only, use `display-monitor-attributes-list' instead. */)
4041 { 4041 {
4042 struct frame *f = XFRAME (frame); 4042 struct frame *f = XFRAME (frame);
4043 4043
4044 if (FRAME_X_P (f) && FRAME_X_DISPLAY_INFO (f) == dpyinfo 4044 if (FRAME_X_P (f) && FRAME_DISPLAY_INFO (f) == dpyinfo
4045 && !EQ (frame, tip_frame)) 4045 && !EQ (frame, tip_frame))
4046 { 4046 {
4047 GdkWindow *gwin = gtk_widget_get_window (FRAME_GTK_WIDGET (f)); 4047 GdkWindow *gwin = gtk_widget_get_window (FRAME_GTK_WIDGET (f));
@@ -4542,7 +4542,7 @@ no value of TYPE (always string in the MS Windows case). */)
4542 { 4542 {
4543 CONS_TO_INTEGER (source, Window, target_window); 4543 CONS_TO_INTEGER (source, Window, target_window);
4544 if (! target_window) 4544 if (! target_window)
4545 target_window = FRAME_X_DISPLAY_INFO (f)->root_window; 4545 target_window = FRAME_DISPLAY_INFO (f)->root_window;
4546 } 4546 }
4547 4547
4548 block_input (); 4548 block_input ();
@@ -4838,8 +4838,8 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
4838 f->output_data.x->scroll_bar_bottom_shadow_pixel = -1; 4838 f->output_data.x->scroll_bar_bottom_shadow_pixel = -1;
4839#endif /* USE_TOOLKIT_SCROLL_BARS */ 4839#endif /* USE_TOOLKIT_SCROLL_BARS */
4840 fset_icon_name (f, Qnil); 4840 fset_icon_name (f, Qnil);
4841 FRAME_X_DISPLAY_INFO (f) = dpyinfo; 4841 FRAME_DISPLAY_INFO (f) = dpyinfo;
4842 f->output_data.x->parent_desc = FRAME_X_DISPLAY_INFO (f)->root_window; 4842 f->output_data.x->parent_desc = FRAME_DISPLAY_INFO (f)->root_window;
4843 f->output_data.x->explicit_parent = 0; 4843 f->output_data.x->explicit_parent = 0;
4844 4844
4845 /* These colors will be set anyway later, but it's important 4845 /* These colors will be set anyway later, but it's important
@@ -4953,14 +4953,14 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
4953 happen. */ 4953 happen. */
4954 init_frame_faces (f); 4954 init_frame_faces (f);
4955 4955
4956 f->output_data.x->parent_desc = FRAME_X_DISPLAY_INFO (f)->root_window; 4956 f->output_data.x->parent_desc = FRAME_DISPLAY_INFO (f)->root_window;
4957 4957
4958 x_figure_window_size (f, parms, 0); 4958 x_figure_window_size (f, parms, 0);
4959 4959
4960 { 4960 {
4961 XSetWindowAttributes attrs; 4961 XSetWindowAttributes attrs;
4962 unsigned long mask; 4962 unsigned long mask;
4963 Atom type = FRAME_X_DISPLAY_INFO (f)->Xatom_net_window_type_tooltip; 4963 Atom type = FRAME_DISPLAY_INFO (f)->Xatom_net_window_type_tooltip;
4964 4964
4965 block_input (); 4965 block_input ();
4966 mask = CWBackPixel | CWOverrideRedirect | CWEventMask; 4966 mask = CWBackPixel | CWOverrideRedirect | CWEventMask;
@@ -4978,7 +4978,7 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
4978 tip_window 4978 tip_window
4979 = FRAME_X_WINDOW (f) 4979 = FRAME_X_WINDOW (f)
4980 = XCreateWindow (FRAME_X_DISPLAY (f), 4980 = XCreateWindow (FRAME_X_DISPLAY (f),
4981 FRAME_X_DISPLAY_INFO (f)->root_window, 4981 FRAME_DISPLAY_INFO (f)->root_window,
4982 /* x, y, width, height */ 4982 /* x, y, width, height */
4983 0, 0, 1, 1, 4983 0, 0, 1, 1,
4984 /* Border. */ 4984 /* Border. */
@@ -4986,7 +4986,7 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
4986 CopyFromParent, InputOutput, CopyFromParent, 4986 CopyFromParent, InputOutput, CopyFromParent,
4987 mask, &attrs); 4987 mask, &attrs);
4988 XChangeProperty (FRAME_X_DISPLAY (f), tip_window, 4988 XChangeProperty (FRAME_X_DISPLAY (f), tip_window,
4989 FRAME_X_DISPLAY_INFO (f)->Xatom_net_window_type, 4989 FRAME_DISPLAY_INFO (f)->Xatom_net_window_type,
4990 XA_ATOM, 32, PropModeReplace, 4990 XA_ATOM, 32, PropModeReplace,
4991 (unsigned char *)&type, 1); 4991 (unsigned char *)&type, 1);
4992 unblock_input (); 4992 unblock_input ();
@@ -5021,10 +5021,10 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
5021 { 5021 {
5022 Lisp_Object disptype; 5022 Lisp_Object disptype;
5023 5023
5024 if (FRAME_X_DISPLAY_INFO (f)->n_planes == 1) 5024 if (FRAME_DISPLAY_INFO (f)->n_planes == 1)
5025 disptype = intern ("mono"); 5025 disptype = intern ("mono");
5026 else if (FRAME_X_DISPLAY_INFO (f)->visual->class == GrayScale 5026 else if (FRAME_DISPLAY_INFO (f)->visual->class == GrayScale
5027 || FRAME_X_DISPLAY_INFO (f)->visual->class == StaticGray) 5027 || FRAME_DISPLAY_INFO (f)->visual->class == StaticGray)
5028 disptype = intern ("grayscale"); 5028 disptype = intern ("grayscale");
5029 else 5029 else
5030 disptype = intern ("color"); 5030 disptype = intern ("color");
@@ -5058,7 +5058,7 @@ x_create_tip_frame (struct x_display_info *dpyinfo,
5058 5058
5059 /* Now that the frame will be official, it counts as a reference to 5059 /* Now that the frame will be official, it counts as a reference to
5060 its display and terminal. */ 5060 its display and terminal. */
5061 FRAME_X_DISPLAY_INFO (f)->reference_count++; 5061 FRAME_DISPLAY_INFO (f)->reference_count++;
5062 f->terminal->reference_count++; 5062 f->terminal->reference_count++;
5063 5063
5064 /* It is now ok to make the frame official even if we get an error 5064 /* It is now ok to make the frame official even if we get an error
@@ -5102,7 +5102,7 @@ compute_tip_xy (struct frame *f, Lisp_Object parms, Lisp_Object dx, Lisp_Object
5102 if (!INTEGERP (left) || !INTEGERP (top)) 5102 if (!INTEGERP (left) || !INTEGERP (top))
5103 { 5103 {
5104 block_input (); 5104 block_input ();
5105 XQueryPointer (FRAME_X_DISPLAY (f), FRAME_X_DISPLAY_INFO (f)->root_window, 5105 XQueryPointer (FRAME_X_DISPLAY (f), FRAME_DISPLAY_INFO (f)->root_window,
5106 &root, &child, root_x, root_y, &win_x, &win_y, &pmask); 5106 &root, &child, root_x, root_y, &win_x, &win_y, &pmask);
5107 unblock_input (); 5107 unblock_input ();
5108 } 5108 }
@@ -5112,7 +5112,7 @@ compute_tip_xy (struct frame *f, Lisp_Object parms, Lisp_Object dx, Lisp_Object
5112 else if (*root_y + XINT (dy) <= 0) 5112 else if (*root_y + XINT (dy) <= 0)
5113 *root_y = 0; /* Can happen for negative dy */ 5113 *root_y = 0; /* Can happen for negative dy */
5114 else if (*root_y + XINT (dy) + height 5114 else if (*root_y + XINT (dy) + height
5115 <= x_display_pixel_height (FRAME_X_DISPLAY_INFO (f))) 5115 <= x_display_pixel_height (FRAME_DISPLAY_INFO (f)))
5116 /* It fits below the pointer */ 5116 /* It fits below the pointer */
5117 *root_y += XINT (dy); 5117 *root_y += XINT (dy);
5118 else if (height + XINT (dy) <= *root_y) 5118 else if (height + XINT (dy) <= *root_y)
@@ -5127,7 +5127,7 @@ compute_tip_xy (struct frame *f, Lisp_Object parms, Lisp_Object dx, Lisp_Object
5127 else if (*root_x + XINT (dx) <= 0) 5127 else if (*root_x + XINT (dx) <= 0)
5128 *root_x = 0; /* Can happen for negative dx */ 5128 *root_x = 0; /* Can happen for negative dx */
5129 else if (*root_x + XINT (dx) + width 5129 else if (*root_x + XINT (dx) + width
5130 <= x_display_pixel_width (FRAME_X_DISPLAY_INFO (f))) 5130 <= x_display_pixel_width (FRAME_DISPLAY_INFO (f)))
5131 /* It fits to the right of the pointer. */ 5131 /* It fits to the right of the pointer. */
5132 *root_x += XINT (dx); 5132 *root_x += XINT (dx);
5133 else if (width + XINT (dx) <= *root_x) 5133 else if (width + XINT (dx) <= *root_x)
@@ -5276,7 +5276,7 @@ Text larger than the specified size is clipped. */)
5276 5276
5277 /* Create a frame for the tooltip, and record it in the global 5277 /* Create a frame for the tooltip, and record it in the global
5278 variable tip_frame. */ 5278 variable tip_frame. */
5279 frame = x_create_tip_frame (FRAME_X_DISPLAY_INFO (f), parms, string); 5279 frame = x_create_tip_frame (FRAME_DISPLAY_INFO (f), parms, string);
5280 f = XFRAME (frame); 5280 f = XFRAME (frame);
5281 5281
5282 /* Set up the frame's root window. */ 5282 /* Set up the frame's root window. */
@@ -5476,7 +5476,7 @@ Value is t if tooltip was open, nil otherwise. */)
5476 struct frame *f = SELECTED_FRAME (); 5476 struct frame *f = SELECTED_FRAME ();
5477 w = f->output_data.x->menubar_widget; 5477 w = f->output_data.x->menubar_widget;
5478 5478
5479 if (!DoesSaveUnders (FRAME_X_DISPLAY_INFO (f)->screen) 5479 if (!DoesSaveUnders (FRAME_DISPLAY_INFO (f)->screen)
5480 && w != NULL) 5480 && w != NULL)
5481 { 5481 {
5482 block_input (); 5482 block_input ();
diff --git a/src/xfont.c b/src/xfont.c
index 1aface6f972..6a675482ed9 100644
--- a/src/xfont.c
+++ b/src/xfont.c
@@ -154,7 +154,7 @@ struct font_driver xfont_driver =
154static Lisp_Object 154static Lisp_Object
155xfont_get_cache (struct frame *f) 155xfont_get_cache (struct frame *f)
156{ 156{
157 Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 157 Display_Info *dpyinfo = FRAME_DISPLAY_INFO (f);
158 158
159 return (dpyinfo->name_list_element); 159 return (dpyinfo->name_list_element);
160} 160}
@@ -488,7 +488,7 @@ xfont_list_pattern (Display *display, const char *pattern,
488static Lisp_Object 488static Lisp_Object
489xfont_list (struct frame *f, Lisp_Object spec) 489xfont_list (struct frame *f, Lisp_Object spec)
490{ 490{
491 Display *display = FRAME_X_DISPLAY_INFO (f)->display; 491 Display *display = FRAME_DISPLAY_INFO (f)->display;
492 Lisp_Object registry, list, val, extra, script; 492 Lisp_Object registry, list, val, extra, script;
493 int len; 493 int len;
494 /* Large enough to contain the longest XLFD (255 bytes) in UTF-8. */ 494 /* Large enough to contain the longest XLFD (255 bytes) in UTF-8. */
@@ -566,7 +566,7 @@ xfont_list (struct frame *f, Lisp_Object spec)
566static Lisp_Object 566static Lisp_Object
567xfont_match (struct frame *f, Lisp_Object spec) 567xfont_match (struct frame *f, Lisp_Object spec)
568{ 568{
569 Display *display = FRAME_X_DISPLAY_INFO (f)->display; 569 Display *display = FRAME_DISPLAY_INFO (f)->display;
570 Lisp_Object extra, val, entity; 570 Lisp_Object extra, val, entity;
571 char name[512]; 571 char name[512];
572 XFontStruct *xfont; 572 XFontStruct *xfont;
@@ -620,7 +620,7 @@ xfont_match (struct frame *f, Lisp_Object spec)
620static Lisp_Object 620static Lisp_Object
621xfont_list_family (struct frame *f) 621xfont_list_family (struct frame *f)
622{ 622{
623 Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 623 Display_Info *dpyinfo = FRAME_DISPLAY_INFO (f);
624 char **names; 624 char **names;
625 int num_fonts, i; 625 int num_fonts, i;
626 Lisp_Object list; 626 Lisp_Object list;
@@ -676,7 +676,7 @@ xfont_list_family (struct frame *f)
676static Lisp_Object 676static Lisp_Object
677xfont_open (struct frame *f, Lisp_Object entity, int pixel_size) 677xfont_open (struct frame *f, Lisp_Object entity, int pixel_size)
678{ 678{
679 Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 679 Display_Info *dpyinfo = FRAME_DISPLAY_INFO (f);
680 Display *display = dpyinfo->display; 680 Display *display = dpyinfo->display;
681 char name[512]; 681 char name[512];
682 int len; 682 int len;
diff --git a/src/xmenu.c b/src/xmenu.c
index 823c63bfc6f..1535b00a47f 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -498,7 +498,7 @@ If FRAME is nil or not given, use the selected frame. */)
498 memset (&ev, 0, sizeof ev); 498 memset (&ev, 0, sizeof ev);
499 ev.xbutton.display = FRAME_X_DISPLAY (f); 499 ev.xbutton.display = FRAME_X_DISPLAY (f);
500 ev.xbutton.window = XtWindow (menubar); 500 ev.xbutton.window = XtWindow (menubar);
501 ev.xbutton.root = FRAME_X_DISPLAY_INFO (f)->root_window; 501 ev.xbutton.root = FRAME_DISPLAY_INFO (f)->root_window;
502 ev.xbutton.time = XtLastTimestampProcessed (FRAME_X_DISPLAY (f)); 502 ev.xbutton.time = XtLastTimestampProcessed (FRAME_X_DISPLAY (f));
503 ev.xbutton.button = Button1; 503 ev.xbutton.button = Button1;
504 ev.xbutton.x = ev.xbutton.y = FRAME_MENUBAR_HEIGHT (f) / 2; 504 ev.xbutton.x = ev.xbutton.y = FRAME_MENUBAR_HEIGHT (f) / 2;
@@ -1367,7 +1367,7 @@ menu_position_func (GtkMenu *menu, gint *x, gint *y, gboolean *push_in, gpointer
1367{ 1367{
1368 struct next_popup_x_y *data = user_data; 1368 struct next_popup_x_y *data = user_data;
1369 GtkRequisition req; 1369 GtkRequisition req;
1370 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (data->f); 1370 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (data->f);
1371 int disp_width = x_display_pixel_width (dpyinfo); 1371 int disp_width = x_display_pixel_width (dpyinfo);
1372 int disp_height = x_display_pixel_height (dpyinfo); 1372 int disp_height = x_display_pixel_height (dpyinfo);
1373 1373
@@ -1449,7 +1449,7 @@ create_and_show_popup_menu (struct frame *f, widget_value *first_wv, int x, int
1449 if (for_click) 1449 if (for_click)
1450 { 1450 {
1451 for (i = 0; i < 5; i++) 1451 for (i = 0; i < 5; i++)
1452 if (FRAME_X_DISPLAY_INFO (f)->grabbed & (1 << i)) 1452 if (FRAME_DISPLAY_INFO (f)->grabbed & (1 << i))
1453 break; 1453 break;
1454 } 1454 }
1455 1455
@@ -1474,7 +1474,7 @@ create_and_show_popup_menu (struct frame *f, widget_value *first_wv, int x, int
1474 1474
1475 /* Must reset this manually because the button release event is not passed 1475 /* Must reset this manually because the button release event is not passed
1476 to Emacs event loop. */ 1476 to Emacs event loop. */
1477 FRAME_X_DISPLAY_INFO (f)->grabbed = 0; 1477 FRAME_DISPLAY_INFO (f)->grabbed = 0;
1478} 1478}
1479 1479
1480#else /* not USE_GTK */ 1480#else /* not USE_GTK */
@@ -1543,7 +1543,7 @@ create_and_show_popup_menu (struct frame *f, widget_value *first_wv,
1543 event->send_event = 0; 1543 event->send_event = 0;
1544 event->display = FRAME_X_DISPLAY (f); 1544 event->display = FRAME_X_DISPLAY (f);
1545 event->time = CurrentTime; 1545 event->time = CurrentTime;
1546 event->root = FRAME_X_DISPLAY_INFO (f)->root_window; 1546 event->root = FRAME_DISPLAY_INFO (f)->root_window;
1547 event->window = event->subwindow = event->root; 1547 event->window = event->subwindow = event->root;
1548 event->x = x; 1548 event->x = x;
1549 event->y = y; 1549 event->y = y;
@@ -1558,7 +1558,7 @@ create_and_show_popup_menu (struct frame *f, widget_value *first_wv,
1558 event->state = 0; 1558 event->state = 0;
1559 event->button = 0; 1559 event->button = 0;
1560 for (i = 0; i < 5; i++) 1560 for (i = 0; i < 5; i++)
1561 if (FRAME_X_DISPLAY_INFO (f)->grabbed & (1 << i)) 1561 if (FRAME_DISPLAY_INFO (f)->grabbed & (1 << i))
1562 event->button = i; 1562 event->button = i;
1563 1563
1564 /* Don't allow any geometry request from the user. */ 1564 /* Don't allow any geometry request from the user. */
@@ -1578,7 +1578,7 @@ create_and_show_popup_menu (struct frame *f, widget_value *first_wv,
1578 make_number (menu_id & ~(-1 << (fact))))); 1578 make_number (menu_id & ~(-1 << (fact)))));
1579 1579
1580 /* Process events that apply to the menu. */ 1580 /* Process events that apply to the menu. */
1581 popup_get_selection (0, FRAME_X_DISPLAY_INFO (f), menu_id, 1); 1581 popup_get_selection (0, FRAME_DISPLAY_INFO (f), menu_id, 1);
1582 1582
1583 unbind_to (specpdl_count, Qnil); 1583 unbind_to (specpdl_count, Qnil);
1584 } 1584 }
@@ -1962,7 +1962,7 @@ create_and_show_dialog (struct frame *f, widget_value *first_wv)
1962 Fcons (make_number (dialog_id >> (fact)), 1962 Fcons (make_number (dialog_id >> (fact)),
1963 make_number (dialog_id & ~(-1 << (fact))))); 1963 make_number (dialog_id & ~(-1 << (fact)))));
1964 1964
1965 popup_get_selection (0, FRAME_X_DISPLAY_INFO (f), dialog_id, 1); 1965 popup_get_selection (0, FRAME_DISPLAY_INFO (f), dialog_id, 1);
1966 1966
1967 unbind_to (count, Qnil); 1967 unbind_to (count, Qnil);
1968 } 1968 }
@@ -2218,13 +2218,13 @@ pop_down_menu (Lisp_Object arg)
2218#ifdef HAVE_X_WINDOWS 2218#ifdef HAVE_X_WINDOWS
2219 /* Assume the mouse has moved out of the X window. 2219 /* Assume the mouse has moved out of the X window.
2220 If it has actually moved in, we will get an EnterNotify. */ 2220 If it has actually moved in, we will get an EnterNotify. */
2221 x_mouse_leave (FRAME_X_DISPLAY_INFO (f)); 2221 x_mouse_leave (FRAME_DISPLAY_INFO (f));
2222 2222
2223 /* State that no mouse buttons are now held. 2223 /* State that no mouse buttons are now held.
2224 (The oldXMenu code doesn't track this info for us.) 2224 (The oldXMenu code doesn't track this info for us.)
2225 That is not necessarily true, but the fiction leads to reasonable 2225 That is not necessarily true, but the fiction leads to reasonable
2226 results, and it is a pain to ask which are actually held now. */ 2226 results, and it is a pain to ask which are actually held now. */
2227 FRAME_X_DISPLAY_INFO (f)->grabbed = 0; 2227 FRAME_DISPLAY_INFO (f)->grabbed = 0;
2228 2228
2229#endif /* HAVE_X_WINDOWS */ 2229#endif /* HAVE_X_WINDOWS */
2230 2230
diff --git a/src/xselect.c b/src/xselect.c
index e5f2e214fba..238eea50df6 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -318,7 +318,7 @@ x_own_selection (Lisp_Object selection_name, Lisp_Object selection_value,
318{ 318{
319 struct frame *f = XFRAME (frame); 319 struct frame *f = XFRAME (frame);
320 Window selecting_window = FRAME_X_WINDOW (f); 320 Window selecting_window = FRAME_X_WINDOW (f);
321 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 321 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
322 Display *display = dpyinfo->display; 322 Display *display = dpyinfo->display;
323 Time timestamp = last_event_timestamp; 323 Time timestamp = last_event_timestamp;
324 Atom selection_atom = symbol_to_x_atom (dpyinfo, selection_name); 324 Atom selection_atom = symbol_to_x_atom (dpyinfo, selection_name);
@@ -997,7 +997,7 @@ x_clear_frame_selections (struct frame *f)
997{ 997{
998 Lisp_Object frame; 998 Lisp_Object frame;
999 Lisp_Object rest; 999 Lisp_Object rest;
1000 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 1000 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
1001 struct terminal *t = dpyinfo->terminal; 1001 struct terminal *t = dpyinfo->terminal;
1002 1002
1003 XSETFRAME (frame, f); 1003 XSETFRAME (frame, f);
@@ -1185,7 +1185,7 @@ x_get_foreign_selection (Lisp_Object selection_symbol, Lisp_Object target_type,
1185 Lisp_Object time_stamp, Lisp_Object frame) 1185 Lisp_Object time_stamp, Lisp_Object frame)
1186{ 1186{
1187 struct frame *f = XFRAME (frame); 1187 struct frame *f = XFRAME (frame);
1188 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 1188 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
1189 Display *display = dpyinfo->display; 1189 Display *display = dpyinfo->display;
1190 Window requestor_window = FRAME_X_WINDOW (f); 1190 Window requestor_window = FRAME_X_WINDOW (f);
1191 Time requestor_time = last_event_timestamp; 1191 Time requestor_time = last_event_timestamp;
@@ -2009,7 +2009,7 @@ On Nextstep, TIME-STAMP and TERMINAL are unused. */)
2009 error ("X selection unavailable for this frame"); 2009 error ("X selection unavailable for this frame");
2010 2010
2011 val = x_get_local_selection (selection_symbol, target_type, 1, 2011 val = x_get_local_selection (selection_symbol, target_type, 1,
2012 FRAME_X_DISPLAY_INFO (f)); 2012 FRAME_DISPLAY_INFO (f));
2013 2013
2014 if (NILP (val) && FRAME_LIVE_P (f)) 2014 if (NILP (val) && FRAME_LIVE_P (f))
2015 { 2015 {
@@ -2056,7 +2056,7 @@ On MS-DOS, all this does is return non-nil if we own the selection. */)
2056 if (!f) 2056 if (!f)
2057 return Qnil; 2057 return Qnil;
2058 2058
2059 dpyinfo = FRAME_X_DISPLAY_INFO (f); 2059 dpyinfo = FRAME_DISPLAY_INFO (f);
2060 CHECK_SYMBOL (selection); 2060 CHECK_SYMBOL (selection);
2061 2061
2062 /* Don't disown the selection when we're not the owner. */ 2062 /* Don't disown the selection when we're not the owner. */
@@ -2108,7 +2108,7 @@ On Nextstep, TERMINAL is unused. */)
2108 if (EQ (selection, Qnil)) selection = QPRIMARY; 2108 if (EQ (selection, Qnil)) selection = QPRIMARY;
2109 if (EQ (selection, Qt)) selection = QSECONDARY; 2109 if (EQ (selection, Qt)) selection = QSECONDARY;
2110 2110
2111 if (f && !NILP (LOCAL_SELECTION (selection, FRAME_X_DISPLAY_INFO (f)))) 2111 if (f && !NILP (LOCAL_SELECTION (selection, FRAME_DISPLAY_INFO (f))))
2112 return Qt; 2112 return Qt;
2113 else 2113 else
2114 return Qnil; 2114 return Qnil;
@@ -2141,7 +2141,7 @@ On Nextstep, TERMINAL is unused. */)
2141 if (!f) 2141 if (!f)
2142 return Qnil; 2142 return Qnil;
2143 2143
2144 dpyinfo = FRAME_X_DISPLAY_INFO (f); 2144 dpyinfo = FRAME_DISPLAY_INFO (f);
2145 2145
2146 if (!NILP (LOCAL_SELECTION (selection, dpyinfo))) 2146 if (!NILP (LOCAL_SELECTION (selection, dpyinfo)))
2147 return Qt; 2147 return Qt;
@@ -2162,7 +2162,7 @@ static Lisp_Object
2162x_clipboard_manager_save (Lisp_Object frame) 2162x_clipboard_manager_save (Lisp_Object frame)
2163{ 2163{
2164 struct frame *f = XFRAME (frame); 2164 struct frame *f = XFRAME (frame);
2165 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 2165 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
2166 Atom data = dpyinfo->Xatom_UTF8_STRING; 2166 Atom data = dpyinfo->Xatom_UTF8_STRING;
2167 2167
2168 XChangeProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 2168 XChangeProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
@@ -2212,7 +2212,7 @@ x_clipboard_manager_save_frame (Lisp_Object frame)
2212 && (f = XFRAME (frame), FRAME_X_P (f)) 2212 && (f = XFRAME (frame), FRAME_X_P (f))
2213 && FRAME_LIVE_P (f)) 2213 && FRAME_LIVE_P (f))
2214 { 2214 {
2215 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 2215 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
2216 Lisp_Object local_selection 2216 Lisp_Object local_selection
2217 = LOCAL_SELECTION (QCLIPBOARD, dpyinfo); 2217 = LOCAL_SELECTION (QCLIPBOARD, dpyinfo);
2218 2218
@@ -2458,7 +2458,7 @@ FRAME is on. If FRAME is nil, the selected frame is used. */)
2458 Atom x_atom; 2458 Atom x_atom;
2459 struct frame *f = decode_window_system_frame (frame); 2459 struct frame *f = decode_window_system_frame (frame);
2460 ptrdiff_t i; 2460 ptrdiff_t i;
2461 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 2461 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
2462 2462
2463 2463
2464 if (SYMBOLP (atom)) 2464 if (SYMBOLP (atom))
diff --git a/src/xterm.c b/src/xterm.c
index ef800461185..60c2ecd1448 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -412,7 +412,7 @@ x_find_topmost_parent (struct frame *f)
412 Window win = None, wi = x->parent_desc; 412 Window win = None, wi = x->parent_desc;
413 Display *dpy = FRAME_X_DISPLAY (f); 413 Display *dpy = FRAME_X_DISPLAY (f);
414 414
415 while (wi != FRAME_X_DISPLAY_INFO (f)->root_window) 415 while (wi != FRAME_DISPLAY_INFO (f)->root_window)
416 { 416 {
417 Window root; 417 Window root;
418 Window *children; 418 Window *children;
@@ -431,7 +431,7 @@ x_find_topmost_parent (struct frame *f)
431void 431void
432x_set_frame_alpha (struct frame *f) 432x_set_frame_alpha (struct frame *f)
433{ 433{
434 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 434 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
435 Display *dpy = FRAME_X_DISPLAY (f); 435 Display *dpy = FRAME_X_DISPLAY (f);
436 Window win = FRAME_OUTER_WINDOW (f); 436 Window win = FRAME_OUTER_WINDOW (f);
437 double alpha = 1.0; 437 double alpha = 1.0;
@@ -788,7 +788,7 @@ x_draw_fringe_bitmap (struct window *w, struct glyph_row *row, struct draw_fring
788 if (p->overlay_p) 788 if (p->overlay_p)
789 { 789 {
790 clipmask = XCreatePixmapFromBitmapData (display, 790 clipmask = XCreatePixmapFromBitmapData (display,
791 FRAME_X_DISPLAY_INFO (f)->root_window, 791 FRAME_DISPLAY_INFO (f)->root_window,
792 bits, p->wd, p->h, 792 bits, p->wd, p->h,
793 1, 0, 1); 793 1, 0, 1);
794 gcv.clip_mask = clipmask; 794 gcv.clip_mask = clipmask;
@@ -892,14 +892,14 @@ x_set_cursor_gc (struct glyph_string *s)
892 xgcv.graphics_exposures = False; 892 xgcv.graphics_exposures = False;
893 mask = GCForeground | GCBackground | GCGraphicsExposures; 893 mask = GCForeground | GCBackground | GCGraphicsExposures;
894 894
895 if (FRAME_X_DISPLAY_INFO (s->f)->scratch_cursor_gc) 895 if (FRAME_DISPLAY_INFO (s->f)->scratch_cursor_gc)
896 XChangeGC (s->display, FRAME_X_DISPLAY_INFO (s->f)->scratch_cursor_gc, 896 XChangeGC (s->display, FRAME_DISPLAY_INFO (s->f)->scratch_cursor_gc,
897 mask, &xgcv); 897 mask, &xgcv);
898 else 898 else
899 FRAME_X_DISPLAY_INFO (s->f)->scratch_cursor_gc 899 FRAME_DISPLAY_INFO (s->f)->scratch_cursor_gc
900 = XCreateGC (s->display, s->window, mask, &xgcv); 900 = XCreateGC (s->display, s->window, mask, &xgcv);
901 901
902 s->gc = FRAME_X_DISPLAY_INFO (s->f)->scratch_cursor_gc; 902 s->gc = FRAME_DISPLAY_INFO (s->f)->scratch_cursor_gc;
903 } 903 }
904} 904}
905 905
@@ -939,14 +939,14 @@ x_set_mouse_face_gc (struct glyph_string *s)
939 xgcv.graphics_exposures = False; 939 xgcv.graphics_exposures = False;
940 mask = GCForeground | GCBackground | GCGraphicsExposures; 940 mask = GCForeground | GCBackground | GCGraphicsExposures;
941 941
942 if (FRAME_X_DISPLAY_INFO (s->f)->scratch_cursor_gc) 942 if (FRAME_DISPLAY_INFO (s->f)->scratch_cursor_gc)
943 XChangeGC (s->display, FRAME_X_DISPLAY_INFO (s->f)->scratch_cursor_gc, 943 XChangeGC (s->display, FRAME_DISPLAY_INFO (s->f)->scratch_cursor_gc,
944 mask, &xgcv); 944 mask, &xgcv);
945 else 945 else
946 FRAME_X_DISPLAY_INFO (s->f)->scratch_cursor_gc 946 FRAME_DISPLAY_INFO (s->f)->scratch_cursor_gc
947 = XCreateGC (s->display, s->window, mask, &xgcv); 947 = XCreateGC (s->display, s->window, mask, &xgcv);
948 948
949 s->gc = FRAME_X_DISPLAY_INFO (s->f)->scratch_cursor_gc; 949 s->gc = FRAME_DISPLAY_INFO (s->f)->scratch_cursor_gc;
950 950
951 } 951 }
952 eassert (s->gc != 0); 952 eassert (s->gc != 0);
@@ -1382,7 +1382,7 @@ x_frame_of_widget (Widget widget)
1382 f = XFRAME (frame); 1382 f = XFRAME (frame);
1383 if (FRAME_X_P (f) 1383 if (FRAME_X_P (f)
1384 && f->output_data.nothing != 1 1384 && f->output_data.nothing != 1
1385 && FRAME_X_DISPLAY_INFO (f) == dpyinfo 1385 && FRAME_DISPLAY_INFO (f) == dpyinfo
1386 && f->output_data.x->widget == widget) 1386 && f->output_data.x->widget == widget)
1387 return f; 1387 return f;
1388 } 1388 }
@@ -1591,7 +1591,7 @@ x_color_cells (Display *dpy, int *ncells)
1591void 1591void
1592x_query_colors (struct frame *f, XColor *colors, int ncolors) 1592x_query_colors (struct frame *f, XColor *colors, int ncolors)
1593{ 1593{
1594 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 1594 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
1595 1595
1596 if (dpyinfo->color_cells) 1596 if (dpyinfo->color_cells)
1597 { 1597 {
@@ -1831,7 +1831,7 @@ x_setup_relief_color (struct frame *f, struct relief *relief, double factor, int
1831 unsigned long pixel; 1831 unsigned long pixel;
1832 unsigned long background = di->relief_background; 1832 unsigned long background = di->relief_background;
1833 Colormap cmap = FRAME_X_COLORMAP (f); 1833 Colormap cmap = FRAME_X_COLORMAP (f);
1834 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 1834 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
1835 Display *dpy = FRAME_X_DISPLAY (f); 1835 Display *dpy = FRAME_X_DISPLAY (f);
1836 1836
1837 xgcv.graphics_exposures = False; 1837 xgcv.graphics_exposures = False;
@@ -3132,9 +3132,9 @@ XTtoggle_invisible_pointer (struct frame *f, int invisible)
3132 block_input (); 3132 block_input ();
3133 if (invisible) 3133 if (invisible)
3134 { 3134 {
3135 if (FRAME_X_DISPLAY_INFO (f)->invisible_cursor != 0) 3135 if (FRAME_DISPLAY_INFO (f)->invisible_cursor != 0)
3136 XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 3136 XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
3137 FRAME_X_DISPLAY_INFO (f)->invisible_cursor); 3137 FRAME_DISPLAY_INFO (f)->invisible_cursor);
3138 } 3138 }
3139 else 3139 else
3140 XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 3140 XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
@@ -3404,7 +3404,7 @@ x_window_to_frame (struct x_display_info *dpyinfo, int wdesc)
3404 FOR_EACH_FRAME (tail, frame) 3404 FOR_EACH_FRAME (tail, frame)
3405 { 3405 {
3406 f = XFRAME (frame); 3406 f = XFRAME (frame);
3407 if (!FRAME_X_P (f) || FRAME_X_DISPLAY_INFO (f) != dpyinfo) 3407 if (!FRAME_X_P (f) || FRAME_DISPLAY_INFO (f) != dpyinfo)
3408 continue; 3408 continue;
3409 if (f->output_data.x->hourglass_window == wdesc) 3409 if (f->output_data.x->hourglass_window == wdesc)
3410 return f; 3410 return f;
@@ -3454,7 +3454,7 @@ x_any_window_to_frame (struct x_display_info *dpyinfo, int wdesc)
3454 if (found) 3454 if (found)
3455 break; 3455 break;
3456 f = XFRAME (frame); 3456 f = XFRAME (frame);
3457 if (FRAME_X_P (f) && FRAME_X_DISPLAY_INFO (f) == dpyinfo) 3457 if (FRAME_X_P (f) && FRAME_DISPLAY_INFO (f) == dpyinfo)
3458 { 3458 {
3459 /* This frame matches if the window is any of its widgets. */ 3459 /* This frame matches if the window is any of its widgets. */
3460 x = f->output_data.x; 3460 x = f->output_data.x;
@@ -3502,7 +3502,7 @@ x_menubar_window_to_frame (struct x_display_info *dpyinfo, XEvent *event)
3502 FOR_EACH_FRAME (tail, frame) 3502 FOR_EACH_FRAME (tail, frame)
3503 { 3503 {
3504 f = XFRAME (frame); 3504 f = XFRAME (frame);
3505 if (!FRAME_X_P (f) || FRAME_X_DISPLAY_INFO (f) != dpyinfo) 3505 if (!FRAME_X_P (f) || FRAME_DISPLAY_INFO (f) != dpyinfo)
3506 continue; 3506 continue;
3507 x = f->output_data.x; 3507 x = f->output_data.x;
3508#ifdef USE_GTK 3508#ifdef USE_GTK
@@ -3534,7 +3534,7 @@ x_top_window_to_frame (struct x_display_info *dpyinfo, int wdesc)
3534 FOR_EACH_FRAME (tail, frame) 3534 FOR_EACH_FRAME (tail, frame)
3535 { 3535 {
3536 f = XFRAME (frame); 3536 f = XFRAME (frame);
3537 if (!FRAME_X_P (f) || FRAME_X_DISPLAY_INFO (f) != dpyinfo) 3537 if (!FRAME_X_P (f) || FRAME_DISPLAY_INFO (f) != dpyinfo)
3538 continue; 3538 continue;
3539 x = f->output_data.x; 3539 x = f->output_data.x;
3540 3540
@@ -3637,7 +3637,7 @@ x_mouse_leave (struct x_display_info *dpyinfo)
3637static void 3637static void
3638XTframe_rehighlight (struct frame *frame) 3638XTframe_rehighlight (struct frame *frame)
3639{ 3639{
3640 x_frame_rehighlight (FRAME_X_DISPLAY_INFO (frame)); 3640 x_frame_rehighlight (FRAME_DISPLAY_INFO (frame));
3641} 3641}
3642 3642
3643static void 3643static void
@@ -3870,7 +3870,7 @@ construct_mouse_click (struct input_event *result, XButtonEvent *event, struct f
3870 result->kind = MOUSE_CLICK_EVENT; 3870 result->kind = MOUSE_CLICK_EVENT;
3871 result->code = event->button - Button1; 3871 result->code = event->button - Button1;
3872 result->timestamp = event->time; 3872 result->timestamp = event->time;
3873 result->modifiers = (x_x_to_emacs_modifiers (FRAME_X_DISPLAY_INFO (f), 3873 result->modifiers = (x_x_to_emacs_modifiers (FRAME_DISPLAY_INFO (f),
3874 event->state) 3874 event->state)
3875 | (event->type == ButtonRelease 3875 | (event->type == ButtonRelease
3876 ? up_modifier 3876 ? up_modifier
@@ -4035,7 +4035,7 @@ XTmouse_position (struct frame **fp, int insist, Lisp_Object *bar_window,
4035 4035
4036 x_catch_errors (FRAME_X_DISPLAY (*fp)); 4036 x_catch_errors (FRAME_X_DISPLAY (*fp));
4037 4037
4038 if (FRAME_X_DISPLAY_INFO (*fp)->grabbed && last_mouse_frame 4038 if (FRAME_DISPLAY_INFO (*fp)->grabbed && last_mouse_frame
4039 && FRAME_LIVE_P (last_mouse_frame)) 4039 && FRAME_LIVE_P (last_mouse_frame))
4040 { 4040 {
4041 /* If mouse was grabbed on a frame, give coords for that frame 4041 /* If mouse was grabbed on a frame, give coords for that frame
@@ -4074,7 +4074,7 @@ XTmouse_position (struct frame **fp, int insist, Lisp_Object *bar_window,
4074 want the edit window. For non-Gtk+ the innermost 4074 want the edit window. For non-Gtk+ the innermost
4075 window is the edit window. For Gtk+ it might not 4075 window is the edit window. For Gtk+ it might not
4076 be. It might be the tool bar for example. */ 4076 be. It might be the tool bar for example. */
4077 if (x_window_to_frame (FRAME_X_DISPLAY_INFO (*fp), win)) 4077 if (x_window_to_frame (FRAME_DISPLAY_INFO (*fp), win))
4078 break; 4078 break;
4079#endif 4079#endif
4080 win = child; 4080 win = child;
@@ -4096,10 +4096,10 @@ XTmouse_position (struct frame **fp, int insist, Lisp_Object *bar_window,
4096#ifdef USE_GTK 4096#ifdef USE_GTK
4097 /* We don't wan't to know the innermost window. We 4097 /* We don't wan't to know the innermost window. We
4098 want the edit window. */ 4098 want the edit window. */
4099 f1 = x_window_to_frame (FRAME_X_DISPLAY_INFO (*fp), win); 4099 f1 = x_window_to_frame (FRAME_DISPLAY_INFO (*fp), win);
4100#else 4100#else
4101 /* Is win one of our frames? */ 4101 /* Is win one of our frames? */
4102 f1 = x_any_window_to_frame (FRAME_X_DISPLAY_INFO (*fp), win); 4102 f1 = x_any_window_to_frame (FRAME_DISPLAY_INFO (*fp), win);
4103#endif 4103#endif
4104 4104
4105#ifdef USE_X_TOOLKIT 4105#ifdef USE_X_TOOLKIT
@@ -4341,7 +4341,7 @@ x_send_scroll_bar_event (Lisp_Object window, int part, int portion, int whole)
4341 4341
4342 /* Construct a ClientMessage event to send to the frame. */ 4342 /* Construct a ClientMessage event to send to the frame. */
4343 ev->type = ClientMessage; 4343 ev->type = ClientMessage;
4344 ev->message_type = FRAME_X_DISPLAY_INFO (f)->Xatom_Scrollbar; 4344 ev->message_type = FRAME_DISPLAY_INFO (f)->Xatom_Scrollbar;
4345 ev->display = FRAME_X_DISPLAY (f); 4345 ev->display = FRAME_X_DISPLAY (f);
4346 ev->window = FRAME_X_WINDOW (f); 4346 ev->window = FRAME_X_WINDOW (f);
4347 ev->format = 32; 4347 ev->format = 32;
@@ -4522,8 +4522,8 @@ xg_scroll_callback (GtkRange *range,
4522 { 4522 {
4523 case GTK_SCROLL_JUMP: 4523 case GTK_SCROLL_JUMP:
4524 /* Buttons 1 2 or 3 must be grabbed. */ 4524 /* Buttons 1 2 or 3 must be grabbed. */
4525 if (FRAME_X_DISPLAY_INFO (f)->grabbed != 0 4525 if (FRAME_DISPLAY_INFO (f)->grabbed != 0
4526 && FRAME_X_DISPLAY_INFO (f)->grabbed < (1 << 4)) 4526 && FRAME_DISPLAY_INFO (f)->grabbed < (1 << 4))
4527 { 4527 {
4528 part = scroll_bar_handle; 4528 part = scroll_bar_handle;
4529 whole = gtk_adjustment_get_upper (adj) - 4529 whole = gtk_adjustment_get_upper (adj) -
@@ -5042,7 +5042,7 @@ x_scroll_bar_create (struct window *w, int top, int left, int width, int height)
5042 a.event_mask = (ButtonPressMask | ButtonReleaseMask 5042 a.event_mask = (ButtonPressMask | ButtonReleaseMask
5043 | ButtonMotionMask | PointerMotionHintMask 5043 | ButtonMotionMask | PointerMotionHintMask
5044 | ExposureMask); 5044 | ExposureMask);
5045 a.cursor = FRAME_X_DISPLAY_INFO (f)->vertical_scroll_bar_cursor; 5045 a.cursor = FRAME_DISPLAY_INFO (f)->vertical_scroll_bar_cursor;
5046 5046
5047 mask = (CWBackPixel | CWEventMask | CWCursor); 5047 mask = (CWBackPixel | CWEventMask | CWCursor);
5048 5048
@@ -5615,7 +5615,7 @@ x_scroll_bar_handle_click (struct scroll_bar *bar, XEvent *event, struct input_e
5615 emacs_event->kind = SCROLL_BAR_CLICK_EVENT; 5615 emacs_event->kind = SCROLL_BAR_CLICK_EVENT;
5616 emacs_event->code = event->xbutton.button - Button1; 5616 emacs_event->code = event->xbutton.button - Button1;
5617 emacs_event->modifiers 5617 emacs_event->modifiers
5618 = (x_x_to_emacs_modifiers (FRAME_X_DISPLAY_INFO 5618 = (x_x_to_emacs_modifiers (FRAME_DISPLAY_INFO
5619 (XFRAME (WINDOW_FRAME (XWINDOW (bar->window)))), 5619 (XFRAME (WINDOW_FRAME (XWINDOW (bar->window)))),
5620 event->xbutton.state) 5620 event->xbutton.state)
5621 | (event->type == ButtonRelease 5621 | (event->type == ButtonRelease
@@ -6227,8 +6227,8 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr,
6227 f->top_pos = y; 6227 f->top_pos = y;
6228 6228
6229 /* Perhaps reparented due to a WM restart. Reset this. */ 6229 /* Perhaps reparented due to a WM restart. Reset this. */
6230 FRAME_X_DISPLAY_INFO (f)->wm_type = X_WMTYPE_UNKNOWN; 6230 FRAME_DISPLAY_INFO (f)->wm_type = X_WMTYPE_UNKNOWN;
6231 FRAME_X_DISPLAY_INFO (f)->net_supported_window = 0; 6231 FRAME_DISPLAY_INFO (f)->net_supported_window = 0;
6232 6232
6233 x_set_frame_alpha (f); 6233 x_set_frame_alpha (f);
6234 } 6234 }
@@ -6462,7 +6462,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr,
6462#endif 6462#endif
6463 6463
6464 event.xkey.state 6464 event.xkey.state
6465 |= x_emacs_to_x_modifiers (FRAME_X_DISPLAY_INFO (f), 6465 |= x_emacs_to_x_modifiers (FRAME_DISPLAY_INFO (f),
6466 extra_keyboard_modifiers); 6466 extra_keyboard_modifiers);
6467 modifiers = event.xkey.state; 6467 modifiers = event.xkey.state;
6468 6468
@@ -6536,7 +6536,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr,
6536 /* Common for all keysym input events. */ 6536 /* Common for all keysym input events. */
6537 XSETFRAME (inev.ie.frame_or_window, f); 6537 XSETFRAME (inev.ie.frame_or_window, f);
6538 inev.ie.modifiers 6538 inev.ie.modifiers
6539 = x_x_to_emacs_modifiers (FRAME_X_DISPLAY_INFO (f), modifiers); 6539 = x_x_to_emacs_modifiers (FRAME_DISPLAY_INFO (f), modifiers);
6540 inev.ie.timestamp = event.xkey.time; 6540 inev.ie.timestamp = event.xkey.time;
6541 6541
6542 /* First deal with keysyms which have defined 6542 /* First deal with keysyms which have defined
@@ -7312,7 +7312,7 @@ static void
7312x_draw_hollow_cursor (struct window *w, struct glyph_row *row) 7312x_draw_hollow_cursor (struct window *w, struct glyph_row *row)
7313{ 7313{
7314 struct frame *f = XFRAME (WINDOW_FRAME (w)); 7314 struct frame *f = XFRAME (WINDOW_FRAME (w));
7315 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 7315 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
7316 Display *dpy = FRAME_X_DISPLAY (f); 7316 Display *dpy = FRAME_X_DISPLAY (f);
7317 int x, y, wd, h; 7317 int x, y, wd, h;
7318 XGCValues xgcv; 7318 XGCValues xgcv;
@@ -7379,7 +7379,7 @@ x_draw_bar_cursor (struct window *w, struct glyph_row *row, int width, enum text
7379 { 7379 {
7380 Display *dpy = FRAME_X_DISPLAY (f); 7380 Display *dpy = FRAME_X_DISPLAY (f);
7381 Window window = FRAME_X_WINDOW (f); 7381 Window window = FRAME_X_WINDOW (f);
7382 GC gc = FRAME_X_DISPLAY_INFO (f)->scratch_cursor_gc; 7382 GC gc = FRAME_DISPLAY_INFO (f)->scratch_cursor_gc;
7383 unsigned long mask = GCForeground | GCBackground | GCGraphicsExposures; 7383 unsigned long mask = GCForeground | GCBackground | GCGraphicsExposures;
7384 struct face *face = FACE_FROM_ID (f, cursor_glyph->face_id); 7384 struct face *face = FACE_FROM_ID (f, cursor_glyph->face_id);
7385 XGCValues xgcv; 7385 XGCValues xgcv;
@@ -7400,7 +7400,7 @@ x_draw_bar_cursor (struct window *w, struct glyph_row *row, int width, enum text
7400 else 7400 else
7401 { 7401 {
7402 gc = XCreateGC (dpy, window, mask, &xgcv); 7402 gc = XCreateGC (dpy, window, mask, &xgcv);
7403 FRAME_X_DISPLAY_INFO (f)->scratch_cursor_gc = gc; 7403 FRAME_DISPLAY_INFO (f)->scratch_cursor_gc = gc;
7404 } 7404 }
7405 7405
7406 x_clip_to_row (w, row, TEXT_AREA, gc); 7406 x_clip_to_row (w, row, TEXT_AREA, gc);
@@ -7567,7 +7567,7 @@ x_bitmap_icon (struct frame *f, Lisp_Object file)
7567 else 7567 else
7568 { 7568 {
7569 /* Create the GNU bitmap and mask if necessary. */ 7569 /* Create the GNU bitmap and mask if necessary. */
7570 if (FRAME_X_DISPLAY_INFO (f)->icon_bitmap_id < 0) 7570 if (FRAME_DISPLAY_INFO (f)->icon_bitmap_id < 0)
7571 { 7571 {
7572 ptrdiff_t rc = -1; 7572 ptrdiff_t rc = -1;
7573 7573
@@ -7581,7 +7581,7 @@ x_bitmap_icon (struct frame *f, Lisp_Object file)
7581 7581
7582 rc = x_create_bitmap_from_xpm_data (f, gnu_xpm_bits); 7582 rc = x_create_bitmap_from_xpm_data (f, gnu_xpm_bits);
7583 if (rc != -1) 7583 if (rc != -1)
7584 FRAME_X_DISPLAY_INFO (f)->icon_bitmap_id = rc; 7584 FRAME_DISPLAY_INFO (f)->icon_bitmap_id = rc;
7585 7585
7586#endif 7586#endif
7587 7587
@@ -7593,8 +7593,8 @@ x_bitmap_icon (struct frame *f, Lisp_Object file)
7593 if (rc == -1) 7593 if (rc == -1)
7594 return 1; 7594 return 1;
7595 7595
7596 FRAME_X_DISPLAY_INFO (f)->icon_bitmap_id = rc; 7596 FRAME_DISPLAY_INFO (f)->icon_bitmap_id = rc;
7597 x_create_bitmap_mask (f, FRAME_X_DISPLAY_INFO (f)->icon_bitmap_id); 7597 x_create_bitmap_mask (f, FRAME_DISPLAY_INFO (f)->icon_bitmap_id);
7598 } 7598 }
7599 } 7599 }
7600 7600
@@ -7602,9 +7602,9 @@ x_bitmap_icon (struct frame *f, Lisp_Object file)
7602 this increments the ref-count one extra time. 7602 this increments the ref-count one extra time.
7603 As a result, the GNU bitmap and mask are never freed. 7603 As a result, the GNU bitmap and mask are never freed.
7604 That way, we don't have to worry about allocating it again. */ 7604 That way, we don't have to worry about allocating it again. */
7605 x_reference_bitmap (f, FRAME_X_DISPLAY_INFO (f)->icon_bitmap_id); 7605 x_reference_bitmap (f, FRAME_DISPLAY_INFO (f)->icon_bitmap_id);
7606 7606
7607 bitmap_id = FRAME_X_DISPLAY_INFO (f)->icon_bitmap_id; 7607 bitmap_id = FRAME_DISPLAY_INFO (f)->icon_bitmap_id;
7608 } 7608 }
7609 7609
7610 x_wm_set_icon_pixmap (f, bitmap_id); 7610 x_wm_set_icon_pixmap (f, bitmap_id);
@@ -7818,7 +7818,7 @@ x_connection_closed (Display *dpy, const char *error_message)
7818 if (FRAME_X_P (XFRAME (frame)) 7818 if (FRAME_X_P (XFRAME (frame))
7819 && FRAME_X_P (XFRAME (minibuf_frame)) 7819 && FRAME_X_P (XFRAME (minibuf_frame))
7820 && ! EQ (frame, minibuf_frame) 7820 && ! EQ (frame, minibuf_frame)
7821 && FRAME_X_DISPLAY_INFO (XFRAME (minibuf_frame)) == dpyinfo) 7821 && FRAME_DISPLAY_INFO (XFRAME (minibuf_frame)) == dpyinfo)
7822 delete_frame (frame, Qnoelisp); 7822 delete_frame (frame, Qnoelisp);
7823 } 7823 }
7824 7824
@@ -7827,7 +7827,7 @@ x_connection_closed (Display *dpy, const char *error_message)
7827 for another frame that we need to delete. */ 7827 for another frame that we need to delete. */
7828 FOR_EACH_FRAME (tail, frame) 7828 FOR_EACH_FRAME (tail, frame)
7829 if (FRAME_X_P (XFRAME (frame)) 7829 if (FRAME_X_P (XFRAME (frame))
7830 && FRAME_X_DISPLAY_INFO (XFRAME (frame)) == dpyinfo) 7830 && FRAME_DISPLAY_INFO (XFRAME (frame)) == dpyinfo)
7831 { 7831 {
7832 /* Set this to t so that delete_frame won't get confused 7832 /* Set this to t so that delete_frame won't get confused
7833 trying to find a replacement. */ 7833 trying to find a replacement. */
@@ -8050,7 +8050,7 @@ xim_destroy_callback (XIM xim, XPointer client_data, XPointer call_data)
8050 FOR_EACH_FRAME (tail, frame) 8050 FOR_EACH_FRAME (tail, frame)
8051 { 8051 {
8052 struct frame *f = XFRAME (frame); 8052 struct frame *f = XFRAME (frame);
8053 if (FRAME_X_P (f) && FRAME_X_DISPLAY_INFO (f) == dpyinfo) 8053 if (FRAME_X_P (f) && FRAME_DISPLAY_INFO (f) == dpyinfo)
8054 { 8054 {
8055 FRAME_XIC (f) = NULL; 8055 FRAME_XIC (f) = NULL;
8056 xic_free_xfontset (f); 8056 xic_free_xfontset (f);
@@ -8141,7 +8141,7 @@ xim_instantiate_callback (Display *display, XPointer client_data, XPointer call_
8141 struct frame *f = XFRAME (frame); 8141 struct frame *f = XFRAME (frame);
8142 8142
8143 if (FRAME_X_P (f) 8143 if (FRAME_X_P (f)
8144 && FRAME_X_DISPLAY_INFO (f) == xim_inst->dpyinfo) 8144 && FRAME_DISPLAY_INFO (f) == xim_inst->dpyinfo)
8145 if (FRAME_XIC (f) == NULL) 8145 if (FRAME_XIC (f) == NULL)
8146 { 8146 {
8147 create_frame_xic (f); 8147 create_frame_xic (f);
@@ -8239,7 +8239,7 @@ x_calc_absolute_position (struct frame *f)
8239 /* Treat negative positions as relative to the leftmost bottommost 8239 /* Treat negative positions as relative to the leftmost bottommost
8240 position that fits on the screen. */ 8240 position that fits on the screen. */
8241 if (flags & XNegative) 8241 if (flags & XNegative)
8242 f->left_pos = x_display_pixel_width (FRAME_X_DISPLAY_INFO (f)) 8242 f->left_pos = x_display_pixel_width (FRAME_DISPLAY_INFO (f))
8243 - FRAME_PIXEL_WIDTH (f) + f->left_pos; 8243 - FRAME_PIXEL_WIDTH (f) + f->left_pos;
8244 8244
8245 { 8245 {
@@ -8262,7 +8262,7 @@ x_calc_absolute_position (struct frame *f)
8262#endif 8262#endif
8263 8263
8264 if (flags & YNegative) 8264 if (flags & YNegative)
8265 f->top_pos = x_display_pixel_height (FRAME_X_DISPLAY_INFO (f)) 8265 f->top_pos = x_display_pixel_height (FRAME_DISPLAY_INFO (f))
8266 - height + f->top_pos; 8266 - height + f->top_pos;
8267 } 8267 }
8268 8268
@@ -8302,7 +8302,7 @@ x_set_offset (struct frame *f, register int xoff, register int yoff, int change_
8302 modified_left = f->left_pos; 8302 modified_left = f->left_pos;
8303 modified_top = f->top_pos; 8303 modified_top = f->top_pos;
8304 8304
8305 if (change_gravity != 0 && FRAME_X_DISPLAY_INFO (f)->wm_type == X_WMTYPE_A) 8305 if (change_gravity != 0 && FRAME_DISPLAY_INFO (f)->wm_type == X_WMTYPE_A)
8306 { 8306 {
8307 /* Some WMs (twm, wmaker at least) has an offset that is smaller 8307 /* Some WMs (twm, wmaker at least) has an offset that is smaller
8308 than the WM decorations. So we use the calculated offset instead 8308 than the WM decorations. So we use the calculated offset instead
@@ -8315,7 +8315,7 @@ x_set_offset (struct frame *f, register int xoff, register int yoff, int change_
8315 modified_left, modified_top); 8315 modified_left, modified_top);
8316 8316
8317 x_sync_with_move (f, f->left_pos, f->top_pos, 8317 x_sync_with_move (f, f->left_pos, f->top_pos,
8318 FRAME_X_DISPLAY_INFO (f)->wm_type == X_WMTYPE_UNKNOWN 8318 FRAME_DISPLAY_INFO (f)->wm_type == X_WMTYPE_UNKNOWN
8319 ? 1 : 0); 8319 ? 1 : 0);
8320 8320
8321 /* change_gravity is non-zero when this function is called from Lisp to 8321 /* change_gravity is non-zero when this function is called from Lisp to
@@ -8329,8 +8329,8 @@ x_set_offset (struct frame *f, register int xoff, register int yoff, int change_
8329 need to compute the top/left offset adjustment for this frame. */ 8329 need to compute the top/left offset adjustment for this frame. */
8330 8330
8331 if (change_gravity != 0 && 8331 if (change_gravity != 0 &&
8332 (FRAME_X_DISPLAY_INFO (f)->wm_type == X_WMTYPE_UNKNOWN 8332 (FRAME_DISPLAY_INFO (f)->wm_type == X_WMTYPE_UNKNOWN
8333 || (FRAME_X_DISPLAY_INFO (f)->wm_type == X_WMTYPE_A 8333 || (FRAME_DISPLAY_INFO (f)->wm_type == X_WMTYPE_A
8334 && (FRAME_X_OUTPUT (f)->move_offset_left == 0 8334 && (FRAME_X_OUTPUT (f)->move_offset_left == 0
8335 && FRAME_X_OUTPUT (f)->move_offset_top == 0)))) 8335 && FRAME_X_OUTPUT (f)->move_offset_top == 0))))
8336 x_check_expected_move (f, modified_left, modified_top); 8336 x_check_expected_move (f, modified_left, modified_top);
@@ -8351,7 +8351,7 @@ wm_supports (struct frame *f, Atom want_atom)
8351 unsigned long actual_size, bytes_remaining; 8351 unsigned long actual_size, bytes_remaining;
8352 int i, rc, actual_format; 8352 int i, rc, actual_format;
8353 Window wmcheck_window; 8353 Window wmcheck_window;
8354 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 8354 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
8355 Window target_window = dpyinfo->root_window; 8355 Window target_window = dpyinfo->root_window;
8356 long max_len = 65536; 8356 long max_len = 65536;
8357 Display *dpy = FRAME_X_DISPLAY (f); 8357 Display *dpy = FRAME_X_DISPLAY (f);
@@ -8432,7 +8432,7 @@ wm_supports (struct frame *f, Atom want_atom)
8432static void 8432static void
8433set_wm_state (Lisp_Object frame, int add, Atom atom, Atom value) 8433set_wm_state (Lisp_Object frame, int add, Atom atom, Atom value)
8434{ 8434{
8435 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (XFRAME (frame)); 8435 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (XFRAME (frame));
8436 8436
8437 x_send_client_event (frame, make_number (0), frame, 8437 x_send_client_event (frame, make_number (0), frame,
8438 dpyinfo->Xatom_net_wm_state, 8438 dpyinfo->Xatom_net_wm_state,
@@ -8451,7 +8451,7 @@ void
8451x_set_sticky (struct frame *f, Lisp_Object new_value, Lisp_Object old_value) 8451x_set_sticky (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
8452{ 8452{
8453 Lisp_Object frame; 8453 Lisp_Object frame;
8454 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 8454 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
8455 8455
8456 XSETFRAME (frame, f); 8456 XSETFRAME (frame, f);
8457 8457
@@ -8474,7 +8474,7 @@ get_current_wm_state (struct frame *f,
8474 Atom actual_type; 8474 Atom actual_type;
8475 unsigned long actual_size, bytes_remaining; 8475 unsigned long actual_size, bytes_remaining;
8476 int i, rc, actual_format, is_hidden = 0; 8476 int i, rc, actual_format, is_hidden = 0;
8477 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 8477 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
8478 long max_len = 65536; 8478 long max_len = 65536;
8479 Display *dpy = FRAME_X_DISPLAY (f); 8479 Display *dpy = FRAME_X_DISPLAY (f);
8480 unsigned char *tmp_data = NULL; 8480 unsigned char *tmp_data = NULL;
@@ -8538,7 +8538,7 @@ get_current_wm_state (struct frame *f,
8538static int 8538static int
8539do_ewmh_fullscreen (struct frame *f) 8539do_ewmh_fullscreen (struct frame *f)
8540{ 8540{
8541 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 8541 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
8542 int have_net_atom = wm_supports (f, dpyinfo->Xatom_net_wm_state); 8542 int have_net_atom = wm_supports (f, dpyinfo->Xatom_net_wm_state);
8543 int cur, dummy; 8543 int cur, dummy;
8544 8544
@@ -8656,7 +8656,7 @@ x_check_fullscreen (struct frame *f)
8656 if (do_ewmh_fullscreen (f)) 8656 if (do_ewmh_fullscreen (f))
8657 return; 8657 return;
8658 8658
8659 if (f->output_data.x->parent_desc != FRAME_X_DISPLAY_INFO (f)->root_window) 8659 if (f->output_data.x->parent_desc != FRAME_DISPLAY_INFO (f)->root_window)
8660 return; /* Only fullscreen without WM or with EWM hints (above). */ 8660 return; /* Only fullscreen without WM or with EWM hints (above). */
8661 8661
8662 /* Setting fullscreen to nil doesn't do anything. We could save the 8662 /* Setting fullscreen to nil doesn't do anything. We could save the
@@ -8666,7 +8666,7 @@ x_check_fullscreen (struct frame *f)
8666 if (f->want_fullscreen != FULLSCREEN_NONE) 8666 if (f->want_fullscreen != FULLSCREEN_NONE)
8667 { 8667 {
8668 int width = FRAME_PIXEL_WIDTH (f), height = FRAME_PIXEL_HEIGHT (f); 8668 int width = FRAME_PIXEL_WIDTH (f), height = FRAME_PIXEL_HEIGHT (f);
8669 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 8669 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
8670 8670
8671 switch (f->want_fullscreen) 8671 switch (f->want_fullscreen)
8672 { 8672 {
@@ -8713,7 +8713,7 @@ x_check_expected_move (struct frame *f, int expected_left, int expected_top)
8713 int adjusted_left; 8713 int adjusted_left;
8714 int adjusted_top; 8714 int adjusted_top;
8715 8715
8716 FRAME_X_DISPLAY_INFO (f)->wm_type = X_WMTYPE_A; 8716 FRAME_DISPLAY_INFO (f)->wm_type = X_WMTYPE_A;
8717 FRAME_X_OUTPUT (f)->move_offset_left = expected_left - current_left; 8717 FRAME_X_OUTPUT (f)->move_offset_left = expected_left - current_left;
8718 FRAME_X_OUTPUT (f)->move_offset_top = expected_top - current_top; 8718 FRAME_X_OUTPUT (f)->move_offset_top = expected_top - current_top;
8719 8719
@@ -8731,7 +8731,7 @@ x_check_expected_move (struct frame *f, int expected_left, int expected_top)
8731 /* It's a "Type B" window manager. We don't have to adjust the 8731 /* It's a "Type B" window manager. We don't have to adjust the
8732 frame's position. */ 8732 frame's position. */
8733 8733
8734 FRAME_X_DISPLAY_INFO (f)->wm_type = X_WMTYPE_B; 8734 FRAME_DISPLAY_INFO (f)->wm_type = X_WMTYPE_B;
8735} 8735}
8736 8736
8737 8737
@@ -9023,7 +9023,7 @@ x_ewmh_activate_frame (struct frame *f)
9023 /* See Window Manager Specification/Extended Window Manager Hints at 9023 /* See Window Manager Specification/Extended Window Manager Hints at
9024 http://freedesktop.org/wiki/Specifications/wm-spec */ 9024 http://freedesktop.org/wiki/Specifications/wm-spec */
9025 9025
9026 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 9026 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
9027 9027
9028 if (FRAME_VISIBLE_P (f) && wm_supports (f, dpyinfo->Xatom_net_active_window)) 9028 if (FRAME_VISIBLE_P (f) && wm_supports (f, dpyinfo->Xatom_net_active_window))
9029 { 9029 {
@@ -9057,7 +9057,7 @@ static void
9057xembed_set_info (struct frame *f, enum xembed_info flags) 9057xembed_set_info (struct frame *f, enum xembed_info flags)
9058{ 9058{
9059 unsigned long data[2]; 9059 unsigned long data[2];
9060 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 9060 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
9061 9061
9062 data[0] = XEMBED_VERSION; 9062 data[0] = XEMBED_VERSION;
9063 data[1] = flags; 9063 data[1] = flags;
@@ -9076,7 +9076,7 @@ xembed_send_message (struct frame *f, Time t, enum xembed_message msg,
9076 9076
9077 event.xclient.type = ClientMessage; 9077 event.xclient.type = ClientMessage;
9078 event.xclient.window = FRAME_X_OUTPUT (f)->parent_desc; 9078 event.xclient.window = FRAME_X_OUTPUT (f)->parent_desc;
9079 event.xclient.message_type = FRAME_X_DISPLAY_INFO (f)->Xatom_XEMBED; 9079 event.xclient.message_type = FRAME_DISPLAY_INFO (f)->Xatom_XEMBED;
9080 event.xclient.format = 32; 9080 event.xclient.format = 32;
9081 event.xclient.data.l[0] = t; 9081 event.xclient.data.l[0] = t;
9082 event.xclient.data.l[1] = msg; 9082 event.xclient.data.l[1] = msg;
@@ -9266,8 +9266,8 @@ x_make_frame_invisible (struct frame *f)
9266 window = FRAME_OUTER_WINDOW (f); 9266 window = FRAME_OUTER_WINDOW (f);
9267 9267
9268 /* Don't keep the highlight on an invisible frame. */ 9268 /* Don't keep the highlight on an invisible frame. */
9269 if (FRAME_X_DISPLAY_INFO (f)->x_highlight_frame == f) 9269 if (FRAME_DISPLAY_INFO (f)->x_highlight_frame == f)
9270 FRAME_X_DISPLAY_INFO (f)->x_highlight_frame = 0; 9270 FRAME_DISPLAY_INFO (f)->x_highlight_frame = 0;
9271 9271
9272 block_input (); 9272 block_input ();
9273 9273
@@ -9321,8 +9321,8 @@ x_iconify_frame (struct frame *f)
9321 Lisp_Object type; 9321 Lisp_Object type;
9322 9322
9323 /* Don't keep the highlight on an invisible frame. */ 9323 /* Don't keep the highlight on an invisible frame. */
9324 if (FRAME_X_DISPLAY_INFO (f)->x_highlight_frame == f) 9324 if (FRAME_DISPLAY_INFO (f)->x_highlight_frame == f)
9325 FRAME_X_DISPLAY_INFO (f)->x_highlight_frame = 0; 9325 FRAME_DISPLAY_INFO (f)->x_highlight_frame = 0;
9326 9326
9327 if (FRAME_ICONIFIED_P (f)) 9327 if (FRAME_ICONIFIED_P (f))
9328 return; 9328 return;
@@ -9397,7 +9397,7 @@ x_iconify_frame (struct frame *f)
9397 9397
9398 msg.xclient.window = FRAME_X_WINDOW (f); 9398 msg.xclient.window = FRAME_X_WINDOW (f);
9399 msg.xclient.type = ClientMessage; 9399 msg.xclient.type = ClientMessage;
9400 msg.xclient.message_type = FRAME_X_DISPLAY_INFO (f)->Xatom_wm_change_state; 9400 msg.xclient.message_type = FRAME_DISPLAY_INFO (f)->Xatom_wm_change_state;
9401 msg.xclient.format = 32; 9401 msg.xclient.format = 32;
9402 msg.xclient.data.l[0] = IconicState; 9402 msg.xclient.data.l[0] = IconicState;
9403 9403
@@ -9436,7 +9436,7 @@ x_iconify_frame (struct frame *f)
9436void 9436void
9437x_free_frame_resources (struct frame *f) 9437x_free_frame_resources (struct frame *f)
9438{ 9438{
9439 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 9439 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
9440 Mouse_HLInfo *hlinfo = &dpyinfo->mouse_highlight; 9440 Mouse_HLInfo *hlinfo = &dpyinfo->mouse_highlight;
9441#ifdef USE_X_TOOLKIT 9441#ifdef USE_X_TOOLKIT
9442 Lisp_Object bar; 9442 Lisp_Object bar;
@@ -9559,7 +9559,7 @@ x_free_frame_resources (struct frame *f)
9559static void 9559static void
9560x_destroy_window (struct frame *f) 9560x_destroy_window (struct frame *f)
9561{ 9561{
9562 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 9562 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
9563 9563
9564 /* If a display connection is dead, don't try sending more 9564 /* If a display connection is dead, don't try sending more
9565 commands to the X server. */ 9565 commands to the X server. */
@@ -9605,9 +9605,9 @@ x_wm_set_size_hint (struct frame *f, long flags, bool user_position)
9605 9605
9606 size_hints.width_inc = FRAME_COLUMN_WIDTH (f); 9606 size_hints.width_inc = FRAME_COLUMN_WIDTH (f);
9607 size_hints.height_inc = FRAME_LINE_HEIGHT (f); 9607 size_hints.height_inc = FRAME_LINE_HEIGHT (f);
9608 size_hints.max_width = x_display_pixel_width (FRAME_X_DISPLAY_INFO (f)) 9608 size_hints.max_width = x_display_pixel_width (FRAME_DISPLAY_INFO (f))
9609 - FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, 0); 9609 - FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, 0);
9610 size_hints.max_height = x_display_pixel_height (FRAME_X_DISPLAY_INFO (f)) 9610 size_hints.max_height = x_display_pixel_height (FRAME_DISPLAY_INFO (f))
9611 - FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, 0); 9611 - FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, 0);
9612 9612
9613 /* Calculate the base and minimum sizes. */ 9613 /* Calculate the base and minimum sizes. */
diff --git a/src/xterm.h b/src/xterm.h
index 2f29667684d..3c091b7afcd 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -700,20 +700,20 @@ enum
700#define FRAME_BASELINE_OFFSET(f) ((f)->output_data.x->baseline_offset) 700#define FRAME_BASELINE_OFFSET(f) ((f)->output_data.x->baseline_offset)
701 701
702/* This gives the x_display_info structure for the display F is on. */ 702/* This gives the x_display_info structure for the display F is on. */
703#define FRAME_X_DISPLAY_INFO(f) ((f)->output_data.x->display_info) 703#define FRAME_DISPLAY_INFO(f) ((f)->output_data.x->display_info)
704 704
705/* This is the `Display *' which frame F is on. */ 705/* This is the `Display *' which frame F is on. */
706#define FRAME_X_DISPLAY(f) (FRAME_X_DISPLAY_INFO (f)->display) 706#define FRAME_X_DISPLAY(f) (FRAME_DISPLAY_INFO (f)->display)
707 707
708/* This is the `Screen *' which frame F is on. */ 708/* This is the `Screen *' which frame F is on. */
709#define FRAME_X_SCREEN(f) (FRAME_X_DISPLAY_INFO (f)->screen) 709#define FRAME_X_SCREEN(f) (FRAME_DISPLAY_INFO (f)->screen)
710#define FRAME_X_SCREEN_NUMBER(f) XScreenNumberOfScreen (FRAME_X_SCREEN (f)) 710#define FRAME_X_SCREEN_NUMBER(f) XScreenNumberOfScreen (FRAME_X_SCREEN (f))
711 711
712/* This is the Visual which frame F is on. */ 712/* This is the Visual which frame F is on. */
713#define FRAME_X_VISUAL(f) FRAME_X_DISPLAY_INFO (f)->visual 713#define FRAME_X_VISUAL(f) FRAME_DISPLAY_INFO (f)->visual
714 714
715/* This is the Colormap which frame F uses. */ 715/* This is the Colormap which frame F uses. */
716#define FRAME_X_COLORMAP(f) FRAME_X_DISPLAY_INFO (f)->cmap 716#define FRAME_X_COLORMAP(f) FRAME_DISPLAY_INFO (f)->cmap
717 717
718/* The difference in pixels between the top left corner of the 718/* The difference in pixels between the top left corner of the
719 Emacs window (including possible window manager decorations) 719 Emacs window (including possible window manager decorations)
@@ -726,20 +726,20 @@ enum
726 726
727 727
728#define FRAME_XIC(f) ((f)->output_data.x->xic) 728#define FRAME_XIC(f) ((f)->output_data.x->xic)
729#define FRAME_X_XIM(f) (FRAME_X_DISPLAY_INFO (f)->xim) 729#define FRAME_X_XIM(f) (FRAME_DISPLAY_INFO (f)->xim)
730#define FRAME_X_XIM_STYLES(f) (FRAME_X_DISPLAY_INFO (f)->xim_styles) 730#define FRAME_X_XIM_STYLES(f) (FRAME_DISPLAY_INFO (f)->xim_styles)
731#define FRAME_XIC_STYLE(f) ((f)->output_data.x->xic_style) 731#define FRAME_XIC_STYLE(f) ((f)->output_data.x->xic_style)
732#define FRAME_XIC_FONTSET(f) ((f)->output_data.x->xic_xfs) 732#define FRAME_XIC_FONTSET(f) ((f)->output_data.x->xic_xfs)
733 733
734/* Value is the smallest width of any character in any font on frame F. */ 734/* Value is the smallest width of any character in any font on frame F. */
735 735
736#define FRAME_SMALLEST_CHAR_WIDTH(F) \ 736#define FRAME_SMALLEST_CHAR_WIDTH(F) \
737 FRAME_X_DISPLAY_INFO(F)->smallest_char_width 737 FRAME_DISPLAY_INFO(F)->smallest_char_width
738 738
739/* Value is the smallest height of any font on frame F. */ 739/* Value is the smallest height of any font on frame F. */
740 740
741#define FRAME_SMALLEST_FONT_HEIGHT(F) \ 741#define FRAME_SMALLEST_FONT_HEIGHT(F) \
742 FRAME_X_DISPLAY_INFO(F)->smallest_font_height 742 FRAME_DISPLAY_INFO(F)->smallest_font_height
743 743
744/* X-specific scroll bar stuff. */ 744/* X-specific scroll bar stuff. */
745 745