emacs-diffs
[Top][All Lists]
Advanced

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

master 1ad2d2f77c7 1/2: Update Android port


From: Po Lu
Subject: master 1ad2d2f77c7 1/2: Update Android port
Date: Mon, 2 Oct 2023 20:59:49 -0400 (EDT)

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

    Update Android port
    
    * src/androidvfs.c (android_afs_open, android_asset_fstat):
    Return proper mtime within file descriptors incorporating asset
    data and within android_asset_fstat.
    
    * src/xterm.c (handle_one_xevent)
    <KeyPress, XI_KeyPress>: Verify presence of a quit keysym
    prior to registering it.
---
 src/androidvfs.c | 30 ++++++++++++++++++++++++++++++
 src/xterm.c      | 54 ++++++++++++++++++++++++++++++------------------------
 2 files changed, 60 insertions(+), 24 deletions(-)

diff --git a/src/androidvfs.c b/src/androidvfs.c
index d099e4d636c..0e5bbf8a13e 100644
--- a/src/androidvfs.c
+++ b/src/androidvfs.c
@@ -1921,6 +1921,21 @@ android_afs_open (struct android_vnode *vnode, int flags,
       /* Size of the file.  */
       info->statb.st_size = AAsset_getLength (asset);
 
+      /* If the installation date can be ascertained, return that as
+        the file's modification time.  */
+
+      if (timespec_valid_p (emacs_installation_time))
+       {
+#ifdef STAT_TIMESPEC
+         STAT_TIMESPEC (&info->statb, st_mtim) = emacs_installation_time;
+#else /* !STAT_TIMESPEC */
+          /* Headers supplied by the NDK r10b contain a `struct stat'
+            without POSIX fields for nano-second timestamps.  */
+         info->statb.st_mtime = emacs_installation_time.tv_sec;
+         info->statb.st_mtime_nsec = emacs_installation_time.tv_nsec;
+#endif /* STAT_TIMESPEC */
+       }
+
       /* Chain info onto afs_file_descriptors.  */
       afs_file_descriptors = info;
 
@@ -7365,6 +7380,21 @@ android_asset_fstat (struct android_fd_or_asset asset,
   statb->st_uid = 0;
   statb->st_gid = 0;
 
+  /* If the installation date can be ascertained, return that as the
+     file's modification time.  */
+
+  if (timespec_valid_p (emacs_installation_time))
+    {
+#ifdef STAT_TIMESPEC
+      STAT_TIMESPEC (statb, st_mtim) = emacs_installation_time;
+#else /* !STAT_TIMESPEC */
+      /* Headers supplied by the NDK r10b contain a `struct stat'
+        without POSIX fields for nano-second timestamps.  */
+      statb->st_mtime = emacs_installation_time.tv_sec;
+      statb->st_mtime_nsec = emacs_installation_time.tv_nsec;
+#endif /* STAT_TIMESPEC */
+    }
+
   /* Size of the file.  */
   statb->st_size = AAsset_getLength (asset.asset);
   return 0;
diff --git a/src/xterm.c b/src/xterm.c
index 18a6c51efb3..517bdf57aab 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -20297,20 +20297,23 @@ handle_one_xevent (struct x_display_info *dpyinfo,
 
          /* See if keysym should make Emacs quit.  */
 
-         if (keysym == dpyinfo->quit_keysym
-             && (xkey.time - dpyinfo->quit_keysym_time
-                 <= 350))
+         if (dpyinfo->quit_keysym)
            {
-             Vquit_flag = Qt;
-             goto done_keysym;
-           }
+             if (keysym == dpyinfo->quit_keysym
+                 && (xkey.time - dpyinfo->quit_keysym_time
+                     <= 350))
+               {
+                 Vquit_flag = Qt;
+                 goto done_keysym;
+               }
 
-         if (keysym == dpyinfo->quit_keysym)
-           {
-             /* Otherwise, set the last time that keysym was
-                pressed.  */
-             dpyinfo->quit_keysym_time = xkey.time;
-             goto done_keysym;
+             if (keysym == dpyinfo->quit_keysym)
+               {
+                 /* Otherwise, set the last time that keysym was
+                    pressed.  */
+                 dpyinfo->quit_keysym_time = xkey.time;
+                 goto done_keysym;
+               }
            }
 
           /* If not using XIM/XIC, and a compose sequence is in progress,
@@ -24227,20 +24230,23 @@ handle_one_xevent (struct x_display_info *dpyinfo,
 
                  /* See if keysym should make Emacs quit.  */
 
-                 if (keysym == dpyinfo->quit_keysym
-                     && (xev->time - dpyinfo->quit_keysym_time
-                         <= 350))
+                 if (dpyinfo->quit_keysym)
                    {
-                     Vquit_flag = Qt;
-                     goto xi_done_keysym;
-                   }
+                     if (keysym == dpyinfo->quit_keysym
+                         && (xev->time - dpyinfo->quit_keysym_time
+                             <= 350))
+                       {
+                         Vquit_flag = Qt;
+                         goto xi_done_keysym;
+                       }
 
-                 if (keysym == dpyinfo->quit_keysym)
-                   {
-                     /* Otherwise, set the last time that keysym was
-                        pressed.  */
-                     dpyinfo->quit_keysym_time = xev->time;
-                     goto xi_done_keysym;
+                     if (keysym == dpyinfo->quit_keysym)
+                       {
+                         /* Otherwise, set the last time that keysym
+                            was pressed.  */
+                         dpyinfo->quit_keysym_time = xev->time;
+                         goto xi_done_keysym;
+                       }
                    }
 
                  /* First deal with keysyms which have defined



reply via email to

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