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.65k stars 830 forks source link

Blank page in foliate book reader on monitor scales above 1 on Hyprland 0.41.2 and 0.42.0; works fine on all scales in Sway #7341

Open MahouShoujoMivutilde opened 1 month ago

MahouShoujoMivutilde commented 1 month ago

Regression?

No

System Info and Version

System/Version info ```sh Hyprland, built from branch main at commit 3b4aabe04c7756fb0a70d78b6f0e701228f46345 dirty (decorations: fix manual resize not recalculating decos (7323)). Date: Tue Aug 13 23:00:31 2024 Tag: v0.42.0-18-g3b4aabe0, commits: 5087 flags: (if any) System Information: System name: Linux Node name: alice Release: 6.6.23.28.realtime1-7-rt-lts Version: #1 SMP PREEMPT_RT Tue, 06 Aug 2024 08:27:40 +0000 GPU information: 09:00.0 VGA compatible controller [0300]: NVIDIA Corporation GM204 [GeForce GTX 970] [10de:13c2] (rev a1) (prog-if 00 [VGA controller]) NVRM version: NVIDIA UNIX x86_64 Kernel Module 555.58.02 Tue Jun 25 01:39:15 UTC 2024 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/witch/hdefault-min.conf: Read Succeeded # vim: ft=hyprlang: # NOTE: this is default config + some of my bindings # This is an example Hyprland config file. # Refer to the wiki for more information. # https://wiki.hyprland.org/Configuring/Configuring-Hyprland/ # Please note not all available settings / options are set here. # For a full list, see the wiki # You can split this configuration into multiple files # Create your files separately and then link them to this file like this: # source = ~/.config/hypr/myColors.conf ################ ### MONITORS ### ################ # See https://wiki.hyprland.org/Configuring/Monitors/ monitor=,preferred,auto,1 # exec-once = glxgears ################### ### MY PROGRAMS ### ################### # See https://wiki.hyprland.org/Configuring/Keywords/ # # Set programs that you use # $terminal = foot # $fileManager = dolphin # $menu = tofi-drun ################# ### AUTOSTART ### ################# # Autostart necessary processes (like notifications daemons, status bars, etc.) # Or execute your favorite apps at launch like this: # exec-once = $terminal # exec-once = nm-applet & # exec-once = waybar & hyprpaper & firefox ############################# ### ENVIRONMENT VARIABLES ### ############################# # See https://wiki.hyprland.org/Configuring/Environment-variables/ env = XCURSOR_SIZE,24 env = HYPRCURSOR_SIZE,24 ##################### ### LOOK AND FEEL ### ##################### # Refer to https://wiki.hyprland.org/Configuring/Variables/ # https://wiki.hyprland.org/Configuring/Variables/#general general { gaps_in = 5 gaps_out = 20 border_size = 3 # col.active_border = rgb(ee1111) col.active_border = rgb(b30000) # NOTE: red borders from wayland, green for xwayland (see rules) # col.inactive_border = rgba(00000000) col.inactive_border = rgba(1a0402ff) # col.inactive_border = rgba(ffffffaa) # Set to true enable resizing windows by clicking and dragging on borders and gaps resize_on_border = false # Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on allow_tearing = false layout = dwindle } # https://wiki.hyprland.org/Configuring/Variables/#decoration decoration { rounding = 10 # Change transparency of focused and unfocused windows active_opacity = 1.0 inactive_opacity = 1.0 drop_shadow = true shadow_range = 4 shadow_render_power = 3 col.shadow = rgba(1a1a1aee) # https://wiki.hyprland.org/Configuring/Variables/#blur blur { enabled = true size = 3 passes = 1 vibrancy = 0.1696 } } # https://wiki.hyprland.org/Configuring/Variables/#animations animations { enabled = true # Default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more bezier = myBezier, 0.05, 0.9, 0.1, 1.05 animation = windows, 1, 7, myBezier animation = windowsOut, 1, 7, default, popin 80% animation = border, 1, 10, default animation = borderangle, 1, 8, default animation = fade, 1, 7, default animation = workspaces, 1, 6, default } # # fast animations # animations { # enabled = yes # # https://easings.net/ # # https://www.cssportal.com/css-cubic-bezier-generator/ # bezier = cst, 0.84, 0.37, 0.2, 0.62 # animation = windows, 1, 1, cst # animation = windowsMove, 1, 2, default # animation = windowsOut, 1, 3, default, popin 80% # animation = border, 1, 5, default # animation = workspaces, 1, 2, default # # faster fade # animation = fade, 1, 2, default # # possibly fucks with gammastep at boot? # first_launch_animation = no # } # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more dwindle { pseudotile = true # Master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below preserve_split = true # You probably want this } # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more master { new_status = master } # https://wiki.hyprland.org/Configuring/Variables/#misc misc { force_default_wallpaper = -1 # Set to 0 or 1 to disable the anime mascot wallpapers disable_hyprland_logo = false # If true disables the random hyprland logo / anime girl background. :( } ############# ### INPUT ### ############# # https://wiki.hyprland.org/Configuring/Variables/#input input { kb_layout = us,ru kb_options = caps:escape,grp:toggle # kb_layout = us # kb_variant = # kb_model = # kb_options = # kb_rules = repeat_delay = 300 repeat_rate = 50 follow_mouse = 1 sensitivity = 0 # -1.0 - 1.0, 0 means no modification. touchpad { natural_scroll = false } } # https://wiki.hyprland.org/Configuring/Variables/#gestures gestures { workspace_swipe = false } # # Example per-device config # # See https://wiki.hyprland.org/Configuring/Keywords/#per-device-input-configs for more # device { # name = epic-mouse-v1 # sensitivity = -0.5 # } #################### ### KEYBINDINGSS ### #################### # some nice mouse binds bindm = SUPER, mouse:272, movewindow bindm = SUPER, mouse:273, resizewindow # compositor bindings # q bind = SUPER SHIFT, q, killactive, # s bind = SUPER, s, togglefloating, # a bind = SUPER, a, pseudo, # f bind = SUPER, f, fullscreen, 1 bind = SUPER SHIFT, f, fullscreen, 0 # MASTER bind=SUPER, o, layoutmsg, orientationcycle left top right center # h bind = SUPER, h, movefocus, l bind = SUPER, h, alterzorder, top # j bind = SUPER, j, movefocus, d bind = SUPER, j, alterzorder, top # k bind = SUPER, k, movefocus, u bind = SUPER, k, alterzorder, top # l bind = SUPER, l, movefocus, r bind = SUPER, l, alterzorder, top bind = SUPER SHIFT, h, movewindow, l bind = SUPER SHIFT, j, movewindow, d bind = SUPER SHIFT, k, movewindow, u bind = SUPER SHIFT, l, movewindow, r # MASTER bind = SUPER, m, layoutmsg, addmaster bind = SUPER SHIFT, m, layoutmsg, removemaster # # - # bind = SUPER SHIFT, underscore, layoutmsg, mfact 0.1 # # + # bind = SUPER SHIFT, plus, layoutmsg, mfact 0.1 bind = ALT, Tab, cyclenext, # change focus to another window bind = ALT, Tab, alterzorder, top # bring it to the top bind = ALT SHIFT, Tab, cyclenext, prev bind = ALT SHIFT, Tab, alterzorder, top bind = SUPER, 1, workspace, 1 bind = SUPER, 2, workspace, 2 bind = SUPER, 3, workspace, 3 bind = SUPER, 4, workspace, 4 bind = SUPER, 5, workspace, 5 bind = SUPER, 6, workspace, 6 bind = SUPER, 7, workspace, 7 bind = SUPER, 8, workspace, 8 bind = SUPER, 9, workspace, 9 bind = SUPER, 0, workspace, 10 # - or + for relative prev / next open workspace bind = SUPER, minus, workspace, e-1 bind = SUPER, equal, workspace, e+1 # bind = SUPER SHIFT, grave, workspace, e-1 # bind = SUPER, grave, workspace, e+1 bind = SUPER CTRL, h, workspace, e-1 bind = SUPER CTRL, l, workspace, e+1 bind = SUPER SHIFT CTRL, Tab, workspace, e-1 bind = SUPER CTRL, Tab, workspace, e+1 bind = SUPER, Tab, workspace, previous bind = SUPER SHIFT, 1, movetoworkspacesilent, 1 bind = SUPER SHIFT, 2, movetoworkspacesilent, 2 bind = SUPER SHIFT, 3, movetoworkspacesilent, 3 bind = SUPER SHIFT, 4, movetoworkspacesilent, 4 bind = SUPER SHIFT, 5, movetoworkspacesilent, 5 bind = SUPER SHIFT, 6, movetoworkspacesilent, 6 bind = SUPER SHIFT, 7, movetoworkspacesilent, 7 bind = SUPER SHIFT, 8, movetoworkspacesilent, 8 bind = SUPER SHIFT, 9, movetoworkspacesilent, 9 bind = SUPER SHIFT, 0, movetoworkspacesilent, 10 # other bindings bind = SUPER, RETURN, exec, foot # windowrulev2 = float,class:floating # windowrulev2 = dimaround,class:floating # bind = SUPER ALT, RETURN, exec, foot -a floating # d bind = SUPER, d, exec, tofi-drun --width 30% --fuzzy-match true bind = SUPER SHIFT, d, exec, tofi-run --history=false --width 30% --fuzzy-match true | xargs -r hyprctl dispatch exec bind = SUPER, y, exec, extra-tools bind = SUPER, g, exec, qalculate-qt bind = , Print, exec, mksrc-wl bind = SUPER, Print, exec, mksrc-wl active bind = SHIFT, Print, exec, mksrc-wl area bind = CTRL, Print, exec, mksrc-wl area-edit ############################## ### WINDOWS AND WORKSPACES ### ############################## # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more # See https://wiki.hyprland.org/Configuring/Workspace-Rules/ for workspace rules # Example windowrule v1 # windowrule = float, ^(kitty)$ # Example windowrule v2 # windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ windowrulev2 = suppressevent maximize, class:.* # You'll probably like this. # Show when using xwayland windowrulev2 = bordercolor rgb(65b770) rgba(00000000), xwayland:1 windowrulev2 = bordersize 3, xwayland:1 ======Config-End======== ```

