Commit Graph

2687 Commits

Author SHA1 Message Date
Ryan Lortie
e5ed11bcf8 Revert "GDBusActionGroup: add static platform registration"
This reverts commit fcc9902e98.
2011-12-16 21:25:57 -05:00
Ryan Lortie
e370631f46 GApplication: emit signals on action changes
Now that we're a GActionMap the story about propagating signals from our
(now-constant) internal action group is vastly simplified.  If someone
calls g_application_set_action_group() then signals will stop working --
but this function is deprecated and they never worked before, so no big
loss there.

https://bugzilla.gnome.org/show_bug.cgi?id=643736
2011-12-16 11:43:59 -05:00
Ryan Lortie
fcc9902e98 GDBusActionGroup: add static platform registration
We provide a mechanism by which a 'platform' (eg: Gtk) can register some
hook functions to be called to collect platform-data at the point of
sending an outgoing action activation request and also to inform the
platform of this data on incoming requests (before and after dispatching
the actual request).

This can be used for forwarding timestamp and startup-notification
information (as is presently done in GApplication) but the before/after
hook could also be used for acquiring/releasing the Gdk lock or other
similar things.

https://bugzilla.gnome.org/show_bug.cgi?id=665737
2011-12-16 10:54:42 -05:00
Colin Walters
63e69b4958 GDBusActionGroup: Fix a typo in docs 2011-12-15 09:47:37 -05:00
Chris Coulson
162bafee37 Initialize service_loop before running the service thread
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666129
2011-12-14 21:15:35 -05:00
Matthias Clasen
a6eda97d8e menu markup: tolerate not having a hash table of objects
Various places in the code were assuming that the hash table was always
available. Fix this, and also avoid leaking strings now that the hash
table may be NULL.

Based on a patch by Simon McVittie, bug 666167
2011-12-14 21:05:38 -05:00
Simon McVittie
a1bd6e0717 tls-interaction test: use a weak pointer instead of a deliberate use-after-free
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666115
Reviewed-by: Dan Winship <danw@gnome.org>
2011-12-14 15:59:29 +00:00
Ryan Lortie
0a7930d048 gdbus tests: remove buggy use of GMainLoop
g_main_loop_quit() only quits mainloops that are currently running --
not ones that may run in the future.  The way the gdbus-threading tests
are written can possibly result in a call to g_main_loop_quit() before
g_main_loop_run() has started.

The mainloops aren't actually used for anything other than signalling
the completion of the threads, so just use g_thread_join() for that.

https://bugzilla.gnome.org/show_bug.cgi?id=666129
2011-12-14 09:33:30 -05:00
Simon McVittie
995a2eb50b Plug some leaks in the GIO tests
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666115
Reviewed-by: Matthias Clasen <mclasen@redhat.com>
2011-12-14 12:41:15 +00:00
Simon McVittie
fedc0cff51 Revert "g_menu_markup_start_element: tolerate not having a hash table of objects"
This reverts commit bcdb606411,
accidentally pushed before it was reviewed.
2011-12-14 12:39:06 +00:00
Simon McVittie
bcdb606411 g_menu_markup_start_element: tolerate not having a hash table of objects
I don't know whether this is the right fix, but gio/tests/gmenumodel
crashes out, which can't be right.
2011-12-14 12:31:31 +00:00
Simon McVittie
a48edddc19 GDBusActionGroup: don't leak param_str
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666113
Reviewed-by: Matthias Clasen <mclasen@redhat.com>
2011-12-14 12:26:17 +00:00
Simon McVittie
fbab468da5 g_dbus_action_group_changed: don't leak iterator and its contents
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666113
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-12-14 12:26:16 +00:00
Matthias Clasen
b386d9ffb7 Add another menu parser test
This one concerns itself with objects.
2011-12-14 00:10:34 -05:00
Matthias Clasen
b153e38ff0 GMenuModel: Flesh out the docs some more 2011-12-13 23:16:25 -05:00
Matthias Clasen
c14a3b3e9c GMenu: purge references to GMenuProxy from the docs 2011-12-13 23:06:16 -05:00
Christophe Fergeau
f3dde2d405 gnetworkmonitornetlink.c: Fix compilation on RHEL 6.2
When trying to compile glib master on a RHEL 6.2 system, it fails with:

