unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Lennart Borgman" <lennart.borgman.073@student.lu.se>
Cc: Emacs Devel <emacs-devel@gnu.org>
Subject: Re: Tooltip pops up when moving mouse
Date: Fri, 18 Mar 2005 00:01:21 +0100	[thread overview]
Message-ID: <003001c52b45$4822dfb0$0200a8c0@sedrcw11488> (raw)
In-Reply-To: 013301c52b31$de1ab010$0200a8c0@sedrcw11488

----- Original Message ----- 
From: "Lennart Borgman" <lennart.borgman.073@student.lu.se>

> Yes, that is how it works on w32 too. I meant something a little bit
> different. I think the timer for the tooltip popup should be canceled (and
> maybe started again) every time the mouse is moved. Indeed I believe that
is
> what the code does.
>
> However this does not work as intended. Sometimes the operation for
> canceling the timer get queued but it is actually canceled and instead the
> tooltip flashes by. To prevent this ugly behaviour that occurs on w32 the
> mouse position where the timer where started must be recorded (I am
> repeating myself here...). As far as I can see this is not done.
>
> It is actually quite simple I believe now:
>
> mouse-position should be called in tooltip.el: tooltip-start-delayed-tip
and
> then again in tooltip-timeout again. It the mouse position has changed
then
> tooltip-timeout should not run tooltip-hook. This should fix the problem
> with the flashing tooltip. I will test and come back...

Coming back ... - the code below seems to do what I want. Comments,
suggestions? Can someone please test on X? Mac?

Changes to tooltip.el:

(defvar tooltip-mouse-pixel-position nil)

(defun tooltip-timeout (object)
  "Function called when timer with id tooltip-timeout-id fires."
  (if (and
       (equal (nth 0 tooltip-mouse-pixel-position) (nth 0
(mouse-pixel-position)))
       (> 10 (abs (- (nth 1 tooltip-mouse-pixel-position) (nth 1
(mouse-pixel-position)))))
       (> 10 (abs (- (nthcdr 2 tooltip-mouse-pixel-position)
       (nthcdr 2 (mouse-pixel-position))))))
      (progn
 (run-hook-with-args-until-success 'tooltip-hook
       tooltip-last-mouse-motion-event))
    ;;(message "%s ### %s" tooltip-mouse-pixel-position
(mouse-pixel-position))
    ))

(defun tooltip-start-delayed-tip ()
  "Add a one-shot timeout to call function tooltip-timeout."
  (setq tooltip-mouse-pixel-position (mouse-pixel-position))
  (setq tooltip-timeout-id
 (add-timeout (tooltip-delay) 'tooltip-timeout nil)))

      reply	other threads:[~2005-03-17 23:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-15 17:29 Tooltip pops up when moving mouse Lennart Borgman
2005-03-16 13:06 ` Lennart Borgman
2005-03-16 21:35   ` Jan D.
2005-03-17 17:12     ` Lennart Borgman
2005-03-17 20:12       ` Jan D.
2005-03-17 20:42         ` Lennart Borgman
2005-03-17 23:01           ` Lennart Borgman [this message]

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to='003001c52b45$4822dfb0$0200a8c0@sedrcw11488' \
    --to=lennart.borgman.073@student.lu.se \
    --cc=emacs-devel@gnu.org \
    /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 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).