valuator->emacs_value = DBL_MIN;
valuator->increment = info->increment;
valuator->number = info->number;
- valuator->pending_enter_reset = false;
break;
}
{
xi_device->valuators[c].invalid_p = false;
xi_device->valuators[c].current_value = tem->current_value;
- xi_device->valuators[c].pending_enter_reset = true;
}
}
}
#ifdef HAVE_XINPUT2_1
static void
-xi_reset_scroll_valuators_for_device_id (struct x_display_info *dpyinfo, int id,
- bool pending_only)
+xi_reset_scroll_valuators_for_device_id (struct x_display_info *dpyinfo,
+ int id)
{
struct xi_device_t *device = xi_device_from_id (dpyinfo, id);
struct xi_scroll_valuator_t *valuator;
for (int i = 0; i < device->scroll_valuator_count; ++i)
{
valuator = &device->valuators[i];
-
- if (pending_only && !valuator->pending_enter_reset)
- continue;
-
- valuator->pending_enter_reset = false;
valuator->invalid_p = true;
valuator->emacs_value = 0.0;
}
{
valuator->invalid_p = false;
valuator->current_value = valuator_info->value;
-
- /* Make sure that this is reset if the pointer moves
- into a window of ours.
-
- Otherwise the valuator state could be left
- invalid if the DeviceChange event happened with
- the pointer outside any Emacs frame. */
- valuator->pending_enter_reset = true;
}
break;
&& enter->mode != XINotifyGrab
&& enter->mode != XINotifyPassiveGrab
&& enter->mode != XINotifyPassiveUngrab)
- xi_reset_scroll_valuators_for_device_id (dpyinfo, enter->deviceid,
- true);
+ xi_reset_scroll_valuators_for_device_id (dpyinfo,
+ enter->deviceid);
#endif
{
retrieve the value of a valuator outside of each motion
event.
- As such, to prevent wildly inaccurate results when the
- valuators have changed outside Emacs, we reset our
- records of each valuator's value whenever the pointer
- moves out of a frame (and not into one of its
- children, which we know about). */
+ As such, to prevent wildly inaccurate results when
+ the valuators have changed outside Emacs, we reset
+ our records of each valuator's value whenever the
+ pointer moves out of a frame. Ideally, this would
+ ignore events with a detail of XINotifyInferior, as
+ the window the pointer moved to would be one known to
+ Emacs, but the code to keep track of which valuators
+ had to be reset upon the corresponding XI_Enter event
+ was very complicated and kept running into server
+ bugs. */
#ifdef HAVE_XINPUT2_1
- if (leave->detail != XINotifyInferior && any
+ if (any
/* xfwm4 selects for button events on the frame
window, resulting in passive grabs being
generated along with the delivery of emulated
&& leave->mode != XINotifyPassiveUngrab
&& leave->mode != XINotifyPassiveGrab)
xi_reset_scroll_valuators_for_device_id (dpyinfo,
- leave->deviceid, false);
+ leave->deviceid);
#endif
x_display_set_last_user_time (dpyinfo, leave->time,
just looks up a top window on Xt builds. */
#ifdef HAVE_XINPUT2_1
- if (leave->detail != XINotifyInferior && f
- && leave->mode != XINotifyUngrab
+ if (f && leave->mode != XINotifyUngrab
&& leave->mode != XINotifyGrab
&& leave->mode != XINotifyPassiveUngrab
&& leave->mode != XINotifyPassiveGrab)
xi_reset_scroll_valuators_for_device_id (dpyinfo,
- leave->deviceid, false);
+ leave->deviceid);
#endif
if (!f)