GNOME Bugzilla – Bug 770614
GtkScale in HighContrast theme with value = 0: WARNING: allocates negative content width/height to node highlight
Last modified: 2017-02-12 15:14:10 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.
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+
Can you provide a testcase that reproduces this ? Just a .ui file would be good enough.
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.
Thanks for the fix!
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?
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.
No more releases of GTK+ 3.20 are scheduled. The new stable version of GTK+ is 3.22.
Oh, I see. Thanks.