<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - libinput ignores xinput settings regarding mouse wheel (quick fix included)"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=105830">105830</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>libinput ignores xinput settings regarding mouse wheel (quick fix included)
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Wayland
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>libinput
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>wayland-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>sblachmann@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>PROBLEM:
libinput ignores settings done by "xinput set-button-map" that set wheels to
zero to deactivate them.

For details, please see: <a href="http://forums.debian.net/viewtopic.php?f=6&t=137104">http://forums.debian.net/viewtopic.php?f=6&t=137104</a>
Bug <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED NOTOURBUG - Mouse wheel tilt is remapped to vertical scroll"
   href="show_bug.cgi?id=104960">https://bugs.freedesktop.org/show_bug.cgi?id=104960</a> is possibly also
influenced by this issue.

CAUSE:
My investigation showed what causes the bug.
The problem is in libinput.c.
Please look at the comments added by me to understand the problem.

SOLUTION:
My quick fix factually just consisted of disabling the wheel by always
returning zero movement.
A *proper* fix would check whether the wheel is enabled at all in the button
map set by xinput or xorg.conf, and discard the events if wheel is disabled.

<<<CODE SNIPPET START>>>
LIBINPUT_EXPORT double
libinput_event_pointer_get_axis_value_discrete(struct libinput_event_pointer
*event,
                                               enum libinput_pointer_axis axis)
{
        struct libinput *libinput = event->base.device->seat->libinput;
        double value = 0;

        require_event_type(libinput_event_get_context(&event->base),
                           event->base.type,
                           0.0,
                           LIBINPUT_EVENT_POINTER_AXIS);

        if (!libinput_event_pointer_has_axis(event, axis)) {
                log_bug_client(libinput, "value requested for unset axis\n");
        } else {
                switch (axis) {
                case LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL:
                        value = event->discrete.x;
                        break;
                case LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL:
                        value = event->discrete.y;
                        break;
                }
        }
//      return value;
//      
//      YUCKY BUG HERE: xinput-disabled wheels will generate events
//      FIX by checking xinput button map
//      for now just FSCK THE SCROLL SH!T

        return 0;
}

LIBINPUT_EXPORT enum libinput_pointer_axis_source
libinput_event_pointer_get_axis_source(struct libinput_event_pointer *event)
{
        require_event_type(libinput_event_get_context(&event->base),
                           event->base.type,
                           0,
                           LIBINPUT_EVENT_POINTER_AXIS);

//      return event->source;
//      
//      YUCKY BUG HERE: xinput-disabled wheels will generate events
//      FIX by checking xinput button map
//      for now just FSCK THE SCROLL SH!T

        return 0;
}
<<<CODE SNIPPET END>>></pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>