From: dickmao Date: Thu, 13 May 2021 13:21:53 +0000 (+0200) Subject: Process sentinels need to work under X and commandline X-Git-Tag: emacs-28.0.90~2482 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5be26b43f441e429dadbf7c8beccb351a84f1275;p=emacs.git Process sentinels need to work under X and commandline * src/process.c (add_non_keyboard_read_fd): Make this a public function. (add_process_read_fd): Fold old, static add_non_keyboard_read_fd guts into here. * src/xsmfns.c (ice_conn_watch_CB): Call add_non_keyboard_read_fd (bug#43834). --- diff --git a/src/process.c b/src/process.c index 84e301a87a5..47a2a6f1a31 100644 --- a/src/process.c +++ b/src/process.c @@ -473,8 +473,15 @@ add_read_fd (int fd, fd_callback func, void *data) fd_callback_info[fd].data = data; } +void +add_non_keyboard_read_fd (int fd, fd_callback func, void *data) +{ + add_read_fd(fd, func, data); + fd_callback_info[fd].flags &= ~KEYBOARD_FD; +} + static void -add_non_keyboard_read_fd (int fd) +add_process_read_fd (int fd) { eassert (fd >= 0 && fd < FD_SETSIZE); eassert (fd_callback_info[fd].func == NULL); @@ -483,12 +490,6 @@ add_non_keyboard_read_fd (int fd) fd_callback_info[fd].flags |= FOR_READ; if (fd > max_desc) max_desc = fd; -} - -static void -add_process_read_fd (int fd) -{ - add_non_keyboard_read_fd (fd); eassert (0 <= fd && fd < FD_SETSIZE); fd_callback_info[fd].flags |= PROCESS_FD; } diff --git a/src/process.h b/src/process.h index d041ada5867..0890f253a40 100644 --- a/src/process.h +++ b/src/process.h @@ -284,6 +284,7 @@ extern bool kbd_on_hold_p (void); typedef void (*fd_callback) (int fd, void *data); extern void add_read_fd (int fd, fd_callback func, void *data); +extern void add_non_keyboard_read_fd (int fd, fd_callback func, void *data); extern void delete_read_fd (int fd); extern void add_write_fd (int fd, fd_callback func, void *data); extern void delete_write_fd (int fd); diff --git a/src/xsmfns.c b/src/xsmfns.c index 10565a4b25f..ddb86d82fe1 100644 --- a/src/xsmfns.c +++ b/src/xsmfns.c @@ -357,7 +357,7 @@ ice_conn_watch_CB (IceConn iceConn, IcePointer clientData, } ice_fd = IceConnectionNumber (iceConn); - add_read_fd (ice_fd, x_session_check_input, NULL); + add_non_keyboard_read_fd (ice_fd, x_session_check_input, NULL); } /* Create the client leader window. */