all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: "Peter Münster" <pmlists@free.fr>
Cc: help-gnu-emacs@gnu.org
Subject: Re: notifications-notify resets idle-time
Date: Tue, 14 Feb 2012 10:45:09 +0100	[thread overview]
Message-ID: <87k43pycii.fsf@gmx.de> (raw)
In-Reply-To: <87pqdie396.fsf@micropit.couberia.bzh> ("Peter \=\?utf-8\?Q\?M\?\= \=\?utf-8\?Q\?\=C3\=BCnster\=22's\?\= message of "Tue, 14 Feb 2012 00:13:09 +0100")

Peter Münster <pmlists@free.fr> writes:

>> One idea would be to add a property `dont-reset-idle-time' to an
>> incoming event. Per default it is nil, and the timer is reset. But if
>> this property exists non-nil, the timer isn't reset.
>
> It should depend on the reason (second argument of signal), because when
> the user presses the mouse button, he is not idle. Expiration can happen
> without user action.

It is not possible to check arguments of an incoming D-Bus signal. The
signal is just put into the event queue. Arguments are inspected when
the event is handled by the respective handler, which is much too late
for the idle-time reset.

>> Wouldn't it suffice just to deregister signal "NotificationClosed"?
>
> How? With dbus-unregister-service?

Yes.

I have played with the other woraround option, reusing the notification
window. The following code snippet, based on your initial example, shall
give you an idea:

--8<---------------cut here---------------start------------->8---
(require 'notifications)
(defvar msg-id nil)
(defvar counter 0)
(defun my-test ()
  (setq counter (1+ counter)
	msg-id (apply 'notifications-notify
		  :title (format "%d" (or msg-id 0)) :body (format "%d" counter)
		  :timeout 0
		  (if msg-id
		      `(:replaces-id ,msg-id)
		    '(:on-close (lambda (&rest ignore) (setq msg-id nil))))))
  (message (format "idle: %d" (if (current-idle-time)
				  (cadr (current-idle-time))
				0))))
(run-with-timer 5 5 'my-test)
--8<---------------cut here---------------end--------------->8---

> Thanks for your efforts,

Best regards, Michael.



  reply	other threads:[~2012-02-14  9:45 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-10 22:08 notifications-notify resets idle-time Peter Münster
2012-02-11  9:57 ` Michael Albinus
2012-02-11 11:38   ` Peter Münster
2012-02-11 12:40     ` Michael Albinus
2012-02-11 12:51       ` Peter Münster
2012-02-11 16:00         ` Michael Albinus
2012-02-11 16:38           ` Peter Münster
2012-02-11 17:26             ` Michael Albinus
2012-02-11 19:06               ` Peter Münster
2012-02-12  9:16                 ` Michael Albinus
2012-02-12 11:09                   ` Peter Münster
2012-02-12 11:59                     ` Michael Albinus
2012-02-12 20:37                       ` Peter Münster
2012-02-12 21:17                         ` Michael Albinus
2012-02-13  8:29                           ` Peter Münster
2012-02-13 11:53                             ` Michael Albinus
2012-02-13 15:42                               ` Peter Münster
2012-02-13 16:43                                 ` Michael Albinus
2012-02-13 23:13                                   ` Peter Münster
2012-02-14  9:45                                     ` Michael Albinus [this message]
2012-03-04 21:24                                       ` Peter Münster
2012-03-05 14:51                                         ` Michael Albinus
2012-03-06 10:34                                         ` Michael Albinus
2012-03-06 14:53                                           ` Peter Münster
2012-03-07  7:58                                             ` Michael Albinus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k43pycii.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=help-gnu-emacs@gnu.org \
    --cc=pmlists@free.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.