Description

Foliate (installed from arch repos) is a book reader that uses webkitgtk-6.0 to render text.

Horrifying, I know. But it's the only one that didn't lag in large books, didn't look like ass, didn't randomly disrespect formatting, didn't try run my library by importing my books to some location without me asking it to do so, had actual GUI and not a meme-tier latin-only hotkeys, etc.

On scale 1 it works fine, without errors.

On anything above one you'll get this:

❯ foliate book.epub
Failed to create GBM buffer of size 0x0: Invalid argument
...

And a blank white page instead of your book.

I can observe this behavior on both wlroots (0.41.2) and aquamarine (hyprland 3b4aabe04c7756fb0a70d78b6f0e701228f46345, aquamarine 9312aa2).

Happens regardless if nvidia specific environment variables are set.

Now, if you look at foliate repo, there are issues about blank pages. https://github.com/johnfactotum/foliate/issues/1107, https://github.com/johnfactotum/foliate/issues/1115, https://github.com/johnfactotum/foliate/issues/1271, with some advice (bad if you don't like slideshow scroll) how to "fix" it - WEBKIT_DISABLE_DMABUF_RENDERER=1

So why make issue here?

Well, because it works on sway 1.9 with wlroots0.17 from arch repos on all scales.

I don't use nix, so because of the need for outdated dependencies I can't easily check when it started happening or if scales above 1 were always broken.

