diff options
| author | Po Lu | 2023-10-03 08:55:57 +0800 |
|---|---|---|
| committer | Po Lu | 2023-10-03 08:55:57 +0800 |
| commit | 1ad2d2f77c742594768e777c36a2eef22f747722 (patch) | |
| tree | fcf69370e2c28e7caf39f6e4e2e7a94ccd7aa03c /src | |
| parent | ad2bb3e9f36d1a4f25e1e2228586331b40a30a46 (diff) | |
| download | emacs-1ad2d2f77c742594768e777c36a2eef22f747722.tar.gz emacs-1ad2d2f77c742594768e777c36a2eef22f747722.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/androidvfs.c | 30 | ||||
| -rw-r--r-- | 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, | |||
| 1921 | /* Size of the file. */ | 1921 | /* Size of the file. */ |
| 1922 | info->statb.st_size = AAsset_getLength (asset); | 1922 | info->statb.st_size = AAsset_getLength (asset); |
| 1923 | 1923 | ||
| 1924 | /* If the installation date can be ascertained, return that as | ||
| 1925 | the file's modification time. */ | ||
| 1926 | |||
| 1927 | if (timespec_valid_p (emacs_installation_time)) | ||
| 1928 | { | ||
| 1929 | #ifdef STAT_TIMESPEC | ||
| 1930 | STAT_TIMESPEC (&info->statb, st_mtim) = emacs_installation_time; | ||
| 1931 | #else /* !STAT_TIMESPEC */ | ||
| 1932 | /* Headers supplied by the NDK r10b contain a `struct stat' | ||
| 1933 | without POSIX fields for nano-second timestamps. */ | ||
| 1934 | info->statb.st_mtime = emacs_installation_time.tv_sec; | ||
| 1935 | info->statb.st_mtime_nsec = emacs_installation_time.tv_nsec; | ||
| 1936 | #endif /* STAT_TIMESPEC */ | ||
| 1937 | } | ||
| 1938 | |||
| 1924 | /* Chain info onto afs_file_descriptors. */ | 1939 | /* Chain info onto afs_file_descriptors. */ |
| 1925 | afs_file_descriptors = info; | 1940 | afs_file_descriptors = info; |
| 1926 | 1941 | ||
| @@ -7365,6 +7380,21 @@ android_asset_fstat (struct android_fd_or_asset asset, | |||
| 7365 | statb->st_uid = 0; | 7380 | statb->st_uid = 0; |
| 7366 | statb->st_gid = 0; | 7381 | statb->st_gid = 0; |
| 7367 | 7382 | ||
| 7383 | /* If the installation date can be ascertained, return that as the | ||
| 7384 | file's modification time. */ | ||
| 7385 | |||
| 7386 | if (timespec_valid_p (emacs_installation_time)) | ||
| 7387 | { | ||
| 7388 | #ifdef STAT_TIMESPEC | ||
| 7389 | STAT_TIMESPEC (statb, st_mtim) = emacs_installation_time; | ||
| 7390 | #else /* !STAT_TIMESPEC */ | ||
| 7391 | /* Headers supplied by the NDK r10b contain a `struct stat' | ||
| 7392 | without POSIX fields for nano-second timestamps. */ | ||
| 7393 | statb->st_mtime = emacs_installation_time.tv_sec; | ||
| 7394 | statb->st_mtime_nsec = emacs_installation_time.tv_nsec; | ||
| 7395 | #endif /* STAT_TIMESPEC */ | ||
| 7396 | } | ||
| 7397 | |||
| 7368 | /* Size of the file. */ | 7398 | /* Size of the file. */ |
| 7369 | statb->st_size = AAsset_getLength (asset.asset); | 7399 | statb->st_size = AAsset_getLength (asset.asset); |
| 7370 | return 0; | 7400 | 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, | |||
| 20297 | 20297 | ||
| 20298 | /* See if keysym should make Emacs quit. */ | 20298 | /* See if keysym should make Emacs quit. */ |
| 20299 | 20299 | ||
| 20300 | if (keysym == dpyinfo->quit_keysym | 20300 | if (dpyinfo->quit_keysym) |
| 20301 | && (xkey.time - dpyinfo->quit_keysym_time | ||
| 20302 | <= 350)) | ||
| 20303 | { | 20301 | { |
| 20304 | Vquit_flag = Qt; | 20302 | if (keysym == dpyinfo->quit_keysym |
| 20305 | goto done_keysym; | 20303 | && (xkey.time - dpyinfo->quit_keysym_time |
| 20306 | } | 20304 | <= 350)) |
| 20305 | { | ||
| 20306 | Vquit_flag = Qt; | ||
| 20307 | goto done_keysym; | ||
| 20308 | } | ||
| 20307 | 20309 | ||
| 20308 | if (keysym == dpyinfo->quit_keysym) | 20310 | if (keysym == dpyinfo->quit_keysym) |
| 20309 | { | 20311 | { |
| 20310 | /* Otherwise, set the last time that keysym was | 20312 | /* Otherwise, set the last time that keysym was |
| 20311 | pressed. */ | 20313 | pressed. */ |
| 20312 | dpyinfo->quit_keysym_time = xkey.time; | 20314 | dpyinfo->quit_keysym_time = xkey.time; |
| 20313 | goto done_keysym; | 20315 | goto done_keysym; |
| 20316 | } | ||
| 20314 | } | 20317 | } |
| 20315 | 20318 | ||
| 20316 | /* If not using XIM/XIC, and a compose sequence is in progress, | 20319 | /* If not using XIM/XIC, and a compose sequence is in progress, |
| @@ -24227,20 +24230,23 @@ handle_one_xevent (struct x_display_info *dpyinfo, | |||
| 24227 | 24230 | ||
| 24228 | /* See if keysym should make Emacs quit. */ | 24231 | /* See if keysym should make Emacs quit. */ |
| 24229 | 24232 | ||
| 24230 | if (keysym == dpyinfo->quit_keysym | 24233 | if (dpyinfo->quit_keysym) |
| 24231 | && (xev->time - dpyinfo->quit_keysym_time | ||
| 24232 | <= 350)) | ||
| 24233 | { | 24234 | { |
| 24234 | Vquit_flag = Qt; | 24235 | if (keysym == dpyinfo->quit_keysym |
| 24235 | goto xi_done_keysym; | 24236 | && (xev->time - dpyinfo->quit_keysym_time |
| 24236 | } | 24237 | <= 350)) |
| 24238 | { | ||
| 24239 | Vquit_flag = Qt; | ||
| 24240 | goto xi_done_keysym; | ||
| 24241 | } | ||
| 24237 | 24242 | ||
| 24238 | if (keysym == dpyinfo->quit_keysym) | 24243 | if (keysym == dpyinfo->quit_keysym) |
| 24239 | { | 24244 | { |
| 24240 | /* Otherwise, set the last time that keysym was | 24245 | /* Otherwise, set the last time that keysym |
| 24241 | pressed. */ | 24246 | was pressed. */ |
| 24242 | dpyinfo->quit_keysym_time = xev->time; | 24247 | dpyinfo->quit_keysym_time = xev->time; |
| 24243 | goto xi_done_keysym; | 24248 | goto xi_done_keysym; |
| 24249 | } | ||
| 24244 | } | 24250 | } |
| 24245 | 24251 | ||
| 24246 | /* First deal with keysyms which have defined | 24252 | /* First deal with keysyms which have defined |