aboutsummaryrefslogtreecommitdiffstats
path: root/src/nsfns.m
diff options
context:
space:
mode:
Diffstat (limited to 'src/nsfns.m')
-rw-r--r--src/nsfns.m30
1 files changed, 27 insertions, 3 deletions
diff --git a/src/nsfns.m b/src/nsfns.m
index 16174210669..b0b779bd41c 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -3210,7 +3210,8 @@ x_hide_tip (bool delete)
3210 3210
3211DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0, 3211DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0,
3212 doc: /* SKIP: real doc in xfns.c. */) 3212 doc: /* SKIP: real doc in xfns.c. */)
3213 (Lisp_Object string, Lisp_Object frame, Lisp_Object parms, Lisp_Object timeout, Lisp_Object dx, Lisp_Object dy) 3213 (Lisp_Object string, Lisp_Object frame, Lisp_Object parms,
3214 Lisp_Object timeout, Lisp_Object dx, Lisp_Object dy)
3214{ 3215{
3215 int root_x, root_y; 3216 int root_x, root_y;
3216 specpdl_ref count = SPECPDL_INDEX (); 3217 specpdl_ref count = SPECPDL_INDEX ();
@@ -3224,6 +3225,10 @@ DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0,
3224 Lisp_Object window, size, tip_buf; 3225 Lisp_Object window, size, tip_buf;
3225 char *str; 3226 char *str;
3226 NSWindow *nswindow; 3227 NSWindow *nswindow;
3228 bool displayed;
3229#ifdef ENABLE_CHECKING
3230 struct glyph_row *row, *end;
3231#endif
3227 3232
3228 AUTO_STRING (tip, " *tip*"); 3233 AUTO_STRING (tip, " *tip*");
3229 3234
@@ -3454,7 +3459,26 @@ DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0,
3454 clear_glyph_matrix (w->desired_matrix); 3459 clear_glyph_matrix (w->desired_matrix);
3455 clear_glyph_matrix (w->current_matrix); 3460 clear_glyph_matrix (w->current_matrix);
3456 SET_TEXT_POS (pos, BEGV, BEGV_BYTE); 3461 SET_TEXT_POS (pos, BEGV, BEGV_BYTE);
3457 try_window (window, pos, TRY_WINDOW_IGNORE_FONTS_CHANGE); 3462 displayed = try_window (window, pos, TRY_WINDOW_IGNORE_FONTS_CHANGE);
3463
3464 if (!displayed && NILP (Vx_max_tooltip_size))
3465 {
3466#ifdef ENABLE_CHECKING
3467 row = w->desired_matrix->rows;
3468 end = w->desired_matrix->rows + w->desired_matrix->nrows;
3469
3470 while (row < end)
3471 {
3472 if (!row->displays_text_p
3473 || row->ends_at_zv_p)
3474 break;
3475 ++row;
3476 }
3477
3478 eassert (row < end && row->ends_at_zv_p);
3479#endif
3480 }
3481
3458 /* Calculate size of tooltip window. */ 3482 /* Calculate size of tooltip window. */
3459 size = Fwindow_text_pixel_size (window, Qnil, Qnil, Qnil, 3483 size = Fwindow_text_pixel_size (window, Qnil, Qnil, Qnil,
3460 make_fixnum (w->pixel_height), Qnil, 3484 make_fixnum (w->pixel_height), Qnil,
@@ -3889,7 +3913,7 @@ Default is t. */);
3889 3913
3890 DEFVAR_LISP ("x-max-tooltip-size", Vx_max_tooltip_size, 3914 DEFVAR_LISP ("x-max-tooltip-size", Vx_max_tooltip_size,
3891 doc: /* SKIP: real doc in xfns.c. */); 3915 doc: /* SKIP: real doc in xfns.c. */);
3892 Vx_max_tooltip_size = Fcons (make_fixnum (80), make_fixnum (40)); 3916 Vx_max_tooltip_size = Qnil;
3893 3917
3894 defsubr (&Sns_read_file_name); 3918 defsubr (&Sns_read_file_name);
3895 defsubr (&Sns_get_resource); 3919 defsubr (&Sns_get_resource);