all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#29627: 25.3; x-show-tip does not display text when x-gtk-use-tooltips is nil and left/right-margin-width is set
@ 2017-12-09 13:54 Terje Larsen
  2017-12-09 20:07 ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Terje Larsen @ 2017-12-09 13:54 UTC (permalink / raw)
  To: 29627

[-- Attachment #1: Type: text/plain, Size: 3781 bytes --]

When you have enabled `left-margin-width' and `right-margin-width'
as well as disabled the `x-gtk-use-system-tooltips', the text will
be invisible when running `x-show-tip'. The tip will be show, but
not visible.

Steps to reproduce with emacs -Q
(setq-default
  left-margin-width 1
  right-margin-width 1)

(setq x-gtk-use-system-tooltips nil)

(x-show-tip "Can you see me now?")

In GNU Emacs 25.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.19)
 of 2017-09-16 built on juergen
Windowing system distributor 'The X.Org Foundation', version 11.0.11905000
Configured using:
 'configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib
 --localstatedir=/var --with-x-toolkit=gtk3 --with-xft --with-modules
 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong
 -fno-plt' CPPFLAGS=-D_FORTIFY_SOURCE=2
 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS
NOTIFY ACL GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 MODULES

Important settings:
  value of $LC_ALL: en_US.UTF-8
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Fundamental

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
‘use-package’ is already installed
For information about GNU Emacs and the GNU system, type C-h C-a.
Making completion list...
funcall-interactively: End of buffer [6 times]

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug sendmail cus-edit cus-start cus-load
wid-edit mm-archive message idna dired format-spec rfc822 mml mml-sec
mailabbrev gmm-utils mailheader mm-decode mm-bodies mm-encode mail-utils
network-stream nsm starttls url-http tls gnutls mail-parse rfc2231
rfc2047 rfc2045 ietf-drums url-gw url-cache url-auth url url-proxy
url-privacy url-expand url-methods url-history url-cookie url-domsuf
url-util mailcap url-handlers url-parse auth-source cl-seq eieio
eieio-core cl-macs gnus-util time-date mm-util help-fns mail-prsvr
password-cache url-vars epg finder-inf info package epg-config seq
byte-opt gv bytecomp byte-compile cl-extra help-mode easymenu cconv
cl-loaddefs pcase cl-lib mule-util tooltip eldoc electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel x-win term/common-win x-dnd
tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment
elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan
thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian
slovak czech european ethiopic indian cyrillic chinese charscript
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote dbusbind inotify
dynamic-setting system-font-setting font-render-setting move-toolbar gtk
x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 207883 48038)
 (symbols 48 28074 0)
 (miscs 40 801 226)
 (strings 32 51742 37972)
 (string-bytes 1 1373182)
 (vectors 16 27579)
 (vector-slots 8 1318855 206622)
 (floats 8 250 210)
 (intervals 56 267 0)
 (buffers 976 60))

