Delete these vars; now part of struct x_display_info.
(x_new_focus_frame): New arg DPYINFO. Callers changed.
Use the struct members instead of the globals.
Call x_frame_rehighlight instead of XTframe_rehighlight, so we can
pass on the dpyinfo pointer.
(x_mouse_leave): New arg DPYINFO. Callers changed.
(XTframe_rehighlight): New arg FRAME. Callers changed.
Now does all the work in x_frame_rehighlight.
(x_frame_rehighlight): New function, code from XTframe_rehighlight.
(XTread_socket): Use the struct members instead of the globals.
(x_unfocus_frame, x_iconify_frame, x_destroy_window): Likewise.
(x_display_box_cursor, x_make_frame_invisible): Likewise.
(x_term_init): Initialize the struct members.
(x_initialize): Delete initialization of deleted globals.
(XTread_socket): Pass dpyinfo to popup_get_selection.
(XTread_socket): For ConfigureNotify,
combine the USE_X_TOOLKIT and non-toolkit cases, which provides
some things that were missing in the former.
(same_x_server): New function.
(x_term_init): If this display shares a keyboard with one we've
already opened, then share the structure.
(x_delete_display): Don't delete the kboard until the reference
count becomes zero.
(x_display_box_cursor): Don't redraw old cursor spot in mouse face
if cursor was on a newline.
(XTread_socket): Handle button events from outside
the frame, received due to grabbing the mouse with a button.
when frame must be redrawn.
(x_make_frame_visible, x_make_frame_invisible)
(x_iconify_frame): Give error if frame has explicit_parent.
(x_new_font): Don't set window height if frame has explicit_parent.
(x_mouse_leave): New function broken out of XTread_socket.
When x_focus_event_frame is nonzero, assume that frame gets focus.
(XTread_socket): Use x_mouse_leave for LeaveNotify.
(x_uncatch_errors): Make the argument a display, not a frame.
(XTread_socket_fake_io_error): New variable.
(XTread_socket): Obey XTread_socket_fake_io_error.
(x_initialize): Init x_noop_count, x_focus_frame
and x_highlight_frame here.
(x_term_init): Not here.
(x_term_init): Open the connection first thing;
if that fails, don't allocate dpyinfo.
(x_delete_display): New function.
(x_connection_closed): New args dpyinfo and error_message.
Delete all frames on the dead display
and all frames using them for minibuffers.
Call x_delete_display.
Maybe signal a Lisp error.
(x_term_init): Don't report error here--just return 0.
(x_scroll_bar_report_motion): Store proper value in
*bar_window (the Emacs window, not the X window number).
(x_scroll_bar_report_motion): Don't clear *fp.
(x_wm_set_icon_pixmap): Use x_bitmap_pixmap.
(show_mouse_face): New arg dpyinfo. All callers changed.
(clear_mouse_face): New arg dpyinfo. All callers changed.
(scratch_cursor_gc): Variable deleted.
(dumpglyphs): Use scratch_cursor_gc in x_display_info.
(syms_of_xterm): Don't staticpro mouse_face_window.
(expose_all_windows, expose_all_icons): Variables deleted.
(BLOCK_INPUT_mask): Variable deleted.
(x_term_init): Set up x_id_name field.
(x_id_name): Variable deleted.
(x_font_table, x_font_table_size, x_n_fonts): Vars deleted.
(x_new_font): Use new fields.
(warp_mouse_on_deiconify): Unused variable deleted.
(x_term_init): Set up dpyinfo->xrdb.
Set up dpyinfo->vertical_scroll_bar_cursor.
(x_scroll_bar_create): Use vertical_scroll_bar_cursor slot.
(x_vertical_scroll_bar_cursor): Variable deleted.
(x_term_init): Really return dpyinfo.
(x_term_init): Call add_keyboard_wait_descriptor,
not change_keyboard_wait_descriptor.
(x_term_init): Pass new arg to init_sigio.
Don't set old_fcntl_owner.
Don't call change_input_fd.
(XTread_socket): Loop over displays and process input from each.
(x_display_name_list): New variable.
(syms_of_xterm): staticpro it.
Don't staticpro slots in the_x_screen.
(x_term_init): Update x_display_name_list along with x_display_list.
Actually malloc the x_display_info.
(the_x_screen): Variable deleted.
(x_make_frame_visible, x_make_frame_invisible):
Pass a frame ptr to x_sync.
(x_term_init): Init all the components of dpyinfo.
(x_display_info_for_display): New function.
(x_*_mod_mask): Variables deleted.
(x_x_to_emacs_modifiers, x_emacs_to_x_modifiers):
New arg dpyinfo; all callers changed.
Store the masks in that structure.
(icon_bitmap): Variable deleted.
(x_bitmap_icon): Use icon_bitmap_id in x_display_info.
(icon_font_info): Variable deleted.
(x_term_init): Set up `connection' field.
(x_find_modifier_meanings):
Arg is now struct x_display_info *.
(x_term_init): Return an x_display_info *.
Store all the data in it, including X atoms and xrdb.
Put the x_display_info structure on x_display_list.
Pass name as Lisp_Object.
(the_x_screen): Variable moved here.
(syms_of_xterm): Staticpro parts of the_x_screen.
(windowinfo): Variable deleted.
(Xatom_*): Variables deleted.
(x_iconify_frame, XTread_socket): Get atoms from the x_display_info,
(XTread_socket): Don't update Vmouse_depressed.
(x_mouse_grabbed): Variable deleted.
(note_mouse_highlight): Use grabbed field instead.
(XTmouse_position, XTread_socket): Likewise.
(x_calc_absolute_position, x_wm_set_size_hint):
Get screen height, width from the x_display_info structure.
(x_bitmap_icon): Arg FILE is now a Lisp_Object.
(x_iconify_frame, x_make_frame_visible): Supply FILE arg to it.
(x_bitmap_icon): Properly discard the previous bitmap.
(x_text_icon): Discard bitmap only if we have one.
(line_dance, line_dance_len, line_dance_in_progress): New vars.
(XTins_del_lines): Don't do any X calls; just update the array.
(do_line_dance): New function. Do the X calls here.
(XTupdate_end, XTwrite_glyphs): Call do_line_dance.