Skip to content

Commit 77812d1

Browse files
author
Yuuki Harano
committed
Before sleep, dispatch draw events.
1 parent 642ba73 commit 77812d1

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/pgtkterm.c

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3604,6 +3604,17 @@ pgtk_select (int fds_lim, fd_set *rfds, fd_set *wfds, fd_set *efds,
36043604
tmop = &tmo;
36053605
}
36063606

3607+
/* Before sleep, dispatch draw events. */
3608+
if (context_acquired)
3609+
{
3610+
int pselect_errno = errno;
3611+
block_input ();
3612+
while (g_main_context_pending (context))
3613+
g_main_context_dispatch (context);
3614+
unblock_input ();
3615+
errno = pselect_errno;
3616+
}
3617+
36073618
fds_lim = max_fds + 1;
36083619
nfds = thread_select (pselect, fds_lim,
36093620
&all_rfds, have_wfds ? &all_wfds : NULL, efds,
@@ -6271,11 +6282,6 @@ pgtk_term_init (Lisp_Object display_name, char *resource_name)
62716282

62726283
xsettings_initialize (dpyinfo);
62736284

6274-
/* According to w32term.c this will stop the emacs console handling
6275-
code from handling keyboard input when we want gtk to do that for
6276-
us */
6277-
add_keyboard_wait_descriptor (0);
6278-
62796285
pgtk_selection_init();
62806286

62816287
pgtk_im_init (dpyinfo);

0 commit comments

Comments
 (0)