From: Po Lu Date: Tue, 5 Sep 2023 06:38:33 +0000 (+0800) Subject: Minor adjustments to Android port stubs X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=cf9353e219a69d3c48f6d6e97413e1c91f1ca5b4;p=emacs.git Minor adjustments to Android port stubs * src/androidfns.c (Fx_display_backing_store): Return `when-mapped' in place of `always', since the former better reflects Android port behavior. (syms_of_androidfns) : Delete defsym. : New defsym. * src/term.c (Fsuspend_tty, Fresume_tty): Properly signal errors on Android rather than quietly disregarding calls. --- diff --git a/src/androidfns.c b/src/androidfns.c index 51421f0a68a..f151be5b9a6 100644 --- a/src/androidfns.c +++ b/src/androidfns.c @@ -1326,9 +1326,9 @@ DEFUN ("x-display-backing-store", Fx_display_backing_store, { check_android_display_info (terminal); - /* The Java part is implemented in a way that it always does the - equivalent of backing store. */ - return Qalways; + /* Window contents are preserved insofar as they remain mapped, in a + fashion tantamount to WhenMapped. */ + return Qwhen_mapped; } DEFUN ("x-display-visual-class", Fx_display_visual_class, @@ -3102,7 +3102,7 @@ syms_of_androidfns (void) { /* Miscellaneous symbols used by some functions here. */ DEFSYM (Qtrue_color, "true-color"); - DEFSYM (Qalways, "always"); + DEFSYM (Qwhen_mapped, "when-mapped"); DEFVAR_LISP ("x-pointer-shape", Vx_pointer_shape, doc: /* SKIP: real text in xfns.c. */); diff --git a/src/term.c b/src/term.c index 9bcb2cb1386..25184101b78 100644 --- a/src/term.c +++ b/src/term.c @@ -76,7 +76,7 @@ static void set_tty_hooks (struct terminal *terminal); static void dissociate_if_controlling_tty (int fd); static void delete_tty (struct terminal *); -#endif +#endif /* !HAVE_ANDROID */ static AVOID maybe_fatal (bool, struct terminal *, const char *, const char *, ...) @@ -2356,7 +2356,7 @@ A suspended tty may be resumed by calling `resume-tty' on it. */) if (f != t->display_info.tty->output) emacs_fclose (t->display_info.tty->output); emacs_fclose (f); -#endif +#endif /* !MSDOS */ t->display_info.tty->input = 0; t->display_info.tty->output = 0; @@ -2368,10 +2368,11 @@ A suspended tty may be resumed by calling `resume-tty' on it. */) /* Clear display hooks to prevent further output. */ clear_tty_hooks (t); -#else - /* This will always signal on Android. */ - decode_tty_terminal (tty); -#endif +#else /* HAVE_ANDROID */ + /* Android doesn't support TTY terminal devices, so unconditionally + signal. */ + error ("Attempt to suspend a non-text terminal device"); +#endif /* !HAVE_ANDROID */ return Qnil; } @@ -2428,7 +2429,7 @@ frame's terminal). */) if (!O_IGNORE_CTTY && strcmp (t->display_info.tty->name, DEV_TTY) != 0) dissociate_if_controlling_tty (fd); -#endif +#endif /* MSDOS */ add_keyboard_wait_descriptor (fd); @@ -2457,9 +2458,11 @@ frame's terminal). */) } set_tty_hooks (t); -#else - decode_tty_terminal (tty); -#endif +#else /* HAVE_ANDROID */ + /* Android doesn't support TTY terminal devices, so unconditionally + signal. */ + error ("Attempt to suspend a non-text terminal device"); +#endif /* !HAVE_ANDROID */ return Qnil; } @@ -2504,7 +2507,7 @@ A value of zero means TTY uses the system's default value. */) error ("Not a tty terminal"); } -#endif +#endif /* !HAVE_ANDROID */ /***********************************************************************