reddit / emacs
Flickering and blinking after upgrading to emacs 28.1
amanol · 2022-09-20 05:52
Hello all,
I am happy `emacs` user 20++ years and I have been through many upgrades during the emacs usage. Just to mention that `Fedora` has been my main distribution ship, which provides the built-in emacs binaries.
In my latest upgrade attempt, the results were frustrating, from "emacs" point of view. The update was from `Fedora 34` to `Fedora 36` with exactly the *same* setup (`gnome`,`wayland`,`nvidia driver`, `.emacs`) , so it went from `emacs 27.1` to `GNU Emacs 28.1` `(build 1, x86_64-redhat-linux-gnu, GTK+ Version 3.24.34, cairo version 1.17.6) of 2022-07-15`
I removed the `*.elc` just to be sure and then the blinking "party" started.
* The menu bar start to flicker in some cases, even with `emacs -Q`. I noticed
`gnome-shell[2160]: Window manager warning: 0x2400142 appears to be one of the offending windows with a timestamp of 7998145. Working around...`
`gnome-shell[2160]: Window manager warning: last_user_time (8352133) is greater than comparison timestamp (8352121). This most likely represents a buggy client sending inaccurate timestamps in messages such as _NET_ACTIVE_WINDOW. Trying to work around...`
But even those message didn't appear again the issue exists in some cases, mainly moving around with page-up/page-down
* Then, in my complete [setup](https://bitbucket.org/amanol/dot-emacs-files/src/master/.emacs), when I loaded some `cpp` file, the cursor started to moving around with his own pace and approach. It didn't want to follow the key directions, or it will follow them with delay. Furthermore, the typing feeling, wasn't very fluent and sometime s the window's frame was going blank, like going to "linux save mode" and after touching a key was coming back.
The profiler-report is [here](https://gist.github.com/apmanol/8b24fede907c59367e2132cbd2f724bb), but I can't figure out anything about the actual problem. The *same* setup was working perfectly before.
The system is Fedora 36 with `GNOME` and `WAYLAND`.
` 5.19.8-602.inttf.fc36.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Sep 12 10:59:47 EEST 2022 x86_64 x86_64 x86_64 GNU/Linux`
And the `emacs` is the vanilla one.
Any ideas on where and how to search about the problems?
anoduck · 2022-09-20 14:41
Wayland, is what my gut is telling me. Either more reliance on it, a config setting, or a changed library.
Have you tried using it in a different terminal emulator? Like X-term or kitty? (One being the old standard, and the other a stable newer option.)
amanol · 2022-09-20 15:45
I have the same suspect, but waiting for more witnesses:-)
Maybe I didn't point it out, but I am using a window for emacs, not running inside terminal. I have not tried the `emacs -nw` yet.
Who1sThatGuyAnyway · 2022-09-20 16:11
probably more correct to say an xwayland issue, related to how emacs components are separated as X components, and how xwayland thinks of separate x components are being separate windows.
Who1sThatGuyAnyway · 2022-09-20 16:12
not a fair question, but if you are using vanilla emacs, could you consider checking emacs 29 with the pgtk-wayland changes, and see if the issues persist? This way you would be avoiding xwayland
amanol · 2022-09-20 17:05
Tried out `GNOME with Xorg` and work as it should.
`emacs -nw` works nice also.
All attempts have the same setup, nothing has changed in the `.emacs` file.
amanol · 2022-09-20 18:08
Desperate as I am, I tried compiling `git HEAD` and it seems to work more smoothly than the "official installation".
Just to be fair, I played around only 10 mins, without noticing the glitches mentioned in the issue.
sudo dnf -y install libgccjit-devel \
jansson-devel \
texinfo \
gtk3-devel
git clone git://git.sv.gnu.org/emacs.git
cd emacs
./autogen.sh
./configure \
--with-pgtk \
--with-gnutls=no \
--with-native-compilation \
--with-json \
--prefix=/tmp/myemacs
make all -j8
make install
my-dot-emacs$ HOME=$(realpath .) /tmp/myemacs/bin/emacs
Who1sThatGuyAnyway · 2022-09-20 18:15
sounds quite reasonable, not desperate.
I hear the biggest limit for emacs29 + pgtk are plugins that are tightly coupled with X, so that is likely where it will burn you.
I'm a wayland person, but a doom-emacs user, so I can't use the wayland options myself - but I will as soon as I am able.
amanol · 2022-09-20 18:31
Any link regarding the plugins + emacs29 issues?
anoduck · 2022-09-21 01:03
Are you using gtk3, gtk2, or something totally different?
I saw `gnome-shell` in the error message and translated it to gnome terminal. It is my mistake. I wouldn't fool with trying it on the terminal.
Just another shot in the dark, have you checked your dpi settings and your compositor settings?
coolvinay1903 · 2022-09-21 02:04
It might be caused by double-buffering. I have the following in my init.el to prevent flickering for 27.1.
;;(https://github.com/emacs-mirror/emacs/blob/master/etc/PROBLEMS)
;; *** Display artifacts on GUI frames on X-based systems.
;; This is known to be caused by using double-buffering (which is enabled`
;; by default in Emacs 26 and later). The artifacts typically appear
;; after commands that cause Emacs to scroll the display.
;; You can disable double-buffering by evaluating the following form:`
(modify-all-frames-parameters '((inhibit-double-buffering . t)))
;; Note that disabling double-buffering will cause flickering of the
;; display in some situations.
The display artifact problem is supposed to be only on X-based systems.
amanol · 2022-09-21 05:55
It's Gnome 42.4 (Fedora 36 native window system)
ldd /usr/bin/emacs | rg gtk
libgtk-3.so.0 => /lib64/libgtk-3.so.0 (0x00007f4643693000)
What exactly should I check there? They seem ok, with the maximum possible values.
Who1sThatGuyAnyway · 2022-09-24 01:18
I looked thinkomg that the old lwn post about the gtk port mentioned plugins, but it doesn't.
Posts like https://www.reddit.com/r/emacs/comments/tgb8zz/any_emacs_user_that_uses_wayland_sway/ mention some plugins which are x-dependent.
amanol · 2022-09-24 09:06
I don't know if it's something like `deja vu` but with this addition seems to behave pretty "natural" for `emacs`.
It pop ups some black rectangles, sometimes, seldom, but as a feeling is acceptable.