bug#32975: Emacs 26.1; GTK Warnings

classic Classic list List threaded Threaded
41 messages Options
123
Reply | Threaded
Open this post in threaded view
|

bug#32975: Emacs 26.1; GTK Warnings

Tjernlund
Setting background-color like so(in my .emacs files):
(setq default-frame-alist '((background-color . "#333333") (foreground-color . "White") (cursor-color . "White")))

Prints these GTK warnings:
(emacs-26:9664): Gtk-CRITICAL **: gtk_widget_get_parent: assertion 'GTK_IS_WIDGET (widget)' failed

(emacs-26:9664): Gtk-CRITICAL **: gtk_widget_override_background_color: assertion 'GTK_IS_WIDGET (widget)' failed

(emacs-26:9664): Gtk-CRITICAL **: gtk_widget_get_parent: assertion 'GTK_IS_WIDGET (widget)' failed

(emacs-26:9664): Gtk-CRITICAL **: gtk_widget_override_background_color: assertion 'GTK_IS_WIDGET (widget)' failed

(emacs-26:9664): Gtk-CRITICAL **: gtk_widget_get_parent: assertion 'GTK_IS_WIDGET (widget)' failed

(emacs-26:9664): Gtk-CRITICAL **: gtk_widget_override_background_color: assertion 'GTK_IS_WIDGET (widget)' failed

(emacs-26:9664): Gtk-CRITICAL **: gtk_widget_get_parent: assertion 'GTK_IS_WIDGET (widget)' failed

(emacs-26:9664): Gtk-CRITICAL **: gtk_widget_override_background_color: assertion 'GTK_IS_WIDGET (widget)' failed



Reply | Threaded
Open this post in threaded view
|

bug#32975: Emacs 26.1; GTK Warnings

Eli Zaretskii
> From: Tjernlund <[hidden email]>
> Date: Sun, 07 Oct 2018 20:19:26 +0200
>
> Setting background-color like so(in my .emacs files):
> (setq default-frame-alist '((background-color . "#333333") (foreground-color . "White") (cursor-color . "White")))
>
> Prints these GTK warnings:
> (emacs-26:9664): Gtk-CRITICAL **: gtk_widget_get_parent: assertion 'GTK_IS_WIDGET (widget)' failed

Please tell your GTK version (and preferably all the other
information collected by "M-x report-emacs-bug RET").

Thanks.

P.S. Do I understand correctly that these messages are emitted only
for that combination of colors?



Reply | Threaded
Open this post in threaded view
|

bug#32975: Emacs 26.1; GTK Warnings

Tjernlund
On Sun, 2018-10-07 at 22:03 +0300, Eli Zaretskii wrote:

> > From: Tjernlund <[hidden email]>
> > Date: Sun, 07 Oct 2018 20:19:26 +0200
> >
> > Setting background-color like so(in my .emacs files):
> > (setq default-frame-alist '((background-color . "#333333") (foreground-color . "White") (cursor-color . "White")))
> >
> > Prints these GTK warnings:
> > (emacs-26:9664): Gtk-CRITICAL **: gtk_widget_get_parent: assertion 'GTK_IS_WIDGET (widget)' failed
>
> Please tell your GTK version (and preferably all the other
> information collected by "M-x report-emacs-bug RET").
>
> Thanks.
>
> P.S. Do I understand correctly that these messages are emitted only
> for that combination of colors?

No, setting background-color to any value will cause the errors
gtk version 3.22.30

Here are some data from M-x report-emacs-bug RET:

Configured using:
 'configure --prefix=/usr --build=x86_64-pc-linux-gnu
 --host=x86_64-pc-linux-gnu --mandir=/usr/share/man
 --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc
 --localstatedir=/var/lib --disable-silent-rules
 --docdir=/usr/share/doc/emacs-26.1-r3
 --htmldir=/usr/share/doc/emacs-26.1-r3/html --libdir=/usr/lib64
 --program-suffix=-emacs-26 --infodir=/usr/share/info/emacs-26
 --localstatedir=/var
 --enable-locallisppath=/etc/emacs:/usr/share/emacs/site-lisp
 --without-compress-install --without-hesiod --without-pop
 --with-file-notification=inotify --enable-acl --with-dbus
 --without-modules --without-gameuser --with-gpm --without-kerberos
 --without-kerberos5 --with-lcms2 --without-xml2 --without-mailutils
 --without-selinux --with-gnutls --without-libsystemd --with-threads
 --without-wide-int --with-zlib --with-sound=alsa --with-x --without-ns
 --without-gconf --without-gsettings --without-toolkit-scroll-bars
 --with-gif --with-jpeg --with-png --with-rsvg --with-tiff --with-xpm
 --without-imagemagick --with-xft --without-cairo --without-libotf
 --without-m17n-flt --with-x-toolkit=gtk3 --without-xwidgets 'CFLAGS=-O2
 -pipe -Wno-error -fno-stack-check' CPPFLAGS= 'LDFLAGS=-Wl,-O1
 -Wl,--as-needed''

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND GPM DBUS NOTIFY ACL GNUTLS FREETYPE XFT
ZLIB GTK3 X11 THREADS LCMS2

Important settings:
  value of $LANG: en_GB.utf8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-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
  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
format-spec rfc822 mml mml-sec password-cache epa derived epg epg-config
gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mail-utils elec-pair ecb edmacro kmacro
ecb-symboldef ecb-analyse ecb-compatibility ecb-winman-support
ecb-autogen autoload radix-tree lisp-mnt ecb-tod ecb-cycle ecb-eshell
ecb-help ecb-jde ecb-method-browser hideshow ecb-semantic-wrapper
ecb-semantic ecb-file-browser ecb-speedbar ecb-layout compile comint
ansi-color ecb-create-layout advice ecb-compilation ecb-common-browser
speedbar sb-image dframe ecb-navigate eieio-compat ecb-mode-line
ecb-face tree-buffer ecb-upgrade ecb-cedet-wrapper semantic/db-mode
semantic/db-find semantic/db-ref semantic/analyze semantic/sort
semantic/scope semantic/analyze/fcn semantic/db eieio-base cl-seq seq
semantic/format ezimage semantic/tag-ls semantic/find semantic/ctxt
semantic/util-modes semantic/util semantic semantic/tag semantic/lex
semantic/fw eieio byte-opt bytecomp byte-compile cconv eieio-core
cl-macs gv eieio-loaddefs mode-local find-func cedet wid-edit
cl-loaddefs cl-lib ecb-util ring thingatpt info easymenu site-gentoo
ecb-autoloads 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 font-render-setting
move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 161892 7932)
 (symbols 48 28117 1)
 (miscs 40 49 111)
 (strings 32 47991 1454)
 (string-bytes 1 1599166)
 (vectors 16 24484)
 (vector-slots 8 622015 7766)
 (floats 8 91 27)
 (intervals 56 331 0)
 (buffers 992 12))



Reply | Threaded
Open this post in threaded view
|

bug#32975: Emacs 26.1; GTK Warnings

Eli Zaretskii
> From: Tjernlund <[hidden email]>
> Cc: [hidden email]
> Date: Mon, 08 Oct 2018 07:27:08 +0200
>
> > P.S. Do I understand correctly that these messages are emitted only
> > for that combination of colors?
>
> No, setting background-color to any value will cause the errors
> gtk version 3.22.30

Do the problems go away if you disable the scroll bars?



Reply | Threaded
Open this post in threaded view
|

bug#32975: Emacs 26.1; GTK Warnings

Tjernlund
On Tue, 2018-10-09 at 18:10 +0300, Eli Zaretskii wrote:

> > From: Tjernlund <[hidden email]>
> > Cc: [hidden email]
> > Date: Mon, 08 Oct 2018 07:27:08 +0200
> >
> > > P.S. Do I understand correctly that these messages are emitted only
> > > for that combination of colors?
> >
> > No, setting background-color to any value will cause the errors
> > gtk version 3.22.30
>
> Do the problems go away if you disable the scroll bars?

The left side scroll bar? Don't know howto do that ..



Reply | Threaded
Open this post in threaded view
|

bug#32975: Emacs 26.1; GTK Warnings

Eli Zaretskii
> From: Tjernlund <[hidden email]>
> Cc: [hidden email]
> Date: Tue, 09 Oct 2018 20:01:12 +0200
>
> On Tue, 2018-10-09 at 18:10 +0300, Eli Zaretskii wrote:
> > > From: Tjernlund <[hidden email]>
> > > Cc: [hidden email]
> > > Date: Mon, 08 Oct 2018 07:27:08 +0200
> > >
> > > > P.S. Do I understand correctly that these messages are emitted only
> > > > for that combination of colors?
> > >
> > > No, setting background-color to any value will cause the errors
> > > gtk version 3.22.30
> >
> > Do the problems go away if you disable the scroll bars?
>
> The left side scroll bar?

All of them.

> Don't know howto do that ..

"M-x scroll-bar-mode RET" should toggle display of vertical scroll
bars.  "M-x horizontal-scroll-bar-mode RET" should do the same with
horizontal scroll bars.



Reply | Threaded
Open this post in threaded view
|

bug#32975: Emacs 26.1; GTK Warnings

Tjernlund
On Tue, 2018-10-09 at 21:18 +0300, Eli Zaretskii wrote:

> > From: Tjernlund <[hidden email]>
> > Cc: [hidden email]
> > Date: Tue, 09 Oct 2018 20:01:12 +0200
> >
> > On Tue, 2018-10-09 at 18:10 +0300, Eli Zaretskii wrote:
> > > > From: Tjernlund <[hidden email]>
> > > > Cc: [hidden email]
> > > > Date: Mon, 08 Oct 2018 07:27:08 +0200
> > > >
> > > > > P.S. Do I understand correctly that these messages are emitted only
> > > > > for that combination of colors?
> > > >
> > > > No, setting background-color to any value will cause the errors
> > > > gtk version 3.22.30
> > >
> > > Do the problems go away if you disable the scroll bars?
> >
> > The left side scroll bar?
>
> All of them.
>
> > Don't know howto do that ..
>
> "M-x scroll-bar-mode RET" should toggle display of vertical scroll
> bars.  "M-x horizontal-scroll-bar-mode RET" should do the same with
> horizontal scroll bars.

They only happen one at startup, if if put in my .emacs:
   (scroll-bar-mode 0)
They are gone.



Reply | Threaded
Open this post in threaded view
|

bug#32975: Emacs 26.1; GTK Warnings

Eli Zaretskii
> From: Tjernlund <[hidden email]>
> Cc: [hidden email]
> Date: Tue, 09 Oct 2018 20:33:45 +0200
>
> > > > Do the problems go away if you disable the scroll bars?
> > >
> > > The left side scroll bar?
> >
> > All of them.
> >
> > > Don't know howto do that ..
> >
> > "M-x scroll-bar-mode RET" should toggle display of vertical scroll
> > bars.  "M-x horizontal-scroll-bar-mode RET" should do the same with
> > horizontal scroll bars.
>
> They only happen one at startup, if if put in my .emacs:
>    (scroll-bar-mode 0)
> They are gone.

Great, then my guess was correct.  These warnings come from
xg_update_scrollbar_pos and from xg_finish_scroll_bar_creation.  Can
some GTK expert try to find out why the scroll-bar widget seems to be
reported as invalid)?  Robert, are you there?

Thanks.



Reply | Threaded
Open this post in threaded view
|

bug#32975: Emacs 26.1; GTK Warnings

Robert Pluim
Eli Zaretskii <[hidden email]> writes:

>> From: Tjernlund <[hidden email]>
>> Cc: [hidden email]
>> Date: Tue, 09 Oct 2018 20:33:45 +0200
>>
>> > > > Do the problems go away if you disable the scroll bars?
>> > >
>> > > The left side scroll bar?
>> >
>> > All of them.
>> >
>> > > Don't know howto do that ..
>> >
>> > "M-x scroll-bar-mode RET" should toggle display of vertical scroll
>> > bars.  "M-x horizontal-scroll-bar-mode RET" should do the same with
>> > horizontal scroll bars.
>>
>> They only happen one at startup, if if put in my .emacs:
>>    (scroll-bar-mode 0)
>> They are gone.
>
> Great, then my guess was correct.  These warnings come from
> xg_update_scrollbar_pos and from xg_finish_scroll_bar_creation.  Can
> some GTK expert try to find out why the scroll-bar widget seems to be
> reported as invalid)?  Robert, are you there?

I can't reproduce this under Gnome or KDE, with the same GTK version.
Which window manager/desktop environment is being used here?

Robert



Reply | Threaded
Open this post in threaded view
|

