linux-surface / iptsd

Userspace daemon for Intel Precise Touch & Stylus
GNU General Public License v2.0
86 stars 39 forks source link

narrowing_error #68

Closed quo closed 1 year ago

quo commented 1 year ago

For me, the current iptsd immediately crashes on touch with a narrowing_error.

The problem is in touch-manager: https://github.com/linux-surface/iptsd/blob/8a187c578e0f31e91dfdc3a456858acc2724240d/src/daemon/touch-manager.cpp#L74-L81

As far as I can tell, this->diagonal is initialized to zero and never changed anywhere. So d1, d2, major, and minor are all infinity, and the narrow fails.

Replacing this->diagonal by processor.diagonal() works (but I'm not entirely sure it's the correct fix).

StollD commented 1 year ago

Wow, yeah, thats kind of a stupid mistake that I made. Its been there for months (since I added support for the basic touch processing). I also was pretty sure I tested the code after I added the narrowing, but idk, maybe I got some stupid edgecase.

Your fix is correct, thank you.