* Unable to register dbus method
@ 2012-12-12 14:55 Lluís
2012-12-12 19:43 ` Michael Albinus
0 siblings, 1 reply; 4+ messages in thread
From: Lluís @ 2012-12-12 14:55 UTC (permalink / raw)
To: emacs-devel
Hi,
After getting a working implementation for providing GNOME Shell's calendar
widget with info from org-mode events, it looks like this suddenly stopped
working:
#v+
(dbus-register-method :session
"org.gnome.Shell.CalendarServer"
"/org/gnome/Shell/CalendarServer"
"org.gnome.Shell.CalendarServer"
"GetEvents"
'ogc:--dbus-get-events)
#v-
The callback never gets invoked, while "dbus-monitor" shows a method call is
actually sent by the widget, but only the evolution server responds to it:
#v+
method call sender=:1.17 -> dest=:1.52 serial=309 path=/org/gnome/Shell/CalendarServer; interface=org.gnome.Shell.CalendarServer; member=GetEvents
int64 1353928320
int64 1357557120
boolean true
method call sender=:1.52 -> dest=:1.41 serial=27 path=/org/gnome/evolution/dataserver/Calendar/3912/6; interface=org.gnome.evolution.dataserver.Calendar; member=open
boolean true
method return sender=:1.41 -> dest=:1.52 reply_serial=27
uint32 18
signal sender=:1.41 -> dest=(null destination) serial=97 path=/org/gnome/evolution/dataserver/Calendar/3912/6; interface=org.gnome.evolution.dataserver.Calendar; member=readonly
boolean false
signal sender=:1.41 -> dest=(null destination) serial=98 path=/org/gnome/evolution/dataserver/Calendar/3912/6; interface=org.gnome.evolution.dataserver.Calendar; member=online
boolean true
signal sender=:1.41 -> dest=(null destination) serial=99 path=/org/gnome/evolution/dataserver/Calendar/3912/6; interface=org.gnome.evolution.dataserver.Calendar; member=opened
array [
string "org.gnome.evolution.dataserver.Calendar.NoSuchCal"
string "No existeix el calendari"
]
signal sender=:1.41 -> dest=(null destination) serial=100 path=/org/gnome/evolution/dataserver/Calendar/3912/6; interface=org.gnome.evolution.dataserver.Calendar; member=open_done
uint32 18
string "org.gnome.evolution.dataserver.Calendar.NoSuchCal"
string "No es pot obrir el calendari: No existeix el calendari"
method return sender=:1.52 -> dest=:1.17 reply_serial=309
array [
]
#v-
Is it maybe that evolution registered for that method first and thus further
registrations simply take no effect? If so, why was this not happening before?
I'm using emacs-snapshot version 2:20121209-1.
For the curious, code is available at
https://github.com/llvilanova/org-gnome-calendar.
Thanks,
Lluis
--
"And it's much the same thing with knowledge, for whenever you learn
something new, the whole world becomes that much richer."
-- The Princess of Pure Reason, as told by Norton Juster in The Phantom
Tollbooth
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Unable to register dbus method
2012-12-12 14:55 Unable to register dbus method Lluís
@ 2012-12-12 19:43 ` Michael Albinus
2012-12-12 21:12 ` Lluís
0 siblings, 1 reply; 4+ messages in thread
From: Michael Albinus @ 2012-12-12 19:43 UTC (permalink / raw)
To: emacs-devel
Lluís <xscript@gmx.net> writes:
> Hi,
Hi Lluís,
> After getting a working implementation for providing GNOME Shell's calendar
> widget with info from org-mode events, it looks like this suddenly stopped
> working:
>
> The callback never gets invoked, while "dbus-monitor" shows a method call is
> actually sent by the widget, but only the evolution server responds to it:
>
> Is it maybe that evolution registered for that method first and thus further
> registrations simply take no effect?
Maybe. Or Evolution has replaced your registration by its own. D-Bus
life is hard.
Note, that you cannot register for just one method; you can register
only for a whole service. `dbus-register-method' does it silently for
you.
Install d-feet (very useful anyway!), and check, which application has
registered for the service org.gnome.Shell.CalendarServer.
In order to bring your application in front of the service, you could
use `dbus-register-service' with the `:replace-existing' flag.
> Thanks,
> Lluis
Best regards, Michael.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Unable to register dbus method
2012-12-12 19:43 ` Michael Albinus
@ 2012-12-12 21:12 ` Lluís
2012-12-13 9:08 ` Michael Albinus
0 siblings, 1 reply; 4+ messages in thread
From: Lluís @ 2012-12-12 21:12 UTC (permalink / raw)
To: Michael Albinus; +Cc: emacs-devel
Michael Albinus writes:
> Lluís <xscript@gmx.net> writes:
>> Hi,
> Hi Lluís,
>> After getting a working implementation for providing GNOME Shell's calendar
>> widget with info from org-mode events, it looks like this suddenly stopped
>> working:
>>
>> The callback never gets invoked, while "dbus-monitor" shows a method call is
>> actually sent by the widget, but only the evolution server responds to it:
>>
>> Is it maybe that evolution registered for that method first and thus further
>> registrations simply take no effect?
> Maybe. Or Evolution has replaced your registration by its own. D-Bus
> life is hard.
> Note, that you cannot register for just one method; you can register
> only for a whole service. `dbus-register-method' does it silently for
> you.
> Install d-feet (very useful anyway!), and check, which application has
> registered for the service org.gnome.Shell.CalendarServer.
> In order to bring your application in front of the service, you could
> use `dbus-register-service' with the `:replace-existing' flag.
Aha! The `:replace-existing' did the trick and it's now working again.
Does this mean I should resend the method invocation through DBus to whomever is
not the "primary owner"? Sorry for the DBus-centric questions.
Thanks a lot,
Lluis
--
"And it's much the same thing with knowledge, for whenever you learn
something new, the whole world becomes that much richer."
-- The Princess of Pure Reason, as told by Norton Juster in The Phantom
Tollbooth
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Unable to register dbus method
2012-12-12 21:12 ` Lluís
@ 2012-12-13 9:08 ` Michael Albinus
0 siblings, 0 replies; 4+ messages in thread
From: Michael Albinus @ 2012-12-13 9:08 UTC (permalink / raw)
To: emacs-devel
Lluís <xscript@gmx.net> writes:
Hi Lluís,
>> In order to bring your application in front of the service, you could
>> use `dbus-register-service' with the `:replace-existing' flag.
>
> Aha! The `:replace-existing' did the trick and it's now working again.
Good.
> Does this mean I should resend the method invocation through DBus to whomever is
> not the "primary owner"? Sorry for the DBus-centric questions.
No. D-Bus uses a queue of registered applications for every service. Every
application, like Evolution or Emacs, can register for a service. First
request wins. All other applications are queued for the service.
If the application, which "owns" the service, is stopped, the next
waiting application in the queue becomes the owner, until the queue is
empty.
The `:replace-existing' flag breaks this rule. Your application is not
queued at the end, but becomes the service name owner immediately.
> Thanks a lot,
> Lluis
Best regards, Michael.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-12-13 9:08 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-12 14:55 Unable to register dbus method Lluís
2012-12-12 19:43 ` Michael Albinus
2012-12-12 21:12 ` Lluís
2012-12-13 9:08 ` Michael Albinus
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.