Properly run emacsclient under Android if DISPLAY is set

* java/org/gnu/emacs/EmacsPixmap.java (EmacsPixmap): Make
dimensions final, since they are never changed after the
constructor.

* lib-src/emacsclient.c (decode_options): If --display is not
provided, always set display to `android' even if DISPLAY is
provided.

* lisp/net/browse-url.el (browse-url): Cease setting DISPLAY
under Android.

* src/callproc.c (getenv_internal, make_environment_block):
Don't afford DISPLAY special treatment under Android.
This commit is contained in:
Po Lu 2023-09-06 10:31:26 +08:00
parent 03ac16ece4
commit aa872f2540
4 changed files with 41 additions and 9 deletions

View file

@ -618,6 +618,7 @@ decode_options (int argc, char **argv)
display in DISPLAY (if any). */
if (create_frame && !tty && !display)
{
#ifndef HAVE_ANDROID
/* Set these here so we use a default_display only when the user
didn't give us an explicit display. */
#if defined (NS_IMPL_COCOA)
@ -626,16 +627,22 @@ decode_options (int argc, char **argv)
alt_display = "w32";
#elif defined (HAVE_HAIKU)
alt_display = "be";
#elif defined (HAVE_ANDROID)
alt_display = "android";
#endif
#endif /* NS_IMPL_COCOA */
#ifdef HAVE_PGTK
display = egetenv ("WAYLAND_DISPLAY");
alt_display = egetenv ("DISPLAY");
#else
#else /* !HAVE_PGTK */
display = egetenv ("DISPLAY");
#endif
#endif /* HAVE_PGTK */
#else /* HAVE_ANDROID */
/* Disregard the DISPLAY environment variable under Android.
Several terminal emulator programs furnish their own X
servers and set DISPLAY, but an Android build is incapable of
displaying X frames. */
alt_display = NULL;
display = "android";
#endif /* !HAVE_ANDROID */
}
if (!display)