Skip to content

wayland: HiDPI fixes#13842

Merged
clefebvre merged 2 commits into
masterfrom
wayland-fixes
Jul 1, 2026
Merged

wayland: HiDPI fixes#13842
clefebvre merged 2 commits into
masterfrom
wayland-fixes

Conversation

@clefebvre

Copy link
Copy Markdown
Member
  • Fix blurry icons
  • Fix blurry images (loaded via St/CSS)

Icons looked blurry in HiDPI under wayland because global.ui_scale is
always equal to 1.

Wayland stage-view scaling keeps Cinnamon UI layout in logical
coordinates, so global.ui_scale remains 1 even on scale-2 outputs.
StIcon was using only that UI scale when loading themed icons, causing
panel icons to be loaded at 1x and then upscaled by the compositor.
Load StIcon textures with the actor resource scale as well as the St
paint scale, and reload icons when the actor resource scale changes.

This keeps actor sizes logical while requesting HiDPI icon assets for
scaled Wayland stage views.
Wayland stage-view scaling keeps St layout in logical coordinates while
painting into scaled framebuffers. CSS image resources still assumed that
the St theme scale was the only relevant scale, so background-image and
border-image assets could be loaded at 1x and then upscaled on HiDPI
Wayland outputs.

Pass the actor resource scale into St theme node painting, cache rendered
theme resources per resource scale, and load CSS image textures and Cairo
surfaces with the combined paint/resource scale. Keep CSS sizing math in
logical coordinates so scaled backing textures do not change layout size.

This makes CSS-backed images, including menu avatar backgrounds, render
crisply on scaled Wayland outputs.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR targets Wayland HiDPI rendering quality by making St theme/background drawing and icon loading aware of Clutter’s resource-scale, so textures/surfaces are generated at appropriate resolution instead of being upscaled (blurry).

Changes:

  • Pass resource_scale into theme-node painting and use it to render background textures/surfaces at the correct pixel density.
  • Update CSS/background image and border-image loading paths to use GFile + scale-aware texture-cache APIs.
  • Make StIcon reload icons when resource-scale changes and request scaled icons/textures from the cache.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/st/st-widget.c Retrieves actor resource-scale and forwards it into theme-node background painting.
src/st/st-theme-node.h Extends st_theme_node_paint() signature to include resource_scale.
src/st/st-theme-node-transition.c Updates transition offscreen painting call sites for the new st_theme_node_paint() signature (currently passes 1.0).
src/st/st-theme-node-private.h Stores resource_scale in StThemeNode cached paint state.
src/st/st-theme-node-drawing.c Uses resource_scale for background image sizing, Cairo device scaling, prerendered texture sizes, and border-image slicing coords.
src/st/st-texture-cache.h Adds st_texture_cache_load_icon_name_with_scale() API.
src/st/st-texture-cache.c Applies Cairo device scaling to pixbuf-derived surfaces; implements icon-name “with scale” loader and keeps old API as a wrapper.
src/st/st-icon.c Tracks resource_scale, listens for notify::resource-scale, and reloads icons using scale-aware cache APIs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/st/st-theme-node.h
Comment thread src/st/st-theme-node-transition.c
@clefebvre clefebvre merged commit 3e373f4 into master Jul 1, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants