-
Notifications
You must be signed in to change notification settings - Fork 80
fix for julia v1.5; jl_function_ptr
was removed
#512
Conversation
src/events.jl
Outdated
else | ||
ret = ccall(closure.callback, Cint, (Ptr{GObject}, Ptr{GdkEventMotion}, Any), p, eventp, closure.closure) | ||
end | ||
ret = closure.callback.f(p, eventp, closure.closure) |
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.
ret = closure.callback.f(p, eventp, closure.closure) | |
ret = closure.callback(p, eventp, closure.closure) |
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.
This would be preferable to avoid increasing yet more the dependence on internal design details.
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.
I agree. I don't think we have a call overload for CFunction
though.
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.
No, but let's just not allocate it then
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.
Oh, wait a minute, is this only called from julia? Why was it using cfunction
in the first place? @tknopp any reason?
With ProfileView I get a long inference stacktrace from @JeffBezanson's version, and with @vtjnash's I get julia> FATAL ERROR: Gtk state corrupted by error thrown in a callback:
ERROR: MethodError: objects of type Base.CFunction are not callable
Stacktrace:
[1] notify_motion(::Ptr{GObject}, ::Ptr{Gtk.GdkEventMotion}, ::Gtk.Gtk_signal_motion{GtkReactive.MouseHandler{GtkReactive.UserUnit}}) at /home/tim/.julia/dev/Gtk/src/events.jl:46
[2] (::Gtk.var"#237#238")() at /home/tim/.julia/dev/Gtk/src/events.jl:2
[3] g_sigatom(::Any) at /home/tim/.julia/dev/Gtk/src/GLib/signals.jl:176
[4] gtk_main() at /home/tim/.julia/dev/Gtk/src/events.jl:1 |
Looking into it. |
Works on 1.5 --- the inference issue is due to a recent change on master. |
Thanks a lot for having a look into this. Especially nice is that we do not need to change the public interface. Would be interesting how "bad" you would consider this workaround. As far a I can see you are using a generated function to move the call to |
I don't think it's that bad. Certainly better than calling an internal C function, so for purposes of keeping the current API it's fine. |
Do you want this merged as-is or do you want #512 (comment) and/or other changes? |
Note that arm64 is failing on Drone because tests that were broken aren't anymore:
armv7l is failing at init time instead:
|
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.
Yeah, looks good. Eventually, this package should probably consider ceasing to use the cfunction_
hack entirely, but it's not immediately necessary to edit the other code.
@tknopp, with apologies to you I presumed to release 1.1.4, so it doesn't hold back progress on the Julia 1.5 release. |
That is just fine. Wanted to have a look at this right now but am happy that things are already done. |
This seems to work well enough for now as a workaround; ImageView.jl works at least. Would be good to try some more Gtk apps to confirm whether it works. I wanted to to just un-break 1.5, and we can work on a redesign later.