mbuesch / razer

Razer device library and tools
http://bues.ch/h/razercfg
GNU General Public License v2.0
250 stars 50 forks source link

udev: Only rescan if the removed device is from Razer #135

Closed GrantM11235 closed 4 years ago

GrantM11235 commented 4 years ago

This fixes the first bug that I described in #134

mbuesch commented 4 years ago

Thanks for your pull request. I'm unsure whether this change is a good idea. I originally implemented it like this, because it did not work with specific vendor-id. Maybe there was a change in some udev version? This might break for users of older udev, if that is the case.

GrantM11235 commented 4 years ago

After extensive testing, I have discovered that the original patch doesn't actually work :facepalm:. I'm not sure how I didn't notice this before, I guess I didn't reloaded my udev rules.

When a USB device is removed, ATTRS{idVendor} can't be used. Luckily, ENV{PRODUCT} works and contains the vendor id, so we can use that with a wildcard.

I have tested this with:

On Debian 8 and 9 the automatic scan runs, but it doesn't detect that the mouse was actually removed until the next time a scan is run, either manually or automatically. This bug is present in the master branch as well.

mbuesch commented 4 years ago

Do you plan to do more changes in the near future? If not, I'm going to release the next version soon, to get the razerd fixes out.

GrantM11235 commented 4 years ago

I don't have any more changes planned, feel free to release the next version whenever you are ready.

mbuesch commented 4 years ago

Great, thanks!

mbuesch commented 4 years ago

Included in version 0.42.