Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Use current display scale for icon fetching #1

Open
properlypurple opened this issue Nov 25, 2020 · 5 comments
Open

Use current display scale for icon fetching #1

properlypurple opened this issue Nov 25, 2020 · 5 comments

Comments

@properlypurple
Copy link

Icons are pixelated or blurry
Swappshot Wed Nov 25 12:28:10 2020

@valpackett
Copy link
Collaborator

wow, thanks for trying this out, it's a bit early :)

What is your display scale? The code currently prefers 2x icons.. What is the compositor, is it running on hardware directly or windowed?

@properlypurple
Copy link
Author

My environment:

  • sway version 1.5.1 running on hardware
  • display: 3440 × 1440
  • scale 1

I haven't tried yet, but I can test with Wayfire as well. I'm a big fan of Plank from elementary OS, and desperately want something that runs on non-GNOME wayland.

@valpackett
Copy link
Collaborator

You can try something like this for now to get the more "perfect" icons (for the raster ones) for scale 1 rather than downscaling:

--- i/shell/src/util/apps.rs
+++ w/shell/src/util/apps.rs
@@ -76,9 +76,7 @@ fn themed_icon(icon: &gio::ThemedIcon) -> Option<linicon::IconPath> {
     let names = icon.get_names();
     let name = names.iter().next()?;
     // TODO: get current scale from caller instead of assuming 2
-    icons_iter(name, dock::ICON_SIZE, 2)
-        .chain(icons_iter(name, dock::ICON_SIZE * 2, 1))
-        .chain(icons_iter(name, dock::ICON_SIZE, 1))
+    icons_iter(name, dock::ICON_SIZE, 1)
         .chain(icons_iter(name, 512, 1))
         .chain(icons_iter(name, 256, 1))
         .chain(icons_iter(name, 128, 1))

@properlypurple
Copy link
Author

Ooh thanks! That looks so much better.

I don't know anything about Rust, but I'm going to try and poke at the code over the weekend.

@valpackett valpackett changed the title Pixelated icons Use current display scale for icon fetching Nov 25, 2020
@valpackett
Copy link
Collaborator

I'll leave this issue open as a reminder for myself to prioritize the // TODO: get current scale from caller instead of assuming 2 thing.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants