St background-image is not updated after changing scale factor
Affected version
- OS: Ubuntu 23.04 and others
- Affected GNOME Shell version: Gnome: GNOME 44.2 is affected, including known previous versions
- Does this issue appear in XOrg and/or Wayland: XOrg/Wayland: both
- Does this issue happen without extensions: no really but breaks things in multiple extensions
Bug summary
In short
background-image: url('...')
for St elements is not updated after changing the display scale factor and drawn using the initial scale factor. The problem persists if the element is redrawn or the style class is changed.
This leads to visual bugs in extensions such as unite-shell (see the bugreport) and the problem seems to exist for a long time (since 2019?).
See screenshots attached at the end of the description.
Steps to reproduce
- Add any element with
background-image
styling to the gnome shell panel - See that the element is displayed correctly
- Change scaling factor (let's say from 2x to 1x)
- See that this element
background-image
is still drawn with 2x scale factor
This works with any combinations of scaling factors, including fractional scaling enabled.
I made a very simple mock gnome shell extension to demonstrate this problem: github link.
What happened
The elements with background-image
are not updated to new scaling factors.
What did you expect to happen
background-image
should be redrawn using current scale factor.
Relevant logs, screenshots, screencasts etc.
Edited by Ilya M