summaryrefslogtreecommitdiff
path: root/src/xterm.h
diff options
context:
space:
mode:
authorDmitry Antipov <dmantipov@yandex.ru>2016-07-12 09:16:26 +0300
committerDmitry Antipov <dmantipov@yandex.ru>2016-07-12 09:16:26 +0300
commit20038f8ab75dd1551412a43cd58520c483c22921 (patch)
treeb42949b761e9642ae6dabc2cfb399f2000207e46 /src/xterm.h
parent8ea599254784e3e6da37ec7ea73f1f6ec6a92ff1 (diff)
downloademacs-20038f8ab75dd1551412a43cd58520c483c22921.tar.gz
Cleanup tooltips
* 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'.
Diffstat (limited to 'src/xterm.h')
-rw-r--r--src/xterm.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/xterm.h b/src/xterm.h
index 675a48443dc..1eb3e304f84 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -362,6 +362,9 @@ struct x_display_info
/* The frame waiting to be auto-raised in XTread_socket. */
struct frame *x_pending_autoraise_frame;
+ /* Tooltip frame on this display. */
+ struct frame *x_tooltip_frame;
+
/* The frame where the mouse was last time we reported a ButtonPress event. */
struct frame *last_mouse_frame;
@@ -575,6 +578,7 @@ struct x_output
GtkTooltip *ttip_widget;
GtkWidget *ttip_lbl;
GtkWindow *ttip_window;
+ guint ttip_timeout;
#endif /* USE_GTK_TOOLTIP */
#endif /* USE_GTK */