aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2022-02-16 14:38:06 +0800
committerPo Lu2022-02-16 14:38:06 +0800
commitdb5d2a4407d9016b09155477ccb6eafe5a17a0dd (patch)
treed8129a0be80f7d0d86edc16d94afadc03327b3e5 /src
parenta654e373499c0182e5e0f031fc0bbf4721f8f2bb (diff)
downloademacs-db5d2a4407d9016b09155477ccb6eafe5a17a0dd.tar.gz
emacs-db5d2a4407d9016b09155477ccb6eafe5a17a0dd.zip
Resolve xwidget scrolling mysteries
* src/xterm.c (x_any_window_to_frame): Handle xwidget views. (handle_one_xevent): Always increment values array when handling motion events.
Diffstat (limited to 'src')
-rw-r--r--src/xterm.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/src/xterm.c b/src/xterm.c
index bd8d5f892f3..57e06f6c7e1 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -5681,6 +5681,13 @@ x_any_window_to_frame (struct x_display_info *dpyinfo, int wdesc)
5681 if (wdesc == None) 5681 if (wdesc == None)
5682 return NULL; 5682 return NULL;
5683 5683
5684#ifdef HAVE_XWIDGETS
5685 struct xwidget_view *xv = xwidget_view_from_window (wdesc);
5686
5687 if (xv)
5688 return xv->frame;
5689#endif
5690
5684 FOR_EACH_FRAME (tail, frame) 5691 FOR_EACH_FRAME (tail, frame)
5685 { 5692 {
5686 if (found) 5693 if (found)
@@ -10997,19 +11004,21 @@ handle_one_xevent (struct x_display_info *dpyinfo,
10997 scroll wheel movement is reported on XInput 2. */ 11004 scroll wheel movement is reported on XInput 2. */
10998 delta = x_get_scroll_valuator_delta (dpyinfo, xev->deviceid, 11005 delta = x_get_scroll_valuator_delta (dpyinfo, xev->deviceid,
10999 i, *values, &val); 11006 i, *values, &val);
11007 values++;
11000 11008
11001 if (delta != DBL_MAX) 11009 if (delta != DBL_MAX)
11002 { 11010 {
11011 if (!f)
11012 {
11013 f = x_any_window_to_frame (dpyinfo, xev->event);
11014
11015 if (!f)
11016 goto XI_OTHER;
11017 }
11018
11003#ifdef HAVE_XWIDGETS 11019#ifdef HAVE_XWIDGETS
11004 if (xv) 11020 if (xv)
11005 { 11021 {
11006 /* FIXME: figure out what in GTK is
11007 causing interval values to jump by
11008 >100 at the end of a touch sequence
11009 when an xwidget gets a scroll event
11010 where is_stop is TRUE. */
11011 if (fabs (delta) > 100)
11012 continue;
11013 if (val->horizontal) 11022 if (val->horizontal)
11014 xv_total_x += delta; 11023 xv_total_x += delta;
11015 else 11024 else
@@ -11019,13 +11028,6 @@ handle_one_xevent (struct x_display_info *dpyinfo,
11019 continue; 11028 continue;
11020 } 11029 }
11021#endif 11030#endif
11022 if (!f)
11023 {
11024 f = x_any_window_to_frame (dpyinfo, xev->event);
11025
11026 if (!f)
11027 goto XI_OTHER;
11028 }
11029 11031
11030 found_valuator = true; 11032 found_valuator = true;
11031 11033
@@ -11107,7 +11109,6 @@ handle_one_xevent (struct x_display_info *dpyinfo,
11107 11109
11108 val->emacs_value = 0; 11110 val->emacs_value = 0;
11109 } 11111 }
11110 values++;
11111 } 11112 }
11112 11113
11113 inev.ie.kind = NO_EVENT; 11114 inev.ie.kind = NO_EVENT;