There is only one explicit ordering guarantee for GObject signals:
- the class closure added when creating a new signal with
G_SIGNAL_RUN_FIRST
will be called before all callbacks added using g_signal_connect()
- the class closure added when creating a new signal eith
G_SIGNAL_RUN_LAST
will be called after all callbacks added using g_signal_connect()
and before all callbacks added using g_signal_connect_after()
This means that you can only control whether a callback is invoked before or after all other callbacks connected manually when you're creating a new signal - for obvious reasons, since you may want to provide an initial state at the start of an emission chain, or you want to ensure a stable state at the end of an emission chain.
As for the order of the callbacks added using g_signal_connect()
, there is no explicit guarantee of any ordering. There's an implicit order, the order of connection, though, that won't likely ever be changed. Remember that signal handlers can install new handlers, or disconnect them, or block the signal emission, so relying on a specific order is usually an indication of a design problem in the code.