emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master cf9353e219a: Minor adjustments to Android port stubs


From: Po Lu
Subject: master cf9353e219a: Minor adjustments to Android port stubs
Date: Tue, 5 Sep 2023 02:39:54 -0400 (EDT)

branch: master
commit cf9353e219a69d3c48f6d6e97413e1c91f1ca5b4
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    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) <always>: Delete defsym.
    <when-mapped>: New defsym.
    
    * src/term.c (Fsuspend_tty, Fresume_tty): Properly signal errors
    on Android rather than quietly disregarding calls.
---
 src/androidfns.c |  8 ++++----
 src/term.c       | 25 ++++++++++++++-----------
 2 files changed, 18 insertions(+), 15 deletions(-)

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 */
 
 
 /***********************************************************************



reply via email to

[Prev in Thread] Current Thread [Next in Thread]