Signal.Handler: correct flag check (#233)

This commit is contained in:
Sergii Fesenko 2021-03-27 20:11:59 +02:00 committed by GitHub
parent a23d44fb82
commit 9be7e092a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -211,11 +211,10 @@ namespace GLib {
public Delegate Handler {
get {
InvocationHint hint = (InvocationHint) Marshal.PtrToStructure (g_signal_get_invocation_hint (obj.Handle), typeof (InvocationHint));
if (hint.run_type == Flags.RunFirst)
return before_handler;
else
return after_handler;
var hint = (InvocationHint) Marshal.PtrToStructure (g_signal_get_invocation_hint (obj.Handle), typeof (InvocationHint));
return hint.run_type.HasFlag(Flags.RunFirst)
? before_handler
: after_handler;
}
}