After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 755129 - GtkStatusIcon: attempt to allocate widget with width -x and height y
GtkStatusIcon: attempt to allocate widget with width -x and height y
Status: RESOLVED WONTFIX
Product: gtk+
Classification: Platform
Component: Widget: Other
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2015-09-16 20:07 UTC by Alberts Muktupāvels
Modified: 2015-10-12 20:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gtktrayicon-x11: include padding in preferred width and height (3.11 KB, patch)
2015-09-16 20:07 UTC, Alberts Muktupāvels
reviewed Details | Review

Description Alberts Muktupāvels 2015-09-16 20:07:17 UTC
Created attachment 311503 [details] [review]
gtktrayicon-x11: include padding in preferred width and height

GtkStatusIcon might show following warning:
gtk_widget_size_allocate(): attempt to allocate widget with width -3 and height 26.

From my testing it looks like this negative width comes from:
padding * 2 - 1.

If padding is 2 then width is -3, if paddding is 10 then width
will be -19. Fix this by setting preferred width or height minimum
size to padding * 2.
Comment 1 Matthias Clasen 2015-09-18 10:57:52 UTC
The patch doesn't make sense to me, as is. Where is the padding incorporated in the size allocation ? That is where it should be taken into account for size requesting.

Afaics, the padding only gets sent to the server side to apply padding outside the status icon.
Comment 2 Alberts Muktupāvels 2015-09-18 11:44:11 UTC
(In reply to Matthias Clasen from comment #1)
> The patch doesn't make sense to me, as is. Where is the padding incorporated
> in the size allocation ? That is where it should be taken into account for
> size requesting.
> 
> Afaics, the padding only gets sent to the server side to apply padding
> outside the status icon.

Not sure if I understood correctly, but padding is used in GtkStatusIcon:
https://git.gnome.org/browse/gtk+/tree/gtk/deprecated/gtkstatusicon.c#n1480

Does not this affect size allocation?
Comment 3 Alberts Muktupāvels 2015-10-12 20:12:25 UTC
Still think that this is gtk+ bug, but since I added similar fix to gnome-panel and GtkStatusIcon is deprecated I will close this as WONTFIX.