• Dmitry Antipov's avatar
    Cleanup tooltips · 20038f8a
    Dmitry Antipov authored
    * src/dispextern.h (toplevel): Remove 'tip_frame' and 'tip_window' decls.
    * src/frame.h (struct frame): New bitfield to indicate tooltip frame.
    (FRAME_TOOLTIP_P): New macro.
    * src/frame.c (make_frame): Mark new frame as regular frame by default.
    (Fframe_list, delete_frame): Redesign to use FRAME_TOOLTIP_P.
    (syms_of_frame): Don't DEFSYM 'Qtooltip' but use 'Qtooltip_timer'
    and 'Qtooltip_parameters' instead.
    * src/gtkutil.h (toplevel): Add 'xg_hide_tip' decl.
    * src/gtkutil.c (xg_hide_tip): New function.
    (xg_hide_tooltip): Adjust to cancel GTK event loop timeout if needed.
    * src/menu.c (Fx_popup_menu): Adjust call to Fx_hide_tip.
    * src/nsfns.c (toplevel): Remove 'tip_frame' leftover.
    * src/w32fns.c (unwind_create_tip_frame): Remove.
    (w32_display_monitor_attributes_list)
    (w32_display_monitor_attributes_list_fallback): Use FRAME_TOOLTIP_P.
    (toplevel): Remove 'tip_frame', 'tip_window' and 'last_show_tip_args'.
    (x_create_tip_frame): Use do_unwind_create_frame.  Mark new frame
    as a tooltip frame and record it using appropriate display info.
    (x_hide_tooltip): Add frame arg.
    (Fx_show_tip): Adjust to avoid globals, store tooltip parameters among
    base frame parameters, store tooltip hide timer among tooltip frame
    parameters.
    (Fx_hide_tip): Add frame arg, hide tooltips on all displays by default.
    (syms_of_w32fns): Don't DEFSYM 'Qtip_frame', don't initialize
    and GC-protect 'tip_timer', 'tip_frame' and 'last_show_tip_args'.
    * src/w32term.c (w32_read_socket): Extract tooltip window id from
    per-display data.  Use FRAME_TOOLTIP_P where appropriate.
    (x_new_font): Use FRAME_TOOLTIP_P.
    (x_free_frame_resources): Reset pointer to tooltip frame.
    * src/w32term.h (struct w32_display_info): New member 'w32_tooltip_frame'.
    * src/xdisp.c (init_iterator, x_consider_frame_title, prepare_menu_bars):
    Use FRAME_TOOLTIP_P.
    * src/xfns.c (x_make_monitor_attribute_list)
    (Fx_display_monitor_attributes_list): Likewise.
    (unwind_create_tip_frame): Remove.
    (toplevel): Remove 'tip_frame', 'tip_window' and 'last_show_tip_args'.
    (x_create_tip_frame): Use do_unwind_create_frame.  Mark new frame
    as a tooltip frame and record it using appropriate display info.
    (x_hide_tooltip): Add frame arg.
    (Fx_show_tip): Adjust to avoid globals, store tooltip parameters among
    base frame parameters, store tooltip hide timer among tooltip frame
    parameters.  To hide GTK system tooltip, use timeout hooked into GTK
    event loop.
    (Fx_hide_tip): Add frame arg, hide tooltips on all displays by default.
    (syms_of_xfns): Don't DEFSYM 'Qtip_frame', don't initialize
    and GC-protect 'tip_timer', 'tip_frame' and 'last_show_tip_args'.
    * src/xterm.c (handle_one_xevent): Extract tooltip window id from
    per-display data.  Use FRAME_TOOLTIP_P where appropriate.
    (x_new_font, x_set_window_size): Use FRAME_TOOLTIP_P.
    (x_free_frame_resources): Reset pointer to tooltip frame.
    * src/xterm.h (struct x_display_info): New member 'x_tooltip_frame'.
    (struct x_output) [USE_GTK_TOOLTIP]: New member 'ttip_timeout'.
    20038f8a
w32term.c 204 KB