all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#65009: 29.1; should emacsclient check BROADWAY_DISPLAY as well as WAYLAND_DISPLAY and DISPLAY?
@ 2023-08-02  9:51 Trent W. Buck
  2023-08-02 13:06 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 3+ messages in thread
From: Trent W. Buck @ 2023-08-02  9:51 UTC (permalink / raw)
  To: 65009

I'm writing this from Emacs 28.2 still, but this is about pgtk 29.1.
I haven't actually tested pgtk myself yet (sorry!)

The good folks of #debian-emacs noticed that while emacsclient doesn't
link to any GUI libraries, it does check GUI environment variables.

    https://sources.debian.org/src/emacs/1:29.1+1-2/lib-src/emacsclient.c/?hl=1703#L631-L636

    631  #ifdef HAVE_PGTK
    632        display = egetenv ("WAYLAND_DISPLAY");
    633        alt_display = egetenv ("DISPLAY");
    634  #else
    635        display = egetenv ("DISPLAY");
    636  #endif

This (maybe) causes weirdness when Debian builds several versions of
/bin/emacs, but a single shared version of /bin/emacsclient.

But THIS bug is about what happens if you're running emacs inside the
browser, using GTK's built-in HTML5 backend:

    # Start the display (a.k.a. web server)
    broadwayd :0 &

    # Connect from a client (could be a different container)
    firefox http://127.0.0.1:8080

    # start some GUI apps
    GDK_BACKEND=broadway BROADWAY_DISPLAY=:0 gtk3-demo &
    GDK_BACKEND=broadway BROADWAY_DISPLAY=:0 gnome-terminal -- emacs -nw &
    GDK_BACKEND=broadway BROADWAY_DISPLAY=:0 virt-manager &
    GDK_BACKEND=broadway BROADWAY_DISPLAY=:0 emacs &

AIUI pGTK makes Emacs a fully native GTK app and this Just Works.
But "emacsclient --create-frame" won't work until/unless it checks $BROADWAY_DISPLAY, right?

And while emacs daemon can tell from just
"-display ${WAYLAND_DISPLAY:-$DISPLAY}"
when wayland is wanted (because WAYLAND_DISPLAY starts with "wayland-"),
that's *not* possible with broadway.
So some kind of additional logic is needed on the server side, too?
Or maybe -display :0 will Just Work as long as emacs --daemon also has GDK_BACKEND=broadway?
I don't fully understand what happens inside the GTK layer.

My main use case for this is to have a GUI when running Emacs in Debian GNU/ntoskrnl (a.k.a. WSL1).
That way I have full, completely normal GNU userland (unlike NTEmacs), but
Indic scripts render properly (unlike Debian GNU emacs -nw inside Microsoft Terminal).
(The normal ways to solve this are WSL2 or MSYS2, but I like being weird.)

If the general consensus is "too hard; WONTFIX", I am OK with that.
This is something I want a couple of times a year, not every single day.





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-08-02 18:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-02  9:51 bug#65009: 29.1; should emacsclient check BROADWAY_DISPLAY as well as WAYLAND_DISPLAY and DISPLAY? Trent W. Buck
2023-08-02 13:06 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-02 18:12   ` Trent W. Buck

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.