Strange off-by-one bug when setting display resolution in GNOME Settings
Issue
The drop-down for setting the display resolution option puts a check-mark on the option immediately below the actually set option in most instances.
Steps to reproduce:
- Open GNOME Settings
- Go to the Displays panel
- Observe the currently-set resolution
- Open the drop-down
- Observe the check-mark on the option immediately below the actually set option.
(Note: the only time this does not happen is when I choose the highest resolution option, which also makes the refresh rate option available)
Screenshots
Below are my general display settings: As can be seen, the refresh rate option is not available, and I have my resolution set to 2560 × 1440 (16∶9). However, the check-mark is on the 2048 × 1536 (4∶9) option, directly below my actual resolution. This behavior persists across all resolutions I have tested besides the highest: 3840 × 2160 (16∶9).
Upon selecting this resolution, but not having applied it, the settings appear as seen below, with the check-mark in the correct place as well as with the refresh rate option available:
This correct behavior persists upon applying the resolution as seen below:
Further Discussion
I am not sure if it is related, or simply coincidence, that the only resolution where the behavior is correct is also the only one where the refresh rate option becomes available. I took a look though the files and found this is using a widget called HdyComboRow
, which is from the libhandy
library. The refresh rate selector also uses this widget, but does not display this off-by-one behavior (although it also only becomes available in the same circumstances where this behavior is not seen in the other use of the widget). From what I see, the widget is not used elsewhere in GNOME Settings, so I don't have much else to test it with, although I doubt the bug is in libhandy
. I tool a brief look through the source code of GNOME Settings, and was unable to determine where the bug originates. On a final note: this bug is visual-only, and does not result in incorrect settings being applied. It persisted using the default theme as well.