I certainly didn't use 1.25 I use now from the beginning of the fractional scaling support, so my comment on one of those issues might just be flatpak disrespecting scaling and working solely for that reason.

Even on sway+wlroots from 3 years ago it works fine on all scales, hyprland has this issue as early as 0.23beta, and probably always had. https://github.com/hyprwm/Hyprland/issues/7341#issuecomment-2347702040

Other WebKitGTK-6.0 apps

Again, I don't know if they just have some internal fallback - the performance is not horrible. But that's just simple webpages, not a million words long books.

But what curious is why sway works. Sway or wlroots, that don't support (proprietary) nvidia, so any nvidia specific fallback on their side is unlikely.

How to reproduce

Install foliate from arch repos (no flatpak/snap sandbox to interfere with anything) and use any .epub book.

Hyprland:

  1. Set monitor = ,preferred,auto,1.25, (same for the scale 2)
  2. Run foliate book.epub and observe the blank page and an error mentioned above
  3. Close foliate
  4. Set monitor = ,preferred,auto,1
  5. Run foliate book.epub again and observe properly rendered book page

Sway:

If needed, copy default config to user config directory, since we will be editing it.

mkdir -p ~/.config/sway
cp /etc/sway/config ~/.config/sway/config
  1. Replace default output statement with output * scale 1, press Super+Shift+C to reload config
  2. Run foliate book.epub - page is displayed properly
  3. Close foliate
  4. Change the scale to 1.25, press Super+Shift+C to reload config
  5. Because it's Sway, terminals now are blurry until you reopen them. We don't care about them.
  6. Run foliate book.epub - page is still displayed properly
  7. Change the scale to 2, press Super+Shift+C to reload config
  8. Run foliate book.epub - page is still displayed properly

