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

Invalid field order on XResizeRequestEvent #1044

Closed
croudet opened this issue Dec 17, 2018 · 3 comments
Closed

Invalid field order on XResizeRequestEvent #1044

croudet opened this issue Dec 17, 2018 · 3 comments

Comments

@croudet
Copy link

croudet commented Dec 17, 2018

JNA version 5.1.0 and current

class XResizeRequestEvent extends Structure {

The field order annotation for XResizeRequestEvent has too much fields.

@FieldOrder({"type", "serial", "send_event", "display", "parent", "window", "x", "y", "width", "height", "border_width", "above", "detail", "value_mask"})
    class XResizeRequestEvent extends Structure {
        public int type;
        public NativeLong serial;   // # of last request processed by server
        public int send_event;      // true if this came from a SendEvent request
        public Display display;     // Display the event was read from
        public Window window;
        public int width, height;
    }
@matthiasblaesing
Copy link
Member

I created PR #1047 - it adds unittests for all X11 structures and found the problem you found. It seems to be the only one and will be fixed with that PR.

@croudet
Copy link
Author

croudet commented Dec 19, 2018

Thanks.

The only other thing I noticed is a duplicate field order declaration (annotation and createFieldOrder method call):

    @FieldOrder({"type", "serial", "send_event", "display", "window"})
    public static class XAnyEvent extends Structure {
        public static final List<String> FIELDS = createFieldsOrder();

@matthiasblaesing
Copy link
Member

Thank you for checking - there are more instances, that show the remains of the old code. These are left overs from the conversion. The code is not used - the static field would need to be returned from getFieldOrder and that is not the case. However it should be cleaned up and this is done now with the second commit.

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

No branches or pull requests

2 participants