From 806b7640c0fe757ee6c2213e33220a807a5aa05d Mon Sep 17 00:00:00 2001 From: Yuuki Harano Date: Tue, 21 Jan 2020 22:45:37 +0900 Subject: [PATCH] Before sleep, dispatch draw events. * src/pgtkterm.c (pgtk_select): remove sigio signal (pgtk_term_init): dispatch draw --- src/pgtkterm.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/pgtkterm.c b/src/pgtkterm.c index 74eb08d3301..92ad1bc6c8e 100644 --- a/src/pgtkterm.c +++ b/src/pgtkterm.c @@ -3605,6 +3605,17 @@ pgtk_select (int fds_lim, fd_set *rfds, fd_set *wfds, fd_set *efds, tmop = &tmo; } + /* Before sleep, dispatch draw events. */ + if (context_acquired) + { + int pselect_errno = errno; + block_input (); + while (g_main_context_pending (context)) + g_main_context_dispatch (context); + unblock_input (); + errno = pselect_errno; + } + fds_lim = max_fds + 1; nfds = thread_select (pselect, fds_lim, &all_rfds, have_wfds ? &all_wfds : NULL, efds, @@ -6271,13 +6282,6 @@ pgtk_term_init (Lisp_Object display_name, char *resource_name) xsettings_initialize (dpyinfo); -#ifdef F_SETOWN - fcntl (dpyinfo->connection, F_SETOWN, getpid ()); -#endif /* ! defined (F_SETOWN) */ - - if (interrupt_input) - init_sigio (dpyinfo->connection); - pgtk_selection_init(); pgtk_im_init (dpyinfo); -- 2.39.5