Crash reports, logs, images, videos

Screenshots

### On 3b4aabe04c7756fb0a70d78b6f0e701228f46345 epiphany-scale-1.25 ![epiphany-scale-1 25](https://github.com/user-attachments/assets/335c4e26-4ed9-426a-82fa-a46936246363) epiphany-scale-1 ![epiphany-scale-1](https://github.com/user-attachments/assets/ae1c41f8-9e9b-49fe-a687-291fce04b336) foliate-scale-1 ![foliate-scale-1](https://github.com/user-attachments/assets/75a79c55-ca5a-4555-9d2e-5d25ba077aac) foliate-scale-1.25 ![foliate-scale-1 25](https://github.com/user-attachments/assets/76e69b42-2fb9-470c-ac06-932f0d664cfc) foliate-scale-2 ![foliate-scale-2](https://github.com/user-attachments/assets/2563386f-ce9c-4ce0-93d7-f69217538ad1) ### 0.41.2 foliate-scale-1 ![foliate-scale-1](https://github.com/user-attachments/assets/6c8e2d61-a4e2-4f24-b034-5eb0605ec93a) foliate-scale-2 ![foliate-scale-2](https://github.com/user-attachments/assets/b368f56e-def2-440f-a6c3-d4d9971a3c8f) ### sway 1.9 + wlroots 0.17 epiphany-aka-gnome-web-scale-1 ![epiphany-aka-gnome-web-scale-1](https://github.com/user-attachments/assets/0855a6a2-6fe0-4593-a7bb-ac22d6d7c1e3) foliate-scale-1 ![foliate-scale-1](https://github.com/user-attachments/assets/e8e4efc8-670b-4cd4-bb3b-8132572dfb37) foliate-scale-1.25 ![foliate-scale-1 25](https://github.com/user-attachments/assets/b2928a9c-40f7-47fd-abce-58d915a48bf0) foliate-scale-2 ![foliate-scale-2](https://github.com/user-attachments/assets/43a5a056-e15d-47c5-8607-6104bf64d7e0)

vaxerski commented 1 month ago

WAYLAND_DEBUG=1 from launching on hyprland and sway please

MahouShoujoMivutilde commented 1 month ago

