mirror of
https://github.com/JakeStanger/ironbar.git
synced 2026-07-11 09:15:22 +01:00
[GH-ISSUE #96] Images look really low quality #8488
Labels
No labels
A:Build
A:CI
A:Client
A:Config
A:Core
A:Documentation
A:Documentation
A:IPC
A:Testing
A:UX/UI
blocked
BREAKING CHANGE
duplicate
good first issue
GTK4
help wanted
invalid
M:Battery
M:Battery
M:Bindmode
M:Bluetooth
M:Brightness
M:Cairo
M:Clipboard
M:Clock
M:Clock
M:Custom
M:Focused
M:Keyboard
M:Launcher
M:Menu
M:Music
M:Music
M:Music
M:Network Manager
M:Notifications
M:SysInfo
M:Tray
M:Volume
M:Workspaces
partially resolved
P:Critical
P:High
P:Low
P:Medium
pull-request
T:Bug
T:Bug
T:Core Enhancement
T:Module Enhancement
T:New Module
T:Question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
JakeStanger/ironbar#8488
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @yavko on GitHub (Apr 3, 2023).
Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/96
Describe the bug
icons and cover art look blurry, hidpi issue perhaps?
Expected behavior
images are displayed at the right resolution
System information:
0.11Additional context
probably hidpi
Screenshots
icon

another icon (only play is icon)
@JakeStanger commented on GitHub (Apr 3, 2023):
What's your config for the images / how are you loading them / what resolution are they?
Images are loaded at a hard-coded width/height at the moment, so will be resized automatically to that size. That could cause issues.
@yavko commented on GitHub (Apr 4, 2023):
Well, these are icons from an icon theme, and come from papirus, which is 100% vector.
@JakeStanger commented on GitHub (Apr 4, 2023):
Ah, so are they all stored as SVGs?
@yavko commented on GitHub (Apr 4, 2023):
Yeah
@JakeStanger commented on GitHub (Apr 7, 2023):
Cool, I suspect there's something weird going on with that then, perhaps related to hidpi as you suggest. Are you able to try bitmap images (literally any appropriately sized image will do just to test) and see if you still get the same problem?
@JakeStanger commented on GitHub (Apr 22, 2023):
I've just merged #120 which means you can now set
icon_sizeon modules, and it will render images at that size. When you get a chance, can you try the latest master and see if setting a size larger than the default (24 formusic) helps at all?I also tested with Papirus myself and had no issues before/after, which does point to hidpi.
@yavko commented on GitHub (Apr 22, 2023):
On it! Just need to compile :/
@yavko commented on GitHub (Apr 22, 2023):
Doesn't work, just renders it giantly, same with cover art, are you using pixbufs for the images? I was using pixbufs with images before (gtk4 tho), and if you didn't choose correct display scale, it would render it blurry like it is now.

@JakeStanger commented on GitHub (Apr 22, 2023):
Yeah, images are all loaded with pixbufs. I don't think I'm setting the display scale anywhere, so that may well be it. Do you have any info/examples on setting the scale?
@yavko commented on GitHub (Apr 22, 2023):
This is how i did it in gtk4, though
os_iconis aGtkPicturenotGtkImage@yavko commented on GitHub (Apr 22, 2023):
I just remembered why I did it like this, I did it like this, because I was rendering a tiny icon as a giant image
@JakeStanger commented on GitHub (Apr 22, 2023):
Looks like there's a separate method in GTK3 that they must have renamed to be default in GTK4. Hopefully it's as easy as that and the linked PR sorts it.
@yavko commented on GitHub (Apr 22, 2023):
Me too 😬, compile time :3
@JakeStanger commented on GitHub (Apr 22, 2023):
If you haven't set up sccache I'd recommend it - it can help a lot with frequent compiles
@yavko commented on GitHub (Apr 22, 2023):
I used to have it setup, but idk how to use it with the nix build system, i'll try to do some research on it now lol
@JakeStanger commented on GitHub (Apr 22, 2023):
Ah of course, that could be an interesting one with nix. I guess an ad-hoc repo clone with a shell env could probably speed it up too?
@yavko commented on GitHub (Apr 22, 2023):
Okay this is superrr weird, still blurry (also i removed the icon size stuff should i re-add it?)


Also it can't be a gtk thing, because this doesn't happen in eww, maybe we can look at its source?
@JakeStanger commented on GitHub (Apr 22, 2023):
Argh. If you try a different theme, does it still occur?
Yeah worth a shot I guess.
Yeah good idea, seems as good a place to poke around
I do have a laptop that's got a 4K screen, but it's on Gnome on X11 at the moment. I think I'll need to set that up when I get time (probs tomorrow) and see if I can replicate/fix it on there.
@yavko commented on GitHub (Apr 22, 2023):
No difference, breeze doesn't change, icon size doesnt as well, also i just noticed this error which has been happening for a while, (checked back at logs)

@JakeStanger commented on GitHub (Apr 22, 2023):
Aha, that looks might suspicious. Have a look at sections 17.12.1.3 and 17.12.1.4 here. A quick google pointed me to those, which sounds relevant?
@yavko commented on GitHub (Apr 22, 2023):
Omg, is this why? I'll add it as dep to flake and test

@yavko commented on GitHub (Apr 22, 2023):
Turns out its already there, i actually need to add a preFixup
@yavko commented on GitHub (Apr 23, 2023):
My pr mostly fixes the issue, I think I know why eww doesn't have this same issue even tho it doesn't include the
preFixUpstuff. I think its because it doesn't use pixbufs for images, in fact it doesn't handle images at all afaik, you give it properties and widget and it will handle those properties directly in gtk, so no taking image or icon and then feeding it into a pixbuf like its done here@JakeStanger commented on GitHub (Apr 23, 2023):
Oh interesting okay, that sounds definitely worth looking into. I'll merge both our PRs because they're steps in the right direction, and I'll leave this issue open to see if I can do what eww's doing and fully resolve it. Thanks for all your help on this one, hugely appreciated.
@JakeStanger commented on GitHub (Apr 23, 2023):
Looks like this isn't the case unfortunately :(
github.com/elkowar/eww@e76206817d/crates/eww/src/widgets/widget_definitions.rs (L517-L518)@yavko commented on GitHub (Apr 23, 2023):
That's weird, then why didn't it have blurry images
@JakeStanger commented on GitHub (Apr 24, 2023):
I think I'm going to need to locally test this to get to the bottom of it. I've tried to set sway up on my laptop but Zorin still ships an ancient version that doesn't support the required wlr protocols :/
I suppose I could put Nix to good use here. Are you able to share your nix config (or at least just the relevant parts of it), and then I can just apply your config on my laptop and (in theory) get a replica environment to test.
Also I've been assuming you're using 4K. Is that the case / what res and scaling are you using?
@yavko commented on GitHub (Apr 24, 2023):
So I use 3200x1800, which is almost 4k. Also my NixOS dotfiles are public on GitHub, they haven't been updated in a while, so when I'll get home I'll push all my local changes.
@yavko commented on GitHub (Apr 25, 2023):
Okay so I added all my local changes earlier here is link just in case https://github.com/yavko/Dotfiles
@JakeStanger commented on GitHub (Apr 30, 2023):
I've managed to get NixOS with your dotfiles running on my laptop, and I can confirm the play icon looks blurry for me too, in both Hyprland and Sway.
My plan next is to have a play with the config/CSS and see if I can get anywhere that way. I'll also test on another distro when I have time to spend setting that up, and see if it occurs there (or if you have something set up where you can do that, that'd be very helpful).
As an aside, it is very awesome that after a few minor tweaks, I can have a near-exact replica of your full system up and running on my machine.
@yavko commented on GitHub (Apr 30, 2023):
I'm glad it's not just my system
Nix is great, totally reproducible, that's why I use it!
@yavko commented on GitHub (May 1, 2023):
Btw, I added some new stuff to my config for hovering, also fixes uptime not working
github.com/yavko/Dotfiles@892525329b (diff-c9239733f0)@JakeStanger commented on GitHub (May 7, 2023):
Ok! One painful install of Arch Linux later, I can confirm it's happening on there as well. I do at least now have a testing ground, so hopefully I can finally get to the bottom of this soon.
@JakeStanger commented on GitHub (May 8, 2023):
I think! Think! I've got it. Weirdly no safe Rust API for it, so took a bit of digging.
@yavko commented on GitHub (May 8, 2023):
Can't wait to test it once I get home!
@yavko commented on GitHub (May 9, 2023):
It works!!!!