bug#32975: Emacs 26.1; GTK Warnings

martin rudalics
 > I can't reproduce this under Gnome or KDE, with the same GTK version.
 > Which window manager/desktop environment is being used here?

I don't have that GTK version installed to test here.  But note this
question of the OP:

 > The left side scroll bar?

By default, GTK builds show scroll bars on the right so either he has
customized them already (which makes me wonder why he asked how to
turn off scroll bars) or other strange things are going on.

martin



Reply | Threaded
Open this post in threaded view
|

bug#32975: Emacs 26.1; GTK Warnings

Robert Pluim
martin rudalics <[hidden email]> writes:

>> I can't reproduce this under Gnome or KDE, with the same GTK version.
>> Which window manager/desktop environment is being used here?
>
> I don't have that GTK version installed to test here.  But note this
> question of the OP:
>
>> The left side scroll bar?
>
> By default, GTK builds show scroll bars on the right so either he has
> customized them already (which makes me wonder why he asked how to
> turn off scroll bars) or other strange things are going on.

Ah, the configure command has '--without-toolkit-scroll-bars', so the
error is even more mystifying.

I can't reproduce even with '--without-toolkit-scroll-bars'.

This is all under X11 though, perhaps the OP is using Wayland?

Cheers

Robert



Reply | Threaded
Open this post in threaded view
|

