Eliminate the warning Allocating size to GtkWindow without calling gtk_widget_get_preferred_size/height

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Eliminate the warning Allocating size to GtkWindow without calling gtk_widget_get_preferred_size/height

David Lowrence
I am seeing this warning when expanding a TreeStore when the expanded height exceeds the size of the window.  I'm attaching a minimal but complete program that exhibits this.

If there's something I'm missing, I'd appreciate anu pointers, but it seems that this is a bug of sorts.  I've Googled this and saw some cases where it was a bug in the application programming, and were corrected, but most of these programs do explicitly allocate the size.

In the attached file, I did nothing to attempt to resize the window (the warning definitely refers to the toplevel window).

This occurs on all the systems on which I've tried it - Windows compiled under MinGW, Debian testing, Arch Linux, Linux Mint, and Ubuntu.  All these systems have some flavor of Gtk 3.22.

Also note that on my tests, if List 2 (the lower iter) is expanded first and the expanded size does not exceed the height of the window, and then List 1 is expanded, the warning is not displayed.

Seemingly, this is only a harmless warning, but it is a bit disconcerting to see it.  FWIW, even Glade (at least v 3.20) emits this warning when the widget hierarchy is expanded.

_______________________________________________
gtk-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-list

test.c (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Eliminate the warning Allocating size to GtkWindow without calling gtk_widget_get_preferred_size/height

The Devils Jester
My application gets spammed with these allocating size warnings constantly, and I have tried to find a way to disable them programmatically without success.  Its just noise in the terminal, and misleading in that end users think there is a problem.  I think that they should be eliminated as well.

On Tue, Jun 27, 2017 at 9:53 PM, David Breeding <[hidden email]> wrote:
I am seeing this warning when expanding a TreeStore when the expanded height exceeds the size of the window.  I'm attaching a minimal but complete program that exhibits this.

If there's something I'm missing, I'd appreciate anu pointers, but it seems that this is a bug of sorts.  I've Googled this and saw some cases where it was a bug in the application programming, and were corrected, but most of these programs do explicitly allocate the size.

In the attached file, I did nothing to attempt to resize the window (the warning definitely refers to the toplevel window).

This occurs on all the systems on which I've tried it - Windows compiled under MinGW, Debian testing, Arch Linux, Linux Mint, and Ubuntu.  All these systems have some flavor of Gtk 3.22.

Also note that on my tests, if List 2 (the lower iter) is expanded first and the expanded size does not exceed the height of the window, and then List 1 is expanded, the warning is not displayed.

Seemingly, this is only a harmless warning, but it is a bit disconcerting to see it.  FWIW, even Glade (at least v 3.20) emits this warning when the widget hierarchy is expanded.

_______________________________________________
gtk-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-list




--
"They don't think it be like it is, but it do." - Oscar Gamble

_______________________________________________
gtk-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Eliminate the warning Allocating size to GtkWindow without calling gtk_widget_get_preferred_size/height

Timm Bäder
On 28.06, The Devils Jester wrote:
> My application gets spammed with these allocating size warnings constantly,
> and I have tried to find a way to disable them programmatically without
> success.  Its just noise in the terminal, and misleading in that end users
> think there is a problem.  I think that they should be eliminated as well.

Those warnings usually come from
https://git.gnome.org/browse/gtk+/tree/gtk/gtkwindow.c?h=gtk-3-22#n9744

The output you're seeing is from gtkwidget.c and inside a
#ifdef G_ENABLE_DEBUG guard. G_ENABLE_DEBUG gets defined when
--disable-debug is NOT passed to the GTK+ build. A few of the warnings
in gtk+ have been put into #ifdef G_ENABLE_CONSISTENCY_CHECKS guards
instead, which is only defined when --enable-debug is explicitly passed
to the build.

If you can come up with a patch, I'm sure it would be merged.

_______________________________________________
gtk-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Eliminate the warning Allocating size to GtkWindow without calling gtk_widget_get_preferred_size/height

The Devils Jester
A compile time flag is not a viable solution to this problem.  I have no control over the compile state of GTK on my end users systems.

For my own personal use case, a flag on a widget (or its container) that indicates that custom size management is being performed on this widget (or its children) and that such warnings are not needed, would be ideal.

On Wed, Jun 28, 2017 at 9:10 AM, Timm Bäder <[hidden email]> wrote:
On 28.06, The Devils Jester wrote:
> My application gets spammed with these allocating size warnings constantly,
> and I have tried to find a way to disable them programmatically without
> success.  Its just noise in the terminal, and misleading in that end users
> think there is a problem.  I think that they should be eliminated as well.

Those warnings usually come from
https://git.gnome.org/browse/gtk+/tree/gtk/gtkwindow.c?h=gtk-3-22#n9744

The output you're seeing is from gtkwidget.c and inside a
#ifdef G_ENABLE_DEBUG guard. G_ENABLE_DEBUG gets defined when
--disable-debug is NOT passed to the GTK+ build. A few of the warnings
in gtk+ have been put into #ifdef G_ENABLE_CONSISTENCY_CHECKS guards
instead, which is only defined when --enable-debug is explicitly passed
to the build.

If you can come up with a patch, I'm sure it would be merged.




--
"They don't think it be like it is, but it do." - Oscar Gamble

_______________________________________________
gtk-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Eliminate the warning Allocating size to GtkWindow without calling gtk_widget_get_preferred_size/height

David Lowrence
In reply to this post by Timm Bäder

On Wed, Jun 28, 2017 at 9:10 AM, Timm Bäder <[hidden email]> wrote:

Those warnings usually come from
https://git.gnome.org/browse/gtk+/tree/gtk/gtkwindow.c?h=gtk-3-22#n9744

The output you're seeing is from gtkwidget.c and inside a
#ifdef G_ENABLE_DEBUG guard. G_ENABLE_DEBUG gets defined when
--disable-debug is NOT passed to the GTK+ build. A few of the warnings
in gtk+ have been put into #ifdef G_ENABLE_CONSISTENCY_CHECKS guards
instead, which is only defined when --enable-debug is explicitly passed
to the build.

I'm in a similar situation as the Devil's Jester in that I try to use the precompiled binaries  provided by my distros to maintain compatibility with my system.

Also, in this particular case, I really feel that the warning is produced by the underlying gtk system.  In the code I provided, the toplevel window is a given size; when I expand the TreeStore, I do not expect to resize containing ScrolledWindow or the toplevel window.  All this should be handled internally, should it not?  Additionally, the fact that the warning is not issued when expanding the first group causes the list to exceed the height of the window does seem to be an inconsistency and appears to be an error in the code itself.

If you can come up with a patch, I'm sure it would be merged.

I'm not sure I'm competent to be working on Gtk itself. 


_______________________________________________
gtk-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Eliminate the warning Allocating size to GtkWindow without calling gtk_widget_get_preferred_size/height

Timm Bäder
On 28.06, David Breeding wrote:

> On Wed, Jun 28, 2017 at 9:10 AM, Timm Bäder <[hidden email]> wrote:
> >
> >
> > Those warnings usually come from
> > https://git.gnome.org/browse/gtk+/tree/gtk/gtkwindow.c?h=gtk-3-22#n9744
> >
> > The output you're seeing is from gtkwidget.c and inside a
> > #ifdef G_ENABLE_DEBUG guard. G_ENABLE_DEBUG gets defined when
> > --disable-debug is NOT passed to the GTK+ build. A few of the warnings
> > in gtk+ have been put into #ifdef G_ENABLE_CONSISTENCY_CHECKS guards
> > instead, which is only defined when --enable-debug is explicitly passed
> > to the build.
> >
>
> I'm in a similar situation as the Devil's Jester in that I try to use the
> precompiled binaries  provided by my distros to maintain compatibility with
> my system.

I know. I never said otherwise. Nobody explicitly passes --enable-debug
to a distr build of gtk+. But if changing gtk+ and waiting for the
change to land in your users' systems isn't an option, I guess nothing
is?

> Also, in this particular case, I really feel that the warning is produced
> by the underlying gtk system.

That's what I said.


> > If you can come up with a patch, I'm sure it would be merged.
> I'm not sure I'm competent to be working on Gtk itself.

Fine, but someone will have to change something. It's a two-line change.
_______________________________________________
gtk-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Eliminate the warning Allocating size to GtkWindow without calling gtk_widget_get_preferred_size/height

The Devils Jester
On Thu, Jun 29, 2017 at 1:12 AM, Timm Bäder <[hidden email]> wrote:

I know. I never said otherwise. Nobody explicitly passes --enable-debug
to a distr build of gtk+. But if changing gtk+ and waiting for the
change to land in your users' systems isn't an option, I guess nothing
is?


If I understand correctly, he is saying that he is not doing anything that should result in such a warning.  If thats the case, its a bug in GTK and putting the warning behind a more restrictive flag isn't a fix, its just pretending the bug doesn't exist.

With my situation, I know that I am often doing things that would result in this warning, within specific containers or windows.  It would be ideal if I could tell GTK that I have good reasons for this, for these particular widgets and that I don't want to get this warning for them, but its OK to warn me about other similar situations for different widgets.  For example a flag on a container that tells GTK that you are doing custom sizing that may trigger the warning but you know that, and its OK.

_______________________________________________
gtk-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Eliminate the warning Allocating size to GtkWindow without calling gtk_widget_get_preferred_size/height

David Lowrence


On Thu, Jun 29, 2017 at 11:19 AM, The Devils Jester <[hidden email]> wrote:
On Thu, Jun 29, 2017 at 1:12 AM, Timm Bäder <[hidden email]> wrote:

I know. I never said otherwise. Nobody explicitly passes --enable-debug
to a distr build of gtk+. But if changing gtk+ and waiting for the
change to land in your users' systems isn't an option, I guess nothing
is?


If I understand correctly, he is saying that he is not doing anything that should result in such a warning.  If that's the case, its a bug in GTK and putting the warning behind a more restrictive flag isn't a fix, its just pretending the bug doesn't exist.

That's exactly what I should have said.  I don't want bona-fide warnings stifled - if I'm doing something wrong, I do want to be notified, but would prefer to not see errant and perhaps misleading warnings popping up.  In the case in point, it appears that something - TreeView? ScrolledWindow? is handling widget expansion contrary to the way Gtk3 expects it to be done.

FWIW, I just compiled the same code (with appropriate modifications) under gtk2 and this warning does not appear.

_______________________________________________
gtk-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-list
Loading...