Persistent tearing in emacs
Hopefully this is a OK place to report bugs. I remember there was a github issue collecting graphic issues but I couldn't find it somehow...
System information
- Kernel version: 6.12.10-asahi-2-1-ARCH
- Mesa version: 20241211 tag
- Desktop manager and compositor: kwin 6.2.4
- Hardware: MBA M1, 16GB
Describe the issue
I have an emacs configuration with a translucent background (alpha 80 I believe). And while it usually works well initially, over time the window would not refresh correctly anymore. After/during scrolling, block of window area would start to display content from a different part of the file that was previously shown. Moving the affected area in/out of view doesn't always help. OTOH, highlighting the area would usually trigger a sufficient refresh to have the content correctly shown.
Below is an example using the MAINTAINERS file from the kernel. (emacs is running under xwayland and all what I did to trigger it is scrolling up and down as well as selecting(highlighting) some text).
First the affected version
which might not look like much other than a small glitch on the third line but in fact the correct content should've been the following.
. As you can see, a lot of the content is actually completely BS..... (edit: I think I clipped one more line for the second screenshot but the point still stand...)
I do have blurring effect on in kwin (it was off by default initially). It's been a long time but I think the part of my emacs configuration responsible for the transparency and bluring is
(set-frame-parameter (selected-frame) 'alpha '(80 80))
(shell-command
(concat "xprop -f _KDE_NET_WM_BLUR_BEHIND_REGION 32c "
"-set _KDE_NET_WM_BLUR_BEHIND_REGION 0 -id "
(frame-parameter (selected-frame) 'outer-window-id)))
(add-to-list 'default-frame-alist '(alpha 80 80))
Regression
This is an issue that was affecting me ever since a very early version of the GPU driver. It briefly disappeared for one version (I believe around when https://asahilinux.org/2023/03/road-to-vulkan/ was published) but all of the versions (kernel + mesa) since that I've tested are affected. I thought this might be because I've been using an old version of firmware (I didn't upgrade my macos installation for a long time) but updating the macos version didn't help. I've also tested this on both X11 and wayland and the behavior is basically the same.