make[4]: Entering directory `/home/teuf/gnome/src/glib/gio'
  CC     libgio_2_0_la-gnetworkmonitornetlink.lo
In file included from gnetworkmonitornetlink.c:25:
/usr/include/linux/netlink.h:35: error: expected specifier-qualifier-list before 'sa_family_t'
gnetworkmonitornetlink.c: In function 'g_network_monitor_netlink_initable_init':
gnetworkmonitornetlink.c:99: error: 'struct sockaddr_nl' has no member named 'nl_family'
gnetworkmonitornetlink.c💯 error: 'struct sockaddr_nl' has no member named 'nl_pid'
gnetworkmonitornetlink.c💯 error: 'struct sockaddr_nl' has no member named 'nl_pad'
gnetworkmonitornetlink.c:101: error: 'struct sockaddr_nl' has no member named 'nl_groups'
make[4]: *** [libgio_2_0_la-gnetworkmonitornetlink.lo] Error 1

sa_family_t is defined in sys/socket.h, this commit makes sure this header is included before netlink.h

This fixes bgo bug #666001
2011-12-13 16:40:34 +01:00
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
bbae5fe941 GMenuMarkup parser: small typo fix in docs 2011-12-12 13:13:42 -05:00
Ryan Lortie
b8cde0b507 More clearly define 'named menu' in the XML parser
This is when menus have id='' attributes.
2011-12-12 13:08:48 -05:00
Ryan Lortie
60bcb36783 GMenu parser: use G_MARKUP_COLLECT_BOOLEAN
...instead of trying to parse the boolean for ourselves.
2011-12-12 13:07:04 -05:00
Matthias Clasen
4f5732f721 GApplication: fix a copy-paste error
Activating an action must not turn into a change-state request.
2011-12-12 01:44:41 -05:00
Matthias Clasen
dec7ed8aba Rearrange GApplication long desc a bit 2011-12-12 00:01:20 -05:00
Matthias Clasen
e242413847 Expand actiongroup docs a bit more 2011-12-12 00:00:16 -05:00
Matthias Clasen
840482658a Fix an assertion when activating apps a second time
This was causing the following critical when running bloatpad twice:
GLib-CRITICAL **: g_hash_table_insert_internal: assertion `hash_table != NULL' failed
2011-12-11 12:05:23 -05:00
Matthias Clasen
f40de4b152 Add some more since tags 2011-12-10 22:14:34 -05:00
Matthias Clasen
f0eb58075a Add a since tag 2011-12-10 21:55:11 -05:00
Matthias Clasen
2d6d127c96 Whitespace fixes
And add some missing since tags.
2011-12-10 21:46:39 -05:00
Matthias Clasen
f109415d95 Add since tags 2011-12-10 20:47:22 -05:00
Ryan Lortie
829b4dfb43 Clean up GApplication docs
Clean up the docs for GApplication and related classes.

I'm no longer writing documentation for the structure type of classes
and interfaces.  See https://bugzilla.gnome.org/show_bug.cgi?id=665926
for discussin on the correct way forward on this point.

Also: stop putting gtk-doc comments in installed headers.
2011-12-10 17:23:28 -05:00
Colin Walters
4eeac41d7d gfile: Don't use C++ keyword "template" as variable name
This breaks autotestkeyword.cc from gtk+.
2011-12-09 11:13:23 -05:00
Aleksander Morgado
8fcb73b0a9 gdbus-codegen: fix typo in generated documentation
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=665858
2011-12-09 15:18:25 +01:00
Thomas Hindoe Paaboel Andersen
721667399a GFile: add g_file_new_temp
A convenience function that creates a temporary file and returns
a GFile and GFileIOStream for it.

The file is created using g_file_open_tmp.

https://bugzilla.gnome.org/show_bug.cgi?id=657085
2011-12-09 08:58:05 -05:00
Matthias Clasen
8d428e3cc4 GApplication: Make ::startup run-first
https://bugzilla.gnome.org/show_bug.cgi?id=665817
2011-12-08 23:46:32 -05:00
Ryan Lortie
a65429cf44 gio.symbols fixes 2011-12-08 18:07:50 -05:00
Ryan Lortie
a6366dc289 GDBusActionGroup: make API just like GDBusMenuModel
Have one simple _get() API that returns the group immediately, in an
empty state.  The group is initialised on the first attempt to interact
with it.

Leave a secret 'back door' for GApplication to do a blocking
initialisation.
2011-12-08 18:07:47 -05:00
Ryan Lortie
0fdd9985bb GDBusActionGroup: drop ability to 'inject'
Also drop the GDBusActionGroupFlags that were only meant to facilitate
injection-based usage.
2011-12-08 18:05:15 -05:00
Matthias Clasen
caa6287f39 More documentation fixes 2011-12-08 18:05:15 -05:00
Matthias Clasen
04aab0cd46 Fix up docs 2011-12-08 18:05:15 -05:00
Matthias Clasen
39bebbed82 Don't use deprecated GApplication api in examples 2011-12-08 18:05:15 -05:00
Ryan Lortie
13e084437b GDBusMenuModel: become thread-aware
Allow imports of the same menu on multiple different main contexts at
the same time by creating a separate object for each context.
2011-12-08 18:05:15 -05:00
Ryan Lortie
25ffde957c menu threaded test: run the mainloop after export
GDBusConnection now dispatches GDestroyNotify calls back to the
mainloop.  Adding an idle to the mainloop is O(n) in the number of idles
already there.  We therefore need to periodically empty the mainloop to
avoid quadratic behaviour with a very large 'n'.
2011-12-08 18:05:15 -05:00
Ryan Lortie
1c036cb9f5 Rename GMenuProxy to GDBusMenuModel
This improves consistency with GDBusActionGroup.
2011-12-08 18:05:15 -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
21aca44ee1 GMenuModel exporter: remove workaround
With Bug 665733 fixed, we can remove the workaround (which was causing
thread safety problems).
2011-12-08 18:05:15 -05:00
Matthias Clasen
328bf4616a Add testcase for threaded menu exporter use
This currently fails
2011-12-08 18:05:14 -05:00
Matthias Clasen
f1a403e809 Add a test for multithreaded action group exporter use 2011-12-08 18:05:14 -05:00
Ryan Lortie
77f6e6a97f GApplication dbus: publish the menus again 2011-12-08 18:05:14 -05:00