]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix tool-tip display when display margins are non-zero by default
authorEli Zaretskii <eliz@gnu.org>
Sat, 9 Dec 2017 20:06:19 +0000 (22:06 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sat, 9 Dec 2017 20:06:19 +0000 (22:06 +0200)
* 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
src/w32fns.c
src/window.h
src/xfns.c

index 46c7c6e5ad6a0f486c642eec06f35854618ae82d..ecd2360dbca2eff24e221859126aa6d4f8c537e2 100644 (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;
index 43af1122fad6be7da1e36ab2caa72c8ab159dd52..b81cd70e0a7223e44256eb9741be513af415cee4 100644 (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;
 
index 25c9686a9f00ffd4a481e1c93eb9f739daf48a0f..563a6f6ff0d13baa3712362929dd8e95cbcdfa9c 100644 (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.
index bbe73aa7c286d397aa667faaa92011e0fd70f3b6..044f14876e3b231ec232bee78b2c621a996383c2 100644 (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;