[-- Attachment #2: Type: text/html, Size: 4823 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#29627: 25.3; x-show-tip does not display text when x-gtk-use-tooltips is nil and left/right-margin-width is set
  2017-12-09 13:54 bug#29627: 25.3; x-show-tip does not display text when x-gtk-use-tooltips is nil and left/right-margin-width is set Terje Larsen
@ 2017-12-09 20:07 ` Eli Zaretskii
  2017-12-10  9:52   ` martin rudalics
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2017-12-09 20:07 UTC (permalink / raw)
  To: Terje Larsen; +Cc: 29627-done

> From: Terje Larsen <terlar@gmail.com>
> Date: Sat, 09 Dec 2017 13:54:24 +0000
> 
> When you have enabled `left-margin-width' and `right-margin-width'
> as well as disabled the `x-gtk-use-system-tooltips', the text will
> be invisible when running `x-show-tip'. The tip will be show, but
> not visible.
> 
> Steps to reproduce with emacs -Q
> (setq-default
>   left-margin-width 1
>   right-margin-width 1)
> 
> (setq x-gtk-use-system-tooltips nil)
> 
> (x-show-tip "Can you see me now?")

Thanks, fixed on the emacs-26 branch.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#29627: 25.3; x-show-tip does not display text when x-gtk-use-tooltips is nil and left/right-margin-width is set
  2017-12-09 20:07 ` Eli Zaretskii
@ 2017-12-10  9:52   ` martin rudalics
  2017-12-10 14:08     ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: martin rudalics @ 2017-12-10  9:52 UTC (permalink / raw)
  To: 29627, eliz, terlar

 > Thanks, fixed on the emacs-26 branch.

Could you please tell why such a harsh treatment was necessary?  In
particular why (1) showing the margins initially failed and (2) instead
of just forcing the window margins have zero width you made the window a
pseudo-window.

Thanks, martin





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#29627: 25.3; x-show-tip does not display text when x-gtk-use-tooltips is nil and left/right-margin-width is set
  2017-12-10  9:52   ` martin rudalics
@ 2017-12-10 14:08     ` Eli Zaretskii
  2017-12-10 14:28       ` martin rudalics
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2017-12-10 14:08 UTC (permalink / raw)
  To: martin rudalics; +Cc: 29627, terlar

> Date: Sun, 10 Dec 2017 10:52:43 +0100
> From: martin rudalics <rudalics@gmx.at>
> 
>  > Thanks, fixed on the emacs-26 branch.
> 
> Could you please tell why such a harsh treatment was necessary?  In
> particular why (1) showing the margins initially failed and (2) instead
> of just forcing the window margins have zero width you made the window a
> pseudo-window.

First, I didn't make the window a pseudo-window; it was always a
pseudo-window.  The line

  w->pseudo_window_p = true;

existed in x-show-tip ever since Emacs 21.  I didn't feel comfortable
with changing that now, certainly not on the release branch.

The bug happened because pseudo-windows cannot have display margins,
an assumption that is in the display code all over the place.  Here's
a typical example:

  static void
  frame_to_window_pixel_xy (struct window *w, int *x, int *y)
  {
    if (w->pseudo_window_p)
      {
	/* A pseudo-window is always full-width, and starts at the
	   left edge of the frame, plus a frame border.  */
	struct frame *f = XFRAME (w->frame);
	*x -= FRAME_INTERNAL_BORDER_WIDTH (f);
	*y = FRAME_TO_WINDOW_PIXEL_Y (w, *y);
      }

The actual root cause for this bug was that update_marginal_area, when
does this:

  output_cursor_to (w, vpos, 0, desired_row->y, 0);
  if (desired_row->used[area])
    rif->write_glyphs (w, updated_row, desired_row->glyphs[area],
		       area, desired_row->used[area]);
  rif->clear_end_of_line (w, updated_row, area, -1);

which in case in point avoided calling the write_glyphs method when
called for area = RIGHT_MARGIN_AREA (because the 'used' count is of
course zero).  That left the output cursor at the beginning of the
glyph row, and then clear_end_of_line method cleared the text which
was already displayed, because of this snippet:

  from_x = w->output_cursor.x;

  /* Translate to frame coordinates.  */
  if (updated_row->full_width_p)
    {
      from_x = WINDOW_TO_FRAME_PIXEL_X (w, from_x);
      to_x = WINDOW_TO_FRAME_PIXEL_X (w, to_x);
    }
  else
    {
      int area_left = window_box_left (w, updated_area);
      from_x += area_left;
      to_x += area_left;
    }

And you will see that window_box_left does this for pseudo-windows:

  if (w->pseudo_window_p)
    return FRAME_INTERNAL_BORDER_WIDTH (f);

which is just another example of the above-mentioned assumption about
pseudo-windows being margin-less.

So from_x remained (almost) zero, unlike in normal windows, and the
already displayed text was deleted.

For some reason that I cannot identify, and don't really care about,
the original recipe did work until Emacs 24.3.  But it could only work
by sheer luck, or maybe something else was preventing the window of
the tooltip frame to acquire display margins.  I just made this
official with my changes, that's all.

As for why I forced the tip buffer have zero margins, instead of doing
the same with the window in which that buffer is displayed, then:

  . why does it matter? the buffer is a temporary buffer generated
    specifically for showing the tip text;
  . I thought doing that with the window is more complex, what with
    all the different ways one can affect a window's parameters

Having said all that, if you see problem(s) caused by my change,
please describe them; I'm not married to the fix I pushed.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#29627: 25.3; x-show-tip does not display text when x-gtk-use-tooltips is nil and left/right-margin-width is set
  2017-12-10 14:08     ` Eli Zaretskii
@ 2017-12-10 14:28       ` martin rudalics
  2017-12-10 14:49         ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: martin rudalics @ 2017-12-10 14:28 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 29627, terlar

 > First, I didn't make the window a pseudo-window; it was always a
 > pseudo-window.  The line
 >
 >    w->pseudo_window_p = true;
 >
 > existed in x-show-tip ever since Emacs 21.

Ah, sorry.  I misread both ChangeLog entry and diffs (and was probably
mislead by this change

-       Currently only used for menu bar windows of frames.  */
+       Currently only used for menu bar windows, for tool bar windows,
+       and for tooltips.  */
)

 > I didn't feel comfortable
 > with changing that now, certainly not on the release branch.

Sure so.

 > And you will see that window_box_left does this for pseudo-windows:
 >
 >    if (w->pseudo_window_p)
 >      return FRAME_INTERNAL_BORDER_WIDTH (f);
 >
 > which is just another example of the above-mentioned assumption about
 > pseudo-windows being margin-less.

Right.

 > So from_x remained (almost) zero, unlike in normal windows, and the
 > already displayed text was deleted.
 >
 > For some reason that I cannot identify, and don't really care about,
 > the original recipe did work until Emacs 24.3.  But it could only work
 > by sheer luck, or maybe something else was preventing the window of
 > the tooltip frame to acquire display margins.  I just made this
 > official with my changes, that's all.
 >
 > As for why I forced the tip buffer have zero margins, instead of doing
 > the same with the window in which that buffer is displayed, then:
 >
 >    . why does it matter? the buffer is a temporary buffer generated
 >      specifically for showing the tip text;
 >    . I thought doing that with the window is more complex, what with
 >      all the different ways one can affect a window's parameters
 >
 > Having said all that, if you see problem(s) caused by my change,
 > please describe them; I'm not married to the fix I pushed.

It's OK.  My concern was that turning tooltip windows into
pseudo-windows would have meant a quite substantial change for the
release branch.

Thanks for the explanations, martin





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#29627: 25.3; x-show-tip does not display text when x-gtk-use-tooltips is nil and left/right-margin-width is set
  2017-12-10 14:28       ` martin rudalics
@ 2017-12-10 14:49         ` Eli Zaretskii
  0 siblings, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2017-12-10 14:49 UTC (permalink / raw)
  To: martin rudalics; +Cc: 29627, terlar

> Date: Sun, 10 Dec 2017 15:28:55 +0100
> From: martin rudalics <rudalics@gmx.at>
> CC: 29627@debbugs.gnu.org, terlar@gmail.com
> 
> -       Currently only used for menu bar windows of frames.  */
> +       Currently only used for menu bar windows, for tool bar windows,
> +       and for tooltips.  */

This is part of my perennial quest to make the comments match the
code...

>  > Having said all that, if you see problem(s) caused by my change,
>  > please describe them; I'm not married to the fix I pushed.
> 
> It's OK.

Great, thanks.

> My concern was that turning tooltip windows into pseudo-windows
> would have meant a quite substantial change for the release branch.

Indeed.  Just like the opposite change bothered me.





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-12-10 14:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-09 13:54 bug#29627: 25.3; x-show-tip does not display text when x-gtk-use-tooltips is nil and left/right-margin-width is set Terje Larsen
2017-12-09 20:07 ` Eli Zaretskii
2017-12-10  9:52   ` martin rudalics
2017-12-10 14:08     ` Eli Zaretskii
2017-12-10 14:28       ` martin rudalics
2017-12-10 14:49         ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.