From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Lennart Borgman" Newsgroups: gmane.emacs.devel Subject: Re: Tooltip pops up when moving mouse Date: Fri, 18 Mar 2005 00:01:21 +0100 Message-ID: <003001c52b45$4822dfb0$0200a8c0@sedrcw11488> References: <002501c52984$826bc550$0200a8c0@sedrcw11488> <001b01c52a28$f7967ba0$0200a8c0@sedrcw11488> <4238A6B5.2060905@swipnet.se> <00f301c52b14$96345700$0200a8c0@sedrcw11488> <013301c52b31$de1ab010$0200a8c0@sedrcw11488> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1111100473 19257 80.91.229.2 (17 Mar 2005 23:01:13 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 17 Mar 2005 23:01:13 +0000 (UTC) Cc: Emacs Devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Mar 18 00:01:12 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DC3zB-0008RT-1S for ged-emacs-devel@m.gmane.org; Fri, 18 Mar 2005 00:01:01 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DC4FY-0005PP-5v for ged-emacs-devel@m.gmane.org; Thu, 17 Mar 2005 18:17:56 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DC4FH-0005LO-3u for emacs-devel@gnu.org; Thu, 17 Mar 2005 18:17:39 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DC4FE-0005K5-P0 for emacs-devel@gnu.org; Thu, 17 Mar 2005 18:17:37 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DC4FE-0005JZ-LA for emacs-devel@gnu.org; Thu, 17 Mar 2005 18:17:36 -0500 Original-Received: from [81.228.11.107] (helo=av1-1-sn1.fre.skanova.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DC3zf-00016Y-Jx for emacs-devel@gnu.org; Thu, 17 Mar 2005 18:01:32 -0500 Original-Received: by av1-1-sn1.fre.skanova.net (Postfix, from userid 502) id E2E6837EFF; Fri, 18 Mar 2005 00:01:30 +0100 (CET) Original-Received: from smtp3-2-sn1.fre.skanova.net (smtp3-2-sn1.fre.skanova.net [81.228.11.164]) by av1-1-sn1.fre.skanova.net (Postfix) with ESMTP id D16EE37E47; Fri, 18 Mar 2005 00:01:30 +0100 (CET) Original-Received: from sedrcw11488 (t1o58p127.telia.com [62.20.164.127]) by smtp3-2-sn1.fre.skanova.net (Postfix) with SMTP id 9553137E54; Fri, 18 Mar 2005 00:01:29 +0100 (CET) Original-To: "Lennart Borgman" , "Jan D." X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1409 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org X-MailScanner-To: ged-emacs-devel@m.gmane.org Xref: news.gmane.org gmane.emacs.devel:34685 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:34685 ----- Original Message ----- From: "Lennart Borgman" > 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)))