emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reading D-Bus messages


From: Michael Albinus
Subject: Re: Reading D-Bus messages
Date: Sat, 25 Sep 2010 18:52:25 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Jan Djärv <address@hidden> writes:

> We should have a general way to add file descriptors and get a
> callback for them.  In the mean time, do something like this in
> process.c:
>
> static SELECT_TYPE dbus_mask;
>
> void
> add_dbus_fd (int fd)
> {
>   FD_SET (fd, &dbus_mask);
>   add_keyboard_wait_descriptor (fd);
> }
>
> void
> remove_dbus_fd (int fd)
> {
>   FD_CLR (fd, &dbus_mask);
>   remove_keyboard_wait_descriptor (fd);
> }
>
> After this wait_reading_process_output
>
>       /* Check for data from a process.  */
>       if (no_avail || nfds == 0)
>       continue;
>
> add
>       for (channel = 0; channel <= max_keyboard_desc; ++channel)
>        if (FD_ISSET (channel, &dbus_mask) && FD_ISSET (channel, &Available))
>             {
>                  xd_read_queued_messages ();
>                  break; /* All dbus channels has been read, exit loop */
>             }
>
> and in init_process:
>
>       FD_ZERO (&dbus_mask);
>
> Use remove_dbus_fd and add_dbus_fd in dbusbind.c.
> But maybe I'll add that general input mechanism instead, well see.

I have added this, and it works fine in an X11 environment. I guess,
redisplay() does the job.

If I test it in a non-X11 terminal, arriving D-Bus messages are
recognised only after pressing a character on the keyboard. So at least
an additional trigger is missing to handle this event in time.

>       Jan D.

Best regards, Michael.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]