1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-29 07:58:28 +00:00

Fix tool-tip display when display margins are non-zero by default

* src/buffer.h (bset_left_margin_cols, bset_right_margin_cols):
New inline functions.
* src/xfns.c (Fx_show_tip):
* src/w32fns.c (Fx_show_tip): Force display margins of the tip
buffer to zero, as it will be displayed in a pseudo-window, which
doesn't support display margins.  (Bug#29627)
This commit is contained in:
Eli Zaretskii 2017-12-09 22:06:19 +02:00
parent e1cc2037a9
commit 122e7264b8
4 changed files with 26 additions and 3 deletions

View File

@ -949,6 +949,16 @@ bset_display_count (struct buffer *b, Lisp_Object val)
b->display_count_ = val;
}
INLINE void
bset_left_margin_cols (struct buffer *b, Lisp_Object val)
{
b->left_margin_cols_ = val;
}
INLINE void
bset_right_margin_cols (struct buffer *b, Lisp_Object val)
{
b->right_margin_cols_ = val;
}
INLINE void
bset_display_time (struct buffer *b, Lisp_Object val)
{
b->display_time_ = val;

View File

@ -7346,6 +7346,7 @@ Text larger than the specified size is clipped. */)
ptrdiff_t count = SPECPDL_INDEX ();
ptrdiff_t count_1;
Lisp_Object window, size;
Lisp_Object tip_buf;
AUTO_STRING (tip, " *tip*");
specbind (Qinhibit_redisplay, Qt);
@ -7503,7 +7504,12 @@ Text larger than the specified size is clipped. */)
tip_f = XFRAME (tip_frame);
window = FRAME_ROOT_WINDOW (tip_f);
set_window_buffer (window, Fget_buffer_create (tip), false, false);
tip_buf = Fget_buffer_create (tip);
/* We will mark the tip window a "pseudo-window" below, and such
windows cannot have display margins. */
bset_left_margin_cols (XBUFFER (tip_buf), make_number (0));
bset_right_margin_cols (XBUFFER (tip_buf), make_number (0));
set_window_buffer (window, tip_buf, false, false);
w = XWINDOW (window);
w->pseudo_window_p = true;

View File

@ -370,7 +370,8 @@ struct window
bool_bf must_be_updated_p : 1;
/* Flag indicating that this window is not a real one.
Currently only used for menu bar windows of frames. */
Currently only used for menu bar windows, for tool bar windows,
and for tooltips. */
bool_bf pseudo_window_p : 1;
/* True means fringes are drawn outside display margins.

View File

@ -6623,6 +6623,7 @@ Text larger than the specified size is clipped. */)
ptrdiff_t count = SPECPDL_INDEX ();
ptrdiff_t count_1;
Lisp_Object window, size;
Lisp_Object tip_buf;
AUTO_STRING (tip, " *tip*");
specbind (Qinhibit_redisplay, Qt);
@ -6787,7 +6788,12 @@ Text larger than the specified size is clipped. */)
tip_f = XFRAME (tip_frame);
window = FRAME_ROOT_WINDOW (tip_f);
set_window_buffer (window, Fget_buffer_create (tip), false, false);
tip_buf = Fget_buffer_create (tip);
/* We will mark the tip window a "pseudo-window" below, and such
windows cannot have display margins. */
bset_left_margin_cols (XBUFFER (tip_buf), make_number (0));
bset_right_margin_cols (XBUFFER (tip_buf), make_number (0));
set_window_buffer (window, tip_buf, false, false);
w = XWINDOW (window);
w->pseudo_window_p = true;