ApplicationIndicator signal names not set in C#/Mono bindings

Bug #526620 reported by Sense Egbert Hofstede
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Application Indicators
Fix Released
Undecided
Unassigned

Bug Description

The signal names of the ApplicationIndicator class are empty for GLib. Therefore they are unusable in C#, you get error messages like:
"(test:12708): GLib-GObject-WARNING **: /build/buildd/glib2.0-2.23.4/gobject/gsignal.c:2199: signal `' is invalid for instance `0x15e3850'"

In that error message should have been the signal's detailed name, which is created by GLib in /gobject/gsignal.c:1533 with the following code: "g_strdelimit (name, G_STR_DELIMITERS ":^", '_'); /* FIXME do character checks like for types */"
The variable 'name' is a 'const gchar *signal_name', the first argument of g_signal_new().

Indicator Application's C library defines the signal_name of e.g. the signal 'connection_changed' as using the define APP_INDICATOR_SIGNAL_CONNECTION_CHANGED, which is set "connection-changed" in the header file. However, on all other places "connection_changed" -- an underscore instead of a hyphen -- is used, including in /bindings/mono/libappindicator-api.metadata and in the fourth argument of g_signal_new(): 'G_STRUCT_OFFSET (AppIndicatorClass, connection_changed)'.

However, changing the value of APP_INDICATOR_SIGNAL_CONNECTION_CHANGED to "connection_changed" doesn't solve the bug: the same error message as mentioned previously is written to the console.

Related branches

Revision history for this message
Sense Egbert Hofstede (sense) wrote :

Attaching the code that, when compiled, generates the error message mentioned above.

Revision history for this message
Sense Egbert Hofstede (sense) wrote :

I'm attaching the GAPI generated ApplicationIndicator.cs file, in which you can clearly see that the events aren't working.
Example:

  [GLib.Signal("")]
  public event AppIndicator.NewAttentionIconHandler NewAttentionIcon {
   add {
    GLib.Signal sig = GLib.Signal.Lookup (this, "", typeof (AppIndicator.NewAttentionIconArgs));
    sig.AddDelegate (value);
   }
   remove {
    GLib.Signal sig = GLib.Signal.Lookup (this, "", typeof (AppIndicator.NewAttentionIconArgs));
    sig.RemoveDelegate (value);
   }
  }

Revision history for this message
Sense Egbert Hofstede (sense) wrote :

I'm working on this, I've nearly got the bug already.

Changed in indicator-application:
assignee: nobody → Sense Hofstede (qense)
status: New → In Progress
Revision history for this message
Sense Egbert Hofstede (sense) wrote :

Fix committed, I'm filing a merge request.
The code was tested and all signals work now, apart from the connection-changed signal, which is never emitted.

Changed in indicator-application:
assignee: Sense Hofstede (qense) → nobody
status: In Progress → Confirmed
Changed in indicator-application:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.