unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Reading D-Bus messages
@ 2009-08-12  9:43 Michael Albinus
  2009-08-12 10:18 ` YAMAMOTO Mitsuharu
  0 siblings, 1 reply; 44+ messages in thread
From: Michael Albinus @ 2009-08-12  9:43 UTC (permalink / raw)
  To: emacs-devel; +Cc: Mario Lang

Hi,

D-Bus messages are arriving to Emacs asynchronously. Unfortunately, there
is no trigger mechanism which notifies the arrival of a message; one must
poll for new incoming messages via dbus_connection_read_write().

The call of this method is wrapped by xd_read_queued_messages() of
dbusbind.c, which is called in gobble_input() (see keyboard.c). D-Bus
messages are converted into Emacs events, and stored via
kbd_buffer_store_event().

This works fine, as long as Emacs runs in a window manager. redisplay()
runs periodically, which includes reading the D-Bus messages.

When Emacs is started in a terminal, this does not work anymore. The
input handling seems to wait for keyboard interrupts and alike, and does
NOT poll anymore, whether there are other incoming events.

How shall xd_read_queued_messages() be activated in such a case?

Best regards, Michael.




^ permalink raw reply	[flat|nested] 44+ messages in thread
* Reading D-Bus messages
@ 2010-09-22 13:18 Michael Albinus
  2010-09-22 18:21 ` Ken Brown
  0 siblings, 1 reply; 44+ messages in thread
From: Michael Albinus @ 2010-09-22 13:18 UTC (permalink / raw)
  To: emacs-devel; +Cc: Ken Brown

Hi,

I'm trying to make Emacs' D-Bus bindings running also in a cygwin
environment. Synchronous D-Bus messages are handled fine.

The problem is reading asynchronous messages. dbusbind.c offers two
functions: xd_pending_messages (called in readable_events), which
returns TRUE when there are D-Bus messages to be read, and
xd_read_queued_messages (called in gobble_input), which reads the
message(s). That works OK on GNU/Linux (and other systems, I haven't
tested myself).

With cygwin, after the first time a D-Bus message has arrived, and
xd_pending_messages has returned TRUE, Emacs is blocked. According to
the traces, xd_pending_messages is called again and again, and
xd_pending_messages isn't called ever.

I do not understand all details of keyboard.c. Is there something I need
to set in order to urge the call of xd_read_queued_messages (via
gobble_input)? Or do I need to suppress further polling? What is the
difference for Emacs running with cygwin, compared with the GNU/Linux case?

Btw, when I call xd_read_queued_messages inside xd_pending_messages,
everything works fine also with cygwin. But I guess this isn't the
correct solution.

Thanks, and best regards, Michael.



^ permalink raw reply	[flat|nested] 44+ messages in thread

end of thread, other threads:[~2010-09-28 13:47 UTC | newest]

Thread overview: 44+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-12  9:43 Reading D-Bus messages Michael Albinus
2009-08-12 10:18 ` YAMAMOTO Mitsuharu
2009-08-12 10:43   ` Michael Albinus
2009-08-12 11:47     ` YAMAMOTO Mitsuharu
2009-08-15 19:16       ` Michael Albinus
2009-08-16  0:09         ` YAMAMOTO Mitsuharu
2009-08-16 12:30           ` Michael Albinus
2009-08-17  1:33             ` YAMAMOTO Mitsuharu
2009-08-17  4:05               ` Daniel Pittman
2009-08-18 15:24               ` Michael Albinus
  -- strict thread matches above, loose matches on Subject: below --
2010-09-22 13:18 Michael Albinus
2010-09-22 18:21 ` Ken Brown
2010-09-23  7:19   ` Michael Albinus
2010-09-23 12:16     ` Ken Brown
2010-09-23 13:42       ` Michael Albinus
2010-09-23 14:26         ` Ken Brown
2010-09-23 14:46           ` Michael Albinus
2010-09-23 20:49             ` Ken Brown
2010-09-23 21:03               ` Eli Zaretskii
2010-09-24  6:30                 ` Michael Albinus
2010-09-24  8:18                   ` Eli Zaretskii
2010-09-24 11:24                     ` Michael Albinus
2010-09-24 14:28                   ` Jan Djärv
2010-09-24 15:10                     ` Michael Albinus
2010-09-24 15:31                       ` Eli Zaretskii
2010-09-24 21:11                         ` Michael Albinus
2010-09-25  7:19                           ` Jan Djärv
2010-09-25 16:52                             ` Michael Albinus
2010-09-25 18:04                               ` Jan Djärv
2010-09-25 20:54                                 ` Michael Albinus
2010-09-26 16:31                                   ` Jan Djärv
2010-09-26 18:24                                     ` Ken Brown
2010-09-26 18:38                                     ` Michael Albinus
2010-09-26 19:17                                       ` Jan Djärv
2010-09-27 15:37                                         ` Michael Albinus
2010-09-27 19:36                                           ` Ken Brown
2010-09-27 21:23                                             ` Michael Albinus
2010-09-28  2:47                                               ` Ken Brown
2010-09-28 13:47                                                 ` Michael Albinus
2010-09-25 21:46                               ` Ken Brown
2010-09-26  0:51                                 ` Ken Brown
2010-09-26  6:43                                   ` Michael Albinus
2010-09-24 13:20                 ` Ken Brown
2010-09-24 13:24                   ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).