wayland: HiDPI fixes#13842
Merged
Merged
Conversation
clefebvre
commented
Jul 1, 2026
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.
Contributor
There was a problem hiding this comment.
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_scaleinto 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
StIconreload icons whenresource-scalechanges 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.