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

Blur in graphical apps when turning off and on my monitor #1839

Closed uncompute closed 1 year ago

uncompute commented 1 year ago

Table of Contents

  1. The problem
  2. Steps to reproduce
  3. Some useful logs
    1. Emacs running from terminal
    2. Firefox running from terminal
    3. Hyprpaper running from terminal
    4. Hyprland logs
  4. Additional info
    1. Hyprland config

The problem

When I turn off and on my 4K monitor, GTK apps become blurry, possibly due to rendering in FullHD. This issue occurs in apps such as Firefox, PCManFM, and Emacs-pgtk. It is worth mentioning that this issue doesn't happen in Sway.

Steps to reproduce

Have some GTK apps running then turn off and on monitor

Some useful logs

Emacs running from terminal

(emacs:13123): Gdk-CRITICAL **: 15:23:01.935: gdk_monitor_get_model: assertion 'GDK_IS_MONITOR (monitor)' failed
(emacs:13123): Gdk-CRITICAL **: 15:23:01.935: gdk_monitor_get_scale_factor: assertion 'GDK_IS_MONITOR (monitor)' failed

Firefox running from terminal

(firefox:12693): Gdk-CRITICAL **: 15:22:57.500: gdk_screen_get_monitor_scale_factor: assertion 'monitor_num < gdk_screen_get_n_monitors (screen)' failed
[Parent 12693, Main Thread] WARNING: gdk_screen_get_monitor_scale_factor: assertion 'monitor_num < gdk_screen_get_n_monitors (screen)' failed: 'glib warning', file /build/firefox/src/firefox-111.0/toolkit/xre/nsSigHandlers.cpp:167

Hyprpaper running from terminal

listener function for opcode 1 of zwlr_layer_surface_v1 is NULL
Aborted (core dumped)

And then it crashes

Hyprland logs

[LOG] Removed monitor DP-1!
[LOG]  [hookSystem] New hook event registered: monitorRemoved
[WARN] Unplugged last monitor, entering an unsafe state. Good luck my friend.
[LOG] Callback 23ef5748 -> 23ef5740,  removed.
[LOG] Callback 23ef56e0 -> 23ef56d8,  removed.
[LOG] Searching for matching rules for Alacritty (title: user@hostname:~)
[LOG] Window 2454ebc0 set title to user@hostname:~
[WARN] Recovering from an unsafe state. May you be lucky.
[LOG] Recovering a removed monitor.
[LOG] Registered signal for owner 23ef5500: 23ef0960 -> 23ef5650 (owner: )
[LOG] Registered signal for owner 23ef5500: 23ef09f0 -> 23ef56b8 (owner: )
[LOG] Registered signal for owner 23ef5500: 23ef09e0 -> 23ef5720 (owner: )
[LOG] Applying monitor rule for DP-1
[LOG] Monitor DP-1: requested 3840x2160@60.000000, found available mode: 3840x2160@59997mHz,
applying.
[LOG] 10bit format DRM_FORMAT_XRGB2101010 succeeded for output DP-1
[LOG] Monitor DP-1 -> destroyed all render data
[LOG] Monitor DP-1 layers arranged: reserved: 0.000000 0.000000 0.000000 0.000000
[LOG] Monitor DP-1 data dump: res 3840x2160@60.00Hz, scale 2.00, transform 0, pos 0x0, 10b 1
[LOG] Added new monitor with name DP-1 at 0,0 with size 3840x2160, pointer 23ef0810
[LOG] New monitor: WORKSPACEID 5, exists: 0
[LOG] Monitor DP-1 layers arranged: reserved: 0.000000 0.000000 0.000000 0.000000
[LOG] Applying monitor rule for DP-1
[LOG] Not applying a new rule to DP-1 because it's already applied!
[LOG] Monitor DP-1 layers arranged: reserved: 0.000000 0.000000 0.000000 0.000000
[LOG] Fading out a non-existent LS??
[LOG] Framebuffer created, status 36053
[LOG] Framebuffer created, status 36053
[LOG] Framebuffer created, status 36053
[LOG] Framebuffer created, status 36053
[LOG] Allocated texture for BGTex
[LOG] Background created for monitor DP-1
[LOG] Shaders initialized successfully.
[LOG] Fading out a non-existent LS??
[LOG] Registered signal for owner 26552200: 24579028 -> 26552350 (owner: layerSurface)
[LOG] Registered signal for owner 26552200: 23f200c0 -> 26552218 (owner: layerSurface)
[LOG] Registered signal for owner 26552200: 23f200d0 -> 26552280 (owner: layerSurface)
[LOG] Registered signal for owner 26552200: 23f200e0 -> 265522e8 (owner: layerSurface)
[LOG] Registered signal for owner 26552200: 23f200f0 -> 265523b8 (owner: layerSurface)
[LOG] LayerSurface 23f20000 (namespace waybar layer 2) created on monitor DP-1
[LOG] LayerSurface 24507820 arranged: x: 0 y: 0 w: 30 h: 1080 with margins: t: 0 l: 0 r: 0 b: 0
[LOG] Monitor DP-1 layers arranged: reserved: 30.000000 0.000000 0.000000 0.000000
[LOG] LayerSurface 23f20000 mapped
[LOG] LayerSurface 24507820 arranged: x: 0 y: 0 w: 30 h: 1080 with margins: t: 0 l: 0 r: 0 b: 0
[LOG] Monitor DP-1 layers arranged: reserved: 30.000000 0.000000 0.000000 0.000000

Additional info

Hyprland config

# Environment variables
env = XDG_CURRENT_DESKTOP,Hyprland
env = XDG_SESSION_TYPE,wayland
env = XDG_SESSION_DESKTOP,Hyprland
env = QT_AUTO_SCREEN_SCALE_FACTOR,1
env = QT_QPA_PLATFORM,wayland;xcb
env = QT_WAYLAND_DISABLE_WINDOWDECORATION,1
env = SDL_VIDEODRIVER,wayland
env = _JAVA_AWT_WM_NONEREPARENTING,1
env = CLUTTER_BACKEND,wayland

# Monitor config
monitor=DP-1,3840x2160@60,0x0,2,bitdepth,10

# Execute your favorite apps at launch
exec-once = /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
exec-once = /usr/bin/waybar
exec-once = /usr/bin/hyprpaper

. . .

workspace = DP-1, 1
workspace = DP-1, 2
workspace = DP-1, 3
workspace = DP-1, 4
workspace = DP-1, 5
workspace = DP-1, 6
workspace = DP-1, 7
workspace = DP-1, 8
workspace = DP-1, 9
vaxerski commented 1 year ago

patch.txt

try this patch

uncompute commented 1 year ago

Well, it works, blur doesn't appear now, but hyprpaper still crashes with the same error and I also get the same errors in terminal for Firefox and Emacs.

vaxerski commented 1 year ago

do they crash though? GTK apps always shit a lot of errors.

the hyprpaper issue is a hyprpaper issue, should be reported to its bug tracker

uncompute commented 1 year ago

I just checked for this behavior in Sway, and the same errors appeared as in Hyprland, so it's probably okay.

Regarding hyprpaper, it's definitely an issue with hyprpaper since it didn't survive the monitor restart in Sway either. However, the mpvpaper that segfaulted in Hyprland did survive in Sway, so maybe it's something to look for.

Anyway, thank you for your help. I will close the issue since the main problem has been resolved.

vaxerski commented 1 year ago

patch pushed in adf5d8a114362a5d32013e95f254b85be048dbdb