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 770614 - GtkScale in HighContrast theme with value = 0: WARNING: allocates negative content width/height to node highlight
GtkScale in HighContrast theme with value = 0: WARNING: allocates negative co...
Product: gtk+
Classification: Platform
Component: Widget: Other
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
Depends on:
Reported: 2016-08-30 20:29 UTC by Daniel Boles
Modified: 2017-02-12 15:14 UTC
See Also:
GNOME target: ---
GNOME version: 3.19/3.20

testcase: creates warnings when value is 0 & redraws occur (e.g. mouseover) (582 bytes, text/plain)
2016-09-03 12:22 UTC, Daniel Boles

Description Daniel Boles 2016-08-30 20:29:58 UTC
Using Gtk::Scale from gtkmm, along with the standard HighContrast theme, produces constant warnings of the following, for height or width, whenever the Gtk::Scale is redrawn.

> (xyz:10439): Gtk-WARNING **: Negative content width -2 (allocation 0, extents 1x1) while allocating gadget (node highlight, owner gtkmm__GtkScale)

This does not happen when using GtkScale directly from C.

HTH and thanks in advance.
Comment 1 Daniel Boles 2016-08-30 20:33:59 UTC
Ah, never mind. This depends on the value being at 0 => no highlight.

My GTK+ vs gtkmm tests differed only in the default value.

So this is a general thing. Moving to GTK+
Comment 2 Matthias Clasen 2016-09-02 22:25:47 UTC
Can you provide a testcase that reproduces this ? Just a .ui file would be good enough.
Comment 3 Daniel Boles 2016-09-03 12:22:34 UTC
Created attachment 334709 [details]
testcase: creates warnings when value is 0 & redraws occur (e.g. mouseover)

Sure, here's a minimal C file that forces HighContrast theme and generates the quoted warnings whenever the Scale's value is 0 and a redraw occurs, e.g. when you mouse over it. Changing the value away from 0 - so that there's a larger highlight gadget, presumably - silences the warnings.

I guess something is wrong with some math for the highlight gadget somewhere.
Comment 4 Daniel Boles 2016-09-04 14:41:06 UTC
Thanks for the fix!
Comment 5 Vlad Orlov 2017-02-12 13:57:11 UTC

Thanks, but which commit fixed this?

I don't see the issue with GTK+ 3.22, but it's still present in 3.20 branch (with 3.20.9). Can you please backport the fix there?
Comment 6 Daniel Boles 2017-02-12 15:08:18 UTC
In GTK+ 3.20, that was commit 6dd558a183761a7d2763b4f7d94b119527851ef3

No release of 3.20 has been done since then, covering this and various other commits made since the last one. I haven't heard when/whether another release will be made.
Comment 7 Emmanuele Bassi (:ebassi) 2017-02-12 15:11:51 UTC
No more releases of GTK+ 3.20 are scheduled. The new stable version of GTK+ is 3.22.
Comment 8 Vlad Orlov 2017-02-12 15:14:10 UTC
Oh, I see. Thanks.