hyprwm / Hyprland

Hyprland is an independent, highly customizable, dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
https://hyprland.org
BSD 3-Clause "New" or "Revised" License
19.55k stars 821 forks source link

GTK LowDPI Mode After Suspend #6928

Open SpookedByRoaches opened 1 month ago

SpookedByRoaches commented 1 month ago

Regression?

Yes

System Info and Version

System/Version info ```sh Hyprland, built from branch at commit 918d8340afd652b011b937d29d5eea0be08467f5 (flake.lock: update). Date: Tue Jun 25 12:06:02 2024 Tag: v0.41.2, commits: 4886 flags: (if any) System Information: System name: Linux Node name: hsn-arch Release: 6.9.9-zen1-1-zen Version: #1 ZEN SMP PREEMPT_DYNAMIC Fri, 12 Jul 2024 00:06:19 +0000 GPU information: 2d:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 [Radeon RX 5600 OEM/5600 XT / 5700/5700 XT] [1002:731f] (rev c1) (prog-if 00 [VGA controller]) os-release: NAME="Arch Linux" PRETTY_NAME="Arch Linux" ID=arch BUILD_ID=rolling ANSI_COLOR="38;2;23;147;209" HOME_URL="https://archlinux.org/" DOCUMENTATION_URL="https://wiki.archlinux.org/" SUPPORT_URL="https://bbs.archlinux.org/" BUG_REPORT_URL="https://gitlab.archlinux.org/groups/archlinux/-/issues" PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/" LOGO=archlinux-logo plugins: ======Config-Start====== Config File: /home/bo3lwa/.config/hypr/hyprland.conf: Read Succeeded # # Please note not all available settings / options are set here. # For a full list, see the wiki # # See https://wiki.hyprland.org/Configuring/Monitors/ monitor=,preferred,auto,1.6 source=~/.config/hypr/themes/macchiatto.conf debug:disable_logs = false # See https://wiki.hyprland.org/Configuring/Keywords/ for more # Execute your favorite apps at launch # exec-once = waybar & hyprpaper & firefox exec-once = hyprpaper exec-once = rm "$HOME/.cache/cliphist/db" exec-once = wl-paste --watch cliphist store exec-once = "$HOME/pkgs/Waybar/build/waybar" exec-once = "$HOME/.config/hypr/cycle_bgs.sh" exec-once = swayidle -w timeout 1200 'hyprctl dispatch dpms off' resume 'hyprctl dispatch dpms on && sleep 5 && touch $HOME/.config/hypr/hyprland.conf' exec-once = echo "$HOME/Important/main.kdbx" | entr -nps "$HOME/scripts/uploadDB.sh" # Source a file (multi-file configs) # source = ~/.config/hypr/myColors.conf # Some default env vars. env = XCURSOR_SIZE,24 # env = GDK_SCALE, 1 # env = QT_AUTO_SCREEN_SCALE_FACTOR,1 # For all categories, see https://wiki.hyprland.org/Configuring/Variables/ input { kb_layout = us,ara kb_options = grp:alts_toggle repeat_rate = 30 repeat_delay = 300 follow_mouse = 1 numlock_by_default = true scroll_factor = 1.5 } xwayland { force_zero_scaling = true } general { gaps_in = 0 gaps_out = 5 border_size = 1 col.active_border = rgba($redAlphaff) rgba($pinkAlphaff) 45deg col.inactive_border = rgba($greenAlphaff) layout = master } decoration { # See https://wiki.hyprland.org/Configuring/Variables/ for more rounding = 10 drop_shadow = yes shadow_range = 4 shadow_render_power = 3 col.shadow = rgba($subtext0Alphaee) inactive_opacity = 0.5 } animations { enabled = yes # Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more animation = windows, 1, 3, default animation = border, 1, 3, default animation = fade, 1, 3, default animation = workspaces, 1, 3, default } dwindle { # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below preserve_split = yes # you probably want this } master { # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more #new_is_master = true } gestures { # See https://wiki.hyprland.org/Configuring/Variables/ for more workspace_swipe = off } # Example windowrule v1 # windowrule = float, ^(kitty)$ # Example windowrule v2 # windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more misc { enable_swallow = true swallow_regex = foot key_press_enables_dpms = false mouse_move_enables_dpms = false } # See https://wiki.hyprland.org/Configuring/Keywords/ for more $mainMod = SUPER # Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more binds { allow_workspace_cycles=true } bind = $mainMod, Q, exec, foot bind = $mainMod, C, killactive, bind = $mainMod SHIFT, E, exit, bind = $mainMod, E, exec, dolphin bind = $mainMod, V, togglefloating, bind = $mainMod, D, exec, wofi --show drun --style $HOME/.config/wofi/clean.css bind = $mainMod, F, fullscreen, 1 bind= $mainMod, M, layoutmsg, swapwithmaster master # Move focus with mainMod + arrow keys bind = $mainMod, left, movefocus, l bind = $mainMod, right, movefocus, r bind = $mainMod, up, movefocus, u bind = $mainMod, down, movefocus, d bind = $mainMod, J, cyclenext, bind = $mainMod, K, layoutmsg, cycleprev # Switch workspaces with mainMod + [0-9] bind = $mainMod, 1, workspace, 1 bind = $mainMod, 2, workspace, 2 bind = $mainMod, 3, workspace, 3 bind = $mainMod, 4, workspace, 4 bind = $mainMod, 5, workspace, 5 bind = $mainMod, 6, workspace, 6 bind = $mainMod, 7, workspace, 7 bind = $mainMod, 8, workspace, 8 bind = $mainMod, 9, workspace, 9 bind = $mainMod, 0, workspace, 10 bind = $mainMod, TAB, workspace, previous # Move active window to a workspace with mainMod + SHIFT + [0-9] bind = $mainMod SHIFT, 1, movetoworkspace, 1 bind = $mainMod SHIFT, 2, movetoworkspace, 2 bind = $mainMod SHIFT, 3, movetoworkspace, 3 bind = $mainMod SHIFT, 4, movetoworkspace, 4 bind = $mainMod SHIFT, 5, movetoworkspace, 5 bind = $mainMod SHIFT, 6, movetoworkspace, 6 bind = $mainMod SHIFT, 7, movetoworkspace, 7 bind = $mainMod SHIFT, 8, movetoworkspace, 8 bind = $mainMod SHIFT, 9, movetoworkspace, 9 bind = $mainMod SHIFT, 0, movetoworkspace, 10 # Scroll through existing workspaces with mainMod + scroll bind = $mainMod, mouse_down, workspace, e+1 bind = $mainMod, mouse_up, workspace, e-1 # Move/resize windows with mainMod + LMB/RMB and dragging bindm = $mainMod, mouse:272, movewindow bindm = $mainMod, mouse:273, resizewindow bind = $mainMod, SPACE, exec, cliphist list | wofi --show dmenu --style $HOME/.config/wofi/compact.css | cliphist decode | wl-copy bindl = $mainMod SHIFT, K, exec, hyprctl switchxkblayout logitech-wireless-keyboard-pid:4023 next binde=, XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+ bindl=, XF86AudioPlay, exec, playerctl -p playerctld play-pause binde=SHIFT, XF86AudioPlay, exec, playerctl -p $(playerctl -l | wofi -s $HOME/.config/wofi/compact.css --show dmenu) play-pause binde=, XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- bindl=, XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle bind = $mainMod, S, exec, grim -g "$(slurp)" - | swappy -f - bind = $mainMod, A, exec, python $HOME/scripts/audio_changer.py bind = $mainMod, P, exec, $HOME/scripts/launchKeepassxc.sh bind = $mainMod, code:60, exec, wofi-emoji # Alternate key binds? bind = Alt, Up, exec, wtype -P Page_Up bind = Alt, Down, exec, wtype -P Page_Down Config File: /home/bo3lwa/.config/hypr/themes/macchiatto.conf: Read Succeeded $rosewaterAlpha = f4dbd6 $flamingoAlpha = f0c6c6 $pinkAlpha = f5bde6 $mauveAlpha = c6a0f6 $redAlpha = ed8796 $maroonAlpha = ee99a0 $peachAlpha = f5a97f $yellowAlpha = eed49f $greenAlpha = a6da95 $tealAlpha = 8bd5ca $skyAlpha = 91d7e3 $sapphireAlpha = 7dc4e4 $blueAlpha = 8aadf4 $lavenderAlpha = b7bdf8 $textAlpha = cad3f5 $subtext1Alpha = b8c0e0 $subtext0Alpha = a5adcb $overlay2Alpha = 939ab7 $overlay1Alpha = 8087a2 $overlay0Alpha = 6e738d $surface2Alpha = 5b6078 $surface1Alpha = 494d64 $surface0Alpha = 363a4f $baseAlpha = 24273a $mantleAlpha = 1e2030 $crustAlpha = 181926 $rosewater = 0xfff5e0dc $flamingo = 0xfff2cdcd $pink = 0xfff5c2e7 $mauve = 0xffcba6f7 $red = 0xfff38ba8 $maroon = 0xffeba0ac $peach = 0xfffab387 $yellow = 0xfff9e2af $green = 0xffa6e3a1 $teal = 0xff94e2d5 $sky = 0xff89dceb $sapphire = 0xff74c7ec $blue = 0xff89b4fa $lavender = 0xffb4befe $text = 0xffcdd6f4 $subtext1 = 0xffbac2de $subtext0 = 0xffa6adc8 $overlay2 = 0xff9399b2 $overlay1 = 0xff7f849c $overlay0 = 0xff6c7086 $surface2 = 0xff585b70 $surface1 = 0xff45475a $surface0 = 0xff313244 $base = 0xff1e1e2e $mantle = 0xff181825 $crust = 0xff11111b ======Config-End======== ```

