Skip to content
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

Possible parentheses missing in code in on_device_removed and on_device_added, in callbacks.c #188

Closed
pascal-niklaus opened this issue Feb 22, 2024 · 1 comment
Labels

Comments

@pascal-niklaus
Copy link
Contributor

I did not notice any actual misbehavior, but the following code seems odd:

callbacks.c: 578:

  if(!gdk_device_get_device_type(device) == GDK_DEVICE_TYPE_MASTER
     || gdk_device_get_n_axes(device) < 2)
    return;

same again on line 664 (on_device_added).

This would evaluate to TRUE when gdk_device_get_device_type returns values > 0, since GDK_DEVICE_TYPE_MASTER is 0.

If this is correct, maybe better write as gdk_device_get_device_type(device) != GDK_DEVICE_TYPE_MASTER) or
!(gdk_device_get_device_type(device) == GDK_DEVICE_TYPE_MASTER).

@bk138
Copy link
Owner

bk138 commented Feb 22, 2024

That's right, would you like to open a PR changing this to != ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants