unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#31884: 26.1.50; Wrong icon in gtk tooltips
@ 2018-06-18 18:24 Carlos Pita
  2018-06-18 19:08 ` Carlos Pita
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Carlos Pita @ 2018-06-18 18:24 UTC (permalink / raw)
  To: 31884

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

In all tooltips I get the crossed circle icon (don't know its stock
name) at the left. I don't know if this is the intended behavior but it
surely looks weird and the icon is both confusing and
unnecessary. Please look at the attached screenshot.


[-- Attachment #2: Tooltip icon --]
[-- Type: image/png, Size: 159404 bytes --]

[-- Attachment #3: Type: text/plain, Size: 4800 bytes --]


---

In GNU Emacs 26.1.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30)
 of 2018-06-09 built on carlos
Repository revision: 3434edc731e4602891a9cf6418ec4e5ff2f60830
Windowing system distributor 'The X.Org Foundation', version 11.0.11906000
System Description:	Manjaro Linux

Recent messages:
Loading company (compiled; note, source file is newer)...done
Loading gnus...done
Loading ido...done
Loading ido-completing-read+...done
Loading paren...done
Loading winner...done
[yas] Prepared just-in-time loading of snippets successfully.
For information about GNU Emacs and the GNU system, type C-h C-a.

Configured using:
 'configure --prefix=/usr --libexecdir=/usr/lib --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 SOUND GPM DBUS GSETTINGS NOTIFY ACL GNUTLS
LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11
MODULES THREADS LIBSYSTEMD LCMS2

Important settings:
  value of $LC_MONETARY: en_US.UTF-8
  value of $LC_NUMERIC: en_US.UTF-8
  value of $LC_TIME: en_US.UTF-8
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  display-line-numbers-mode: t
  flymake-mode: t
  diff-auto-refine-mode: t
  pyvenv-mode: t
  shell-dirtrack-mode: t
  winner-mode: t
  show-paren-mode: t
  ido-ubiquitous-mode: t
  ido-everywhere: t
  global-company-mode: t
  company-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
rfc822 mml mml-sec epa derived epg mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail
display-line-numbers checkdoc flymake-proc flymake warnings
doom-themes-org vc-git cl-extra yasnippet elec-pair
highlight-indentation help-fns radix-tree help-mode elpy
find-file-in-project ivy delsel ivy-overlay ffap thingatpt windmove
diff-mode easy-mmode elpy-shell pyvenv esh-var esh-io esh-cmd esh-opt
esh-ext esh-proc esh-arg esh-groups eshell esh-module esh-mode esh-util
elpy-profile elpy-django elpy-refactor subr-x python tramp-sh tramp
tramp-compat tramp-loaddefs trampver ucs-normalize shell pcomplete
parse-time format-spec advice json map grep compile comint ansi-color
files-x company-oddmuse company-keywords company-etags etags xref
project company-gtags company-dabbrev-code company-dabbrev company-files
company-capf company-cmake company-xcode company-clang company-semantic
company-eclim company-template company-css company-nxml company-bbdb
doom-tomorrow-night-theme doom-themes doom-themes-common winner ring
paren ido-completing-read+ memoize s cus-edit minibuf-eldef ido gnus
nnheader gnus-util rmail rmail-loaddefs rfc2047 rfc2045 ietf-drums
mail-utils mm-util mail-prsvr wid-edit company edmacro kmacro pcase
cus-start cus-load finder-inf info package easymenu epg-config
url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache url-vars seq byte-opt gv bytecomp
byte-compile cconv cl-loaddefs cl-lib server time-date mule-util tooltip
eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel
term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode
lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors 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 composite charscript charprop case-table epa-hook jka-cmpr-hook
help simple abbrev obarray 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 lcms2 dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty
make-network-process emacs)

Memory information:
((conses 16 399826 14914)
 (symbols 48 34718 2)
 (miscs 40 72 141)
 (strings 32 86093 3404)
 (string-bytes 1 2338503)
 (vectors 16 53837)
 (vector-slots 8 943294 14754)
 (floats 8 196 215)
 (intervals 56 299 0)
 (buffers 992 13))

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

* bug#31884: 26.1.50; Wrong icon in gtk tooltips
  2018-06-18 18:24 bug#31884: 26.1.50; Wrong icon in gtk tooltips Carlos Pita
@ 2018-06-18 19:08 ` Carlos Pita
  2018-06-19  1:03   ` Carlos Pita
  2018-06-19  1:15 ` bug#31884: Carlos Pita
  2018-06-19  1:17 ` bug#31884: (no subject) Carlos Pita
  2 siblings, 1 reply; 10+ messages in thread
From: Carlos Pita @ 2018-06-18 19:08 UTC (permalink / raw)
  To: 31884

Searching through the icon browser I would say that the icon in the
screenshot has stock name action-unavailable or
action-unavailable-symbolic. I grepped emacs code for these names and
couldn't find them, so I assume they're set by gtk on response to a
requested "unavailable action" (go figure). Now, the gtk code that
creates the tooltip seems to be replacing the original icon+label box
with just a custom label:

  0       g_object_set (G_OBJECT (widget), "has-tooltip", FALSE, NULL);
  1       x->ttip_widget = tooltip;
  2       g_object_ref (G_OBJECT (tooltip));
  3       x->ttip_lbl = gtk_label_new ("");
  4       g_object_ref (G_OBJECT (x->ttip_lbl));
  5       gtk_tooltip_set_custom (tooltip, x->ttip_lbl);
  6       x->ttip_window = GTK_WINDOW (gtk_widget_get_toplevel (x->ttip_lbl));

I'm unable to see here how an icon is being set at all.





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

* bug#31884: 26.1.50; Wrong icon in gtk tooltips
  2018-06-18 19:08 ` Carlos Pita
@ 2018-06-19  1:03   ` Carlos Pita
  2018-06-20  0:09     ` Noam Postavsky
  0 siblings, 1 reply; 10+ messages in thread
From: Carlos Pita @ 2018-06-19  1:03 UTC (permalink / raw)
  To: 31884

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

Tags: patch

This was a hard one to find...

The problem is in gtkutil.c xg_show_tooltip: gtk_widget_show_all makes
the icon that comes by default with a tooltip visible, which is
undesirable since that icon was never set. The fix is to simply use
gtk_widget_show.

Attached is a python script that reproduces the behavior, trying to
mimic the real emacs code. The first time you press the button show is
called and the tooltip has no icon, as expected. The second time
show_all is called and the missing icon problem manifests. If you keep
pressing the button show and show_all alternate, but the missing icon
is still there since it has been made visible forever by the first
show_all call.

[-- Attachment #2: tooltip.py --]
[-- Type: text/x-python, Size: 1307 bytes --]

import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk  # noqa


class App(Gtk.Window):

    def __init__(self):
        super().__init__()
        self.tip = self.tip_win = self.tip_lbl = None
        self.all = False
        self.set_size_request(250, 200)
        self.set_tooltip_text('Hi')
        self.connect("destroy", Gtk.main_quit)
        self.connect("query-tooltip", self._tip_cb)

        fixed = Gtk.Fixed()
        self.add(fixed)
        button = Gtk.Button("Button")
        button.set_size_request(80, 35)
        fixed.put(button, 50, 50)
        button.connect("clicked", self._show_tip)

        self.show_all()

    def _tip_cb(self, top_win, x, y, xt, tip):
        if self.tip_win is None:
            top_win.set_property("has-tooltip", False)
            self.tip = tip
            self.tip_lbl = Gtk.Label("Top window tip")
            self.tip.set_custom(self.tip_lbl)
            self.tip_win = self.tip_lbl.get_toplevel()
        return False

    def _show_tip(self, _):
        if self.tip is None:
            return
        self.tip.set_custom(self.tip_lbl)
        if self.all:
            self.tip_win.show_all()
        else:
            self.tip_win.show()
        self.all = not self.all

if __name__ == "__main__":
    pyapp = App()
    Gtk.main()

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

* bug#31884:
  2018-06-18 18:24 bug#31884: 26.1.50; Wrong icon in gtk tooltips Carlos Pita
  2018-06-18 19:08 ` Carlos Pita
@ 2018-06-19  1:15 ` Carlos Pita
  2018-06-19  1:17 ` bug#31884: (no subject) Carlos Pita
  2 siblings, 0 replies; 10+ messages in thread
From: Carlos Pita @ 2018-06-19  1:15 UTC (permalink / raw)
  To: 31884

Tags: patch





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

* bug#31884: (no subject)
  2018-06-18 18:24 bug#31884: 26.1.50; Wrong icon in gtk tooltips Carlos Pita
  2018-06-18 19:08 ` Carlos Pita
  2018-06-19  1:15 ` bug#31884: Carlos Pita
@ 2018-06-19  1:17 ` Carlos Pita
  2 siblings, 0 replies; 10+ messages in thread
From: Carlos Pita @ 2018-06-19  1:17 UTC (permalink / raw)
  To: 31884

Tags: patch





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

* bug#31884: 26.1.50; Wrong icon in gtk tooltips
  2018-06-19  1:03   ` Carlos Pita
@ 2018-06-20  0:09     ` Noam Postavsky
  2018-06-20  0:12       ` Carlos Pita
  0 siblings, 1 reply; 10+ messages in thread
From: Noam Postavsky @ 2018-06-20  0:09 UTC (permalink / raw)
  To: Carlos Pita; +Cc: 31884

severity 31884 minor
quit

Carlos Pita <carlosjosepita@gmail.com> writes:

> Tags: patch

> Attached is a python script that reproduces the behavior,

That is sure to be useful, but I don't think it's a patch.  Did you mean
to post one?






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

* bug#31884: 26.1.50; Wrong icon in gtk tooltips
  2018-06-20  0:09     ` Noam Postavsky
@ 2018-06-20  0:12       ` Carlos Pita
  2018-06-20 23:47         ` Noam Postavsky
  0 siblings, 1 reply; 10+ messages in thread
From: Carlos Pita @ 2018-06-20  0:12 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: 31884

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

It's just that it was so easy that I described it in words: change
show_all to show :). But ok, here I'm attaching a proper patch.

[-- Attachment #2: 0001-Remove-broken-icon-from-tooltip.patch --]
[-- Type: text/x-patch, Size: 762 bytes --]

From 8a0a4e6e8c6dfa6b546387d011e487b1484f572b Mon Sep 17 00:00:00 2001
From: memeplex <carlosjosepita@gmail.com>
Date: Tue, 19 Jun 2018 02:12:11 -0300
Subject: [PATCH 1/2] Remove broken icon from tooltip

---
 src/gtkutil.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gtkutil.c b/src/gtkutil.c
index 83b306a..06f38a0 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -762,7 +762,7 @@ xg_show_tooltip (struct frame *f, int root_x, int root_y)
       block_input ();
       gtk_window_move (x->ttip_window, root_x / xg_get_scale (f),
 		       root_y / xg_get_scale (f));
-      gtk_widget_show_all (GTK_WIDGET (x->ttip_window));
+      gtk_widget_show (GTK_WIDGET (x->ttip_window));
       unblock_input ();
     }
 #endif
-- 
2.17.1


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

* bug#31884: 26.1.50; Wrong icon in gtk tooltips
  2018-06-20  0:12       ` Carlos Pita
@ 2018-06-20 23:47         ` Noam Postavsky
  2018-06-21  0:18           ` Carlos Pita
  0 siblings, 1 reply; 10+ messages in thread
From: Noam Postavsky @ 2018-06-20 23:47 UTC (permalink / raw)
  To: Carlos Pita; +Cc: 31884

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

Carlos Pita <carlosjosepita@gmail.com> writes:

> It's just that it was so easy that I described it in words: change
> show_all to show :). But ok, here I'm attaching a proper patch.

> Subject: [PATCH 1/2] Remove broken icon from tooltip

Thanks, I checked it out on my gtk build; I don't have quite the same
icon you showed, but it looks like some kind of place holder that
shouldn't be there indeed.  The patch gets rid of it, so I guess it's
the right thing.

Have you done copyright assignment for Emacs?  Obviously, the patch is
too trivial to require it, but in case you haven't done it we should
mark the commit with "Copyright-paperwork-exempt: yes".


[-- Attachment #2: screenshot of gtk icon using before applying patch --]
[-- Type: image/png, Size: 9235 bytes --]

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

* bug#31884: 26.1.50; Wrong icon in gtk tooltips
  2018-06-20 23:47         ` Noam Postavsky
@ 2018-06-21  0:18           ` Carlos Pita
  2018-06-22  0:18             ` Noam Postavsky
  0 siblings, 1 reply; 10+ messages in thread
From: Carlos Pita @ 2018-06-21  0:18 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: 31884

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

>
>
> Thanks, I checked it out on my gtk build; I don't have quite the same
> icon you showed, but it looks like


Different stock icons for "missing icon" I guess.

some kind of place holder that
> shouldn't be there indeed


It's an icon gtk puts by default in a tooltip widget. Usually it's hidden
if you don't set it but show_all is exposing it. The attached python script
shows all this very clearly.

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

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

* bug#31884: 26.1.50; Wrong icon in gtk tooltips
  2018-06-21  0:18           ` Carlos Pita
@ 2018-06-22  0:18             ` Noam Postavsky
  0 siblings, 0 replies; 10+ messages in thread
From: Noam Postavsky @ 2018-06-22  0:18 UTC (permalink / raw)
  To: Carlos Pita; +Cc: 31884

tags 31884 fixed
close 31884 27.1
quit

Carlos Pita <carlosjosepita@gmail.com> writes:

>  Thanks, I checked it out on my gtk build; I don't have quite the same
>  icon you showed, but it looks like 
>
> Different stock icons for "missing icon" I guess.

Yep, I pushed to master.

[1: 8a7475ca79]: 2018-06-21 19:57:59 -0400
  Remove broken icon from tooltip (Bug#31884)
  https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=8a7475ca796ecd5816fab9f11baf07bcc395d951





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

end of thread, other threads:[~2018-06-22  0:18 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-18 18:24 bug#31884: 26.1.50; Wrong icon in gtk tooltips Carlos Pita
2018-06-18 19:08 ` Carlos Pita
2018-06-19  1:03   ` Carlos Pita
2018-06-20  0:09     ` Noam Postavsky
2018-06-20  0:12       ` Carlos Pita
2018-06-20 23:47         ` Noam Postavsky
2018-06-21  0:18           ` Carlos Pita
2018-06-22  0:18             ` Noam Postavsky
2018-06-19  1:15 ` bug#31884: Carlos Pita
2018-06-19  1:17 ` bug#31884: (no subject) Carlos Pita

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).