lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] GTK warnings


From: Vadim Zeitlin
Subject: Re: [lmi] GTK warnings
Date: Fri, 1 Jul 2022 17:16:58 +0200

On Thu, 30 Jun 2022 19:47:11 +0000 Greg Chicares <gchicares@sbcglobal.net> 
wrote:

GC> With the wx upgrade, I still have a few GTK warnings:

 Just to be clear, the only GTK message which is suppressed inside wx
itself right now is the

        gtk_notebook_get_tab_label: assertion 'list != NULL' failed

one, as it's really due to a bug in GTK itself and there is nothing anybody
(wx or the application) can do about it.

 Unfortunately I've just noticed, while testing, that there is still
another instance of this message remaining when closing an MDI tab
(including when doing it implicitly on program exit) because my fix only
took care of wxNotebook and wxMDIChildFrame doesn't use this class. I'll
fix this one, at least, but it will require another (small) wx update...


 As for the other warnings, they're still, in principle, preventable or, at
least, I couldn't prove that they were due to bugs too, so they remain, but
there is now an easy way to filter individual warnings in wxGTK itself, so
more messages could be suppressed later. I also thought about providing a
way for the application to define its own GTK diagnostics filtering, but I
wasn't really sure if it was a good idea and didn't want to delay wx 3.2.0
even further, so I finally didn't do it.

 For completeness, there is a new wxApp::GTKSuppressDiagnostics() that can
be used to suppress all GTK diagnostics, but it might be unwise to do it
just in case some of them indicate some real problems.

GC> (lmi_wx_shared:79710): Gtk-WARNING **: 19:32:24.395: Drawing a gadget with 
negative dimensions. Did you forget to allocate a size? (node tab owner 
GtkNotebook)

 I don't see this one, using GTK 3.24.34. Could you please tell me what do
I need to do to see it?

GC> (lmi_wx_shared:79710): Gtk-CRITICAL **: 19:32:24.402: 
gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkScrollbar
GC> 
GC> Would it be easy to prevent those?

 We'd have to use use the code of wxGTKImpl::LogFilterByMessage (see
include/wx/gtk/private/log.h in wx sources) in lmi. We could simplify it a
bit as we probably don't care about supporting ancient glib versions, but
it's still not completely trivial.

 Calling GTKSuppressDiagnostics() would be trivial, of course, if you're
ready to do it.

GC> I conjecture that notebook tabs might have a dimension of -1

 No, they don't really have the dimension of -1, i.e. it's not just a
simple bug in wx. Looking at the first occurrence of the second message
that I see, it starts with resizing wxNotebook containing the MDI children
in the GTK version to a perfectly respectable 1185*565 size (the exact
numbers don't matter, of course, what matters is that they're quite
reasonable and definitely not negative or even too small). But then,
completely outside of wx code, GtkNotebook itself decides to allocate 82*32
to its scrollbar -- which still seems reasonable, but somehow ends up being
smaller than the minimum requested height of 46 that GtkScrollbar needs. So
while there does seem to be something wrong here, as GtkNotebook should
respect its children minimum sizes, normally, it's not as trivial as just
not giving it an invalid size, unfortunately.

 Sorry for lack of a good answer here,
VZ

Attachment: pgpIIQFE5Tfvy.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]