summaryrefslogtreecommitdiff
path: root/src/frame.h
diff options
context:
space:
mode:
authorMartin Rudalics <rudalics@gmx.at>2018-01-18 10:36:47 +0100
committerMartin Rudalics <rudalics@gmx.at>2018-01-18 10:36:47 +0100
commite462308f03c9c16c47abc82d6f339ca9d18898f9 (patch)
tree49cc7306cb35a007eb43a2fe122be881f5cfa13f /src/frame.h
parent6e9f20b3ff49adfc05a7f4b49b1b92daa4fb1ca9 (diff)
downloademacs-e462308f03c9c16c47abc82d6f339ca9d18898f9.tar.gz
Fix some tooltip related problems
Replace 'tooltip' frame parameter with a 'tooltip' member in the frame structure. For GTK+ builds use 'tip_last_frame' to find the frame for which the currently visible tooltip was made. For modeline help-echoing have tooltips show applicable actions only. * lisp/bindings.el (mode-line-default-help-echo): New function as default value of homonymous option. * src/dispextern.h (tip_frame, tip_window): Remove declarations. * src/frame.c (make_frame): Initialize new frame structure member 'tooltip'. (Fframe_list, other_frames): Rewrite with new macro FRAME_TOOLTIP_P. * src/frame.h (struct frame): New member 'tooltip'. (FRAME_TOOLTIP_P): New macro. * src/gtkutil.c (xg_prepare_tooltip, xg_hide_tooltip): Rewrite using boolean return values. * src/nsfns.m (tip_frame): Remove declaration. * src/w32fns.c (w32_display_monitor_attributes_list) (w32_display_monitor_attributes_list_fallback): Rewrite with new macro FRAME_TOOLTIP_P. (tip_last_string, tip_last_frame, tip_last_parms): New Lisp scalars replacing Lisp vector last_show_tip_args. (x_create_tip_frame): Set new frame's 'tooltip' structure member to true. (x_hide_tip): Additionally test tip_frame for liveness. (Fx_show_tip): Handle last_show_tip_args to tip_last_frame, tip_last_string and tip_last_parms conversion. (syms_of_w32fns): staticpro tip_last_frame, tip_last_string and tip_last_parms instead of last_show_tip_args. * src/w32term.c (w32_read_socket, x_new_font): Rewrite with new macro FRAME_TOOLTIP_P. * src/w32term.h (tip_window): Add external declaration. * src/xdisp.c (x_consider_frame_title, prepare_menu_bars) (should_produce_line_number): Rewrite with new macro FRAME_TOOLTIP_P. (note_mode_line_or_margin_highlight): If `mode-line-default-help-echo' specifies a function, call it to produce help echo string. * src/xfns.c (x_make_monitor_attribute_list) (Fx_display_monitor_attributes_list): Rewrite with new macro FRAME_TOOLTIP_P. (tip_last_string, tip_last_frame, tip_last_parms): New Lisp scalars replacing Lisp vector last_show_tip_args. (x_create_tip_frame): Set new frame's 'tooltip' structure member to true. (x_hide_tip): Rewrite with additional tests of frames for liveness and taking into account that for GTK+ tips the reference frame is now stored in tip_last_frame instead of tip_frame. (Fx_show_tip): Handle last_show_tip_args to tip_last_frame, tip_last_string and tip_last_parms conversion. For GTK+ store FRAME argument in tip_last-frame. (syms_of_xfns): staticpro tip_last_frame, tip_last_string and tip_last_parms instead of last_show_tip_args. * src/xterm.c (x_update_begin, handle_one_xevent, x_new_font) (x_set_window_size): Rewrite with new macro FRAME_TOOLTIP_P. * src/xterm.h (tip_window): Add external declaration. * etc/NEWS: Mention new modeline tooltips behavior.
Diffstat (limited to 'src/frame.h')
-rw-r--r--src/frame.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/frame.h b/src/frame.h
index 402d6c0a7b2..2c9c4143886 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -342,6 +342,9 @@ struct frame
ENUM_BF (output_method) output_method : 3;
#ifdef HAVE_WINDOW_SYSTEM
+ /* True if this frame is a tooltip frame. */
+ bool_bf tooltip : 1;
+
/* See FULLSCREEN_ enum on top. */
ENUM_BF (fullscreen_type) want_fullscreen : 4;
@@ -351,9 +354,7 @@ struct frame
/* Nonzero if we should actually display horizontal scroll bars on this frame. */
bool_bf horizontal_scroll_bars : 1;
-#endif /* HAVE_WINDOW_SYSTEM */
-#if defined (HAVE_WINDOW_SYSTEM)
/* True if this is an undecorated frame. */
bool_bf undecorated : 1;
@@ -967,6 +968,7 @@ default_pixels_per_inch_y (void)
#define FRAME_Z_GROUP_ABOVE_SUSPENDED(f) \
((f)->z_group == z_group_above_suspended)
#define FRAME_Z_GROUP_BELOW(f) ((f)->z_group == z_group_below)
+#define FRAME_TOOLTIP_P(f) ((f)->tooltip)
#ifdef NS_IMPL_COCOA
#define FRAME_NS_APPEARANCE(f) ((f)->ns_appearance)
#define FRAME_NS_TRANSPARENT_TITLEBAR(f) ((f)->ns_transparent_titlebar)
@@ -983,6 +985,7 @@ default_pixels_per_inch_y (void)
#define FRAME_Z_GROUP_NONE(f) ((void) (f), true)
#define FRAME_Z_GROUP_ABOVE(f) ((void) (f), false)
#define FRAME_Z_GROUP_BELOW(f) ((void) (f), false)
+#define FRAME_TOOLTIP_P(f) ((void) f, false)
#endif /* HAVE_WINDOW_SYSTEM */
/* Whether horizontal scroll bars are currently enabled for frame F. */