aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Verona2013-09-13 17:11:02 +0200
committerJoakim Verona2013-09-13 17:11:02 +0200
commitfda7ba7c422a8d5a5827e33bb1c800778790955f (patch)
tree74a7f099ea80bbaca3a6ce7e7d6cddb651c5dc07
parent9de87b9a2f98b8f7b24b3a7b7cb1dfda7c562bf1 (diff)
parentaad3612f9eb7280bd4db8ee697186e75b1e82765 (diff)
downloademacs-fda7ba7c422a8d5a5827e33bb1c800778790955f.tar.gz
emacs-fda7ba7c422a8d5a5827e33bb1c800778790955f.zip
merge from trunk
-rw-r--r--lisp/ChangeLog8
-rw-r--r--lisp/ls-lisp.el23
-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
30 files changed, 367 insertions, 370 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 93156233ee1..649e3a3b01c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,11 @@
12013-09-13 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * ls-lisp.el: Use advice-add.
4 (original-insert-directory): Remove.
5 (ls-lisp--insert-directory): Rename from insert-directory; add
6 `orig-fun' argument.
7 (insert-directory): Advise.
8
12013-09-13 Eli Zaretskii <eliz@gnu.org> 92013-09-13 Eli Zaretskii <eliz@gnu.org>
2 10
3 * term.el (term-emulate-terminal): Decode the command string 11 * term.el (term-emulate-terminal): Decode the command string
diff --git a/lisp/ls-lisp.el b/lisp/ls-lisp.el
index 82a78545d62..9ffbd2ccf56 100644
--- a/lisp/ls-lisp.el
+++ b/lisp/ls-lisp.el
@@ -198,9 +198,6 @@ to fail to line up, e.g. if month names are not all of the same length."
198 :type 'boolean 198 :type 'boolean
199 :group 'ls-lisp) 199 :group 'ls-lisp)
200 200
201(defvar original-insert-directory nil
202 "This holds the original function definition of `insert-directory'.")
203
204(defvar ls-lisp-uid-d-fmt "-%d" 201(defvar ls-lisp-uid-d-fmt "-%d"
205 "Format to display integer UIDs.") 202 "Format to display integer UIDs.")
206(defvar ls-lisp-uid-s-fmt "-%s" 203(defvar ls-lisp-uid-s-fmt "-%s"
@@ -213,15 +210,10 @@ to fail to line up, e.g. if month names are not all of the same length."
213 "Format to display integer file sizes.") 210 "Format to display integer file sizes.")
214(defvar ls-lisp-filesize-f-fmt "%.0f" 211(defvar ls-lisp-filesize-f-fmt "%.0f"
215 "Format to display float file sizes.") 212 "Format to display float file sizes.")
216
217;; Remember the original insert-directory function
218(or (featurep 'ls-lisp) ; FJW: unless this file is being reloaded!
219 (setq original-insert-directory (symbol-function 'insert-directory)))
220
221 213
222;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 214;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
223 215
224(defun insert-directory (file switches &optional wildcard full-directory-p) 216(defun ls-lisp--insert-directory (orig-fun file switches &optional wildcard full-directory-p)
225 "Insert directory listing for FILE, formatted according to SWITCHES. 217 "Insert directory listing for FILE, formatted according to SWITCHES.
226Leaves point after the inserted text. 218Leaves point after the inserted text.
227SWITCHES may be a string of options, or a list of strings. 219SWITCHES may be a string of options, or a list of strings.
@@ -231,12 +223,10 @@ switches do not contain `d', so that a full listing is expected.
231 223
232This version of the function comes from `ls-lisp.el'. 224This version of the function comes from `ls-lisp.el'.
233If the value of `ls-lisp-use-insert-directory-program' is non-nil then 225If the value of `ls-lisp-use-insert-directory-program' is non-nil then
234it works exactly like the version from `files.el' and runs a directory 226this advice just delegates the work to ORIG-FUN (the normal `insert-directory'
235listing program whose name is in the variable 227function from `files.el').
236`insert-directory-program'; if also WILDCARD is non-nil then it runs 228But if the value of `ls-lisp-use-insert-directory-program' is nil
237the shell specified by `shell-file-name'. If the value of 229then it runs a Lisp emulation.
238`ls-lisp-use-insert-directory-program' is nil then it runs a Lisp
239emulation.
240 230
241The Lisp emulation does not run any external programs or shells. It 231The Lisp emulation does not run any external programs or shells. It
242supports ordinary shell wildcards if `ls-lisp-support-shell-wildcards' 232supports ordinary shell wildcards if `ls-lisp-support-shell-wildcards'
@@ -245,7 +235,7 @@ to match file names. It does not support all `ls' switches -- those
245that work are: A a B C c F G g h i n R r S s t U u X. The l switch 235that work are: A a B C c F G g h i n R r S s t U u X. The l switch
246is assumed to be always present and cannot be turned off." 236is assumed to be always present and cannot be turned off."
247 (if ls-lisp-use-insert-directory-program 237 (if ls-lisp-use-insert-directory-program
248 (funcall original-insert-directory 238 (funcall orig-fun
249 file switches wildcard full-directory-p) 239 file switches wildcard full-directory-p)
250 ;; We need the directory in order to find the right handler. 240 ;; We need the directory in order to find the right handler.
251 (let ((handler (find-file-name-handler (expand-file-name file) 241 (let ((handler (find-file-name-handler (expand-file-name file)
@@ -305,6 +295,7 @@ is assumed to be always present and cannot be turned off."
305 (replace-match "total used in directory") 295 (replace-match "total used in directory")
306 (end-of-line) 296 (end-of-line)
307 (insert " available " available))))))))) 297 (insert " available " available)))))))))
298(advice-add 'insert-directory :around #'ls-lisp--insert-directory)
308 299
309(defun ls-lisp-insert-directory 300(defun ls-lisp-insert-directory
310 (file switches time-index wildcard-regexp full-directory-p) 301 (file switches time-index wildcard-regexp full-directory-p)
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 67bf15bddd1..28b132b5fbf 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -12331,7 +12331,7 @@ note_tool_bar_highlight (struct frame *f, int x, int y)
12331{ 12331{
12332 Lisp_Object window = f->tool_bar_window; 12332 Lisp_Object window = f->tool_bar_window;
12333 struct window *w = XWINDOW (window); 12333 struct window *w = XWINDOW (window);
12334 Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 12334 Display_Info *dpyinfo = FRAME_DISPLAY_INFO (f);
12335 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f); 12335 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (f);
12336 int hpos, vpos; 12336 int hpos, vpos;
12337 struct glyph *glyph; 12337 struct glyph *glyph;
@@ -26252,7 +26252,7 @@ get_window_cursor_type (struct window *w, struct glyph *glyph, int *width,
26252 26252
26253 /* Detect a nonselected window or nonselected frame. */ 26253 /* Detect a nonselected window or nonselected frame. */
26254 else if (w != XWINDOW (f->selected_window) 26254 else if (w != XWINDOW (f->selected_window)
26255 || f != FRAME_X_DISPLAY_INFO (f)->x_highlight_frame) 26255 || f != FRAME_DISPLAY_INFO (f)->x_highlight_frame)
26256 { 26256 {
26257 *active_cursor = 0; 26257 *active_cursor = 0;
26258 26258
@@ -27912,7 +27912,7 @@ define_frame_cursor1 (struct frame *f, Cursor cursor, Lisp_Object pointer)
27912 cursor = FRAME_X_OUTPUT (f)->horizontal_drag_cursor; 27912 cursor = FRAME_X_OUTPUT (f)->horizontal_drag_cursor;
27913#ifdef HAVE_X_WINDOWS 27913#ifdef HAVE_X_WINDOWS
27914 else if (EQ (pointer, intern ("vdrag"))) 27914 else if (EQ (pointer, intern ("vdrag")))
27915 cursor = FRAME_X_DISPLAY_INFO (f)->vertical_scroll_bar_cursor; 27915 cursor = FRAME_DISPLAY_INFO (f)->vertical_scroll_bar_cursor;
27916#endif 27916#endif
27917 else if (EQ (pointer, intern ("hourglass"))) 27917 else if (EQ (pointer, intern ("hourglass")))
27918 cursor = FRAME_X_OUTPUT (f)->hourglass_cursor; 27918 cursor = FRAME_X_OUTPUT (f)->hourglass_cursor;
@@ -28075,7 +28075,7 @@ note_mode_line_or_margin_highlight (Lisp_Object window, int x, int y,
28075 /* Change the mouse pointer according to what is under it. */ 28075 /* Change the mouse pointer according to what is under it. */
28076 if (FRAME_WINDOW_P (f)) 28076 if (FRAME_WINDOW_P (f))
28077 { 28077 {
28078 dpyinfo = FRAME_X_DISPLAY_INFO (f); 28078 dpyinfo = FRAME_DISPLAY_INFO (f);
28079 if (STRINGP (string)) 28079 if (STRINGP (string))
28080 { 28080 {
28081 cursor = FRAME_X_OUTPUT (f)->nontext_cursor; 28081 cursor = FRAME_X_OUTPUT (f)->nontext_cursor;
@@ -28097,7 +28097,7 @@ note_mode_line_or_margin_highlight (Lisp_Object window, int x, int y,
28097 } 28097 }
28098 else 28098 else
28099 /* Default mode-line pointer. */ 28099 /* Default mode-line pointer. */
28100 cursor = FRAME_X_DISPLAY_INFO (f)->vertical_scroll_bar_cursor; 28100 cursor = FRAME_DISPLAY_INFO (f)->vertical_scroll_bar_cursor;
28101 } 28101 }
28102#endif 28102#endif
28103 } 28103 }
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 52a2809ffbb..45155bc2a65 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -415,7 +415,7 @@ x_find_topmost_parent (struct frame *f)
415 Window win = None, wi = x->parent_desc; 415 Window win = None, wi = x->parent_desc;
416 Display *dpy = FRAME_X_DISPLAY (f); 416 Display *dpy = FRAME_X_DISPLAY (f);
417 417
418 while (wi != FRAME_X_DISPLAY_INFO (f)->root_window) 418 while (wi != FRAME_DISPLAY_INFO (f)->root_window)
419 { 419 {
420 Window root; 420 Window root;
421 Window *children; 421 Window *children;
@@ -434,7 +434,7 @@ x_find_topmost_parent (struct frame *f)
434void 434void
435x_set_frame_alpha (struct frame *f) 435x_set_frame_alpha (struct frame *f)
436{ 436{
437 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 437 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
438 Display *dpy = FRAME_X_DISPLAY (f); 438 Display *dpy = FRAME_X_DISPLAY (f);
439 Window win = FRAME_OUTER_WINDOW (f); 439 Window win = FRAME_OUTER_WINDOW (f);
440 double alpha = 1.0; 440 double alpha = 1.0;
@@ -791,7 +791,7 @@ x_draw_fringe_bitmap (struct window *w, struct glyph_row *row, struct draw_fring
791 if (p->overlay_p) 791 if (p->overlay_p)
792 { 792 {
793 clipmask = XCreatePixmapFromBitmapData (display, 793 clipmask = XCreatePixmapFromBitmapData (display,
794 FRAME_X_DISPLAY_INFO (f)->root_window, 794 FRAME_DISPLAY_INFO (f)->root_window,
795 bits, p->wd, p->h, 795 bits, p->wd, p->h,
796 1, 0, 1); 796 1, 0, 1);
797 gcv.clip_mask = clipmask; 797 gcv.clip_mask = clipmask;
@@ -895,14 +895,14 @@ x_set_cursor_gc (struct glyph_string *s)
895 xgcv.graphics_exposures = False; 895 xgcv.graphics_exposures = False;
896 mask = GCForeground | GCBackground | GCGraphicsExposures; 896 mask = GCForeground | GCBackground | GCGraphicsExposures;
897 897
898 if (FRAME_X_DISPLAY_INFO (s->f)->scratch_cursor_gc) 898 if (FRAME_DISPLAY_INFO (s->f)->scratch_cursor_gc)
899 XChangeGC (s->display, FRAME_X_DISPLAY_INFO (s->f)->scratch_cursor_gc, 899 XChangeGC (s->display, FRAME_DISPLAY_INFO (s->f)->scratch_cursor_gc,
900 mask, &xgcv); 900 mask, &xgcv);
901 else 901 else
902 FRAME_X_DISPLAY_INFO (s->f)->scratch_cursor_gc 902 FRAME_DISPLAY_INFO (s->f)->scratch_cursor_gc
903 = XCreateGC (s->display, s->window, mask, &xgcv); 903 = XCreateGC (s->display, s->window, mask, &xgcv);
904 904
905 s->gc = FRAME_X_DISPLAY_INFO (s->f)->scratch_cursor_gc; 905 s->gc = FRAME_DISPLAY_INFO (s->f)->scratch_cursor_gc;
906 } 906 }
907} 907}
908 908
@@ -942,14 +942,14 @@ x_set_mouse_face_gc (struct glyph_string *s)
942 xgcv.graphics_exposures = False; 942 xgcv.graphics_exposures = False;
943 mask = GCForeground | GCBackground | GCGraphicsExposures; 943 mask = GCForeground | GCBackground | GCGraphicsExposures;
944 944
945 if (FRAME_X_DISPLAY_INFO (s->f)->scratch_cursor_gc) 945 if (FRAME_DISPLAY_INFO (s->f)->scratch_cursor_gc)
946 XChangeGC (s->display, FRAME_X_DISPLAY_INFO (s->f)->scratch_cursor_gc, 946 XChangeGC (s->display, FRAME_DISPLAY_INFO (s->f)->scratch_cursor_gc,
947 mask, &xgcv); 947 mask, &xgcv);
948 else 948 else
949 FRAME_X_DISPLAY_INFO (s->f)->scratch_cursor_gc 949 FRAME_DISPLAY_INFO (s->f)->scratch_cursor_gc
950 = XCreateGC (s->display, s->window, mask, &xgcv); 950 = XCreateGC (s->display, s->window, mask, &xgcv);
951 951
952 s->gc = FRAME_X_DISPLAY_INFO (s->f)->scratch_cursor_gc; 952 s->gc = FRAME_DISPLAY_INFO (s->f)->scratch_cursor_gc;
953 953
954 } 954 }
955 eassert (s->gc != 0); 955 eassert (s->gc != 0);
@@ -1385,7 +1385,7 @@ x_frame_of_widget (Widget widget)
1385 f = XFRAME (frame); 1385 f = XFRAME (frame);
1386 if (FRAME_X_P (f) 1386 if (FRAME_X_P (f)
1387 && f->output_data.nothing != 1 1387 && f->output_data.nothing != 1
1388 && FRAME_X_DISPLAY_INFO (f) == dpyinfo 1388 && FRAME_DISPLAY_INFO (f) == dpyinfo
1389 && f->output_data.x->widget == widget) 1389 && f->output_data.x->widget == widget)
1390 return f; 1390 return f;
1391 } 1391 }
@@ -1594,7 +1594,7 @@ x_color_cells (Display *dpy, int *ncells)
1594void 1594void
1595x_query_colors (struct frame *f, XColor *colors, int ncolors) 1595x_query_colors (struct frame *f, XColor *colors, int ncolors)
1596{ 1596{
1597 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 1597 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
1598 1598
1599 if (dpyinfo->color_cells) 1599 if (dpyinfo->color_cells)
1600 { 1600 {
@@ -1834,7 +1834,7 @@ x_setup_relief_color (struct frame *f, struct relief *relief, double factor, int
1834 unsigned long pixel; 1834 unsigned long pixel;
1835 unsigned long background = di->relief_background; 1835 unsigned long background = di->relief_background;
1836 Colormap cmap = FRAME_X_COLORMAP (f); 1836 Colormap cmap = FRAME_X_COLORMAP (f);
1837 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 1837 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
1838 Display *dpy = FRAME_X_DISPLAY (f); 1838 Display *dpy = FRAME_X_DISPLAY (f);
1839 1839
1840 xgcv.graphics_exposures = False; 1840 xgcv.graphics_exposures = False;
@@ -3141,9 +3141,9 @@ XTtoggle_invisible_pointer (struct frame *f, int invisible)
3141 block_input (); 3141 block_input ();
3142 if (invisible) 3142 if (invisible)
3143 { 3143 {
3144 if (FRAME_X_DISPLAY_INFO (f)->invisible_cursor != 0) 3144 if (FRAME_DISPLAY_INFO (f)->invisible_cursor != 0)
3145 XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 3145 XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
3146 FRAME_X_DISPLAY_INFO (f)->invisible_cursor); 3146 FRAME_DISPLAY_INFO (f)->invisible_cursor);
3147 } 3147 }
3148 else 3148 else
3149 XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 3149 XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
@@ -3413,7 +3413,7 @@ x_window_to_frame (struct x_display_info *dpyinfo, int wdesc)
3413 FOR_EACH_FRAME (tail, frame) 3413 FOR_EACH_FRAME (tail, frame)
3414 { 3414 {
3415 f = XFRAME (frame); 3415 f = XFRAME (frame);
3416 if (!FRAME_X_P (f) || FRAME_X_DISPLAY_INFO (f) != dpyinfo) 3416 if (!FRAME_X_P (f) || FRAME_DISPLAY_INFO (f) != dpyinfo)
3417 continue; 3417 continue;
3418 if (f->output_data.x->hourglass_window == wdesc) 3418 if (f->output_data.x->hourglass_window == wdesc)
3419 return f; 3419 return f;
@@ -3463,7 +3463,7 @@ x_any_window_to_frame (struct x_display_info *dpyinfo, int wdesc)
3463 if (found) 3463 if (found)
3464 break; 3464 break;
3465 f = XFRAME (frame); 3465 f = XFRAME (frame);
3466 if (FRAME_X_P (f) && FRAME_X_DISPLAY_INFO (f) == dpyinfo) 3466 if (FRAME_X_P (f) && FRAME_DISPLAY_INFO (f) == dpyinfo)
3467 { 3467 {
3468 /* This frame matches if the window is any of its widgets. */ 3468 /* This frame matches if the window is any of its widgets. */
3469 x = f->output_data.x; 3469 x = f->output_data.x;
@@ -3511,7 +3511,7 @@ x_menubar_window_to_frame (struct x_display_info *dpyinfo, XEvent *event)
3511 FOR_EACH_FRAME (tail, frame) 3511 FOR_EACH_FRAME (tail, frame)
3512 { 3512 {
3513 f = XFRAME (frame); 3513 f = XFRAME (frame);
3514 if (!FRAME_X_P (f) || FRAME_X_DISPLAY_INFO (f) != dpyinfo) 3514 if (!FRAME_X_P (f) || FRAME_DISPLAY_INFO (f) != dpyinfo)
3515 continue; 3515 continue;
3516 x = f->output_data.x; 3516 x = f->output_data.x;
3517#ifdef USE_GTK 3517#ifdef USE_GTK
@@ -3543,7 +3543,7 @@ x_top_window_to_frame (struct x_display_info *dpyinfo, int wdesc)
3543 FOR_EACH_FRAME (tail, frame) 3543 FOR_EACH_FRAME (tail, frame)
3544 { 3544 {
3545 f = XFRAME (frame); 3545 f = XFRAME (frame);
3546 if (!FRAME_X_P (f) || FRAME_X_DISPLAY_INFO (f) != dpyinfo) 3546 if (!FRAME_X_P (f) || FRAME_DISPLAY_INFO (f) != dpyinfo)
3547 continue; 3547 continue;
3548 x = f->output_data.x; 3548 x = f->output_data.x;
3549 3549
@@ -3646,7 +3646,7 @@ x_mouse_leave (struct x_display_info *dpyinfo)
3646static void 3646static void
3647XTframe_rehighlight (struct frame *frame) 3647XTframe_rehighlight (struct frame *frame)
3648{ 3648{
3649 x_frame_rehighlight (FRAME_X_DISPLAY_INFO (frame)); 3649 x_frame_rehighlight (FRAME_DISPLAY_INFO (frame));
3650} 3650}
3651 3651
3652static void 3652static void
@@ -3879,7 +3879,7 @@ construct_mouse_click (struct input_event *result, XButtonEvent *event, struct f
3879 result->kind = MOUSE_CLICK_EVENT; 3879 result->kind = MOUSE_CLICK_EVENT;
3880 result->code = event->button - Button1; 3880 result->code = event->button - Button1;
3881 result->timestamp = event->time; 3881 result->timestamp = event->time;
3882 result->modifiers = (x_x_to_emacs_modifiers (FRAME_X_DISPLAY_INFO (f), 3882 result->modifiers = (x_x_to_emacs_modifiers (FRAME_DISPLAY_INFO (f),
3883 event->state) 3883 event->state)
3884 | (event->type == ButtonRelease 3884 | (event->type == ButtonRelease
3885 ? up_modifier 3885 ? up_modifier
@@ -4044,7 +4044,7 @@ XTmouse_position (struct frame **fp, int insist, Lisp_Object *bar_window,
4044 4044
4045 x_catch_errors (FRAME_X_DISPLAY (*fp)); 4045 x_catch_errors (FRAME_X_DISPLAY (*fp));
4046 4046
4047 if (FRAME_X_DISPLAY_INFO (*fp)->grabbed && last_mouse_frame 4047 if (FRAME_DISPLAY_INFO (*fp)->grabbed && last_mouse_frame
4048 && FRAME_LIVE_P (last_mouse_frame)) 4048 && FRAME_LIVE_P (last_mouse_frame))
4049 { 4049 {
4050 /* If mouse was grabbed on a frame, give coords for that frame 4050 /* If mouse was grabbed on a frame, give coords for that frame
@@ -4083,7 +4083,7 @@ XTmouse_position (struct frame **fp, int insist, Lisp_Object *bar_window,
4083 want the edit window. For non-Gtk+ the innermost 4083 want the edit window. For non-Gtk+ the innermost
4084 window is the edit window. For Gtk+ it might not 4084 window is the edit window. For Gtk+ it might not
4085 be. It might be the tool bar for example. */ 4085 be. It might be the tool bar for example. */
4086 if (x_window_to_frame (FRAME_X_DISPLAY_INFO (*fp), win)) 4086 if (x_window_to_frame (FRAME_DISPLAY_INFO (*fp), win))
4087 break; 4087 break;
4088#endif 4088#endif
4089 win = child; 4089 win = child;
@@ -4105,10 +4105,10 @@ XTmouse_position (struct frame **fp, int insist, Lisp_Object *bar_window,
4105#ifdef USE_GTK 4105#ifdef USE_GTK
4106 /* We don't wan't to know the innermost window. We 4106 /* We don't wan't to know the innermost window. We
4107 want the edit window. */ 4107 want the edit window. */
4108 f1 = x_window_to_frame (FRAME_X_DISPLAY_INFO (*fp), win); 4108 f1 = x_window_to_frame (FRAME_DISPLAY_INFO (*fp), win);
4109#else 4109#else
4110 /* Is win one of our frames? */ 4110 /* Is win one of our frames? */
4111 f1 = x_any_window_to_frame (FRAME_X_DISPLAY_INFO (*fp), win); 4111 f1 = x_any_window_to_frame (FRAME_DISPLAY_INFO (*fp), win);
4112#endif 4112#endif
4113 4113
4114#ifdef USE_X_TOOLKIT 4114#ifdef USE_X_TOOLKIT
@@ -4350,7 +4350,7 @@ x_send_scroll_bar_event (Lisp_Object window, int part, int portion, int whole)
4350 4350
4351 /* Construct a ClientMessage event to send to the frame. */ 4351 /* Construct a ClientMessage event to send to the frame. */
4352 ev->type = ClientMessage; 4352 ev->type = ClientMessage;
4353 ev->message_type = FRAME_X_DISPLAY_INFO (f)->Xatom_Scrollbar; 4353 ev->message_type = FRAME_DISPLAY_INFO (f)->Xatom_Scrollbar;
4354 ev->display = FRAME_X_DISPLAY (f); 4354 ev->display = FRAME_X_DISPLAY (f);
4355 ev->window = FRAME_X_WINDOW (f); 4355 ev->window = FRAME_X_WINDOW (f);
4356 ev->format = 32; 4356 ev->format = 32;
@@ -4531,8 +4531,8 @@ xg_scroll_callback (GtkRange *range,
4531 { 4531 {
4532 case GTK_SCROLL_JUMP: 4532 case GTK_SCROLL_JUMP:
4533 /* Buttons 1 2 or 3 must be grabbed. */ 4533 /* Buttons 1 2 or 3 must be grabbed. */
4534 if (FRAME_X_DISPLAY_INFO (f)->grabbed != 0 4534 if (FRAME_DISPLAY_INFO (f)->grabbed != 0
4535 && FRAME_X_DISPLAY_INFO (f)->grabbed < (1 << 4)) 4535 && FRAME_DISPLAY_INFO (f)->grabbed < (1 << 4))
4536 { 4536 {
4537 part = scroll_bar_handle; 4537 part = scroll_bar_handle;
4538 whole = gtk_adjustment_get_upper (adj) - 4538 whole = gtk_adjustment_get_upper (adj) -
@@ -5051,7 +5051,7 @@ x_scroll_bar_create (struct window *w, int top, int left, int width, int height)
5051 a.event_mask = (ButtonPressMask | ButtonReleaseMask 5051 a.event_mask = (ButtonPressMask | ButtonReleaseMask
5052 | ButtonMotionMask | PointerMotionHintMask 5052 | ButtonMotionMask | PointerMotionHintMask
5053 | ExposureMask); 5053 | ExposureMask);
5054 a.cursor = FRAME_X_DISPLAY_INFO (f)->vertical_scroll_bar_cursor; 5054 a.cursor = FRAME_DISPLAY_INFO (f)->vertical_scroll_bar_cursor;
5055 5055
5056 mask = (CWBackPixel | CWEventMask | CWCursor); 5056 mask = (CWBackPixel | CWEventMask | CWCursor);
5057 5057
@@ -5624,7 +5624,7 @@ x_scroll_bar_handle_click (struct scroll_bar *bar, XEvent *event, struct input_e
5624 emacs_event->kind = SCROLL_BAR_CLICK_EVENT; 5624 emacs_event->kind = SCROLL_BAR_CLICK_EVENT;
5625 emacs_event->code = event->xbutton.button - Button1; 5625 emacs_event->code = event->xbutton.button - Button1;
5626 emacs_event->modifiers 5626 emacs_event->modifiers
5627 = (x_x_to_emacs_modifiers (FRAME_X_DISPLAY_INFO 5627 = (x_x_to_emacs_modifiers (FRAME_DISPLAY_INFO
5628 (XFRAME (WINDOW_FRAME (XWINDOW (bar->window)))), 5628 (XFRAME (WINDOW_FRAME (XWINDOW (bar->window)))),
5629 event->xbutton.state) 5629 event->xbutton.state)
5630 | (event->type == ButtonRelease 5630 | (event->type == ButtonRelease
@@ -6236,8 +6236,8 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr,
6236 f->top_pos = y; 6236 f->top_pos = y;
6237 6237
6238 /* Perhaps reparented due to a WM restart. Reset this. */ 6238 /* Perhaps reparented due to a WM restart. Reset this. */
6239 FRAME_X_DISPLAY_INFO (f)->wm_type = X_WMTYPE_UNKNOWN; 6239 FRAME_DISPLAY_INFO (f)->wm_type = X_WMTYPE_UNKNOWN;
6240 FRAME_X_DISPLAY_INFO (f)->net_supported_window = 0; 6240 FRAME_DISPLAY_INFO (f)->net_supported_window = 0;
6241 6241
6242 x_set_frame_alpha (f); 6242 x_set_frame_alpha (f);
6243 } 6243 }
@@ -6471,7 +6471,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr,
6471#endif 6471#endif
6472 6472
6473 event.xkey.state 6473 event.xkey.state
6474 |= x_emacs_to_x_modifiers (FRAME_X_DISPLAY_INFO (f), 6474 |= x_emacs_to_x_modifiers (FRAME_DISPLAY_INFO (f),
6475 extra_keyboard_modifiers); 6475 extra_keyboard_modifiers);
6476 modifiers = event.xkey.state; 6476 modifiers = event.xkey.state;
6477 6477
@@ -6545,7 +6545,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr,
6545 /* Common for all keysym input events. */ 6545 /* Common for all keysym input events. */
6546 XSETFRAME (inev.ie.frame_or_window, f); 6546 XSETFRAME (inev.ie.frame_or_window, f);
6547 inev.ie.modifiers 6547 inev.ie.modifiers
6548 = x_x_to_emacs_modifiers (FRAME_X_DISPLAY_INFO (f), modifiers); 6548 = x_x_to_emacs_modifiers (FRAME_DISPLAY_INFO (f), modifiers);
6549 inev.ie.timestamp = event.xkey.time; 6549 inev.ie.timestamp = event.xkey.time;
6550 6550
6551 /* First deal with keysyms which have defined 6551 /* First deal with keysyms which have defined
@@ -7321,7 +7321,7 @@ static void
7321x_draw_hollow_cursor (struct window *w, struct glyph_row *row) 7321x_draw_hollow_cursor (struct window *w, struct glyph_row *row)
7322{ 7322{
7323 struct frame *f = XFRAME (WINDOW_FRAME (w)); 7323 struct frame *f = XFRAME (WINDOW_FRAME (w));
7324 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 7324 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
7325 Display *dpy = FRAME_X_DISPLAY (f); 7325 Display *dpy = FRAME_X_DISPLAY (f);
7326 int x, y, wd, h; 7326 int x, y, wd, h;
7327 XGCValues xgcv; 7327 XGCValues xgcv;
@@ -7393,7 +7393,7 @@ x_draw_bar_cursor (struct window *w, struct glyph_row *row, int width, enum text
7393 { 7393 {
7394 Display *dpy = FRAME_X_DISPLAY (f); 7394 Display *dpy = FRAME_X_DISPLAY (f);
7395 Window window = FRAME_X_WINDOW (f); 7395 Window window = FRAME_X_WINDOW (f);
7396 GC gc = FRAME_X_DISPLAY_INFO (f)->scratch_cursor_gc; 7396 GC gc = FRAME_DISPLAY_INFO (f)->scratch_cursor_gc;
7397 unsigned long mask = GCForeground | GCBackground | GCGraphicsExposures; 7397 unsigned long mask = GCForeground | GCBackground | GCGraphicsExposures;
7398 struct face *face = FACE_FROM_ID (f, cursor_glyph->face_id); 7398 struct face *face = FACE_FROM_ID (f, cursor_glyph->face_id);
7399 XGCValues xgcv; 7399 XGCValues xgcv;
@@ -7414,7 +7414,7 @@ x_draw_bar_cursor (struct window *w, struct glyph_row *row, int width, enum text
7414 else 7414 else
7415 { 7415 {
7416 gc = XCreateGC (dpy, window, mask, &xgcv); 7416 gc = XCreateGC (dpy, window, mask, &xgcv);
7417 FRAME_X_DISPLAY_INFO (f)->scratch_cursor_gc = gc; 7417 FRAME_DISPLAY_INFO (f)->scratch_cursor_gc = gc;
7418 } 7418 }
7419 7419
7420 x_clip_to_row (w, row, TEXT_AREA, gc); 7420 x_clip_to_row (w, row, TEXT_AREA, gc);
@@ -7581,7 +7581,7 @@ x_bitmap_icon (struct frame *f, Lisp_Object file)
7581 else 7581 else
7582 { 7582 {
7583 /* Create the GNU bitmap and mask if necessary. */ 7583 /* Create the GNU bitmap and mask if necessary. */
7584 if (FRAME_X_DISPLAY_INFO (f)->icon_bitmap_id < 0) 7584 if (FRAME_DISPLAY_INFO (f)->icon_bitmap_id < 0)
7585 { 7585 {
7586 ptrdiff_t rc = -1; 7586 ptrdiff_t rc = -1;
7587 7587
@@ -7595,7 +7595,7 @@ x_bitmap_icon (struct frame *f, Lisp_Object file)
7595 7595
7596 rc = x_create_bitmap_from_xpm_data (f, gnu_xpm_bits); 7596 rc = x_create_bitmap_from_xpm_data (f, gnu_xpm_bits);
7597 if (rc != -1) 7597 if (rc != -1)
7598 FRAME_X_DISPLAY_INFO (f)->icon_bitmap_id = rc; 7598 FRAME_DISPLAY_INFO (f)->icon_bitmap_id = rc;
7599 7599
7600#endif 7600#endif
7601 7601
@@ -7607,8 +7607,8 @@ x_bitmap_icon (struct frame *f, Lisp_Object file)
7607 if (rc == -1) 7607 if (rc == -1)
7608 return 1; 7608 return 1;
7609 7609
7610 FRAME_X_DISPLAY_INFO (f)->icon_bitmap_id = rc; 7610 FRAME_DISPLAY_INFO (f)->icon_bitmap_id = rc;
7611 x_create_bitmap_mask (f, FRAME_X_DISPLAY_INFO (f)->icon_bitmap_id); 7611 x_create_bitmap_mask (f, FRAME_DISPLAY_INFO (f)->icon_bitmap_id);
7612 } 7612 }
7613 } 7613 }
7614 7614
@@ -7616,9 +7616,9 @@ x_bitmap_icon (struct frame *f, Lisp_Object file)
7616 this increments the ref-count one extra time. 7616 this increments the ref-count one extra time.
7617 As a result, the GNU bitmap and mask are never freed. 7617 As a result, the GNU bitmap and mask are never freed.
7618 That way, we don't have to worry about allocating it again. */ 7618 That way, we don't have to worry about allocating it again. */
7619 x_reference_bitmap (f, FRAME_X_DISPLAY_INFO (f)->icon_bitmap_id); 7619 x_reference_bitmap (f, FRAME_DISPLAY_INFO (f)->icon_bitmap_id);
7620 7620
7621 bitmap_id = FRAME_X_DISPLAY_INFO (f)->icon_bitmap_id; 7621 bitmap_id = FRAME_DISPLAY_INFO (f)->icon_bitmap_id;
7622 } 7622 }
7623 7623
7624 x_wm_set_icon_pixmap (f, bitmap_id); 7624 x_wm_set_icon_pixmap (f, bitmap_id);
@@ -7832,7 +7832,7 @@ x_connection_closed (Display *dpy, const char *error_message)
7832 if (FRAME_X_P (XFRAME (frame)) 7832 if (FRAME_X_P (XFRAME (frame))
7833 && FRAME_X_P (XFRAME (minibuf_frame)) 7833 && FRAME_X_P (XFRAME (minibuf_frame))
7834 && ! EQ (frame, minibuf_frame) 7834 && ! EQ (frame, minibuf_frame)
7835 && FRAME_X_DISPLAY_INFO (XFRAME (minibuf_frame)) == dpyinfo) 7835 && FRAME_DISPLAY_INFO (XFRAME (minibuf_frame)) == dpyinfo)
7836 delete_frame (frame, Qnoelisp); 7836 delete_frame (frame, Qnoelisp);
7837 } 7837 }
7838 7838
@@ -7841,7 +7841,7 @@ x_connection_closed (Display *dpy, const char *error_message)
7841 for another frame that we need to delete. */ 7841 for another frame that we need to delete. */
7842 FOR_EACH_FRAME (tail, frame) 7842 FOR_EACH_FRAME (tail, frame)
7843 if (FRAME_X_P (XFRAME (frame)) 7843 if (FRAME_X_P (XFRAME (frame))
7844 && FRAME_X_DISPLAY_INFO (XFRAME (frame)) == dpyinfo) 7844 && FRAME_DISPLAY_INFO (XFRAME (frame)) == dpyinfo)
7845 { 7845 {
7846 /* Set this to t so that delete_frame won't get confused 7846 /* Set this to t so that delete_frame won't get confused
7847 trying to find a replacement. */ 7847 trying to find a replacement. */
@@ -8064,7 +8064,7 @@ xim_destroy_callback (XIM xim, XPointer client_data, XPointer call_data)
8064 FOR_EACH_FRAME (tail, frame) 8064 FOR_EACH_FRAME (tail, frame)
8065 { 8065 {
8066 struct frame *f = XFRAME (frame); 8066 struct frame *f = XFRAME (frame);
8067 if (FRAME_X_P (f) && FRAME_X_DISPLAY_INFO (f) == dpyinfo) 8067 if (FRAME_X_P (f) && FRAME_DISPLAY_INFO (f) == dpyinfo)
8068 { 8068 {
8069 FRAME_XIC (f) = NULL; 8069 FRAME_XIC (f) = NULL;
8070 xic_free_xfontset (f); 8070 xic_free_xfontset (f);
@@ -8155,7 +8155,7 @@ xim_instantiate_callback (Display *display, XPointer client_data, XPointer call_
8155 struct frame *f = XFRAME (frame); 8155 struct frame *f = XFRAME (frame);
8156 8156
8157 if (FRAME_X_P (f) 8157 if (FRAME_X_P (f)
8158 && FRAME_X_DISPLAY_INFO (f) == xim_inst->dpyinfo) 8158 && FRAME_DISPLAY_INFO (f) == xim_inst->dpyinfo)
8159 if (FRAME_XIC (f) == NULL) 8159 if (FRAME_XIC (f) == NULL)
8160 { 8160 {
8161 create_frame_xic (f); 8161 create_frame_xic (f);
@@ -8253,7 +8253,7 @@ x_calc_absolute_position (struct frame *f)
8253 /* Treat negative positions as relative to the leftmost bottommost 8253 /* Treat negative positions as relative to the leftmost bottommost
8254 position that fits on the screen. */ 8254 position that fits on the screen. */
8255 if (flags & XNegative) 8255 if (flags & XNegative)
8256 f->left_pos = x_display_pixel_width (FRAME_X_DISPLAY_INFO (f)) 8256 f->left_pos = x_display_pixel_width (FRAME_DISPLAY_INFO (f))
8257 - FRAME_PIXEL_WIDTH (f) + f->left_pos; 8257 - FRAME_PIXEL_WIDTH (f) + f->left_pos;
8258 8258
8259 { 8259 {
@@ -8276,7 +8276,7 @@ x_calc_absolute_position (struct frame *f)
8276#endif 8276#endif
8277 8277
8278 if (flags & YNegative) 8278 if (flags & YNegative)
8279 f->top_pos = x_display_pixel_height (FRAME_X_DISPLAY_INFO (f)) 8279 f->top_pos = x_display_pixel_height (FRAME_DISPLAY_INFO (f))
8280 - height + f->top_pos; 8280 - height + f->top_pos;
8281 } 8281 }
8282 8282
@@ -8316,7 +8316,7 @@ x_set_offset (struct frame *f, register int xoff, register int yoff, int change_
8316 modified_left = f->left_pos; 8316 modified_left = f->left_pos;
8317 modified_top = f->top_pos; 8317 modified_top = f->top_pos;
8318 8318
8319 if (change_gravity != 0 && FRAME_X_DISPLAY_INFO (f)->wm_type == X_WMTYPE_A) 8319 if (change_gravity != 0 && FRAME_DISPLAY_INFO (f)->wm_type == X_WMTYPE_A)
8320 { 8320 {
8321 /* Some WMs (twm, wmaker at least) has an offset that is smaller 8321 /* Some WMs (twm, wmaker at least) has an offset that is smaller
8322 than the WM decorations. So we use the calculated offset instead 8322 than the WM decorations. So we use the calculated offset instead
@@ -8329,7 +8329,7 @@ x_set_offset (struct frame *f, register int xoff, register int yoff, int change_
8329 modified_left, modified_top); 8329 modified_left, modified_top);
8330 8330
8331 x_sync_with_move (f, f->left_pos, f->top_pos, 8331 x_sync_with_move (f, f->left_pos, f->top_pos,
8332 FRAME_X_DISPLAY_INFO (f)->wm_type == X_WMTYPE_UNKNOWN 8332 FRAME_DISPLAY_INFO (f)->wm_type == X_WMTYPE_UNKNOWN
8333 ? 1 : 0); 8333 ? 1 : 0);
8334 8334
8335 /* change_gravity is non-zero when this function is called from Lisp to 8335 /* change_gravity is non-zero when this function is called from Lisp to
@@ -8343,8 +8343,8 @@ x_set_offset (struct frame *f, register int xoff, register int yoff, int change_
8343 need to compute the top/left offset adjustment for this frame. */ 8343 need to compute the top/left offset adjustment for this frame. */
8344 8344
8345 if (change_gravity != 0 && 8345 if (change_gravity != 0 &&
8346 (FRAME_X_DISPLAY_INFO (f)->wm_type == X_WMTYPE_UNKNOWN 8346 (FRAME_DISPLAY_INFO (f)->wm_type == X_WMTYPE_UNKNOWN
8347 || (FRAME_X_DISPLAY_INFO (f)->wm_type == X_WMTYPE_A 8347 || (FRAME_DISPLAY_INFO (f)->wm_type == X_WMTYPE_A
8348 && (FRAME_X_OUTPUT (f)->move_offset_left == 0 8348 && (FRAME_X_OUTPUT (f)->move_offset_left == 0
8349 && FRAME_X_OUTPUT (f)->move_offset_top == 0)))) 8349 && FRAME_X_OUTPUT (f)->move_offset_top == 0))))
8350 x_check_expected_move (f, modified_left, modified_top); 8350 x_check_expected_move (f, modified_left, modified_top);
@@ -8365,7 +8365,7 @@ wm_supports (struct frame *f, Atom want_atom)
8365 unsigned long actual_size, bytes_remaining; 8365 unsigned long actual_size, bytes_remaining;
8366 int i, rc, actual_format; 8366 int i, rc, actual_format;
8367 Window wmcheck_window; 8367 Window wmcheck_window;
8368 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 8368 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
8369 Window target_window = dpyinfo->root_window; 8369 Window target_window = dpyinfo->root_window;
8370 long max_len = 65536; 8370 long max_len = 65536;
8371 Display *dpy = FRAME_X_DISPLAY (f); 8371 Display *dpy = FRAME_X_DISPLAY (f);
@@ -8446,7 +8446,7 @@ wm_supports (struct frame *f, Atom want_atom)
8446static void 8446static void
8447set_wm_state (Lisp_Object frame, int add, Atom atom, Atom value) 8447set_wm_state (Lisp_Object frame, int add, Atom atom, Atom value)
8448{ 8448{
8449 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (XFRAME (frame)); 8449 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (XFRAME (frame));
8450 8450
8451 x_send_client_event (frame, make_number (0), frame, 8451 x_send_client_event (frame, make_number (0), frame,
8452 dpyinfo->Xatom_net_wm_state, 8452 dpyinfo->Xatom_net_wm_state,
@@ -8465,7 +8465,7 @@ void
8465x_set_sticky (struct frame *f, Lisp_Object new_value, Lisp_Object old_value) 8465x_set_sticky (struct frame *f, Lisp_Object new_value, Lisp_Object old_value)
8466{ 8466{
8467 Lisp_Object frame; 8467 Lisp_Object frame;
8468 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 8468 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
8469 8469
8470 XSETFRAME (frame, f); 8470 XSETFRAME (frame, f);
8471 8471
@@ -8488,7 +8488,7 @@ get_current_wm_state (struct frame *f,
8488 Atom actual_type; 8488 Atom actual_type;
8489 unsigned long actual_size, bytes_remaining; 8489 unsigned long actual_size, bytes_remaining;
8490 int i, rc, actual_format, is_hidden = 0; 8490 int i, rc, actual_format, is_hidden = 0;
8491 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 8491 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
8492 long max_len = 65536; 8492 long max_len = 65536;
8493 Display *dpy = FRAME_X_DISPLAY (f); 8493 Display *dpy = FRAME_X_DISPLAY (f);
8494 unsigned char *tmp_data = NULL; 8494 unsigned char *tmp_data = NULL;
@@ -8552,7 +8552,7 @@ get_current_wm_state (struct frame *f,
8552static int 8552static int
8553do_ewmh_fullscreen (struct frame *f) 8553do_ewmh_fullscreen (struct frame *f)
8554{ 8554{
8555 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 8555 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
8556 int have_net_atom = wm_supports (f, dpyinfo->Xatom_net_wm_state); 8556 int have_net_atom = wm_supports (f, dpyinfo->Xatom_net_wm_state);
8557 int cur, dummy; 8557 int cur, dummy;
8558 8558
@@ -8670,7 +8670,7 @@ x_check_fullscreen (struct frame *f)
8670 if (do_ewmh_fullscreen (f)) 8670 if (do_ewmh_fullscreen (f))
8671 return; 8671 return;
8672 8672
8673 if (f->output_data.x->parent_desc != FRAME_X_DISPLAY_INFO (f)->root_window) 8673 if (f->output_data.x->parent_desc != FRAME_DISPLAY_INFO (f)->root_window)
8674 return; /* Only fullscreen without WM or with EWM hints (above). */ 8674 return; /* Only fullscreen without WM or with EWM hints (above). */
8675 8675
8676 /* Setting fullscreen to nil doesn't do anything. We could save the 8676 /* Setting fullscreen to nil doesn't do anything. We could save the
@@ -8680,7 +8680,7 @@ x_check_fullscreen (struct frame *f)
8680 if (f->want_fullscreen != FULLSCREEN_NONE) 8680 if (f->want_fullscreen != FULLSCREEN_NONE)
8681 { 8681 {
8682 int width = FRAME_PIXEL_WIDTH (f), height = FRAME_PIXEL_HEIGHT (f); 8682 int width = FRAME_PIXEL_WIDTH (f), height = FRAME_PIXEL_HEIGHT (f);
8683 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 8683 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
8684 8684
8685 switch (f->want_fullscreen) 8685 switch (f->want_fullscreen)
8686 { 8686 {
@@ -8727,7 +8727,7 @@ x_check_expected_move (struct frame *f, int expected_left, int expected_top)
8727 int adjusted_left; 8727 int adjusted_left;
8728 int adjusted_top; 8728 int adjusted_top;
8729 8729
8730 FRAME_X_DISPLAY_INFO (f)->wm_type = X_WMTYPE_A; 8730 FRAME_DISPLAY_INFO (f)->wm_type = X_WMTYPE_A;
8731 FRAME_X_OUTPUT (f)->move_offset_left = expected_left - current_left; 8731 FRAME_X_OUTPUT (f)->move_offset_left = expected_left - current_left;
8732 FRAME_X_OUTPUT (f)->move_offset_top = expected_top - current_top; 8732 FRAME_X_OUTPUT (f)->move_offset_top = expected_top - current_top;
8733 8733
@@ -8745,7 +8745,7 @@ x_check_expected_move (struct frame *f, int expected_left, int expected_top)
8745 /* It's a "Type B" window manager. We don't have to adjust the 8745 /* It's a "Type B" window manager. We don't have to adjust the
8746 frame's position. */ 8746 frame's position. */
8747 8747
8748 FRAME_X_DISPLAY_INFO (f)->wm_type = X_WMTYPE_B; 8748 FRAME_DISPLAY_INFO (f)->wm_type = X_WMTYPE_B;
8749} 8749}
8750 8750
8751 8751
@@ -9037,7 +9037,7 @@ x_ewmh_activate_frame (struct frame *f)
9037 /* See Window Manager Specification/Extended Window Manager Hints at 9037 /* See Window Manager Specification/Extended Window Manager Hints at
9038 http://freedesktop.org/wiki/Specifications/wm-spec */ 9038 http://freedesktop.org/wiki/Specifications/wm-spec */
9039 9039
9040 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 9040 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
9041 9041
9042 if (FRAME_VISIBLE_P (f) && wm_supports (f, dpyinfo->Xatom_net_active_window)) 9042 if (FRAME_VISIBLE_P (f) && wm_supports (f, dpyinfo->Xatom_net_active_window))
9043 { 9043 {
@@ -9071,7 +9071,7 @@ static void
9071xembed_set_info (struct frame *f, enum xembed_info flags) 9071xembed_set_info (struct frame *f, enum xembed_info flags)
9072{ 9072{
9073 unsigned long data[2]; 9073 unsigned long data[2];
9074 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 9074 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
9075 9075
9076 data[0] = XEMBED_VERSION; 9076 data[0] = XEMBED_VERSION;
9077 data[1] = flags; 9077 data[1] = flags;
@@ -9090,7 +9090,7 @@ xembed_send_message (struct frame *f, Time t, enum xembed_message msg,
9090 9090
9091 event.xclient.type = ClientMessage; 9091 event.xclient.type = ClientMessage;
9092 event.xclient.window = FRAME_X_OUTPUT (f)->parent_desc; 9092 event.xclient.window = FRAME_X_OUTPUT (f)->parent_desc;
9093 event.xclient.message_type = FRAME_X_DISPLAY_INFO (f)->Xatom_XEMBED; 9093 event.xclient.message_type = FRAME_DISPLAY_INFO (f)->Xatom_XEMBED;
9094 event.xclient.format = 32; 9094 event.xclient.format = 32;
9095 event.xclient.data.l[0] = t; 9095 event.xclient.data.l[0] = t;
9096 event.xclient.data.l[1] = msg; 9096 event.xclient.data.l[1] = msg;
@@ -9280,8 +9280,8 @@ x_make_frame_invisible (struct frame *f)
9280 window = FRAME_OUTER_WINDOW (f); 9280 window = FRAME_OUTER_WINDOW (f);
9281 9281
9282 /* Don't keep the highlight on an invisible frame. */ 9282 /* Don't keep the highlight on an invisible frame. */
9283 if (FRAME_X_DISPLAY_INFO (f)->x_highlight_frame == f) 9283 if (FRAME_DISPLAY_INFO (f)->x_highlight_frame == f)
9284 FRAME_X_DISPLAY_INFO (f)->x_highlight_frame = 0; 9284 FRAME_DISPLAY_INFO (f)->x_highlight_frame = 0;
9285 9285
9286 block_input (); 9286 block_input ();
9287 9287
@@ -9335,8 +9335,8 @@ x_iconify_frame (struct frame *f)
9335 Lisp_Object type; 9335 Lisp_Object type;
9336 9336
9337 /* Don't keep the highlight on an invisible frame. */ 9337 /* Don't keep the highlight on an invisible frame. */
9338 if (FRAME_X_DISPLAY_INFO (f)->x_highlight_frame == f) 9338 if (FRAME_DISPLAY_INFO (f)->x_highlight_frame == f)
9339 FRAME_X_DISPLAY_INFO (f)->x_highlight_frame = 0; 9339 FRAME_DISPLAY_INFO (f)->x_highlight_frame = 0;
9340 9340
9341 if (FRAME_ICONIFIED_P (f)) 9341 if (FRAME_ICONIFIED_P (f))
9342 return; 9342 return;
@@ -9411,7 +9411,7 @@ x_iconify_frame (struct frame *f)
9411 9411
9412 msg.xclient.window = FRAME_X_WINDOW (f); 9412 msg.xclient.window = FRAME_X_WINDOW (f);
9413 msg.xclient.type = ClientMessage; 9413 msg.xclient.type = ClientMessage;
9414 msg.xclient.message_type = FRAME_X_DISPLAY_INFO (f)->Xatom_wm_change_state; 9414 msg.xclient.message_type = FRAME_DISPLAY_INFO (f)->Xatom_wm_change_state;
9415 msg.xclient.format = 32; 9415 msg.xclient.format = 32;
9416 msg.xclient.data.l[0] = IconicState; 9416 msg.xclient.data.l[0] = IconicState;
9417 9417
@@ -9450,7 +9450,7 @@ x_iconify_frame (struct frame *f)
9450void 9450void
9451x_free_frame_resources (struct frame *f) 9451x_free_frame_resources (struct frame *f)
9452{ 9452{
9453 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 9453 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
9454 Mouse_HLInfo *hlinfo = &dpyinfo->mouse_highlight; 9454 Mouse_HLInfo *hlinfo = &dpyinfo->mouse_highlight;
9455#ifdef USE_X_TOOLKIT 9455#ifdef USE_X_TOOLKIT
9456 Lisp_Object bar; 9456 Lisp_Object bar;
@@ -9573,7 +9573,7 @@ x_free_frame_resources (struct frame *f)
9573static void 9573static void
9574x_destroy_window (struct frame *f) 9574x_destroy_window (struct frame *f)
9575{ 9575{
9576 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); 9576 struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
9577 9577
9578 /* If a display connection is dead, don't try sending more 9578 /* If a display connection is dead, don't try sending more
9579 commands to the X server. */ 9579 commands to the X server. */
@@ -9619,9 +9619,9 @@ x_wm_set_size_hint (struct frame *f, long flags, bool user_position)
9619 9619
9620 size_hints.width_inc = FRAME_COLUMN_WIDTH (f); 9620 size_hints.width_inc = FRAME_COLUMN_WIDTH (f);
9621 size_hints.height_inc = FRAME_LINE_HEIGHT (f); 9621 size_hints.height_inc = FRAME_LINE_HEIGHT (f);
9622 size_hints.max_width = x_display_pixel_width (FRAME_X_DISPLAY_INFO (f)) 9622 size_hints.max_width = x_display_pixel_width (FRAME_DISPLAY_INFO (f))
9623 - FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, 0); 9623 - FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, 0);
9624 size_hints.max_height = x_display_pixel_height (FRAME_X_DISPLAY_INFO (f)) 9624 size_hints.max_height = x_display_pixel_height (FRAME_DISPLAY_INFO (f))
9625 - FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, 0); 9625 - FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, 0);
9626 9626
9627 /* Calculate the base and minimum sizes. */ 9627 /* 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