nwg-piotr / nwg-dock-hyprland

GTK3-based dock for Hyprland
MIT License
149 stars 11 forks source link

Blurry on 2k display #22

Open etherbiswas opened 10 months ago

etherbiswas commented 10 months ago

IMG_20230820_132052_HDR Dock icons appear blurry hard to see in the image but it is very pixelated when not using something like 1920x1080p, this is noticeable on 2560x1600p

nwg-piotr commented 10 months ago

One of my monitors is 2K, and the icons are sharp as a razor. They may be blurry if you use fractional scaling, but this is the problem of GTK and Wayland. I can do nothing about it.

etherbiswas commented 10 months ago

as you can see no fractional scaling in my hyprland config

etherbiswas commented 10 months ago

![Uploading IMG_20230820_184357_HDR_AI.jpg…]()

etherbiswas commented 10 months ago

![Uploading IMG_20230820_184357_HDR_AI~2.jpg…]()

etherbiswas commented 10 months ago

github isnt updating;

monitor=DP-1,preferred,auto,2
monitor=DP-2,preferred,auto,1

# unscale XWayland
xwayland {
  force_zero_scaling = true
}

# toolkit-specific scale
env = GDK_SCALE,2
env = XCURSOR_SIZE,32
exec-once = brightnessctl set 30%
exec-once = nwg-panel
exec-once = nwg-dock-hyprland -x
exec-once = hyprpaper

this should not be in the fractional scaling category?

nwg-piotr commented 10 months ago

With monitor scale: 2.00 icons appear blurry, indeed - even if it's not a fractional scaling. But there's nothing I could do about it.

nwg-piotr commented 10 months ago

After a short investigation: we could achieve sharp icons on scaled displays by giving up on icon size in pixels and gdk.Pixbuf. We would need to always use predefined icon sizes:

const (
    ICON_SIZE_INVALID       IconSize = C.GTK_ICON_SIZE_INVALID
    ICON_SIZE_MENU          IconSize = C.GTK_ICON_SIZE_MENU
    ICON_SIZE_SMALL_TOOLBAR IconSize = C.GTK_ICON_SIZE_SMALL_TOOLBAR
    ICON_SIZE_LARGE_TOOLBAR IconSize = C.GTK_ICON_SIZE_LARGE_TOOLBAR
    ICON_SIZE_BUTTON        IconSize = C.GTK_ICON_SIZE_BUTTON
    ICON_SIZE_DND           IconSize = C.GTK_ICON_SIZE_DND
    ICON_SIZE_DIALOG        IconSize = C.GTK_ICON_SIZE_DIALOG
)

This is quite a fundamental and limiting change, that would need to be applied to all my stuff, not only the dock. I am not sure if I want to go into it for just a single issue reported.

Also: gtk menus will still appear blurred. :/