Subject: 28.0.50; xwidget-webkit flickers

From: Aiko Kyle <[email-masked]>
Date: Fri, 29 May 2020 14:00:41 -0600

Steps to reproduce:
- emacs is configured --with-xwidgets
- emacs -Q
- M-x xwidget-webkit-browse-url with try any url
- M-x and type anything in minibuffer
While typing in the minibuffer one will observe a lot of flickering of
the xwidget-webkit window. I've also found that sometimes the entire
window will stop rendering its content, instead showing what was
previously behind it.

When searching around for this bug, it seems it has been encountered by
a few other people here [1] and here [2]. In [1] it seems to be that
this issues only affects emacs xwidget-webkit in linux while the ns port
seems to be unaffected, although I haven't tried running xwidgets on
macOS. In [2] there is a link to a video that shows similar behavior to
what I observe although that person is using it over a forwarded x11
frame. Emacs 26.3 also seems to be affected by this issue. In case it's
relevant (although I doubt it since others have observed this issue),
I'm using exwm as my window manager.

I've started looking through the code xwidget-webkit code in xwidget.c
although I have no experience with GTK code, so I was hoping someone
here might be able to help.

Thanks!
Akira Kyle

[1] https://github.com/fuxialexander/emacs-webkit-katex-render/issues/6#issuecomment-515979935
[2] https://www.reddit.com/r/emacs/comments/eoq4ud/instantpreview_markdown_org_files_with/feik3sm?utm_source=share&utm_medium=web2x

In GNU Emacs 28.0.50 (build 1, aarch64-unknown-linux-gnu, GTK+ Version 3.24.20, cairo version 1.16.0)
Repository revision: 104b68b670eb6de6614c562ae6b18c009b20584f
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12008000
System Description: NixOS 20.09 (Nightingale)

Configured using:
 'configure
 --prefix=/nix/store/shqqgl8dwmz7g5brcilap8xjx7kcwlkm-emacs-git-20200524.0
 --disable-build-details --with-modules --with-x-toolkit=gtk3 --with-xft
 --with-xwidgets CFLAGS=-DMAC_OS_X_VERSION_MAX_ALLOWED=101200'

Configured features:
XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND DBUS GSETTINGS GLIB NOTIFY
INOTIFY LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS XWIDGETS
LIBSYSTEMD JSON PDUMPER GMP