Commit c25de336 authored by Albert Astals Cid's avatar Albert Astals Cid
Browse files

Error out if the device returns a negative number of buttons

btnx[1] is reporting a negative number of buttons in my machine (-87) so
ignore it instead of crashing (once we have negative buttons things quite don't work),
ignoring is not wrong since after all btnx is not a joystick


Reviewers: davidedmundson

Reviewed By: davidedmundson

Subscribers: plasma-devel

Tags: #plasma

Differential Revision:
parent 85d79c00
......@@ -184,6 +184,10 @@ JoyDevice::ErrorCode JoyDevice::open()
return JoyDevice::ERR_GET_CORR;
if (bt < 0) {
return JoyDevice::ERR_GET_BUTTONS;
descr = name;
joyFd = fd;
axes = ax;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment