diff options
| author | Eli Zaretskii | 2017-12-09 22:06:19 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2017-12-09 22:06:19 +0200 |
| commit | 122e7264b88049e8d1a0b54dd993f137238c33fb (patch) | |
| tree | 9db4446dd341a4401c524d1b6790814254adf3f5 /src | |
| parent | e1cc2037a9183bab9440b7b981a233c95d896aac (diff) | |
| download | emacs-122e7264b88049e8d1a0b54dd993f137238c33fb.tar.gz emacs-122e7264b88049e8d1a0b54dd993f137238c33fb.zip | |
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)
Diffstat (limited to 'src')
| -rw-r--r-- | src/buffer.h | 10 | ||||
| -rw-r--r-- | src/w32fns.c | 8 | ||||
| -rw-r--r-- | src/window.h | 3 | ||||
| -rw-r--r-- | src/xfns.c | 8 |
4 files changed, 26 insertions, 3 deletions
diff --git a/src/buffer.h b/src/buffer.h index 46c7c6e5ad6..ecd2360dbca 100644 --- a/src/buffer.h +++ b/src/buffer.h | |||
| @@ -949,6 +949,16 @@ bset_display_count (struct buffer *b, Lisp_Object val) | |||
| 949 | b->display_count_ = val; | 949 | b->display_count_ = val; |
| 950 | } | 950 | } |
| 951 | INLINE void | 951 | INLINE void |
| 952 | bset_left_margin_cols (struct buffer *b, Lisp_Object val) | ||
| 953 | { | ||
| 954 | b->left_margin_cols_ = val; | ||
| 955 | } | ||
| 956 | INLINE void | ||
| 957 | bset_right_margin_cols (struct buffer *b, Lisp_Object val) | ||
| 958 | { | ||
| 959 | b->right_margin_cols_ = val; | ||
| 960 | } | ||
| 961 | INLINE void | ||
| 952 | bset_display_time (struct buffer *b, Lisp_Object val) | 962 | bset_display_time (struct buffer *b, Lisp_Object val) |
| 953 | { | 963 | { |
| 954 | b->display_time_ = val; | 964 | b->display_time_ = val; |
diff --git a/src/w32fns.c b/src/w32fns.c index 43af1122fad..b81cd70e0a7 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -7346,6 +7346,7 @@ Text larger than the specified size is clipped. */) | |||
| 7346 | ptrdiff_t count = SPECPDL_INDEX (); | 7346 | ptrdiff_t count = SPECPDL_INDEX (); |
| 7347 | ptrdiff_t count_1; | 7347 | ptrdiff_t count_1; |
| 7348 | Lisp_Object window, size; | 7348 | Lisp_Object window, size; |
| 7349 | Lisp_Object tip_buf; | ||
| 7349 | AUTO_STRING (tip, " *tip*"); | 7350 | AUTO_STRING (tip, " *tip*"); |
| 7350 | 7351 | ||
| 7351 | specbind (Qinhibit_redisplay, Qt); | 7352 | specbind (Qinhibit_redisplay, Qt); |
| @@ -7503,7 +7504,12 @@ Text larger than the specified size is clipped. */) | |||
| 7503 | 7504 | ||
| 7504 | tip_f = XFRAME (tip_frame); | 7505 | tip_f = XFRAME (tip_frame); |
| 7505 | window = FRAME_ROOT_WINDOW (tip_f); | 7506 | window = FRAME_ROOT_WINDOW (tip_f); |
| 7506 | set_window_buffer (window, Fget_buffer_create (tip), false, false); | 7507 | tip_buf = Fget_buffer_create (tip); |
| 7508 | /* We will mark the tip window a "pseudo-window" below, and such | ||
| 7509 | windows cannot have display margins. */ | ||
| 7510 | bset_left_margin_cols (XBUFFER (tip_buf), make_number (0)); | ||
| 7511 | bset_right_margin_cols (XBUFFER (tip_buf), make_number (0)); | ||
| 7512 | set_window_buffer (window, tip_buf, false, false); | ||
| 7507 | w = XWINDOW (window); | 7513 | w = XWINDOW (window); |
| 7508 | w->pseudo_window_p = true; | 7514 | w->pseudo_window_p = true; |
| 7509 | 7515 | ||
diff --git a/src/window.h b/src/window.h index 25c9686a9f0..563a6f6ff0d 100644 --- a/src/window.h +++ b/src/window.h | |||
| @@ -370,7 +370,8 @@ struct window | |||
| 370 | bool_bf must_be_updated_p : 1; | 370 | bool_bf must_be_updated_p : 1; |
| 371 | 371 | ||
| 372 | /* Flag indicating that this window is not a real one. | 372 | /* Flag indicating that this window is not a real one. |
| 373 | Currently only used for menu bar windows of frames. */ | 373 | Currently only used for menu bar windows, for tool bar windows, |
| 374 | and for tooltips. */ | ||
| 374 | bool_bf pseudo_window_p : 1; | 375 | bool_bf pseudo_window_p : 1; |
| 375 | 376 | ||
| 376 | /* True means fringes are drawn outside display margins. | 377 | /* True means fringes are drawn outside display margins. |
diff --git a/src/xfns.c b/src/xfns.c index bbe73aa7c28..044f14876e3 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -6623,6 +6623,7 @@ Text larger than the specified size is clipped. */) | |||
| 6623 | ptrdiff_t count = SPECPDL_INDEX (); | 6623 | ptrdiff_t count = SPECPDL_INDEX (); |
| 6624 | ptrdiff_t count_1; | 6624 | ptrdiff_t count_1; |
| 6625 | Lisp_Object window, size; | 6625 | Lisp_Object window, size; |
| 6626 | Lisp_Object tip_buf; | ||
| 6626 | AUTO_STRING (tip, " *tip*"); | 6627 | AUTO_STRING (tip, " *tip*"); |
| 6627 | 6628 | ||
| 6628 | specbind (Qinhibit_redisplay, Qt); | 6629 | specbind (Qinhibit_redisplay, Qt); |
| @@ -6787,7 +6788,12 @@ Text larger than the specified size is clipped. */) | |||
| 6787 | 6788 | ||
| 6788 | tip_f = XFRAME (tip_frame); | 6789 | tip_f = XFRAME (tip_frame); |
| 6789 | window = FRAME_ROOT_WINDOW (tip_f); | 6790 | window = FRAME_ROOT_WINDOW (tip_f); |
| 6790 | set_window_buffer (window, Fget_buffer_create (tip), false, false); | 6791 | tip_buf = Fget_buffer_create (tip); |
| 6792 | /* We will mark the tip window a "pseudo-window" below, and such | ||
| 6793 | windows cannot have display margins. */ | ||
| 6794 | bset_left_margin_cols (XBUFFER (tip_buf), make_number (0)); | ||
| 6795 | bset_right_margin_cols (XBUFFER (tip_buf), make_number (0)); | ||
| 6796 | set_window_buffer (window, tip_buf, false, false); | ||
| 6791 | w = XWINDOW (window); | 6797 | w = XWINDOW (window); |
| 6792 | w->pseudo_window_p = true; | 6798 | w->pseudo_window_p = true; |
| 6793 | 6799 | ||