bug#32975: Emacs 26.1; GTK Warnings

Tjernlund
On Wed, 2018-10-10 at 12:08 +0200, Robert Pluim wrote:
> martin rudalics <[hidden email]> writes:
>
> > > I can't reproduce this under Gnome or KDE, with the same GTK version.
> > > Which window manager/desktop environment is being used here?

This is under MATE

> >
> > I don't have that GTK version installed to test here.  But note this
> > question of the OP:
> >
> > > The left side scroll bar?
> >
> > By default, GTK builds show scroll bars on the right so either he has
> > customized them already (which makes me wonder why he asked how to
> > turn off scroll bars) or other strange things are going on.

I have not, maybe Gentoo has ?

>
> Ah, the configure command has '--without-toolkit-scroll-bars', so the
> error is even more mystifying.
>
> I can't reproduce even with '--without-toolkit-scroll-bars'.
>
> This is all under X11 though, perhaps the OP is using Wayland?

X11

I now did some more test and found that (require 'ecb) is also needed.

Here is my .emacs;

;(scroll-bar-mode 0)
(setq inhibit-splash-screen t)
(global-set-key "\C-cg" 'goto-line)
(require 'ecb)
;; Color settings.
(setq default-frame-alist '((background-color . "#333333") (foreground-color . "White") (cursor-color . "White")))
(setq initial-frame-alist default-frame-alist)

(defun my-commit-mode()
(ispell-change-dictionary "en")
;; Flyspell commit msgs
(flyspell-mode)
;; Do not create svn-commit.tmp~ backup file
(set (make-local-variable 'backup-inhibited) t))

(setq auto-mode-alist (cons '("/svn-commit\\.tmp\\'" . my-commit-mode)
auto-mode-alist))

(setq auto-mode-alist (cons '("COMMIT_EDITMSG" . my-commit-mode)
auto-mode-alist))



Reply | Threaded
Open this post in threaded view
|

bug#32975: Emacs 26.1; GTK Warnings

Robert Pluim
Tjernlund <[hidden email]> writes:

> X11
>
> I now did some more test and found that (require 'ecb) is also needed.

With that I can reproduce it. '--without-toolkit-scroll-bars' is
required, which narrows down the potential source a lot.

Robert



Reply | Threaded
Open this post in threaded view
|

bug#32975: Emacs 26.1; GTK Warnings

Robert Pluim
Robert Pluim <[hidden email]> writes:

> Tjernlund <[hidden email]> writes:
>
>> X11
>>
>> I now did some more test and found that (require 'ecb) is also needed.
>
> With that I can reproduce it. '--without-toolkit-scroll-bars' is
> required, which narrows down the potential source a lot.
>

So I donʼt think we should be calling GTK functions on scrollbars that
are not GTK widgets (Iʼm stunned we've never seen this before). This
fixes it for me. Martin?

diff --git a/src/xfns.c b/src/xfns.c
index 1381fee57e..4fad01a68e 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -1085,12 +1085,13 @@ x_set_background_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
       XSetWindowBackground (dpy, FRAME_X_WINDOW (f), bg);
       XSetForeground (dpy, x->cursor_gc, bg);
 
-#ifdef USE_GTK
+#ifdef USE_TOOLKIT_SCROLL_BARS
+# ifdef USE_GTK
       xg_set_background_color (f, bg);
-#endif
-
-#ifndef USE_TOOLKIT_SCROLL_BARS /* Turns out to be annoying with
-   toolkit scroll bars.  */
+# endif
+#else
+/* Turns out to be annoying with toolkit scroll bars, so only set the
+   background for non-toolkit.  */
       {
  Lisp_Object bar;
  for (bar = FRAME_SCROLL_BARS (f);



Reply | Threaded
Open this post in threaded view
|

bug#32975: Emacs 26.1; GTK Warnings

martin rudalics
 > So I donʼt think we should be calling GTK functions on scrollbars that
 > are not GTK widgets (Iʼm stunned we've never seen this before).

Setting the background color on a GTK build without GTK scroll bars
seems pretty rare to me.  In addition, one usually has to look at the
console to see the warnings.

 > This
 > fixes it for me. Martin?

Do we want to skip xg_set_widget_bg too?

martin




Reply | Threaded
Open this post in threaded view
|

bug#32975: Emacs 26.1; GTK Warnings

Robert Pluim
martin rudalics <[hidden email]> writes:

>> So I donʼt think we should be calling GTK functions on scrollbars that
>> are not GTK widgets (Iʼm stunned we've never seen this before).
>
> Setting the background color on a GTK build without GTK scroll bars
> seems pretty rare to me.  In addition, one usually has to look at the
> console to see the warnings.
>
>> This
>> fixes it for me. Martin?
>
> Do we want to skip xg_set_widget_bg too?

I can't see a code path where that would get called in the non-toolkit
case, but the code is a twisty maze of similar functions.

Robert



Reply | Threaded
Open this post in threaded view
|

bug#32975: Emacs 26.1; GTK Warnings

martin rudalics
 >> Do we want to skip xg_set_widget_bg too?
 >
 > I can't see a code path where that would get called in the non-toolkit
 > case, but the code is a twisty maze of similar functions.

Don't we want to fix toolkit (GTK) builds with non-toolkit scroll bars
here?  Or am I missing something?

martin



Reply | Threaded
Open this post in threaded view
|

bug#32975: Emacs 26.1; GTK Warnings

Robert Pluim
martin rudalics <[hidden email]> writes:

>>> Do we want to skip xg_set_widget_bg too?
>>
>> I can't see a code path where that would get called in the non-toolkit
>> case, but the code is a twisty maze of similar functions.
>
> Don't we want to fix toolkit (GTK) builds with non-toolkit scroll bars
> here?  Or am I missing something?

We do, but I only see xg_set_widget_bg getting called on scrollbar
widgets when USE_TOOLKIT_SCROLL_BARS is set, in which case they're GTK
widgets, so thatʼs the right thing to do.

Robert



Reply | Threaded
Open this post in threaded view
|

bug#32975: Emacs 26.1; GTK Warnings

martin rudalics
 > We do, but I only see xg_set_widget_bg getting called on scrollbar
 > widgets when USE_TOOLKIT_SCROLL_BARS is set, in which case they're GTK
 > widgets, so thatʼs the right thing to do.

I apologize for my stubbornness.

xg_set_background_color (struct frame *f, unsigned long bg)

has

       xg_set_widget_bg (f, FRAME_GTK_WIDGET (f), FRAME_BACKGROUND_PIXEL (f));

which IIUC does not work on scrollbar widgets.

martin




Reply | Threaded
Open this post in threaded view
|

bug#32975: Emacs 26.1; GTK Warnings

Robert Pluim
martin rudalics <[hidden email]> writes:

>> We do, but I only see xg_set_widget_bg getting called on scrollbar
>> widgets when USE_TOOLKIT_SCROLL_BARS is set, in which case they're GTK
>> widgets, so thatʼs the right thing to do.
>
> I apologize for my stubbornness.
>

No apology needed

> xg_set_background_color (struct frame *f, unsigned long bg)
>
> has
>
>       xg_set_widget_bg (f, FRAME_GTK_WIDGET (f), FRAME_BACKGROUND_PIXEL (f));
>
> which IIUC does not work on scrollbar widgets.

There is only one call to xg_set_background_color, from xfns.c, which looks
like this with my patch applied:

#ifdef USE_TOOLKIT_SCROLL_BARS
# ifdef USE_GTK
      xg_set_background_color (f, bg);
# endif
#else

So it will only ever happen when the scrollbars are GTK widgets.

Robert



123