summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/alloc.c2
-rw-r--r--src/dispextern.h7
-rw-r--r--src/frame.c6
-rw-r--r--src/xdisp.c20
-rw-r--r--src/xfns.c6
-rw-r--r--src/xterm.c12
6 files changed, 44 insertions, 9 deletions
diff --git a/src/alloc.c b/src/alloc.c
index f479226845a..ae892e49d7d 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -1760,7 +1760,7 @@ static char const string_overrun_cookie[GC_STRING_OVERRUN_COOKIE_SIZE] =
#ifdef GC_CHECK_STRING_BYTES
-#define SDATA_SIZE(NBYTES) FLEXSIZEOF (struct sdata, data, NBYTES)
+#define SDATA_SIZE(NBYTES) FLEXSIZEOF (struct sdata, data, (NBYTES) + 1)
#else /* not GC_CHECK_STRING_BYTES */
diff --git a/src/dispextern.h b/src/dispextern.h
index 2f55d8cbc87..430afbf09a3 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -3452,7 +3452,14 @@ void gamma_correct (struct frame *, COLORREF *);
void x_implicitly_set_name (struct frame *, Lisp_Object, Lisp_Object);
void x_change_tool_bar_height (struct frame *f, int);
+/* The frame used to display a tooltip.
+
+ Note: In a GTK build with non-zero x_gtk_use_system_tooltips, this
+ variable holds the frame that shows the tooltip, not the frame of
+ the tooltip itself, so checking whether a frame is a tooltip frame
+ cannot just compare the frame to what this variable holds. */
extern Lisp_Object tip_frame;
+
extern Window tip_window;
extern frame_parm_handler x_frame_parm_handlers[];
diff --git a/src/frame.c b/src/frame.c
index fe1709e6ede..2b32751c0d3 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -1472,7 +1472,11 @@ DEFUN ("frame-list", Fframe_list, Sframe_list,
Lisp_Object frames;
frames = Fcopy_sequence (Vframe_list);
#ifdef HAVE_WINDOW_SYSTEM
- if (FRAMEP (tip_frame))
+ if (FRAMEP (tip_frame)
+#ifdef USE_GTK
+ && !NILP (Fframe_parameter (tip_frame, Qtooltip))
+#endif
+ )
frames = Fdelq (tip_frame, frames);
#endif
return frames;
diff --git a/src/xdisp.c b/src/xdisp.c
index f1a6c622d09..f1c6b9ff699 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -16066,8 +16066,10 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp,
since the handling of this_line_start_pos, etc., in redisplay
handles the same cases. */
&& !EQ (window, minibuf_window)
- && (FRAME_WINDOW_P (f)
- || !overlay_arrow_in_current_buffer_p ()))
+ /* When overlay arrow is shown in current buffer, point movement
+ is no longer "simple", as it typically causes the overlay
+ arrow to move as well. */
+ && !overlay_arrow_in_current_buffer_p ())
{
int this_scroll_margin, top_scroll_margin;
struct glyph_row *row = NULL;
@@ -17698,7 +17700,11 @@ try_window_reusing_current_matrix (struct window *w)
/* Don't try to reuse the display if windows have been split
or such. */
|| windows_or_buffers_changed
- || f->cursor_type_changed)
+ || f->cursor_type_changed
+ /* This function cannot handle buffers where the overlay arrow
+ is shown on the fringes, because if the arrow position
+ changes, we cannot just reuse the current matrix. */
+ || overlay_arrow_in_current_buffer_p ())
return false;
/* Can't do this if showing trailing whitespace. */
@@ -21126,7 +21132,13 @@ should_produce_line_number (struct it *it)
#ifdef HAVE_WINDOW_SYSTEM
/* Don't display line number in tooltip frames. */
- if (FRAMEP (tip_frame) && EQ (WINDOW_FRAME (it->w), tip_frame))
+ if (FRAMEP (tip_frame) && EQ (WINDOW_FRAME (it->w), tip_frame)
+#ifdef USE_GTK
+ /* GTK builds store in tip_frame the frame that shows the tip,
+ so we need an additional test. */
+ && !NILP (Fframe_parameter (tip_frame, Qtooltip))
+#endif
+ )
return false;
#endif
diff --git a/src/xfns.c b/src/xfns.c
index 9022e4a9674..83fc07dc6cb 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -4915,7 +4915,11 @@ Internal use only, use `display-monitor-attributes-list' instead. */)
struct frame *f = XFRAME (frame);
if (FRAME_X_P (f) && FRAME_DISPLAY_INFO (f) == dpyinfo
- && !EQ (frame, tip_frame))
+ && !(EQ (frame, tip_frame)
+#ifdef USE_GTK
+ && !NILP (Fframe_parameter (tip_frame, Qtooltip))
+#endif
+ ))
{
GdkWindow *gwin = gtk_widget_get_window (FRAME_GTK_WIDGET (f));
diff --git a/src/xterm.c b/src/xterm.c
index dbb8349452d..e11cde771ab 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -997,7 +997,11 @@ x_update_begin (struct frame *f)
{
#ifdef USE_CAIRO
if (! NILP (tip_frame) && XFRAME (tip_frame) == f
- && ! FRAME_VISIBLE_P (f))
+ && ! FRAME_VISIBLE_P (f)
+#ifdef USE_GTK
+ && !NILP (Fframe_parameter (tip_frame, Qtooltip))
+#endif
+ )
return;
if (! FRAME_CR_SURFACE (f))
@@ -9960,7 +9964,11 @@ x_new_font (struct frame *f, Lisp_Object font_object, int fontset)
/* Don't change the size of a tip frame; there's no point in
doing it because it's done in Fx_show_tip, and it leads to
problems because the tip frame has no widget. */
- if (NILP (tip_frame) || XFRAME (tip_frame) != f)
+ if (NILP (tip_frame) || XFRAME (tip_frame) != f
+#ifdef USE_GTK
+ || NILP (Fframe_parameter (tip_frame, Qtooltip))
+#endif
+ )
{
adjust_frame_size (f, FRAME_COLS (f) * FRAME_COLUMN_WIDTH (f),
FRAME_LINES (f) * FRAME_LINE_HEIGHT (f), 3,