summaryrefslogtreecommitdiff
path: root/lib-src
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2023-09-06 10:31:26 +0800
committerPo Lu <luangruo@yahoo.com>2023-09-06 10:31:26 +0800
commitaa872f2540377ae5c5e054a55cdd789934a56a47 (patch)
tree431d835301bdc45a83a8f3939d4af8c43ced6789 /lib-src
parent03ac16ece40ba3e3ba805d6a61cc457d84bf3792 (diff)
downloademacs-aa872f2540377ae5c5e054a55cdd789934a56a47.tar.gz
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.
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/emacsclient.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index a72fced1bf2..d15f9846163 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -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)