; * src/xterm.c (x_if_event): Minor speed improvements.
This commit is contained in:
parent
bb56cc4cad
commit
6fb206329f
1 changed files with 6 additions and 1 deletions
|
@ -6605,12 +6605,17 @@ x_if_event (Display *dpy, XEvent *event_return,
|
|||
current_time = current_timespec ();
|
||||
target = timespec_add (current_time, timeout);
|
||||
|
||||
/* Check if an event is already in the queue. If it is, avoid
|
||||
syncing. */
|
||||
if (XCheckIfEvent (dpy, event_return, predicate, arg))
|
||||
return 0;
|
||||
|
||||
while (true)
|
||||
{
|
||||
/* Get events into the queue. */
|
||||
XSync (dpy, False);
|
||||
|
||||
/* Check if an event is now in the queue. */
|
||||
/* Look for an event again. */
|
||||
if (XCheckIfEvent (dpy, event_return, predicate, arg))
|
||||
return 0;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue