* src/xterm.c (handle_one_xevent): Add similar event mode check
to code under USE_X_TOOLKIT conditional. (bug#57476)
just looks up a top window on Xt builds. */
#ifdef HAVE_XINPUT2_1
- if (leave->detail != XINotifyInferior && f)
+ if (leave->detail != XINotifyInferior && f
+ && leave->mode != XINotifyUngrab
+ && leave->mode != XINotifyGrab
+ && leave->mode != XINotifyPassiveUngrab
+ && leave->mode != XINotifyPassiveGrab)
xi_reset_scroll_valuators_for_device_id (dpyinfo,
leave->deviceid, false);
#endif