all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Akira Kyle <ak@akirakyle.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Po Lu <luangruo@yahoo.com>, Emacs developers <emacs-devel@gnu.org>
Subject: Re: SVG widget in GNU Emacs
Date: Tue, 26 Oct 2021 00:32:55 -0600	[thread overview]
Message-ID: <CAPWcbYEjpKtq1PKemv8gg0cnL9=Vp95TyEtaSMqmAkVAbS_LAQ@mail.gmail.com> (raw)
In-Reply-To: <835ytrbx8s.fsf@gnu.org>

On Wed, Oct 20, 2021 at 8:28 AM Eli Zaretskii <eliz@gnu.org> wrote:
>
> > > Apart of the above, just look at xwidget.c and xwidget.el, and you
> > > will see the FIXMEs, the incomplete doc strings, and other stuff left
> > > unfinished.  The idea was that those will get finished once the
> > > feature is in the sources, but unfortunately it didn't happen.
> >
> > Indeed, I see your point.  Thanks.
> >
> > I will probably work on this once I get the time.
>
> Thanks, cleanup in that area will be appreciated.

IMHO the current xwidget implementation in emacs should deprecated. A
year ago I spent some time digging into all of this and the result was
my proof of concept emacs module that implemented the webkitgtk
functionally independent of xwidgets, called emac-webkit
(https://github.com/akirakyle/emacs-webkit and there's a thread that I
started here about a year ago to discuss this). The webkitgtk part of
xwidgets really is the only functional part, since the buttons and
other widgets have only an incomplete lisp interface and
implementation.

Po, if you're seriously considering cleaning up this code, it might be
wise to take a step back and consider what features its trying to
provide and how. There's a fundamental tension between the
buffer/window model of emacs and the way gtk implements a MVC paradigm
that makes it nontrivial for them to be compatible. This situation has
only worsened as gtk has been moving its api's to better support a
future with heavy reliance on gpu rendering. IIRC this means the
offscreen rendering technique employed by xwidgets is being deprecated
in gtk. Furthermore xwidgets was implemented before webkit was
transitioned to a containerized worker process architecture so there's
bugs one has to work through as gtk attempts to take back control of
things like signal masks that emacs controls when it initializes gtk.
My impression has actually been that the nsxwidgets have worked far
better and reliably since that was merged (in fact I remember coming
across some emacs package out there that relied on xwidgets, but that
only supported it on macOS as something or another was broken with
xwidgets on gtk). I suspect the transition from x11 to wayland has
introduced a lot of bugs and difficulties for really complex gtk
widgets like webkitgtk.

Ultimately I'd rather see effort go into getting pure gtk merged and
working to eliminate the mess of inpure mixtures of gtk and x11 code
from emacs (there could of course still be a "pure" X backend for
those who desire to run emacs with motif). I think as time goes on, it
will look worse and worse for emacs to need xwayland to run, as
distributions will stop including it by default.

Also I think there's a lot of work to be done on xdisp.c. As I've seen
here and elsewhere, there seems to be sustained interest in richer,
flexible display options to support things like multicolumns or
buffers in buffers without resorting to clever hacks that work around
around the limitations of the current linear character arrays that
emacs represents buffer data as. Browsers with the DOM have obviously
already solved this problem in a very general way, and it's quite
popular these days to leave such complexity and optimization effort to
the browser engine devs and use something like electron. I doubt the
emacs devs or maintainers would ever consent to running emacs on top
of chromium or webkit (although there's already the effort to have
emacs run on servo here https://github.com/emacs-ng/emacs-ng but that
just adds servo as a gui toolkit and doesn't attempt to touch
xdisp.c). So that leaves it to someone to really understand xdisp.c
enough to extend it in such a way that maintains the optimizations
people care about for text terminals, while allowing richer data
structures to be displayed efficiently by the modern gui toolkit
paradigms. No easy task.

Sorry for the long reply. I end up thinking about this topic whenever
I get frustrated with emacs' display engine. I wish I had the time to
work on this, but alas I've started grad school and don't even have
time to work emacs-webkit much.



  reply	other threads:[~2021-10-26  6:32 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-20  2:00 SVG widget in GNU Emacs Anand Tamariya
2021-10-20  3:15 ` Po Lu
2021-10-20 12:09   ` Eli Zaretskii
2021-10-20 12:48     ` Po Lu
2021-10-20 13:08       ` Eli Zaretskii
2021-10-20 13:17         ` Po Lu
2021-10-20 14:13           ` Eli Zaretskii
2021-10-26  6:32             ` Akira Kyle [this message]
2021-10-26 12:32               ` GUI and redisplay work (was: SVG widget in GNU Emacs) Stefan Monnier
2021-10-26 12:51                 ` Stefan Kangas
2021-10-26 13:23                   ` Eli Zaretskii
2021-10-26 13:19                 ` Eli Zaretskii
2021-10-27 16:07                 ` Alexandre Garreau
2021-10-27 17:12                   ` tomas
2021-10-27 19:00                     ` Alexandre Garreau
2021-10-29 17:34                       ` GUI and redisplay work Arthur Miller
2021-10-29 19:29                         ` Alexandre Garreau
2021-10-29 20:05                           ` Alexandre Garreau
2021-10-27  9:47               ` SVG widget in GNU Emacs Po Lu
2021-10-27 12:10                 ` Eli Zaretskii
2021-10-27 12:25                   ` Po Lu
2021-10-27 20:01                     ` Akira Kyle
2021-10-28  1:21                       ` Po Lu
2021-10-28 13:50                       ` Fix flickering on X11 xwidgets (was: Re: SVG widget in GNU Emacs) Po Lu
2021-10-27 19:49                 ` SVG widget in GNU Emacs Akira Kyle
2021-10-28  1:15                   ` Po Lu
2021-10-28  6:15                   ` Eli Zaretskii
2021-10-28  9:39                     ` Po Lu
2021-10-20 22:35   ` Richard Stallman
2021-10-20 23:37     ` dalanicolai
2021-10-21  0:31       ` dalanicolai
2021-10-21  0:07     ` Po Lu
2021-10-20  8:15 ` Lars Ingebrigtsen
2021-10-20  9:13   ` Anand Tamariya

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPWcbYEjpKtq1PKemv8gg0cnL9=Vp95TyEtaSMqmAkVAbS_LAQ@mail.gmail.com' \
    --to=ak@akirakyle.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=luangruo@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.