1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-29 08:31:35 -08:00

Send scroll stop events to xwidgets correctly

* src/xterm.c (handle_one_xevent): Record stop events manually.

* src/xwidget.h (xwidget_scroll):
* src/xwidget.c (xwidget_scroll): New parameter `stop_p'.
This commit is contained in:
Po Lu 2021-12-08 10:04:31 +08:00
parent 176c63287f
commit 5671709590
3 changed files with 11 additions and 7 deletions

View file

@ -9851,6 +9851,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
XIValuatorState *states;
double *values;
bool found_valuator = false;
bool any_stop_p = false;
/* A fake XMotionEvent for x_note_mouse_movement. */
XMotionEvent ev;
@ -10003,9 +10004,13 @@ handle_one_xevent (struct x_display_info *dpyinfo,
if (val->horizontal)
xv_total_x += delta;
else
xv_total_y += -delta;
xv_total_y += delta;
found_valuator = true;
if (delta == 0.0)
any_stop_p = true;
continue;
}
#endif
@ -10092,7 +10097,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
if (found_valuator)
xwidget_scroll (xv, xev->event_x, xev->event_y,
xv_total_x, xv_total_y, xev->mods.effective,
xev->time);
xev->time, any_stop_p);
else
xwidget_motion_notify (xv, xev->event_x, xev->event_y,
xev->mods.effective, xev->time);

View file

@ -1062,7 +1062,8 @@ xwidget_motion_notify (struct xwidget_view *view,
void
xwidget_scroll (struct xwidget_view *view, double x, double y,
double dx, double dy, uint state, Time time)
double dx, double dy, uint state, Time time,
bool stop_p)
{
GdkEvent *xg_event;
GtkWidget *target;
@ -1097,9 +1098,7 @@ xwidget_scroll (struct xwidget_view *view, double x, double y,
xg_event->scroll.delta_x = dx;
xg_event->scroll.delta_y = dy;
xg_event->scroll.device = find_suitable_pointer (view->frame);
if (!(fabs (dx) > 0) || !(fabs (dy) > 0))
xg_event->scroll.is_stop = TRUE;
xg_event->scroll.is_stop = stop_p;
g_object_ref (xg_event->any.window);

View file

@ -199,7 +199,7 @@ extern void xwidget_motion_or_crossing (struct xwidget_view *,
extern void xwidget_motion_notify (struct xwidget_view *, double,
double, uint, Time);
extern void xwidget_scroll (struct xwidget_view *, double, double,
double, double, uint, Time);
double, double, uint, Time, bool);
#endif
#endif
#else