[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-26 122e726: Fix tool-tip display when display margin
From: |
Eli Zaretskii |
Subject: |
[Emacs-diffs] emacs-26 122e726: Fix tool-tip display when display margins are non-zero by default |
Date: |
Sat, 9 Dec 2017 15:07:34 -0500 (EST) |
branch: emacs-26
commit 122e7264b88049e8d1a0b54dd993f137238c33fb
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>
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)
---
src/buffer.h | 10 ++++++++++
src/w32fns.c | 8 +++++++-
src/window.h | 3 ++-
src/xfns.c | 8 +++++++-
4 files changed, 26 insertions(+), 3 deletions(-)
diff --git a/src/buffer.h b/src/buffer.h
index 46c7c6e..ecd2360 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -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;
diff --git a/src/w32fns.c b/src/w32fns.c
index 43af112..b81cd70 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -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;
diff --git a/src/window.h b/src/window.h
index 25c9686..563a6f6 100644
--- a/src/window.h
+++ b/src/window.h
@@ -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.
diff --git a/src/xfns.c b/src/xfns.c
index bbe73aa..044f148 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -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;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] emacs-26 122e726: Fix tool-tip display when display margins are non-zero by default,
Eli Zaretskii <=