]> git.eshelyaron.com Git - emacs.git/commitdiff
Stop relying on `x_coalesce_scroll_events' in pgtk code
authorPo Lu <luangruo@yahoo.com>
Wed, 1 Dec 2021 13:50:43 +0000 (21:50 +0800)
committerPo Lu <luangruo@yahoo.com>
Wed, 1 Dec 2021 13:50:43 +0000 (21:50 +0800)
* src/pgtkterm.c (scroll_event): Use
`mwheel_coalesce_scroll_events'.
(x_coalesce_scroll_events): Remove variable.

src/pgtkterm.c

index 190436a82d2f30a5ac73676f71b700934b3f7a12..15d5fda105f05a1c55dceb92265032d28b269dda 100644 (file)
@@ -6037,7 +6037,7 @@ scroll_event (GtkWidget * widget, GdkEvent * event, gpointer * user_data)
       dpyinfo->scroll.acc_x += delta_x;
       dpyinfo->scroll.acc_y += delta_y;
       if (dpyinfo->scroll.acc_y >= dpyinfo->scroll.y_per_line
-         || !x_coalesce_scroll_events)
+         || !mwheel_coalesce_scroll_events)
        {
          int nlines = dpyinfo->scroll.acc_y / dpyinfo->scroll.y_per_line;
          inev.ie.kind = WHEEL_EVENT;
@@ -6045,7 +6045,7 @@ scroll_event (GtkWidget * widget, GdkEvent * event, gpointer * user_data)
          inev.ie.arg = list3 (make_fixnum (nlines),
                               make_float (-dpyinfo->scroll.acc_x * 100),
                               make_float (-dpyinfo->scroll.acc_y * 100));
-         if (!x_coalesce_scroll_events)
+         if (!mwheel_coalesce_scroll_events)
            {
              dpyinfo->scroll.acc_y = 0;
              dpyinfo->scroll.acc_x = 0;
@@ -6056,7 +6056,7 @@ scroll_event (GtkWidget * widget, GdkEvent * event, gpointer * user_data)
            }
        }
       else if (dpyinfo->scroll.acc_y <= -dpyinfo->scroll.y_per_line
-              || !x_coalesce_scroll_events)
+              || !mwheel_coalesce_scroll_events)
        {
          int nlines = -dpyinfo->scroll.acc_y / dpyinfo->scroll.y_per_line;
          inev.ie.kind = WHEEL_EVENT;
@@ -6065,7 +6065,7 @@ scroll_event (GtkWidget * widget, GdkEvent * event, gpointer * user_data)
                               make_float (-dpyinfo->scroll.acc_x * 100),
                               make_float (-dpyinfo->scroll.acc_y * 100));
 
-         if (!x_coalesce_scroll_events)
+         if (!mwheel_coalesce_scroll_events)
            {
              dpyinfo->scroll.acc_y = 0;
              dpyinfo->scroll.acc_x = 0;
@@ -6074,7 +6074,7 @@ scroll_event (GtkWidget * widget, GdkEvent * event, gpointer * user_data)
            dpyinfo->scroll.acc_y -= -dpyinfo->scroll.y_per_line * nlines;
        }
       else if (dpyinfo->scroll.acc_x >= dpyinfo->scroll.x_per_char
-              || !x_coalesce_scroll_events)
+              || !mwheel_coalesce_scroll_events)
        {
          int nchars = dpyinfo->scroll.acc_x / dpyinfo->scroll.x_per_char;
          inev.ie.kind = HORIZ_WHEEL_EVENT;
@@ -6083,7 +6083,7 @@ scroll_event (GtkWidget * widget, GdkEvent * event, gpointer * user_data)
                               make_float (-dpyinfo->scroll.acc_x * 100),
                               make_float (-dpyinfo->scroll.acc_y * 100));
 
-         if (x_coalesce_scroll_events)
+         if (mwheel_coalesce_scroll_events)
            dpyinfo->scroll.acc_x -= dpyinfo->scroll.x_per_char * nchars;
          else
            {
@@ -6100,7 +6100,7 @@ scroll_event (GtkWidget * widget, GdkEvent * event, gpointer * user_data)
                               make_float (-dpyinfo->scroll.acc_x * 100),
                               make_float (-dpyinfo->scroll.acc_y * 100));
 
-         if (x_coalesce_scroll_events)
+         if (mwheel_coalesce_scroll_events)
            dpyinfo->scroll.acc_x -= -dpyinfo->scroll.x_per_char * nchars;
          else
            {
@@ -6799,10 +6799,6 @@ If set to a non-float value, there will be no wait at all.  */);
   window_being_scrolled = Qnil;
   staticpro (&window_being_scrolled);
 
-  DEFVAR_BOOL ("x-coalesce-scroll-events", x_coalesce_scroll_events,
-              doc: /* SKIP: real doc in xterm.c.  */);
-  x_coalesce_scroll_events = true;
-
   /* Tell Emacs about this window system.  */
   Fprovide (Qpgtk, Qnil);
 }