X11: Obey timed_delay
I noticed a strange thing where the X11 windowport didn't show the tethered thrown aklys animation correctly. Interestingly, other stuff, such as zapped wands did show the path. I didn't bother trying to figure out what the core was doing differently, as the animation worked in all the other windowports, so instead fix the issue in X11, so it behaves the same as all the others. The issue seems to be that the event loop exited on any(?) event, instead of our specific timed event. So, create our event with a magic id number, and exit only when we encounter that. Also: Obey the timed_delay option, and change the delay from 30ms to 50ms, like in other windowports.
This commit is contained in:
+8
-5
@@ -1750,6 +1750,7 @@ d_timeout(XtPointer client_data, XtIntervalId *id)
|
||||
mesg->type = ClientMessage;
|
||||
mesg->message_type = XA_STRING;
|
||||
mesg->format = 8;
|
||||
mesg->data.b[0] = DELAY_EVENT_ID;
|
||||
XSendEvent(XtDisplay(window_list[WIN_MAP].w),
|
||||
XtWindow(window_list[WIN_MAP].w), False, NoEventMask,
|
||||
(XEvent *) mesg);
|
||||
@@ -1766,11 +1767,13 @@ X11_delay_output(void)
|
||||
{
|
||||
if (!x_inited)
|
||||
return;
|
||||
|
||||
(void) XtAppAddTimeOut(app_context, 30L, d_timeout, (XtPointer) 0);
|
||||
|
||||
/* The timeout function will enable the event loop exit. */
|
||||
(void) x_event(EXIT_ON_SENT_EVENT);
|
||||
#ifdef TIMED_DELAY
|
||||
if (flags.nap && !iflags.debug_fuzzer) {
|
||||
(void) XtAppAddTimeOut(app_context, 50L, d_timeout, (XtPointer) 0);
|
||||
/* The timeout function will enable the event loop exit. */
|
||||
(void) x_event(EXIT_ON_SENT_EVENT);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* X11_hangup ------------------------------------------------------------- */
|
||||
|
||||
Reference in New Issue
Block a user