Commit Graph

10 Commits

Author SHA1 Message Date
Ryan Lortie
93f17967e4 GActionGroupExporter: stop using signal IDs
GDBusConnection recently changed to dispatching its GDestroyNotify calls
from an idle instead of on-the-spot.  Under the previous regime, we
would destroy-notify the action group export of a GtkApplicationWindow
at the point it was removed from the application (ie: slightly before
being disposed).

With the destroy notify now deferred to an idle, the window has already
been disposed, so the signal handlers have already been disconnected.

Avoid the problem by dropping our use of signal IDs and just do
g_signal_handlers_disconnect_by_func(), which doesn't complain if there
is no connection.
2011-12-12 13:33:54 -05:00
Ryan Lortie
14900d37f4 action exporter: clarify threading situation
Exporting can only be done relative to a particular given main context
and all interaction with the action group must be on that same context.

Fix up the implementation so that the user can specify that context with
the normal (thread default) mechanism and document the limitation on the
API.

Adjust the testcase to adhere to the documentation limitations.  It
passes now.
2011-12-08 18:05:15 -05:00
Ryan Lortie
7af08e1fc0 action exporter: use GSource* instead of source id
Keep track of the GSource* of our event dispatch idle instead of using
source ID.
2011-12-08 18:05:15 -05:00
Ryan Lortie
64e3e10c98 action exporter: cancel pending events on unexport
If there are events pending when we unexport the action group, free them
and cancel the pending idle.
2011-12-08 18:05:15 -05:00
Ryan Lortie
4f2c207745 menu/action exporter docs fixup 2011-12-08 18:05:14 -05:00
Ryan Lortie
f7886d6adb Action group exporter: clean up the API
Make it look more like a typical GDBusConnection API with integer
registration ID and corresponding unexport call.  Kill the 'query' call.
2011-12-08 18:05:14 -05:00
Matthias Clasen
5002cb2935 Make stopping an action group export work 2011-12-08 18:05:13 -05:00
Matthias Clasen
cd22e1967d Describe the org.gtk.Actions interface
Even though we consider the interface to be an implementation
detail, we should have internal documentation for the interface.
2011-12-08 18:05:12 -05:00
Matthias Clasen
db34b1aebe Rename exporter APIs
There are no public 'exporter' objects, so don't allude to them
in the function names. At the same time, we want to make it clear
that these functions are D-Bus specific.

The new APIs are
g_action_group_dbus_export_start
g_action_group_dbus_export_query
g_action_group_dbus_export_stop
g_menu_model_dbus_export_start
g_menu_model_dbus_export_query
g_menu_model_dbus_export_stop
2011-12-08 18:05:12 -05:00
Ryan Lortie
940ec94f0a Add GActionGroup D-Bus exporter 2011-12-08 18:05:12 -05:00