pwmt / zathura

Document viewer
https://pwmt.org/projects/zathura
zlib License
2.13k stars 147 forks source link

Lagging scroll in i3/openbox/awesomewm on 4k screen #303

Open sebastinas opened 2 years ago

sebastinas commented 2 years ago

On GitLab by @rrueger on Jan 6, 2022, 14:35


Current Behavior

When scrolling a PDF in zathura, there is significant lag if the window is larger than about 60% of the screen. The larger the window, the more lag there is.

This issue is not present on gnome (both Xorg and Wayland) or sway (Wayland).

I have filed this issue with i3, but they seem to think that it is not i3 causing the issue.

Expected Behavior

That there is no lag when scrolling.

Reproduction Instructions

Open an arbitrary document in zathura, make the window large (doesn't necessarily have to be full screen) and scroll up and down. An example document would be this shimano bike components parts list with many pictures which may exasperate the lagging and make differences more visible.

Environment

Zathura version (latest git build)

zathura 0.4.8
girara 0.3.6 (runtime: 0.3.6)
(plugin) cb (0.1.8) (/usr/lib/zathura/libcb.so)
(plugin) djvu (0.2.9) (/usr/lib/zathura/libdjvu.so)
(plugin) pdf-poppler (0.3.0) (/usr/lib/zathura/libpdf-poppler.so)
(plugin) ps (0.2.7) (/usr/lib/zathura/libps.so)

On Archlinux running Linux 5.15.12-arch1-1.

Since there is no crash, I haven't included the logfile. I happy to do so, if you think it will help for this kind of issue.

I am using a 4k screen on a capable Dell XPS 1510 (i7-11800H 16 Core, 24MB cache, 32 GB RAM). I don't think hardware is a limiting factor.

I have turned off any touchpad acceleration features and reset my libinput configurations to the default. So I don't think it is the scrolling action that is lagging.

This hasn't always been an issue. I cannot pin down exactly when the lagging started, because most of the time I only have documents open on half of the screen.

I suspect this might be some sort of GTK configuration issue, similar to the slow startup of gtk applications in i3, but not in gnome if the xinitrc isn't correctly configured.

For completeness, I am including my ~/.xinitrc below

test -f "/etc/X11/xinit/.Xresources" && xrdb    -merge "/etc/X11/xinit/.Xresources"
test -f "/etc/X11/xinit/.Xmodmap"    && xmodmap "/etc/X11/xinit/.Xmodmap"
test -f "$HOME/.Xresources"          && xrdb    -merge "$HOME/.Xresources"
test -f "$HOME/.Xmodmap"             && xmodmap "$HOME/.Xmodmap"
for file in /etc/X11/xinit/xinitrc.d/?*.sh
do
  [ -x "$file" ] && source "$file"
done
exec i3 --shmlog-size=26214400

I start my X session with xorg-xdm.

sebastinas commented 2 years ago

On GitLab by @rrueger on Jan 6, 2022, 16:10


I just tested llpp, which is quite similar to zathura, and uses the mupdf backend. This does not experience the same lag as zathura, so I think the problem is at zathura's end.

However, I would still like to continue using zathura for its synctex support, so I would be very grateful for any adivce on how to fix this issue.

sebastinas commented 2 years ago

On GitLab by @rrueger on Jan 9, 2022, 01:42


Update: I have tested this configuration on a 1080p laptop (Dell XPS 9550), and there seems to be no lag. So --- as far as I can tell --- this issue is due to using a 4k screen. I suppose gnome does scaling differently?

I changed the Xft.dpi: 192 in ~/.Xresources and /etc/X11/xdm/Xresources to Xft.dpi: 96 so that zathura performs no scaling, but the issue remains.