help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: notifications-notify resets idle-time


From: Peter Münster
Subject: Re: notifications-notify resets idle-time
Date: Sun, 12 Feb 2012 21:37:07 +0100
User-agent: Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.0.93 (gnu/linux)

On Sun, Feb 12 2012, Michael Albinus wrote:

> Look for the code which is embedded in
>
> #ifdef HAVE_DBUS
> #endif

Yes, the code is executed, when the notification windows expires.

The timer is reset on line 2849 in keyboard.c:

--8<---------------cut here---------------start------------->8---
 non_reread:

  if (!end_time)
    timer_stop_idle ();
  RESUME_POLLING;
--8<---------------cut here---------------end--------------->8---

I've found that with some `puts("xxx")' here and there. I tried gdb
(using ddd) but without success: the execution stops before I can set a
breakpoint...


> Maybe it's a timing issue.

I don't know. But I've prepared now a very simple test file and it would
be nice if you could try it please on your system and send me the
*Messages* buffer afterwards, just to compare it with mine.
You just need to save the attached file in /tmp and then run
"emacs -Q -l /tmp/notify.el"
The test takes just 2 seconds ;)

Thanks for your efforts!
-- 
           Peter
(require 'notifications)
(setq dbus-debug t)
(notifications-notify :timeout 1000)
(defun my-test ()
  (let ((ct (current-idle-time)))
    (message (format "idle time: %f"
                     (if ct
                       (+ (cadr ct) (/ (nth 2 ct) 1000000.0))
                       0)))))
(run-with-timer 1.5 nil 'my-test)

reply via email to

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