diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2006-01-24 20:01:23 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2006-01-24 20:01:23 +0800 |
commit | 21086fc06ec3d08e3c5609cc53383e7c18fd2175 (patch) | |
tree | d1369c22bd13556991212cba3dec47f1ea525fd4 | |
parent | fa5456904722028972f1bbebdbb196c2cfd2e521 (diff) | |
download | gsoc2013-epiphany-21086fc06ec3d08e3c5609cc53383e7c18fd2175.tar gsoc2013-epiphany-21086fc06ec3d08e3c5609cc53383e7c18fd2175.tar.gz gsoc2013-epiphany-21086fc06ec3d08e3c5609cc53383e7c18fd2175.tar.bz2 gsoc2013-epiphany-21086fc06ec3d08e3c5609cc53383e7c18fd2175.tar.lz gsoc2013-epiphany-21086fc06ec3d08e3c5609cc53383e7c18fd2175.tar.xz gsoc2013-epiphany-21086fc06ec3d08e3c5609cc53383e7c18fd2175.tar.zst gsoc2013-epiphany-21086fc06ec3d08e3c5609cc53383e7c18fd2175.zip |
Use DBUS_NAME_FLAG_DO_NOT_QUEUE when requesting the name, and also handle
2006-01-24 Christian Persch <chpe@cvs.gnome.org>
* src/ephy-dbus.c: (ephy_dbus_connect_to_session_bus):
Use DBUS_NAME_FLAG_DO_NOT_QUEUE when requesting the name,
and also handle unexpected request return values.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | src/ephy-dbus.c | 19 |
2 files changed, 18 insertions, 8 deletions
@@ -1,3 +1,10 @@ +2006-01-24 Christian Persch <chpe@cvs.gnome.org> + + * src/ephy-dbus.c: (ephy_dbus_connect_to_session_bus): + + Use DBUS_NAME_FLAG_DO_NOT_QUEUE when requesting the name, + and also handle unexpected request return values. + 2006-01-23 Crispin Flowerday <gnome@flowerday.cx> * src/bookmarks/ephy-open-tabs-action.c: (node_added_cb): diff --git a/src/ephy-dbus.c b/src/ephy-dbus.c index ea33a076b..214a8452e 100644 --- a/src/ephy-dbus.c +++ b/src/ephy-dbus.c @@ -35,6 +35,11 @@ #define DBUS_NAME_FLAG_PROHIBIT_REPLACEMENT 0 #endif +/* dbus < 0.6 compat */ +#ifndef DBUS_NAME_FLAG_DO_NOT_QUEUE +#define DBUS_NAME_FLAG_DO_NOT_QUEUE 0 +#endif + #define RECONNECT_DELAY 3000 #define EPHY_DBUS_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), EPHY_TYPE_DBUS, EphyDbusPrivate)) @@ -275,7 +280,8 @@ ephy_dbus_connect_to_session_bus (EphyDbus *ephy_dbus, if (!org_freedesktop_DBus_request_name (proxy, DBUS_EPHY_SERVICE, - DBUS_NAME_FLAG_PROHIBIT_REPLACEMENT, + DBUS_NAME_FLAG_PROHIBIT_REPLACEMENT | + DBUS_NAME_FLAG_DO_NOT_QUEUE, &request_ret, error)) { /* We have a BIG problem! */ @@ -283,19 +289,16 @@ ephy_dbus_connect_to_session_bus (EphyDbus *ephy_dbus, return FALSE; } - if (request_ret == DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) + if (request_ret == DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER || + request_ret == DBUS_REQUEST_NAME_REPLY_ALREADY_OWNER) { ephy_dbus->priv->is_session_service_owner = TRUE; } - else if (request_ret == DBUS_REQUEST_NAME_REPLY_EXISTS) + else if (request_ret == DBUS_REQUEST_NAME_REPLY_EXISTS || + request_ret == DBUS_REQUEST_NAME_REPLY_IN_QUEUE) { ephy_dbus->priv->is_session_service_owner = FALSE; } - else - { - /* FIXME can this happen? */ - g_assert_not_reached (); - } LOG ("Instance is %ssession bus owner.", ephy_dbus->priv->is_session_service_owner ? "" : "NOT "); |