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 781605 - GtkVolumeButton limited to 10 values
GtkVolumeButton limited to 10 values
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
3.22.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2017-04-22 10:09 UTC by Christoph Reiter (lazka)
Modified: 2017-05-01 09:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gtkscale: disable value rounding by default (2.26 KB, patch)
2017-04-23 08:16 UTC, Christoph Reiter (lazka)
none Details | Review

Description Christoph Reiter (lazka) 2017-04-22 10:09:57 UTC
Since https://git.gnome.org/browse/gtk+/commit/?h=gtk-3-22&id=4a6bd134bdc192b4830a1c6228e27332d4629418 GtkVolumeButton can only represent 10 different values when dragging with the mouse.

1) Open gtk3-widget-factory
2) Go to page 2
3) Click the volume button in the top left corner
4) Click and drag the slider

Expected: No value rounding
Actual: The slider knob snaps to one of 10 values

Reverting the above commit fixes the problem.
Comment 1 Christoph Reiter (lazka) 2017-04-23 07:07:54 UTC
The same problem affects the color chooser and the font size chooser (which limits the colors, font sizes one can select..)

Solutions:

1) Disable rounding only for GtkScaleButton, GtkColorChooser and GtkFontChooser
2) Disable rounding of GtkScale by default (set digits default value from 1 to -1)
3) Revert the patch for 3.22 and change default only in master
Comment 2 Christoph Reiter (lazka) 2017-04-23 08:16:58 UTC
Created attachment 350258 [details] [review]
gtkscale: disable value rounding by default

Before 4a6bd134bdc192b483 GtkScale did not round values if no value
was shown and many widgets using GtkScaleButton and GtkScale like
GtkVolumeButton, GtkColorEditor and GtkFontChooserWidget implicitly
depended on this behavior. This broke selecting specific colors,
font sizes and volume levels.

This restores the previous behavior of the common case by disabling rounding
by default for all cases.

The removal of the round_digits value in GtkScaleButton is needed because before
4a6bd134bdc192b483 this value was ignored/reset by GtkScale and removing it
restores the previous default behavior.
Comment 3 Daniel Boles 2017-04-24 08:50:51 UTC
I'm sorry if that patch has caused any issues and will let everyone else decide on the best solution - including reverting if my judgment wasn't good here.

Isn't there an option 4, though? Set a number of digits more than the default 1 on the Scalebutton etc cases. I've not looked into it yet but presumably e.g. the ScaleButton runs from 0 to 1 and the current number of digits == 1 causes the 10-step behaviour. Why not bump that to 2 digits or something? May be an option.
Comment 4 Daniel Boles 2017-04-25 08:54:40 UTC
And perhaps an option 5? Leave Scale's default at 1 for rounding to 1 digit, and explicitly pass -1 from ScaleButton et al.
Comment 5 Christoph Reiter (lazka) 2017-04-26 11:38:39 UTC
The commit was reverted, so closing this.

https://git.gnome.org/browse/gtk+/commit/?id=197355e15ac10bc05b7eed34c9eae6fa33b9f5c4
Comment 6 Daniel Boles 2017-04-28 20:47:27 UTC
Please could someone also apply the behavioural and documentation reverts to the gtk-2-24 branch? So that it will not cause problems in the next release (it was done since the previous one). I am on a rubbish internet connection and computer for the next while, so it might take me an age to get this done. Thanks.
Comment 7 Christoph Reiter (lazka) 2017-04-30 17:34:48 UTC
> Please could someone also apply the behavioural and documentation reverts to the gtk-2-24 branch?

Done
Comment 8 Daniel Boles 2017-05-01 09:18:07 UTC
Thank you!