Description

OK so this is a weird issue. When scaling the monitor, then suspending the screen using hyprctl dispatch dpms suspend, GTK applications go to lowDPI mode. This happens to Firefox and GnuCash. I don't know any other applications that use GTK but these two have this problem consistently. If the app is in lowdpi mode then you bring the screen back to the default scale of 1, it's fine again.

The commit that created that issue is 6967a31450441fc5605c05db6f65505dace4b263

How to reproduce

Crash reports, logs, images, videos

No response

Sydius commented 1 month ago

This similarly happens if I power off my monitors and then power them back on (manually, by pressing the buttons). I also get thrown onto a new blank workspace, though that may be a different issue.

New instances of Firefox are fine. Other apps seem fine.

I'm using fractional scaling (1.5) but the issue reproduces with 2.0 as well.

I was hopeful that I could revert the commit mentioned above or maybe even try to fix it myself, but #6268 is quite the large change so I gave up on that idea.

I don't know if it's related, but I found https://www.reddit.com/r/swaywm/comments/m4dfku/firefox_becomes_blurry_after_waking_up_from_sleep/ which points to a wlroots issue from 2020: https://github.com/swaywm/wlroots/issues/2466 -- my understanding is that Hypr recently moved away from wlroots, so perhaps whatever fix was needed there could be helpful here. But it could also be a red herring.

Sydius commented 1 month ago

As a silly little workaround for now, I've pinned about:profiles in Firefox and click the 'Restart normally...' button when necessary. It seems to put the window back where it was, how it was, but with the crisper fonts again.

Sydius commented 1 month ago

I've discovered that this also happens if I switch my monitors to a different computer using a KVM. I suppose this isn't terribly surprising, given the other scenarios it also happens in, but thought I'd mention it in case it helps narrow anything down.

Sydius commented 1 month ago

Having tested it some more, I think this has something to do with how quickly the monitor wakes up. I have two monitors: an Acer that is dog slow to wake up and a Dell that is, comparatively, snappy. If Firefox is on the Dell monitor when dpms is toggled, it's fine; if it's on the Acer, this bug occurs. I swapped the Acer for another Dell and now the problem happens a lot less frequently (but does still happen rarely, I think). My guess is it's some kind of timing issue / race condition somewhere.