After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 697601 - reduce GMenuModel D-Bus traffic
reduce GMenuModel D-Bus traffic
Status: RESOLVED OBSOLETE
Product: glib
Classification: Platform
Component: gapplication
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2013-04-09 03:30 UTC by Allison Karlitskaya (desrt)
Modified: 2018-05-24 15:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GMenuModel exporter: group change signals (6.69 KB, patch)
2013-04-09 03:31 UTC, Allison Karlitskaya (desrt)
reviewed Details | Review
GMenu: add g_menu_remove_all() API (1.75 KB, patch)
2013-04-09 03:31 UTC, Allison Karlitskaya (desrt)
committed Details | Review

Description Allison Karlitskaya (desrt) 2013-04-09 03:30:58 UTC
Here are two fixes that should help to reduce the amount of traffic sent
over D-Bus when applications change their menus.

The first is a patch to group changes into one signal sent from an idle
(along with a testcase to make sure it's working).

The next is a new API: g_menu_remove_all().  This prevents one from
having to repeatedly call g_menu_remove() with each possible index.
Comment 1 Allison Karlitskaya (desrt) 2013-04-09 03:31:31 UTC
Created attachment 241008 [details] [review]
GMenuModel exporter: group change signals

The GMenuModel D-Bus protocol has always supported grouping of change
signals.

We originally wanted to avoid potentially sending change signals for
menus and actions out of sync with each other in order to avoid the case
of menuitem being created for an action that did not yet exist on the
remote side.

We considered some rather exotic methods of dealing with this
out-of-order issue including "reservations" on GDBusConnections for who
would send the next message, but they all fell through.

For this reason, the grouping feature of the protocol was never used: we
were always sending one event per signal.

As it turns out, the order in which menuitems and actions show up on the
remote is not very important so we don't have to worry about this
problem anymore.  This patch implements the grouping (which is fairly
easy because the code was specifically designed for this possibility).
Comment 2 Allison Karlitskaya (desrt) 2013-04-09 03:31:34 UTC
Created attachment 241009 [details] [review]
GMenu: add g_menu_remove_all() API

Removes all of the items from a GMenu.  The keyboard indicator wants to
do this as part of refreshing the layout list, as an example.
Comment 3 Matthias Clasen 2013-04-09 22:42:36 UTC
Review of attachment 241008 [details] [review]:

Looks reasonable - does it break the shell or unity ?
Comment 4 Matthias Clasen 2013-04-09 22:43:43 UTC
Review of attachment 241009 [details] [review]:

Yes. Just add it to the docs too, please
Comment 5 Allison Karlitskaya (desrt) 2013-04-19 18:53:07 UTC
Comment on attachment 241009 [details] [review]
GMenu: add g_menu_remove_all() API

Attachment 241009 [details] pushed as 1de0625 - GMenu: add g_menu_remove_all() API
Comment 6 GNOME Infrastructure Team 2018-05-24 15:09:55 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/687.