diff options
| author | Nathan Lee <2431820-nathanal@users.noreply.gitlab.com> | 2019-08-31 02:49:22 +0000 |
|---|---|---|
| committer | Nathan Lee <2431820-nathanal@users.noreply.gitlab.com> | 2019-08-31 02:49:22 +0000 |
| commit | ba7fb61f5a36f170046fda2a701c93ea37a2e9e1 (patch) | |
| tree | 0b909dbeb9ec40339110c8d2f949e827d3627742 /src/extension/dbus/dbus-init.cpp | |
| parent | Improvements and bug fixes to XMLDialog (diff) | |
| download | inkscape-ba7fb61f5a36f170046fda2a701c93ea37a2e9e1.tar.gz inkscape-ba7fb61f5a36f170046fda2a701c93ea37a2e9e1.zip | |
Only register desktop on Dbus once
Based off Guiu Rocafort Ferrer's patch/findings.
See https://gitlab.com/inkscape/inkscape/issues/195.
Diffstat (limited to '')
| -rw-r--r-- | src/extension/dbus/dbus-init.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/extension/dbus/dbus-init.cpp b/src/extension/dbus/dbus-init.cpp index 30f9fa1dc..c83caacc1 100644 --- a/src/extension/dbus/dbus-init.cpp +++ b/src/extension/dbus/dbus-init.cpp @@ -189,12 +189,18 @@ dbus_init_desktop_interface (SPDesktop * dt) connection = dbus_get_connection(); proxy = dbus_get_proxy(connection); - DocumentInterface *doc_interface = (DocumentInterface*) dbus_register_object (connection, - proxy, TYPE_DOCUMENT_INTERFACE, - &dbus_glib_document_interface_object_info, name.c_str()); - doc_interface->target = Inkscape::ActionContext(dt); - doc_interface->updates = TRUE; - dt->dbus_document_interface=doc_interface; + if (!dbus_g_connection_lookup_g_object(connection, name.c_str())) { + DocumentInterface *doc_interface = (DocumentInterface*) dbus_register_object (connection, + proxy, + TYPE_DOCUMENT_INTERFACE, + &dbus_glib_document_interface_object_info, + name.c_str()); + + // Set the document info for this interface + doc_interface->target = Inkscape::ActionContext(dt); + doc_interface->updates = TRUE; + dt->dbus_document_interface=doc_interface; + } return strdup(name.c_str()); } |
