<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_UNCONFIRMED "
   title="UNCONFIRMED - libinput keep open motion sensor input device"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=91563#c6">Comment # 6</a>
              on <a class="bz_bug_link 
          bz_status_UNCONFIRMED "
   title="UNCONFIRMED - libinput keep open motion sensor input device"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=91563">bug 91563</a>
              from <span class="vcard"><a class="email" href="mailto:dev@mgautier.fr" title="Matthieu Gautier <dev@mgautier.fr>"> <span class="fn">Matthieu Gautier</span></a>
</span></b>
        <pre>Created <span class=""><a href="attachment.cgi?id=118007" name="attach_118007" title="patch to add to linux tree, to add INPUT_PROP_ACCELEROMETER">attachment 118007</a> <a href="attachment.cgi?id=118007&action=edit" title="patch to add to linux tree, to add INPUT_PROP_ACCELEROMETER">[details]</a></span>
patch to add to linux tree, to add INPUT_PROP_ACCELEROMETER

Sorry for my silence but, as said Bastien, I was away.
(And, as I'm leaving again, I'll be silent for the next few weeks..)


Indeed, the tag INPUT_PROP_ACCELEROMETER is missing in applesmc. Adding it [1]
doesn't fix the problem. It shows that it is more complex that it seems ...

With the tag INPUT_PROP_ACCELEROMETER, a recent systemd version (>219, the
fedora22 version[2]) properly add the udev ID_INPUT_ACCELEROMETER=1 tag.

With this tag, libinput still open the device. However, it seems to be the
right thing to do. Gnome(-shell?) now detect the device is a accelerometer and
display a button to deactivate screen rotation, so we should keep the device
open.

So I've add a custom udev rules to remove the udev ID_INPUT (and
ID_INPUT_ACCELEROMETER) tag:

SUBSYSTEM=="input" ATTRS{properties}=="40" ENV{ID_INPUT}=""
ENV{ID_INPUT_ACCELEROMETER}=""

Without a ID_INPUT, libinput should ignore the device, but.. it doesn't.
The device is still open, but it seems to be never closed.
Each time, I go back to gdm (close user session), the device is open one more
time. lsof report each time that the gnome-shell process open N time the same
device.

I have still not found why. Once I'll go back, I'll investigate this again.

[1] I haven't submit my patch to kernel, but just apply the attached patch to
linux tree if you what to test.

[2] If you what to test with 219 systemd version, you can add a custom rules to
add the ID_INPUT_ACCELEROMETER yourself :
SUBSYSTEM=="input" ATTRS{properties}=="40" ENV{ID_INPUT_ACCELEROMETER}="1"</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>