This is on 197f8807900afc81c1c92ad17e621d1998ee268b and 0.41.2 from arch repos.

sway-1.9-wlr0.17-foliate-scale-2.log sway-1.9-wlr0.17-foliate-scale-1.25.log sway-1.9-wlr0.17-foliate-scale-1.log sway-1.9-wlr0.17-epiphany-scale-2.log sway-1.9-wlr0.17-epiphany-scale-1.25.log sway-1.9-wlr0.17-epiphany-scale-1.log v0.42.0-19-g197f8807-epiphany-scale-2.log v0.42.0-19-g197f8807-epiphany-scale-1.25.log v0.42.0-19-g197f8807-epiphany-scale-1.log v0.41.2-epiphany-scale-2.log v0.41.2-epiphany-scale-1.log v0.41.2-foliate-scale-2.log v0.41.2-foliate-scale-1.25.log v0.41.2-foliate-scale-1.log v0.42.0-19-g197f8807-foliate-scale-2.log v0.42.0-19-g197f8807-foliate-scale-1.log v0.42.0-19-g197f8807-foliate-scale-1.25.log

If you noticed that epiphany somehow doesn't output GBM error - idk why. I didn't change anything in configs, and this single commit that I upgraded to doesn't make sense as the cause. The only thing possibly related is mesa (1:24.1.5-2 -> 1:24.1.6-1) upgrade.

With foliate it's the same as outlined in the issue above, still.

romanstingler commented 2 weeks ago

There was an update in 'egl-wayland' 1.16 which fixed a QT6 Webengine bug https://github.com/NVIDIA/egl-wayland/releases/tag/1.1.16 worth a try in the meantime

MahouShoujoMivutilde commented 2 weeks ago

Status:

On d35e70a8c6599bb058cf86eb87c783ce1cf72471 (post 0.43.0), aquamarine 0.4.1, nvidia 560.35.03, egl-wayland 1.1.16, mesa 24.2.2, foliate 3.1.1, webkitgtk-6.0 2.44.4

The behavior is the same - scale 1 works fine, same GBM error on scales above 1 and empty window.


Also, something curious happens with nested sway window on host hyprland scales above 1:

Details

Hyprland scale 1, sway 1.25 ![03-09-2024-21_27_46](https://github.com/user-attachments/assets/ed0802c8-06af-46fd-9532-99ad32fbc2c3) Hyprland scale 1.25, sway 1.25 ![03-09-2024-21_28_05](https://github.com/user-attachments/assets/d55fd65b-09e1-4b81-9494-c74bce2083e5) wtf?

This doesn't happen when sway in nested inside another sway.

Details

sway 1.25 inside sway 1.25 ![03-09-2024-21_38_06](https://github.com/user-attachments/assets/f2f19539-5bd8-4565-9a43-ab86d54bb287)

MahouShoujoMivutilde commented 3 days ago

Tried to hunt it down, in vm, using 1 Jun 2024 box.

"Broken" here means scales above 1 reproduce the issue (blank page).

0.40.0 is broken - hyprwayland-scanner first introduced 0.37.1 is broken - before wlroots fork 0.33.1 is broken - there is no GBM error (still a blank page). Unfortunately, didn't pay attention if other earlier versions also had no error 0.27.2 is invalid - scale setting (1.25; 2) is ignored? - scale is 1, so it works 0.24.1 is broken 0.23beta is broken - earliest available in the arch linux archive

I think, it's safe to say, it never worked properly with scales above 1.

I also tested older versions of sway and wlroots:

sway 1.9 wlroots 0.17.1 works sway 1.7 wlroots 0.15.0 works (from almost 3 years ago)

Another note:

Foliate 2.6.4 that uses gtk3 3.24.41 and webkit2gtk 2.42.5 works on any scale, but works like a slideshow on large books, so I assume it has some fallback to software render internally that just didn't get ported to gtk4. I didn't investigate it further, as the performance is unusable anyway, and gpu render clearly can work (sway) on gtk4 too without any performance issues.