-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate the class given in class if not explicitly given #792
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1362,7 +1362,17 @@ libwacom_get_height(const WacomDevice *device) | |
LIBWACOM_EXPORT WacomClass | ||
libwacom_get_class(const WacomDevice *device) | ||
{ | ||
return device->cls; | ||
if (device->cls != WCLASS_UNKNOWN) { | ||
return device->cls; | ||
} | ||
if (device->integration_flags & WACOM_DEVICE_INTEGRATED_DISPLAY && | ||
device->integration_flags & WACOM_DEVICE_INTEGRATED_SYSTEM) { | ||
return WCLASS_ISDV4; | ||
} | ||
if (device->integration_flags & WACOM_DEVICE_INTEGRATED_DISPLAY) { | ||
return WCLASS_CINTIQ; | ||
} | ||
return WCLASS_BAMBOO; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the Then again there's so few of them that we can mark those in the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, come to think of it: this is better as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For the archives: |
||
} | ||
|
||
LIBWACOM_EXPORT int | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is i think a bit more readable.
(oh, and I always like to have
()
around any bitwise operations, it makes the code a bit more readable)