(fast_find_position): Handle case where position is before
an invisible character, thus not actually listed in charstarts.
(x_make_frame_visible): Use XGetGeometry to see if
position has been changed by the window manager. Use
FRAME_OUTER_WINDOW.
is non-null before calling note_mouse_highlight.
(x_destroy_window): If f equals mouse_face_mouse_frame,
clear that, and clear mouse_face_deferred_gc too.
For wm_take_focus, use x_any_window_to_frame.
Don't use FRAME_XIC if it is null, here.
(dumpglyphs): Use 8-bit output to X, rather than 16-bit,
if the character values permit that.
(x_new_fontset): If frame F has already using FONTSET, avoid the
duplicated work. Use FS_LOAD_FONT.
(x_list_fonts): Call Fassoc to search Valternate_charset_table.
(x_load_font): Get around a buf of XListFonts
x_wm_set_size_hint if window has no parent yet.
Simplify the call to x_real_positions.
(x_make_frame_visible): Use win_gravity to decide whether to
call XMoveWindow. Also, don't do it if frame already visible.
when frame was made invisible.
(x_make_frame_visible): Put the call to x_set_offset back as it was.
Near the end, instead call XMoveWindow, but only if original
positions were not negative.
mapping the window and accepting input.
(x_calc_absolute_position): Do nothing if current position
is already for the top-left corner.
Handle errors in XTranslateCoordinates.
(XTread_socket): Simplify handling of ConfigureNotify events.
Always call x_wm_set_size_hint for them.
No need to call XTranslateCoordinates here.
(x_clear_errors): New function.
Save value of x_catch_errors and pass to x_uncatch_errors.
(x_catch_errors): Use specpdl so can be nested.
Use a Lisp string to as the buffer for the X message.
(x_uncatch_errors, x_had_errors_p, x_check_errors): Related changes.
(x_catch_errors_unwind): New function.
(x_error_quitter): Call x_error_catcher if appropriate.
(x_error_message_string): New variable.
(syms_of_xterm): Defvar it.
(x_caught_error_message): Variable deleted.
(X_ERROR_MESSAGE_SIZE): Renamed from X_CAUGHT_ERROR_MESSAGE_SIZE.
(x_error_handler): New function, calls x_error_quitter or ..._checker.
(x_initialize): Use x_error_handler as error handler for X.
use-default-ascent.
Fill background in advance if font has
non-zero _MULE_BASELINE_OFFSET property.
(x_load_font, x_term_init): Handle font property _MULE_DEFAULT_ASCENT.
(PER_CHAR_METRIC): New macro.
(dumpglyphs): New argument CMPCHARP. Handle multibyte characters.
(XTwrite_glyphs, redraw_previous_char, redraw_following_char):
Supply argument CMPCHARP to dumpglyphs.
(dumprectangle): Display whole glyph of wide-column characters.
Supply argument CMPCHARP to dumpglyphs.
(show_mouse_face): Supply argument CMPCHARP to dumpglyphs.
(x_draw_box): Pay attention to wide-column characters.
(x_draw_single_glyph): Supply argument CMPCHARP to dumpglyphs.
(x_new_font): Call fs_load_font for actual font loading work.
(x_new_fontset): New function.
(x_get_font_info, x_list_fonts, x_load_font, x_query_font): New
functions providing API to fontset handler.
(x_term_init): Initialize several new members of struct x_display_info.
(clear_cursor, x_display_bar_cursor, x_display_box_cursor)
(x_set_window_size): Use phys_cursor_on field in frame.
(x_update_cursor): Negative phys_cursor_x no longer means anything.
(x_scroll_bar_expose): Use VERTICAL_SCROLL_BAR_WIDTH_TRIM.
(XTchange_line_highlight, dumpglyphs, XTclear_end_of_line)
(do_line_dance, pixel_to_glyph_coords): Use FRAME_WINDOW_WIDTH.
(x_scroll_bar_move, x_scroll_bar_create):
Add a border around the actual window.
(x_scroll_bar_expose): Don't trim the width here.
and VERTICAL_SCROLL_BAR_TOP_RANGE.
(XTclear_end_of_line): Shift end-of-line when there is a
left-side scroll bar by FRAME_LEFT_SCROLL_BAR_WIDTH.
(do_line_dance): Take into account the width of a left-side scroll bar.
(dumprectangle): Trim at FRAME_EXTERNAL_WIDTH instead of FRAME_WIDTH.
(fast_find_position): Use new macro WINDOW_LEFT_MARGIN.
(show_mouse_face): Likewise.
(x_scroll_bar_set_handle): VERTICAL_SCROLL_BAR_INSIDE_WIDTH now
requires the frame as an argument.
(x_scroll_bar_expose): Narrow the box slightly for a left-side scroll bar.
(show_mouse_face, clear_cursor): Likewise.
(x_display_cursor): New args X and Y.
(XTupdate_end, XTcursor_to, XTwrite_glyphs): Pass new args.
(XTupdate_begin): Initialize curs_x, curs_y here.
only for Motif.
(XTread_socket): Fixing previous change:
Clear last_mouse_press_frame on non-menu-bar ButtonPress.
Always use last_mouse_press_frame as frame for ButtonRelease.
But ignore the event if frame's output_data.x is null.
Save the ButtonRelease only if USE_MOTIF.
(last_mouse_press_frame): This is now a Lisp object.
(syms_of_xterm): Initialize and staticpro it.
(x_connection_close_if_hung): New subroutine, at the end of the file.
Include X11/Xlibint.h only for this function.
#undef bcopy, bzero, bcmp, min, max first.
Define malloc and free to avoid type conflicts.
(x_connection_signal): Use x_connection_close_if_hung.
if it applies to this frame.
Clear out the frame cursor position in Xt version as in Xlib version.
(x_update_cursor): If no previous cursor position is known,
leave the cursor off.
(x_connection_closed): Set FRAME_X_DISPLAY to 0.
(x_destroy_window): Don't do any X operations if FRAME_X_DISPLAY is 0.
(x_term_init): Use "" as 2nd arg to setlocale.
(x_connection_signal): Don't stop polling.
Don't mess with SIGALRM.
Those were relics of the superseded Dec 19 change.
on Solaris.
[SOLARIS2]: Include Xlibint.h.
(x_connection_signal): Access XlibDisplayWriting properly.
No need to sleep--if the flag is set, assume connection is dead.
(x_connection_signal): Try all the server connections
to see which one was lost.
(XTcondemn_scroll_bars): No error if
FRAME_CONDEMNED_SCROLL_BARS is non-nil already.
Just move all the scroll bars into there.
(XTread_socket): Use that to cycle through all displays for XNoOp.
(XTread_socket) [USE_X_TOOLKIT]: For ButtonPress in menu bar,
save the event--don't pass to Xt yet. Make a menu_bar_activate_event.
(temp_index, temp_buffer): Now static.
(x_term_init) [HAVE_X11XTR6]: Set LC_NUMERIC and LC_TIME back to C.
(note_mouse_movement): Set mouse_moved in the x_display_info.
(XTmouse_position, x_scroll_bar_note_movement): Likewise.
(x_scroll_bar_report_motion): Likewise.
(x_draw_box, x_display_box_cursor, x_display_bar_cursor):
New args x, y. Don't use curs_x or curs_y here. Callers changed.
in the arg for XLookupKey.
(x_display_bar_cursor, x_display_box_cursor):
Don't alter curs_x or curs_y here.
(x_display_cursor): Copy them from the frame cursor here.
(x_update_cursor): New function.
(frame_highlight, frame_unhighlight): Use x_update_cursor.
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.