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

eventmask type conflict #9

Open
aeosynth opened this issue Jul 19, 2016 · 3 comments
Open

eventmask type conflict #9

aeosynth opened this issue Jul 19, 2016 · 3 comments
Labels
enhancement help wanted incomplete-gir Weirdness caused by wrong or missing GIR data

Comments

@aeosynth
Copy link

Gdk::WindowAttr.new(
  event_mask: Gdk::EventMask::ZERO_NONE
  )
no overload matches 'Gdk::WindowAttr.new', event_mask: LibGdk::EventMask
Overloads are:
 - Gdk::WindowAttr.new(title : String | Nil = nil, event_mask : Int32 | Nil = nil, x : Int32 | Nil = nil, y : Int32 | Nil = nil, width : Int32 | Nil = nil, height : Int32 | Nil = nil, wclass : Gdk::WindowWindowClass | Nil = nil, visual : Gdk::Visual | Nil = nil, window_type : Gdk::WindowType | Nil = nil, cursor : Gdk::Cursor | Nil = nil, wmclass_name : String | Nil = nil, wmclass_class : String | Nil = nil, override_redirect : Bool | Nil = nil, type_hint : Gdk::WindowTypeHint | Nil = nil)
 - Gdk::WindowAttr.new(gdk_window_attr : ::Pointer(LibGdk::WindowAttr))

also the flags have type UInt32, but WindowAttr wants them as Int32

@jhass
Copy link
Owner

jhass commented Jul 19, 2016

Apparently you're not supposed to set this directly but use gdk_window_set_events / Gdk::Window#events=

window.events = Gdk::EventMask::ZERO_NONE

There's no member for it in GdkWindowAttributesType, so setting it directly in the attributes passed to gdk_window_new has no effect anyway presumably.

Given the documentation of that field lists it as gint too, generating something else could probably lead to incorrect code. Unfortunately I see nothing in GIStructInfo or GIFieldInfo to determine that the field is private, worse, if that argument is generated it means it's marked as writable (as per GIFieldInfoFlags). So I currently have no idea how to hide it from the wrapper, other than starting to maintain a blacklist.

@aeosynth
Copy link
Author

Apparently you're not supposed to set this directly

i imagine the docs would say so, like they do for wmclass_name:

https://developer.gnome.org/gdk3/stable/gdk3-Windows.html#GdkWindowAttr

gchar *wmclass_name;
don’t use (see gtk_window_set_wmclass())

.

There's no member for it in GdkWindowAttributesType, so setting it directly in the attributes passed to gdk_window_new has no effect anyway presumably.

https://developer.gnome.org/gdk3/stable/gdk3-Windows.html#GdkWindowAttributesType:

Fields in GdkWindowAttr not covered by a bit in this enum are required; for example, the width /height , wclass , and window_type fields are required, they have no corresponding flag in GdkWindowAttributesType.

@jhass
Copy link
Owner

jhass commented Jul 20, 2016

i imagine the docs would say so, like they do for wmclass_name

They do?

gint event_mask; event mask (see gdk_window_set_events())

I took the "for example" as obligatory and the list of required attributes there as actually complete. More importantly as I already said the field is a gint and GdkEventMask is a guint, but more importantly an enum type. It's impossible to generate code that handles this correctly, there's no indication whatsoever in the typelib that the as gint marked field event_mask is supposed to receive a as guint typed enum called GdkEventMask. Unless I'm overlooking something, if so please do point it out.

@jhass jhass added enhancement incomplete-gir Weirdness caused by wrong or missing GIR data labels Oct 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement help wanted incomplete-gir Weirdness caused by wrong or missing GIR data
Projects
None yet
Development

No branches or pull requests

2 participants