From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#5703: 23.1.92; `x-show-tip' and `tooltip-frame-parameters' do not respect `left' and `top' Date: Tue, 30 Mar 2010 16:15:37 +0300 Message-ID: <83pr2mympy.fsf__47791.9662524529$1269955678$gmane$org@gnu.org> References: <87pr38rnan.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1269955678 19801 80.91.229.12 (30 Mar 2010 13:27:58 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 30 Mar 2010 13:27:58 +0000 (UTC) Cc: emacs-devel@gnu.org, 5703@debbugs.gnu.org To: Chong Yidong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Mar 30 15:27:54 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1NwbU0-0007Y4-W6 for geb-bug-gnu-emacs@m.gmane.org; Tue, 30 Mar 2010 15:27:54 +0200 Original-Received: from localhost ([127.0.0.1]:32788 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NwbTw-0000cd-Q7 for geb-bug-gnu-emacs@m.gmane.org; Tue, 30 Mar 2010 09:27:48 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NwbS2-00085R-4h for bug-gnu-emacs@gnu.org; Tue, 30 Mar 2010 09:25:50 -0400 Original-Received: from [140.186.70.92] (port=43166 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NwbS0-00084k-DL for bug-gnu-emacs@gnu.org; Tue, 30 Mar 2010 09:25:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NwbRz-0007MH-80 for bug-gnu-emacs@gnu.org; Tue, 30 Mar 2010 09:25:48 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35698) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NwbRq-0007KY-D8; Tue, 30 Mar 2010 09:25:38 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1NwbIX-00015q-LA; Tue, 30 Mar 2010 09:16:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org, help-debbugs@gnu.org Resent-Date: Tue, 30 Mar 2010 13:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 5703 X-GNU-PR-Package: emacs,w32 X-GNU-PR-Keywords: Original-Received: via spool by 5703-submit@debbugs.gnu.org id=B5703.12699549374195 (code B ref 5703); Tue, 30 Mar 2010 13:16:01 +0000 Original-Received: (at 5703) by debbugs.gnu.org; 30 Mar 2010 13:15:37 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NwbI9-00015c-GR for submit@debbugs.gnu.org; Tue, 30 Mar 2010 09:15:37 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NwbI7-00015X-80 for 5703@debbugs.gnu.org; Tue, 30 Mar 2010 09:15:35 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0L0300K00JG1KP00@a-mtaout20.012.net.il> for 5703@debbugs.gnu.org; Tue, 30 Mar 2010 16:15:29 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([77.127.176.135]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0L0300KBMJHSBS10@a-mtaout20.012.net.il>; Tue, 30 Mar 2010 16:15:29 +0300 (IDT) In-reply-to: <87pr38rnan.fsf@stupidchicken.com> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Tue, 30 Mar 2010 09:16:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:35805 Archived-At: > From: Chong Yidong > Date: Sat, 13 Mar 2010 15:15:12 -0500 > Cc: 5703@debbugs.gnu.org > > "Drew Adams" wrote: > > > M-: (x-show-tip "aaaaaaaa" (selected-frame) '((left . 30) (top . 40)) 10 0 0) > > > > Instead of displaying the tooltip frame at the absolute > > location specified by `left' and `top', it always displays it at the mouse > > position plus the DX and DY (0 and 0 here). > > This is reported to be a regression against Emacs 22. Unfortunately, > it's Windows-only, and I can't reproduce it. Could someone with access > to a Windows box give it a shot? I think the small patch below fixes this. But since this is about pretest, I would like second opinion on that from anyone who is familiar with this stuff (not only on MS-Windows). In particular, I'd like to hear from Jason. Please also try the patched version in as many different use-cases as you can, to make sure it doesn't break anything. Here's what I found to be the reason of the bug: compute_tip_xy relies on the tip frame's parameters (passed to it through the `parms' argument) for figuring out where to display the tooltip. But by the time compute_tip_xy is called, the `top' and `left' parameters were already removed from `parms'. That's because x_create_tip_frame, called a few lines before that, calls x_figure_window_size, which sets up f->top_pos and f->left_pos from `top' and `left', and as a side effect removes them from the frame's parameters alist. I see almost identical code in xfns.c versions of these functions, so I'd be interested to hear how come the X version does not suffer from the same problem. That's because the patch below, although it does the job, feels a bit kludgey, and I wonder if there a cleaner way. === modified file 'src/w32fns.c' --- src/w32fns.c 2010-01-13 08:35:10 +0000 +++ src/w32fns.c 2010-03-30 12:57:13 +0000 @@ -5927,6 +5927,10 @@ Text larger than the specified size is c /* Move the tooltip window where the mouse pointer is. Resize and show it. */ compute_tip_xy (f, parms, dx, dy, width, height, &root_x, &root_y); + if (f->top_pos) + root_y = f->top_pos; + if (f->left_pos) + root_x = f->left_pos; { /* Adjust Window size to take border into account. */