Skip to content

Commit

Permalink
X11 port could block on getch() if nodelay() and PDC_set_blink() were…
Browse files Browse the repository at this point in the history
… both set to TRUE. Fixes issue #216.  Problem found and largely solved by @u3shit.
  • Loading branch information
Bill-Gray committed Oct 5, 2021
1 parent 5602f4c commit e20301a
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions x11/pdckbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ static unsigned long _process_mouse_event( const XEvent *event)
last_button_no = button_no;

napms(SP->mouse_wait);
while (XtAppPending(pdc_app_context))
while (PDC_check_key())
{
XEvent rel;
XtAppNextEvent(pdc_app_context, &rel);
Expand Down Expand Up @@ -600,11 +600,18 @@ static unsigned long _process_mouse_event( const XEvent *event)

bool PDC_check_key(void)
{
XtInputMask s = XtAppPending(pdc_app_context);
const XtInputMask s = XtAppPending(pdc_app_context);

PDC_LOG(("PDC_check_key() - returning %s\n", s ? "TRUE" : "FALSE"));
if (s & XtIMTimer)
XtAppProcessEvent(pdc_app_context, XtIMTimer);
if (s & XtIMSignal)
XtAppProcessEvent(pdc_app_context, XtIMSignal);
if (s & XtIMAlternateInput)
XtAppProcessEvent(pdc_app_context, XtIMAlternateInput);

return pdc_resize_now || !!s;
PDC_LOG(("PDC_check_key() - returning %s\n", (s & XtIMXEvent) ? "TRUE" : "FALSE"));

return pdc_resize_now || !!(s & XtIMXEvent);
}

/* return the next available key or mouse event */
Expand Down

0 comments on commit e20301a

Please sign in to comment.