aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorPo Lu2023-09-06 10:31:26 +0800
committerPo Lu2023-09-06 10:31:26 +0800
commitaa872f2540377ae5c5e054a55cdd789934a56a47 (patch)
tree431d835301bdc45a83a8f3939d4af8c43ced6789 /lib-src
parent03ac16ece40ba3e3ba805d6a61cc457d84bf3792 (diff)
downloademacs-aa872f2540377ae5c5e054a55cdd789934a56a47.tar.gz
emacs-aa872f2540377ae5c5e054a55cdd789934a56a47.zip
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)
618 display in DISPLAY (if any). */ 618 display in DISPLAY (if any). */
619 if (create_frame && !tty && !display) 619 if (create_frame && !tty && !display)
620 { 620 {
621#ifndef HAVE_ANDROID
621 /* Set these here so we use a default_display only when the user 622 /* Set these here so we use a default_display only when the user
622 didn't give us an explicit display. */ 623 didn't give us an explicit display. */
623#if defined (NS_IMPL_COCOA) 624#if defined (NS_IMPL_COCOA)
@@ -626,16 +627,22 @@ decode_options (int argc, char **argv)
626 alt_display = "w32"; 627 alt_display = "w32";
627#elif defined (HAVE_HAIKU) 628#elif defined (HAVE_HAIKU)
628 alt_display = "be"; 629 alt_display = "be";
629#elif defined (HAVE_ANDROID) 630#endif /* NS_IMPL_COCOA */
630 alt_display = "android";
631#endif
632 631
633#ifdef HAVE_PGTK 632#ifdef HAVE_PGTK
634 display = egetenv ("WAYLAND_DISPLAY"); 633 display = egetenv ("WAYLAND_DISPLAY");
635 alt_display = egetenv ("DISPLAY"); 634 alt_display = egetenv ("DISPLAY");
636#else 635#else /* !HAVE_PGTK */
637 display = egetenv ("DISPLAY"); 636 display = egetenv ("DISPLAY");
638#endif 637#endif /* HAVE_PGTK */
638#else /* HAVE_ANDROID */
639 /* Disregard the DISPLAY environment variable under Android.
640 Several terminal emulator programs furnish their own X
641 servers and set DISPLAY, but an Android build is incapable of
642 displaying X frames. */
643 alt_display = NULL;
644 display = "android";
645#endif /* !HAVE_ANDROID */
639 } 646 }
640 647
641 if (!display) 648 if (!display)